diff --git a/js/src/jit-test/tests/basic/syntax-error-illegal-character.js b/js/src/jit-test/tests/basic/syntax-error-illegal-character.js index 0205bbcdd45f..1a8551bafa70 100644 --- a/js/src/jit-test/tests/basic/syntax-error-illegal-character.js +++ b/js/src/jit-test/tests/basic/syntax-error-illegal-character.js @@ -1,5 +1,3 @@ -load(libdir + "class.js"); - var JSMSG_ILLEGAL_CHARACTER = "illegal character"; var JSMSG_UNTERMINATED_STRING = "unterminated string literal"; @@ -27,6 +25,7 @@ function test_eval(code) { assertEq(caught, true); } + function test(code) { test_reflect(code); test_reflect("'use strict'; " + code); @@ -469,18 +468,16 @@ test_no_fun_no_eval("export const a = 1, b = @"); test_no_fun_no_eval("export const a = 1, b = 2 @"); test_no_fun_no_eval("export const a = 1, b = 2; @"); -if (classesEnabled()) { - test_no_fun_no_eval("export class @"); - test_no_fun_no_eval("export class Foo @"); - test_no_fun_no_eval("export class Foo { @"); - test_no_fun_no_eval("export class Foo { constructor @"); - test_no_fun_no_eval("export class Foo { constructor( @"); - test_no_fun_no_eval("export class Foo { constructor() @"); - test_no_fun_no_eval("export class Foo { constructor() { @"); - test_no_fun_no_eval("export class Foo { constructor() {} @"); - test_no_fun_no_eval("export class Foo { constructor() {} } @"); - test_no_fun_no_eval("export class Foo { constructor() {} }; @"); -} +test_no_fun_no_eval("export class @"); +test_no_fun_no_eval("export class Foo @"); +test_no_fun_no_eval("export class Foo { @"); +test_no_fun_no_eval("export class Foo { constructor @"); +test_no_fun_no_eval("export class Foo { constructor( @"); +test_no_fun_no_eval("export class Foo { constructor() @"); +test_no_fun_no_eval("export class Foo { constructor() { @"); +test_no_fun_no_eval("export class Foo { constructor() {} @"); +test_no_fun_no_eval("export class Foo { constructor() {} } @"); +test_no_fun_no_eval("export class Foo { constructor() {} }; @"); test_no_fun_no_eval("export default @"); test_no_fun_no_eval("export default 1 @"); @@ -499,27 +496,25 @@ test_no_fun_no_eval("export default function foo() { @"); test_no_fun_no_eval("export default function foo() {} @"); test_no_fun_no_eval("export default function foo() {}; @"); -if (classesEnabled()) { - test_no_fun_no_eval("export default class @"); - test_no_fun_no_eval("export default class { @"); - test_no_fun_no_eval("export default class { constructor @"); - test_no_fun_no_eval("export default class { constructor( @"); - test_no_fun_no_eval("export default class { constructor() @"); - test_no_fun_no_eval("export default class { constructor() { @"); - test_no_fun_no_eval("export default class { constructor() {} @"); - test_no_fun_no_eval("export default class { constructor() {} } @"); - test_no_fun_no_eval("export default class { constructor() {} }; @"); +test_no_fun_no_eval("export default class @"); +test_no_fun_no_eval("export default class { @"); +test_no_fun_no_eval("export default class { constructor @"); +test_no_fun_no_eval("export default class { constructor( @"); +test_no_fun_no_eval("export default class { constructor() @"); +test_no_fun_no_eval("export default class { constructor() { @"); +test_no_fun_no_eval("export default class { constructor() {} @"); +test_no_fun_no_eval("export default class { constructor() {} } @"); +test_no_fun_no_eval("export default class { constructor() {} }; @"); - test_no_fun_no_eval("export default class Foo @"); - test_no_fun_no_eval("export default class Foo { @"); - test_no_fun_no_eval("export default class Foo { constructor @"); - test_no_fun_no_eval("export default class Foo { constructor( @"); - test_no_fun_no_eval("export default class Foo { constructor() @"); - test_no_fun_no_eval("export default class Foo { constructor() { @"); - test_no_fun_no_eval("export default class Foo { constructor() {} @"); - test_no_fun_no_eval("export default class Foo { constructor() {} } @"); - test_no_fun_no_eval("export default class Foo { constructor() {} }; @"); -} +test_no_fun_no_eval("export default class Foo @"); +test_no_fun_no_eval("export default class Foo { @"); +test_no_fun_no_eval("export default class Foo { constructor @"); +test_no_fun_no_eval("export default class Foo { constructor( @"); +test_no_fun_no_eval("export default class Foo { constructor() @"); +test_no_fun_no_eval("export default class Foo { constructor() { @"); +test_no_fun_no_eval("export default class Foo { constructor() {} @"); +test_no_fun_no_eval("export default class Foo { constructor() {} } @"); +test_no_fun_no_eval("export default class Foo { constructor() {} }; @"); // import diff --git a/js/src/jit-test/tests/modules/export-declaration.js b/js/src/jit-test/tests/modules/export-declaration.js index 4036a7488524..3dc2869b2b30 100644 --- a/js/src/jit-test/tests/modules/export-declaration.js +++ b/js/src/jit-test/tests/modules/export-declaration.js @@ -1,6 +1,5 @@ load(libdir + "match.js"); load(libdir + "asserts.js"); -load(libdir + "class.js"); var { Pattern, MatchError } = Match; @@ -203,18 +202,16 @@ program([ ) ]).assert(Reflect.parse("export function f() {}")); -if (classesEnabled()) { - program([ - exportDeclaration( - classDeclaration( - ident("Foo") - ), - null, - null, - false - ) - ]).assert(Reflect.parse("export class Foo { constructor() {} }")); -} +program([ + exportDeclaration( + classDeclaration( + ident("Foo") + ), + null, + null, + false + ) +]).assert(Reflect.parse("export class Foo { constructor() {} }")); program([ exportDeclaration( @@ -295,29 +292,27 @@ program([ ) ]).assert(Reflect.parse("export default function foo() {}")); -if (classesEnabled()) { - program([ - exportDeclaration( - classDeclaration( - ident("*default*") - ), - null, - null, - true - ) - ]).assert(Reflect.parse("export default class { constructor() {} }")); +program([ + exportDeclaration( + classDeclaration( + ident("*default*") + ), + null, + null, + true + ) +]).assert(Reflect.parse("export default class { constructor() {} }")); - program([ - exportDeclaration( - classDeclaration( - ident("Foo") - ), - null, - null, - true - ) - ]).assert(Reflect.parse("export default class Foo { constructor() {} }")); -} +program([ + exportDeclaration( + classDeclaration( + ident("Foo") + ), + null, + null, + true + ) +]).assert(Reflect.parse("export default class Foo { constructor() {} }")); program([ exportDeclaration( diff --git a/js/src/tests/ecma_6/Class/newTargetMethods.js b/js/src/tests/ecma_6/Class/newTargetMethods.js index 055ec0bf1984..84dba1cec720 100644 --- a/js/src/tests/ecma_6/Class/newTargetMethods.js +++ b/js/src/tests/ecma_6/Class/newTargetMethods.js @@ -1,5 +1,3 @@ -var test = ` - // Just like newTargetDirectInvoke, except to prove it works in functions // defined with method syntax as well. Note that methods, getters, and setters // are not constructible. @@ -48,10 +46,7 @@ for (let i = 0; i < TEST_ITERATIONS; i++) clInst.cl; for (let i = 0; i < TEST_ITERATIONS; i++) clInst.cl = 4; -`; -if (classesEnabled()) - eval(test); if (typeof reportCompare === "function") reportCompare(0,0,"OK"); diff --git a/js/src/tests/ecma_6/Class/superPropEvalInsideArrow.js b/js/src/tests/ecma_6/Class/superPropEvalInsideArrow.js index c81d86c3dc0d..882f93ba0ace 100644 --- a/js/src/tests/ecma_6/Class/superPropEvalInsideArrow.js +++ b/js/src/tests/ecma_6/Class/superPropEvalInsideArrow.js @@ -1,5 +1,3 @@ -var test = ` - class foo { constructor() { } @@ -8,10 +6,6 @@ class foo { } } assertEq(new foo().method()(), Object.prototype.toString); -`; - -if (classesEnabled()) - eval(test); if (typeof reportCompare === "function") reportCompare(0,0,"OK"); diff --git a/js/src/tests/ecma_6/Class/superPropHeavyweightArrow.js b/js/src/tests/ecma_6/Class/superPropHeavyweightArrow.js index dda69edc0c7c..ce30690d539d 100644 --- a/js/src/tests/ecma_6/Class/superPropHeavyweightArrow.js +++ b/js/src/tests/ecma_6/Class/superPropHeavyweightArrow.js @@ -1,5 +1,3 @@ -var test = ` - class foo { constructor() { } @@ -9,10 +7,6 @@ class foo { } assertEq(new foo().method()(), Object.prototype.toString); -`; - -if (classesEnabled()) - eval(test); if (typeof reportCompare === "function") reportCompare(0,0,"OK");