diff --git a/tests/src/test/java/org/mozilla/javascript/tests/StrictModeApiTest.java b/tests/src/test/java/org/mozilla/javascript/tests/StrictModeApiTest.java index e9b4b97528..51a054579e 100644 --- a/tests/src/test/java/org/mozilla/javascript/tests/StrictModeApiTest.java +++ b/tests/src/test/java/org/mozilla/javascript/tests/StrictModeApiTest.java @@ -20,7 +20,7 @@ public class StrictModeApiTest { @Test public void strictModeError() { final ContextFactory contextFactory = - new Utils.FeatureContextFactory( + Utils.contextFactoryWithFeatures( Context.FEATURE_STRICT_MODE, Context.FEATURE_STRICT_VARS, Context.FEATURE_STRICT_EVAL, @@ -40,7 +40,7 @@ public void onlyGetterError() { final String script = "o.readonlyProp = 123"; Utils.runWithAllModes( - new Utils.FeatureContextFactory(Context.FEATURE_STRICT_MODE), + Utils.contextFactoryWithFeatures(Context.FEATURE_STRICT_MODE), cx -> { try { Scriptable scope = cx.initSafeStandardObjects(); diff --git a/tests/src/test/java/org/mozilla/javascript/tests/es6/PropertyTest.java b/tests/src/test/java/org/mozilla/javascript/tests/es6/PropertyTest.java index 8fb2b85314..985f61aed2 100644 --- a/tests/src/test/java/org/mozilla/javascript/tests/es6/PropertyTest.java +++ b/tests/src/test/java/org/mozilla/javascript/tests/es6/PropertyTest.java @@ -125,7 +125,7 @@ public void redefineSetterProperty() throws Exception { public void redefinePropertyWithThreadSafeSlotMap() { final ContextFactory factory = - new Utils.FeatureContextFactory(Context.FEATURE_THREAD_SAFE_OBJECTS); + Utils.contextFactoryWithFeatures(Context.FEATURE_THREAD_SAFE_OBJECTS); try (Context cx = factory.enterContext()) { cx.setLanguageVersion(Context.VERSION_ES6); diff --git a/tests/src/test/java/org/mozilla/javascript/tests/intl402/NativeStringTest.java b/tests/src/test/java/org/mozilla/javascript/tests/intl402/NativeStringTest.java index 4df0e5c0c7..d710015c88 100644 --- a/tests/src/test/java/org/mozilla/javascript/tests/intl402/NativeStringTest.java +++ b/tests/src/test/java/org/mozilla/javascript/tests/intl402/NativeStringTest.java @@ -23,7 +23,7 @@ public void toLocaleLowerCase() { String js = "'\\u0130'.toLocaleLowerCase()"; Utils.runWithAllModes( - new Utils.FeatureContextFactory(Context.FEATURE_INTL_402), + Utils.contextFactoryWithFeatures(Context.FEATURE_INTL_402), cx -> { final Scriptable scope = cx.initStandardObjects(); cx.setLanguageVersion(Context.VERSION_ES6); @@ -35,7 +35,7 @@ public void toLocaleLowerCase() { }); Utils.runWithAllModes( - new Utils.FeatureContextFactory(Context.FEATURE_INTL_402), + Utils.contextFactoryWithFeatures(Context.FEATURE_INTL_402), cx -> { final Scriptable scope = cx.initStandardObjects(); cx.setLanguageVersion(Context.VERSION_ES6); @@ -50,20 +50,20 @@ public void toLocaleLowerCase() { @Test public void toLocaleLowerCaseParam() { Utils.assertWithAllModes( - new Utils.FeatureContextFactory(Context.FEATURE_INTL_402), + Utils.contextFactoryWithFeatures(Context.FEATURE_INTL_402), Context.VERSION_ES6, null, "\u0069\u0307", "'\\u0130'.toLocaleLowerCase('en')"); Utils.assertWithAllModes( - new Utils.FeatureContextFactory(Context.FEATURE_INTL_402), + Utils.contextFactoryWithFeatures(Context.FEATURE_INTL_402), Context.VERSION_ES6, null, "\u0069", "'\\u0130'.toLocaleLowerCase('tr')"); Utils.assertWithAllModes( - new Utils.FeatureContextFactory(Context.FEATURE_INTL_402), + Utils.contextFactoryWithFeatures(Context.FEATURE_INTL_402), Context.VERSION_ES6, null, "\u0069\u0307", @@ -75,7 +75,7 @@ public void toLocaleUpperCase() { String js = "'\\u0069'.toLocaleUpperCase()"; Utils.runWithAllModes( - new Utils.FeatureContextFactory(Context.FEATURE_INTL_402), + Utils.contextFactoryWithFeatures(Context.FEATURE_INTL_402), cx -> { final Scriptable scope = cx.initStandardObjects(); cx.setLanguageVersion(Context.VERSION_ES6); @@ -87,7 +87,7 @@ public void toLocaleUpperCase() { }); Utils.runWithAllModes( - new Utils.FeatureContextFactory(Context.FEATURE_INTL_402), + Utils.contextFactoryWithFeatures(Context.FEATURE_INTL_402), cx -> { final Scriptable scope = cx.initStandardObjects(); cx.setLanguageVersion(Context.VERSION_ES6); @@ -102,20 +102,20 @@ public void toLocaleUpperCase() { @Test public void toLocaleUpperCaseParam() { Utils.assertWithAllModes( - new Utils.FeatureContextFactory(Context.FEATURE_INTL_402), + Utils.contextFactoryWithFeatures(Context.FEATURE_INTL_402), Context.VERSION_ES6, null, "\u0049", "'\\u0069'.toLocaleUpperCase('en')"); Utils.assertWithAllModes( - new Utils.FeatureContextFactory(Context.FEATURE_INTL_402), + Utils.contextFactoryWithFeatures(Context.FEATURE_INTL_402), Context.VERSION_ES6, null, "\u0130", "'\\u0069'.toLocaleUpperCase('tr')"); Utils.assertWithAllModes( - new Utils.FeatureContextFactory(Context.FEATURE_INTL_402), + Utils.contextFactoryWithFeatures(Context.FEATURE_INTL_402), Context.VERSION_ES6, null, "\u0049",