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

Numeric triggers many syntax warnings in Firefox 40 #65

Open
jwmerrill opened this issue Jun 26, 2015 · 1 comment
Open

Numeric triggers many syntax warnings in Firefox 40 #65

jwmerrill opened this issue Jun 26, 2015 · 1 comment

Comments

@jwmerrill
Copy link

Firefox 40 is currently the alpha/aurora/developer edition release. Loading numeric prints many warnings to the console of the form

SyntaxError: unreachable code after return statement numeric-1.2.6.js:3:54
SyntaxError: unreachable code after return statement numeric-1.2.6.js:5:26
SyntaxError: unreachable code after return statement numeric-1.2.6.js:3:51
SyntaxError: unreachable code after return statement numeric-1.2.6.js:5:31
SyntaxError: unreachable code after return statement numeric-1.2.6.js:3:69
SyntaxError: unreachable code after return statement numeric-1.2.6.js:3:52
SyntaxError: unreachable code after return statement numeric-1.2.6.js:3:86
SyntaxError: unreachable code after return statement numeric-1.2.6.js:5:39
SyntaxError: unreachable code after return statement numeric-1.2.6.js:4:47
SyntaxError: unreachable code after return statement numeric-1.2.6.js:6:39
SyntaxError: unreachable code after return statement numeric-1.2.6.js:4:32

Here's a jsbin that does nothing but include Numeric—you can open it in firefox 40 and check the console.

http://output.jsbin.com/qubolo

These are unfortunately not very easy to debug, because the line and column numbers appear to refer to generated code rather than the actual source of numeric.

@aesedepece
Copy link

As read in MDN:

Automatic Semicolon Insertion
The return statement is affected by automatic semicolon insertion (ASI). No line terminator is allowed between the return keyword and the expression.

return
a + b;

is transformed by ASI into:

return; 
a + b;

Starting with Gecko 40 the console will warn "unreachable code after return statement".

Link: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/return

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