Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it right? #18

Open
windwhinny opened this issue Nov 20, 2013 · 1 comment
Open

Is it right? #18

windwhinny opened this issue Nov 20, 2013 · 1 comment
Assignees
Labels

Comments

@windwhinny
Copy link

var newFn = function() {
    // this is pretty ugly, but we need to run the code below before the callback
    process.nextTick(function() {
        fn.apply(this, arguments);
     });
}
...
...
var obj = oldInit.call(this, doc, query, newFn);

I notice that at line 66 of index.js, the arguments is the arguments for the anonymous function in nextTick, not for the newFn.
Is it right?

I think this is better.

var newFn = function() {
    // this is pretty ugly, but we need to run the code below before the callback
    var args=arguments
    process.nextTick(function() {
        fn.apply(this, args);
     });
}
@sieira
Copy link
Collaborator

sieira commented Nov 11, 2015

Will check it

@sieira sieira self-assigned this Nov 11, 2015
@sieira sieira added the bug label Nov 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants