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

moved nested functions to top level for strict mode #1

Merged
merged 1 commit into from Mar 1, 2016
Merged

moved nested functions to top level for strict mode #1

merged 1 commit into from Mar 1, 2016

Conversation

slintes
Copy link
Contributor

@slintes slintes commented Feb 23, 2016

some browsers complained that functions may only be defined on top level in strict mode

some browsers complained that functions may only be defined on top level in strict mode
@wulfsolter
Copy link
Owner

I've had a look and I can't replicate browsers complaining. Can you tell me a bit more?

@wulfsolter wulfsolter self-assigned this Feb 28, 2016
@slintes
Copy link
Contributor Author

slintes commented Feb 28, 2016

See e.g. 2nd topic in this paragraph: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Strict_mode#Paving_the_way_for_future_ECMAScript_versions
I can try to create a simple test project tomorrow.

@slintes
Copy link
Contributor Author

slintes commented Mar 1, 2016

Here an example: http://plnkr.co/edit/OXJVbkL0BEAGNJKmxXgf?p=preview
Works in Chrome, but gives error in Firefox and Safari:
SyntaxError: in strict mode code, functions may be declared only at top level or immediately within another function

wulfsolter added a commit that referenced this pull request Mar 1, 2016
moved nested functions to top level for strict mode
@wulfsolter wulfsolter merged commit 3816ae7 into wulfsolter:master Mar 1, 2016
@wulfsolter
Copy link
Owner

Ah, nice! Thanks for the demo @slintes :)

@wulfsolter
Copy link
Owner

Updated on npm with 1.0.7

@slintes slintes deleted the strict-mode branch April 12, 2016 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants