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

Shouldn't treat the parameters in nested functions as dependencies #7

Closed
linanqiu opened this issue Feb 24, 2015 · 1 comment
Closed

Comments

@linanqiu
Copy link

I'm failing this test case

it('shouldn\'t treat the parameters in nested functions as dependencies',
      function () {
        var injectedFuncWithNested = app.inject(function (app, login, Auth) {
          function nested(d, e, f) {}
          var args = Array.prototype.slice.call(arguments, 0);
          return args.length;
        });
        expect(injectedFuncWithNested()).to.equal(3);
      });

I'm confused by app and login. They were never registered with the module, so how can they be used in the function during injection? If they should be ignored, then why would expect(injectedFunWithNested())).to.equal(3)?

@levbrie
Copy link
Contributor

levbrie commented Feb 24, 2015

@linanqiu really good question. Actually, another student had the very same one. Please see issue 32 on js-course and let me know if that discussion clears things up for you.

Best,
Lev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants