Another demo of the ASI hazard: const join = function (x) { return x.join() } `abc`.split('') console.log(join); // ['a', 'b', 'c']
-
-
-
Aren't these hazards avoidable with a good linter?
End of conversation
New conversation -
-
-
If not, I will do this today
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
What did you expect the output to be?
-
Dave, see my response for a perhaps more obvious (mis)use where ASI can bite you after you concatenate 2 modules.https://twitter.com/bswierczynski/status/879138306671378432 …
-
The catch: a semicolon is NOT inserted before ` BTW: Already mentioned by https://www.npmjs.com/package/standard … : Never start a line with (, [, or `
-
Oh I see.
End of conversation
New conversation -
-
-
Yeah :( (function() { //previous module })() `id className`.split('\n').forEach(() => {/*...*/}) TypeError: (anonymous) is not a function
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
@flowtype to the rescue ;) -
Semicolons to the rescue ;)
-
Yea that was given
End of conversation
New conversation -
-
-
Adding it to my list! :O
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.