mirror of
https://github.com/RGBCube/serenity
synced 2025-05-23 18:35:07 +00:00

This patch adds support in the parser and interpreter for this: var a = 1, b = 2, c = a + b; VariableDeclaration is now a sequence of VariableDeclarators. :^)
11 lines
215 B
JavaScript
11 lines
215 B
JavaScript
function assert(x) { if (!x) throw 1; }
|
|
|
|
try {
|
|
var a = 1, b = 2, c = a + b;
|
|
assert(a === 1);
|
|
assert(b === 2);
|
|
assert(c === 3);
|
|
console.log("PASS");
|
|
} catch (e) {
|
|
console.log("FAIL: " + e);
|
|
}
|