@garybernhardt
> x = function () { if (true) { break } }
[Function: x]
> x()
SyntaxError: Illegal break statement
> x = function () { if (false) { break } }
[Function: x]
> x()
SyntaxError: Illegal break statement
wat
-
-
Replying to @aredridel @garybernhardt
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/break … Needs to be a loop, switch or have a label
1 reply 0 retweets 0 likes -
Replying to @rajeshj @garybernhardt
The wat is the fact that it parses but doesn't run
1 reply 0 retweets 3 likes -
Oooh, gross. Syntax errors should be strictly at parse time, not run time. I guess the evaluation pipeline for JS blurs those boundaries too much.
2 replies 0 retweets 1 like -
Replying to @mx00s @mekajfire and
This smells like it's the REPL/console at work (as that's a slightly different environment than your run-of-the-mill JS exec context). /cc
@evilpies? This breaks at parse time when in a JS file included via a script tag, at least in Firefox.1 reply 0 retweets 0 likes -
Replying to @slsoftworks @mekajfire and
Entirely at call time in V8, even from a file.
1 reply 0 retweets 0 likes -
Replying to @aredridel @mekajfire and1 reply 0 retweets 0 likes
-
Replying to @slsoftworks @aredridel and
That does indeed look odd. Same in
@NodeJS 10. The spec says it should be an early error.@hashseed@marjakh@_gsathya Any ideas?
https://tc39.github.io/ecma262/#sec-break-statement …2 replies 0 retweets 1 like -
Replying to @bmeurer @slsoftworks and
Yeah probably not recognized as early error.
1 reply 0 retweets 1 like
Many other examples here: https://bugs.chromium.org/p/v8/issues/detail?id=2728 … && https://bugs.chromium.org/p/v8/issues/detail?id=896 …
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.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.