Bug 1555464 - Part 2: Enable fields by default in the JS shell. r=khyperia
☠☠ backed out by f15dfe18a9d9 ☠ ☠
authorJason Orendorff <jorendorff@mozilla.com>
Wed, 26 Jun 2019 04:43:05 +0000
changeset 480181 8227f5fbbe20c12a0a72f9bc601b62425a9fcf8d
parent 480180 d7e33c843b241b40873edfac5b6bbd3c151d11b0
child 480182 d7a2d32cfb3eac6014d574419002d3a8fb21ca67
push id88548
push userjorendorff@mozilla.com
push dateWed, 26 Jun 2019 15:56:54 +0000
treeherderautoland@8227f5fbbe20 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhyperia
bugs1555464
milestone69.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 1555464 - Part 2: Enable fields by default in the JS shell. r=khyperia Differential Revision: https://phabricator.services.mozilla.com/D34639
js/public/CompileOptions.h
js/src/jit-test/tests/fields/access.js
js/src/jit-test/tests/fields/basic.js
js/src/jit-test/tests/fields/bug1540787.js
js/src/jit-test/tests/fields/bug1540789.js
js/src/jit-test/tests/fields/bug1540798.js
js/src/jit-test/tests/fields/bug1547129.js
js/src/jit-test/tests/fields/bug1547130.js
js/src/jit-test/tests/fields/bug1547133.js
js/src/jit-test/tests/fields/bug1547136.js
js/src/jit-test/tests/fields/bug1547467.js
js/src/jit-test/tests/fields/bug1547915.js
js/src/jit-test/tests/fields/bug1551454.js
js/src/jit-test/tests/fields/bug1551454_2.js
js/src/jit-test/tests/fields/bug1552022.js
js/src/jit-test/tests/fields/bug1552229.js
js/src/jit-test/tests/fields/bug1552875.js
js/src/jit-test/tests/fields/error.js
js/src/jit-test/tests/fields/field_types.js
js/src/jit-test/tests/fields/initprop.js
js/src/jit-test/tests/fields/literal.js
js/src/jit-test/tests/fields/mixed_methods.js
js/src/jit-test/tests/fields/quirks.js
js/src/jit-test/tests/fields/super.js
js/src/jit-test/tests/fields/superproperty.js
js/src/shell/js.cpp
--- a/js/public/CompileOptions.h
+++ b/js/public/CompileOptions.h
@@ -117,17 +117,17 @@ class JS_PUBLIC_API TransitiveCompileOpt
   AsmJSOption asmJSOption = AsmJSOption::Disabled;
   bool throwOnAsmJSValidationFailureOption = false;
   bool forceAsync = false;
   bool discardSource = false;
   bool sourceIsLazy = false;
   bool allowHTMLComments = true;
   bool hideScriptFromDebugger = false;
   bool bigIntEnabledOption = false;
-  bool fieldsEnabledOption = false;
+  bool fieldsEnabledOption = true;
 
   /**
    * |introductionType| is a statically allocated C string: one of "eval",
    * "Function", or "GeneratorFunction".
    */
   const char* introductionType = nullptr;
 
   unsigned introductionLineno = 0;
--- a/js/src/jit-test/tests/fields/access.js
+++ b/js/src/jit-test/tests/fields/access.js
@@ -1,10 +1,8 @@
-// |jit-test| --enable-experimental-fields
-
 class C {
     x = 5;
 }
 
 c = new C();
 assertEq(5, c.x);
 
 if (typeof reportCompare === "function")
--- a/js/src/jit-test/tests/fields/basic.js
+++ b/js/src/jit-test/tests/fields/basic.js
@@ -1,9 +1,7 @@
-// |jit-test| --enable-experimental-fields
-
 class C {
     x;
     y = 2;
 }
 
 if (typeof reportCompare === "function")
   reportCompare(true, true);
--- a/js/src/jit-test/tests/fields/bug1540787.js
+++ b/js/src/jit-test/tests/fields/bug1540787.js
@@ -1,6 +1,4 @@
-// |jit-test| --enable-experimental-fields
-
 class C {
     x = 1;
     constructor() {};
 }
--- a/js/src/jit-test/tests/fields/bug1540789.js
+++ b/js/src/jit-test/tests/fields/bug1540789.js
@@ -1,5 +1,3 @@
-// |jit-test| --enable-experimental-fields
-
 class C {
     y = () => this.x;
 }
--- a/js/src/jit-test/tests/fields/bug1540798.js
+++ b/js/src/jit-test/tests/fields/bug1540798.js
@@ -1,10 +1,8 @@
-// |jit-test| --enable-experimental-fields
-
 try { evaluate(`
 class constructor  { get;                                           } // Long line is long
 // Long line XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 test();
 function test() {
     try {
       x;
     } catch (v) {
--- a/js/src/jit-test/tests/fields/bug1547129.js
+++ b/js/src/jit-test/tests/fields/bug1547129.js
@@ -1,10 +1,8 @@
-// |jit-test| --enable-experimental-fields
-
 load(libdir + "asserts.js");
 
 new class foo extends Array {
   e = function() {}
 }
 
 source = `new class bar extends Promise { e = function() {} }`;
 // Calling the Promise constructor with empty args fails with TypeError.
--- a/js/src/jit-test/tests/fields/bug1547130.js
+++ b/js/src/jit-test/tests/fields/bug1547130.js
@@ -1,3 +1,1 @@
-// |jit-test| --enable-experimental-fields
-
 [ class  { i32a = [ i32a ] = c27 } ] && class { c27 = [ c27 ] = c27 }
--- a/js/src/jit-test/tests/fields/bug1547133.js
+++ b/js/src/jit-test/tests/fields/bug1547133.js
@@ -1,5 +1,3 @@
-// |jit-test| --enable-experimental-fields
-
 class C47 {
   static method(s = class { [y75] = 42; }) {}
 }
--- a/js/src/jit-test/tests/fields/bug1547136.js
+++ b/js/src/jit-test/tests/fields/bug1547136.js
@@ -1,3 +1,1 @@
-// |jit-test| --enable-experimental-fields
-
 try {} catch ([ c = class { ["s"] }]) {}
--- a/js/src/jit-test/tests/fields/bug1547467.js
+++ b/js/src/jit-test/tests/fields/bug1547467.js
@@ -1,10 +1,8 @@
-// |jit-test| --enable-experimental-fields
-
 load(libdir + "asserts.js");
 
 assertThrowsInstanceOf(() => {
         class foo extends null {
             constructor(a = class bar extends bar {}) {}
         }
         new foo();
     },
--- a/js/src/jit-test/tests/fields/bug1547915.js
+++ b/js/src/jit-test/tests/fields/bug1547915.js
@@ -1,6 +1,4 @@
-// |jit-test| --enable-experimental-fields
-
 load(libdir + "asserts.js");
 
 source = `#_\\u200C`;
 assertThrowsInstanceOf(() => eval(source), SyntaxError);
--- a/js/src/jit-test/tests/fields/bug1551454.js
+++ b/js/src/jit-test/tests/fields/bug1551454.js
@@ -1,10 +1,8 @@
-// |jit-test| --enable-experimental-fields
-
 class C {
   1 = eval();
 }
 new C();
 
 class D {
   1.5 = eval();
 }
--- a/js/src/jit-test/tests/fields/bug1551454_2.js
+++ b/js/src/jit-test/tests/fields/bug1551454_2.js
@@ -1,8 +1,6 @@
-// |jit-test| --enable-experimental-fields
-
 let f = 1;
 class X { f=f; }
 assertEq(new X().f, 1);
 
 if (typeof reportCompare === "function")
   reportCompare(true, true);
--- a/js/src/jit-test/tests/fields/bug1552022.js
+++ b/js/src/jit-test/tests/fields/bug1552022.js
@@ -1,10 +1,8 @@
-// |jit-test| --enable-experimental-fields
-
 load(libdir + "eqArrayHelper.js");
 
 let expected = [];
 class B {
     constructor(...args) {
         assertEqArray(expected, args);
     }
 }
--- a/js/src/jit-test/tests/fields/bug1552229.js
+++ b/js/src/jit-test/tests/fields/bug1552229.js
@@ -1,10 +1,8 @@
-// |jit-test| --enable-experimental-fields
-
 let i = 0;
 function f(x) {
     assertEq(++i, x);
     return x;
 }
 class C{
     [f(1)](){}
     [f(2)] = "hi";
--- a/js/src/jit-test/tests/fields/bug1552875.js
+++ b/js/src/jit-test/tests/fields/bug1552875.js
@@ -1,10 +1,8 @@
-// |jit-test| --enable-experimental-fields
-
 class C {
     x = function(){};
     0 = function(){};
     ["y" + 0] = function(){};
 }
 
 let c = new C();
 assertEq(c["x"].name, "x");
--- a/js/src/jit-test/tests/fields/error.js
+++ b/js/src/jit-test/tests/fields/error.js
@@ -1,10 +1,8 @@
-// |jit-test| --enable-experimental-fields
-
 load(libdir + "asserts.js");
 
 let source = `class C {
     x =
 }`;
 assertErrorMessage(() => Function(source), SyntaxError, /./);
 
 source = `class C {
--- a/js/src/jit-test/tests/fields/field_types.js
+++ b/js/src/jit-test/tests/fields/field_types.js
@@ -1,10 +1,8 @@
-// |jit-test| --enable-experimental-fields
-
 class C {
     [Math.sqrt(16)];
     [Math.sqrt(8)] = 5 + 2;
     "hi";
     "bye" = {};
     2 = 2;
     0x101 = 2;
     0o101 = 2;
--- a/js/src/jit-test/tests/fields/initprop.js
+++ b/js/src/jit-test/tests/fields/initprop.js
@@ -1,10 +1,8 @@
-// |jit-test| --enable-experimental-fields
-
 let called = false
 class base {
     set x(arg) {
         called = true;
     }
     get x() {
         called = true;
         return 0;
--- a/js/src/jit-test/tests/fields/literal.js
+++ b/js/src/jit-test/tests/fields/literal.js
@@ -1,10 +1,8 @@
-// |jit-test| --enable-experimental-fields
-
 load(libdir + "asserts.js");
 
 source = `var y = {
     x;
 }`;
 assertErrorMessage(() => eval(source), SyntaxError, /./);
 
 // This is legal, and is equivalent to `var y = { x: x };`
--- a/js/src/jit-test/tests/fields/mixed_methods.js
+++ b/js/src/jit-test/tests/fields/mixed_methods.js
@@ -1,10 +1,8 @@
-// |jit-test| --enable-experimental-fields
-
 class C {
     x;
     y(){}
     z = 2;
     w(){};
 }
 
 if (typeof reportCompare === "function")
--- a/js/src/jit-test/tests/fields/quirks.js
+++ b/js/src/jit-test/tests/fields/quirks.js
@@ -1,10 +1,8 @@
-// |jit-test| --enable-experimental-fields
-
 class C {
     x;;;;
     y
     ;
 }
 
 class D {
     x = 5;
--- a/js/src/jit-test/tests/fields/super.js
+++ b/js/src/jit-test/tests/fields/super.js
@@ -1,10 +1,8 @@
-// |jit-test| --enable-experimental-fields
-
 class Base {
 }
 
 class C extends Base {
   field;
 }
 let c = new C();
 assertEq(true, "field" in c);
--- a/js/src/jit-test/tests/fields/superproperty.js
+++ b/js/src/jit-test/tests/fields/superproperty.js
@@ -1,9 +1,8 @@
-// |jit-test| --enable-experimental-fields
 // SuperProperty syntax is allowed in fields.
 
 class Base {
   get accessor() {
     return this.constructor.name;
   }
   method() {
     return this.constructor.name;
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -10216,17 +10216,17 @@ static bool SetContextOptions(JSContext*
 #ifdef ENABLE_WASM_GC
   enableWasmGc = op.getBoolOption("wasm-gc");
 #endif
   enableWasmVerbose = op.getBoolOption("wasm-verbose");
   enableTestWasmAwaitTier2 = op.getBoolOption("test-wasm-await-tier2");
   enableAsyncStacks = !op.getBoolOption("no-async-stacks");
   enableStreams = !op.getBoolOption("no-streams");
   enableBigInt = !op.getBoolOption("no-bigint");
-  enableFields = op.getBoolOption("enable-experimental-fields");
+  enableFields = !op.getBoolOption("disable-experimental-fields");
   enableAwaitFix = !op.getBoolOption("disable-experimental-await-fix");
 
   JS::ContextOptionsRef(cx)
       .setBaseline(enableBaseline)
       .setIon(enableIon)
       .setAsmJS(enableAsmJS)
       .setWasm(enableWasm)
       .setWasmBaseline(enableWasmBaseline)
@@ -10955,18 +10955,18 @@ int main(int argc, char** argv, char** e
       !op.addBoolOption('\0', "no-native-regexp",
                         "Disable native regexp compilation") ||
       !op.addBoolOption('\0', "no-unboxed-objects",
                         "Disable creating unboxed plain objects") ||
       !op.addBoolOption('\0', "enable-streams",
                         "Enable WHATWG Streams (default)") ||
       !op.addBoolOption('\0', "no-streams", "Disable WHATWG Streams") ||
       !op.addBoolOption('\0', "no-bigint", "Disable BigInt support") ||
-      !op.addBoolOption('\0', "enable-experimental-fields",
-                        "Enable fields in classes") ||
+      !op.addBoolOption('\0', "disable-experimental-fields",
+                        "Disable public fields in classes") ||
       !op.addBoolOption('\0', "disable-experimental-await-fix",
                         "Disable new, faster await semantics") ||
       !op.addStringOption('\0', "shared-memory", "on/off",
                           "SharedArrayBuffer and Atomics "
 #if SHARED_MEMORY_DEFAULT
                           "(default: on, off to disable)"
 #else
                           "(default: off, on to enable)"