diff options
author | Linus Groh <mail@linusgroh.de> | 2020-10-27 19:16:23 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-10-28 21:11:32 +0100 |
commit | b4e51249e95ca891dad26c3763788c85d54903e5 (patch) | |
tree | ee9d5b426a9ff01481dd4f6e37d59f48e1a077a7 /Libraries/LibJS/Tests | |
parent | d278f61f4c63f9904eaf71d2efb37189e8133331 (diff) | |
download | serenity-b4e51249e95ca891dad26c3763788c85d54903e5.zip |
LibJS: Always insert semicolon after do-while statement if missing
https://tc39.es/ecma262/#sec-additions-and-changes-that-introduce-incompatibilities-with-prior-editions
11.9.1: In ECMAScript 2015, Automatic Semicolon Insertion adds a
semicolon at the end of a do-while statement if the semicolon is
missing. This change aligns the specification with the actual behaviour
of most existing implementations.
Diffstat (limited to 'Libraries/LibJS/Tests')
-rw-r--r-- | Libraries/LibJS/Tests/loops/do-while-basic.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Libraries/LibJS/Tests/loops/do-while-basic.js b/Libraries/LibJS/Tests/loops/do-while-basic.js index e76c20e211..c935c5f0a6 100644 --- a/Libraries/LibJS/Tests/loops/do-while-basic.js +++ b/Libraries/LibJS/Tests/loops/do-while-basic.js @@ -18,3 +18,7 @@ test("exception in test expression", () => { do {} while (foo); }).toThrow(ReferenceError); }); + +test("automatic semicolon insertion", () => { + expect("do {} while (false) foo").toEval(); +}); |