Bug 1089045 - Part 3: Add parser test for ES6 class. r=Waldo
authorTooru Fujisawa <arai_a@mac.com>
Fri, 07 Aug 2015 04:20:49 +0900
changeset 257395 a8493abd3c62b77e4741da181239af5549d84f80
parent 257394 4f87d8225c7adefbe74126ed61bb79e85a2e9355
child 257437 aa6830e2abd87ecfa379f5365b201696aa926a24
push id63614
push userarai_a@mac.com
push dateWed, 12 Aug 2015 12:42:24 +0000
treeherdermozilla-inbound@a8493abd3c62 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersWaldo
bugs1089045
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1089045 - Part 3: Add parser test for ES6 class. r=Waldo
js/src/jit-test/lib/syntax.js
--- a/js/src/jit-test/lib/syntax.js
+++ b/js/src/jit-test/lib/syntax.js
@@ -1001,16 +1001,126 @@ function test_syntax(replacements, check
   test("({a}) => @");
   test("({a: @");
   test("({a: b @");
   test("({a: b, @");
   test("({a: b} @");
   test("({a: b}) @");
   test("({a: b}) => @");
 
+  if (classesEnabled()) {
+    // ---- Class declaration ----
+
+    test("class @");
+    test("class a @");
+    test("class a { @");
+    test("class a { constructor @");
+    test("class a { constructor( @");
+    test("class a { constructor() @");
+    test("class a { constructor() { @");
+    test("class a { constructor() { } @");
+    test("class a { constructor() { } } @");
+
+    test("class a { constructor() { } static @");
+    test("class a { constructor() { } static m @");
+    test("class a { constructor() { } static m( @");
+    test("class a { constructor() { } static m() @");
+    test("class a { constructor() { } static m() { @");
+    test("class a { constructor() { } static m() {} @");
+    test("class a { constructor() { } static m() {} } @");
+
+    test("class a { constructor() { } static ( @");
+    test("class a { constructor() { } static () @");
+    test("class a { constructor() { } static () { @");
+    test("class a { constructor() { } static () {} @");
+    test("class a { constructor() { } static () {} } @");
+
+    test("class a { constructor() { } static get @");
+    test("class a { constructor() { } static get p @");
+    test("class a { constructor() { } static get p( @");
+    test("class a { constructor() { } static get p() @");
+    test("class a { constructor() { } static get p() { @");
+    test("class a { constructor() { } static get p() {} @");
+    test("class a { constructor() { } static get p() {} } @");
+
+    test("class a { constructor() { } static set @");
+    test("class a { constructor() { } static set p @");
+    test("class a { constructor() { } static set p( @");
+    test("class a { constructor() { } static set p(v @");
+    test("class a { constructor() { } static set p(v) @");
+    test("class a { constructor() { } static set p(v) { @");
+    test("class a { constructor() { } static set p(v) {} @");
+    test("class a { constructor() { } static set p(v) {} } @");
+
+    test("class a { constructor() { } * @");
+    test("class a { constructor() { } *m @");
+    test("class a { constructor() { } *m( @");
+    test("class a { constructor() { } *m() @");
+    test("class a { constructor() { } *m() { @");
+    test("class a { constructor() { } *m() {} @");
+    test("class a { constructor() { } *m() {} } @");
+
+    test("class a { constructor() { } static * @");
+    test("class a { constructor() { } static *m @");
+    test("class a { constructor() { } static *m( @");
+    test("class a { constructor() { } static *m() @");
+    test("class a { constructor() { } static *m() { @");
+    test("class a { constructor() { } static *m() {} @");
+    test("class a { constructor() { } static *m() {} } @");
+
+    test("class a extends @");
+    test("class a extends b @");
+    test("class a extends b { @");
+
+    test("class a extends ( @");
+    test("class a extends ( b @");
+    test("class a extends ( b ) @");
+    test("class a extends ( b ) { @");
+
+    // ---- Class expression ----
+
+    test("( class @");
+    test("( class a @");
+    test("( class a { @");
+    test("( class a { constructor @");
+    test("( class a { constructor( @");
+    test("( class a { constructor() @");
+    test("( class a { constructor() { @");
+    test("( class a { constructor() { } @");
+    test("( class a { constructor() { } } @");
+    test("( class a { constructor() { } } ) @");
+
+    test("(class a extends @");
+    test("(class a extends b @");
+    test("(class a extends b { @");
+
+    test("(class a extends ( @");
+    test("(class a extends ( b @");
+    test("(class a extends ( b ) @");
+    test("(class a extends ( b ) { @");
+
+    test("( class { @");
+    test("( class { constructor @");
+    test("( class { constructor( @");
+    test("( class { constructor() @");
+    test("( class { constructor() { @");
+    test("( class { constructor() { } @");
+    test("( class { constructor() { } } @");
+    test("( class { constructor() { } } ) @");
+
+    test("(class extends @");
+    test("(class extends b @");
+    test("(class extends b { @");
+
+    test("(class extends ( @");
+    test("(class extends ( b @");
+    test("(class extends ( b ) @");
+    test("(class extends ( b ) { @");
+  }
+
   // ---- Other ----
 
   // Literals
 
   test("a @");
   test("1 @");
   test("1. @");
   test("1.2 @");