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

Instantiation fails when invoke name is Object function (toString, toLocaleString,...) #184

Closed
martinratinaud opened this issue May 21, 2015 · 5 comments
Labels

Comments

@martinratinaud
Copy link
Contributor

trying to register a component with a reserved name like in

angular.module('templates')
    .filter('toString', function () {

will produce the error below

Uncaught Error: [$injector:modulerr] Failed to instantiate module app due to:
Error: [$injector:modulerr] Failed to instantiate module oc.lazyLoad due to:
TypeError: regInvokes[moduleName][type][invokeList].indexOf is not a function

To prevent this, in function registerInvokeList, we should use !regInvokes[moduleName][type].hasOwnProperty(invokeList) instead of angular.isUndefined(regInvokes[moduleName][type][invokeList])

I will do a PR soon.

Thanks for this awesome module

@ocombe
Copy link
Owner

ocombe commented May 21, 2015

Waiting for the PR, thanks :)

@ocombe ocombe added the bug label May 21, 2015
martinratinaud added a commit to I-We/ocLazyLoad that referenced this issue May 21, 2015
@martinratinaud
Copy link
Contributor Author

Done, but very quickly, when do you plan to merge it ?

@ocombe
Copy link
Owner

ocombe commented May 21, 2015

Once I've had the time to test it, probably tonight

@martinratinaud
Copy link
Contributor Author

Awesome,

although, I don't manage to run gulp build-files, should I ?

martinratinaud added a commit to I-We/ocLazyLoad that referenced this issue May 21, 2015
@ocombe
Copy link
Owner

ocombe commented May 21, 2015

Not really, but you can add a test if you like, it's always appreciated :)

martinratinaud added a commit to I-We/ocLazyLoad that referenced this issue May 21, 2015
ocombe added a commit that referenced this issue May 21, 2015
@ocombe ocombe closed this as completed May 29, 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