summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Tuple/syntax.js
blob: 826e8adbdfd69ca110f5d5d82baf59a2d59f8ba0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// |reftest| skip-if(!this.hasOwnProperty("Tuple"))

Reflect.parse("#[]");
Reflect.parse("#[ foo ]");
Reflect.parse("#[ foo, ]");
Reflect.parse("#[ foo, bar ]");
Reflect.parse("#[ foo, ...bar ]");
Reflect.parse("#[ foo, ...bar, ]");
Reflect.parse("#[ foo, ...bar, baz ]");
Reflect.parse("#[ foo() ]");

assertThrowsInstanceOf(() => Reflect.parse("#[,]"), SyntaxError);
assertThrowsInstanceOf(() => Reflect.parse("#[ foo, , bar ]"), SyntaxError);
assertThrowsInstanceOf(() => Reflect.parse("#[ foo ] = bar"), SyntaxError);

if (typeof reportCompare === "function") reportCompare(0, 0);