Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upASI exceptions #535
Comments
This comment has been minimized.
This comment has been minimized.
Is a strong word, seeing as all of these emit glaring warnings |
This comment has been minimized.
This comment has been minimized.
|
All of those examples parse fine and produce valid code, it can fail on execution with an exception, but if you are unlucky enough with variable naming, it can also execute fine and produce unexpected behavior. |
This comment has been minimized.
This comment has been minimized.
|
I meant if you are using |
dcousens
added
the
question
label
May 31, 2016
This comment has been minimized.
This comment has been minimized.
|
Aye, I get that, and it's certainly great to have a tool that statically checks against it. My comment is solely about the readme, apologies if that wasn't clear. I think people should make informed decisions, but that only works if the information you get is accurate. |
This comment has been minimized.
This comment has been minimized.
|
@maciejhirsz Thanks for your comments. The reason we omitted the other cases in the readme is that they usually don't appear in real code. foo = bar
+new Date
/baz/g.test('baz')is most likely to be: foo = bar
myFn(+new Date)
var isBaz = /baz/g.test('baz')The full details are explained in |
maciejhirsz commentedMay 31, 2016
•
edited
You list
[and(as exceptions for starting new lines without semicolon, someone also added the template string backtick ```. There is actually more of those:+and-operators:becomes
foo = bar + new Date/becomes
foo = bar / baz / g.test('baz')That makes it a total of 6 exceptions you have to look out for:
[,(, ```,+, `-`, `/`