diff --git a/test/language/eval-code/direct/block-decl-strict-source.js b/test/language/eval-code/direct/block-decl-eval-source-is-strict-nostrict.js similarity index 65% rename from test/language/eval-code/direct/block-decl-strict-source.js rename to test/language/eval-code/direct/block-decl-eval-source-is-strict-nostrict.js index dad6f7563b12bc5abcdf232bd12d41055f80311e..12deaa67fa00a452c20ac85b941ab641c4dbc237 100644 --- a/test/language/eval-code/direct/block-decl-strict-source.js +++ b/test/language/eval-code/direct/block-decl-eval-source-is-strict-nostrict.js @@ -1,14 +1,17 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -description: AnnexB extension not honored in strict mode -es6id: B.3.3.2 +esid: sec-web-compat-evaldeclarationinstantiation +description: > + AnnexB extension not honored in strict mode, Block statement + in eval code containing a function declaration info: | - Block statement in eval code containing a function declaration - B.3.3.3 Changes to EvalDeclarationInstantiation 1. If strict is false, then + ... + +flags: [noStrict] ---*/ var err; diff --git a/test/language/eval-code/direct/block-decl-eval-source-is-strict-onlystrict.js b/test/language/eval-code/direct/block-decl-eval-source-is-strict-onlystrict.js new file mode 100644 index 0000000000000000000000000000000000000000..0ee638614a7ce2050555266bfb1993dcf76f72da --- /dev/null +++ b/test/language/eval-code/direct/block-decl-eval-source-is-strict-onlystrict.js @@ -0,0 +1,28 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-web-compat-evaldeclarationinstantiation +description: > + AnnexB extension not honored in strict mode, Block statement + in eval code containing a function declaration +info: | + B.3.3.3 Changes to EvalDeclarationInstantiation + + 1. If strict is false, then + ... + +flags: [onlyStrict] +---*/ + +var err; + +eval('"use strict";{ function f() {} }'); + +try { + f; +} catch (exception) { + err = exception; +} + +assert.sameValue(err.constructor, ReferenceError); + diff --git a/test/language/eval-code/direct/block-decl-nostrict.js b/test/language/eval-code/direct/block-decl-nostrict.js new file mode 100644 index 0000000000000000000000000000000000000000..97e159c1191f7d3f0ab3a2f62b7fc2a43bb75488 --- /dev/null +++ b/test/language/eval-code/direct/block-decl-nostrict.js @@ -0,0 +1,27 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-web-compat-evaldeclarationinstantiation +description: > + AnnexB extension not honored in strict mode, Block statement + in eval code containing a function declaration +info: | + B.3.3.3 Changes to EvalDeclarationInstantiation + + 1. If strict is false, then + ... + +flags: [noStrict] +---*/ + +var err; + +eval('{ function f() {} }'); + +try { + f; +} catch (exception) { + err = exception; +} + +assert.sameValue(err, undefined); diff --git a/test/language/eval-code/direct/block-decl-strict-caller.js b/test/language/eval-code/direct/block-decl-onlystrict.js similarity index 68% rename from test/language/eval-code/direct/block-decl-strict-caller.js rename to test/language/eval-code/direct/block-decl-onlystrict.js index 43a29e0b2b6a01f6f24e6180f08ebd616a46a91e..2a61cb4467616154b30296772666ece98c2a024a 100644 --- a/test/language/eval-code/direct/block-decl-strict-caller.js +++ b/test/language/eval-code/direct/block-decl-onlystrict.js @@ -1,15 +1,17 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -description: AnnexB extension not honored in strict mode -es6id: B.3.3.2 -flags: [onlyStrict] +esid: sec-web-compat-evaldeclarationinstantiation +description: > + AnnexB extension not honored in strict mode, Block statement + in eval code containing a function declaration info: | - Block statement in eval code containing a function declaration - B.3.3.3 Changes to EvalDeclarationInstantiation 1. If strict is false, then + ... + +flags: [onlyStrict] ---*/ var err; diff --git a/test/language/eval-code/direct/switch-case-decl-strict-source.js b/test/language/eval-code/direct/switch-case-decl-eval-source-is-strict-nostrict.js similarity index 66% rename from test/language/eval-code/direct/switch-case-decl-strict-source.js rename to test/language/eval-code/direct/switch-case-decl-eval-source-is-strict-nostrict.js index 6c5835de0bf7b239c1e3b4057402b0fb0f12db32..e58338702d1a02560546f61aed5cd05858762050 100644 --- a/test/language/eval-code/direct/switch-case-decl-strict-source.js +++ b/test/language/eval-code/direct/switch-case-decl-eval-source-is-strict-nostrict.js @@ -1,15 +1,17 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -description: AnnexB extension not honored in strict mode -es6id: B.3.3.3 +esid: sec-web-compat-evaldeclarationinstantiation +description: > + AnnexB extension not honored in strict mode, Function declaration + in the `case` clause of a `switch` statement in eval code info: | - Function declaration in the `case` clause of a `switch` statement in eval - code - B.3.3.3 Changes to EvalDeclarationInstantiation 1. If strict is false, then + ... + +flags: [noStrict] ---*/ var err; diff --git a/test/language/eval-code/direct/switch-case-decl-eval-source-is-strict-onlystrict.js b/test/language/eval-code/direct/switch-case-decl-eval-source-is-strict-onlystrict.js new file mode 100644 index 0000000000000000000000000000000000000000..0368049c07c9e39e0c5d54f660255bc235efb131 --- /dev/null +++ b/test/language/eval-code/direct/switch-case-decl-eval-source-is-strict-onlystrict.js @@ -0,0 +1,33 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-web-compat-evaldeclarationinstantiation +description: > + AnnexB extension not honored in strict mode, Function declaration + in the `case` clause of a `switch` statement in eval code +info: | + B.3.3.3 Changes to EvalDeclarationInstantiation + + 1. If strict is false, then + ... + +flags: [onlyStrict] +---*/ + +var err; + +eval('\ + "use strict";\ + switch (1) {\ + case 1:\ + function f() { }\ + }\ +'); + +try { + f; +} catch (exception) { + err = exception; +} + +assert.sameValue(err.constructor, ReferenceError); diff --git a/test/language/eval-code/direct/switch-case-decl-nostrict.js b/test/language/eval-code/direct/switch-case-decl-nostrict.js new file mode 100644 index 0000000000000000000000000000000000000000..808debf6077e41fea4fb2234a119e0a83ebbc77d --- /dev/null +++ b/test/language/eval-code/direct/switch-case-decl-nostrict.js @@ -0,0 +1,32 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-web-compat-evaldeclarationinstantiation +description: > + AnnexB extension not honored in strict mode, Function declaration + in the `case` clause of a `switch` statement in eval code +info: | + B.3.3.3 Changes to EvalDeclarationInstantiation + + 1. If strict is false, then + ... + +flags: [noStrict] +---*/ + +var err; + +eval('\ + switch (1) {\ + case 1:\ + function f() { }\ + }\ +'); + +try { + f; +} catch (exception) { + err = exception; +} + +assert.sameValue(err, undefined); diff --git a/test/language/eval-code/direct/switch-case-decl-strict-caller.js b/test/language/eval-code/direct/switch-case-decl-onlystrict.js similarity index 68% rename from test/language/eval-code/direct/switch-case-decl-strict-caller.js rename to test/language/eval-code/direct/switch-case-decl-onlystrict.js index 604da83499f39eb4fe0091cedc9a7250e53514d7..3c9277fa0480a62fd9aad722d353603303091fea 100644 --- a/test/language/eval-code/direct/switch-case-decl-strict-caller.js +++ b/test/language/eval-code/direct/switch-case-decl-onlystrict.js @@ -1,16 +1,17 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -description: AnnexB extension not honored in strict mode -es6id: B.3.3.3 -flags: [onlyStrict] +esid: sec-web-compat-evaldeclarationinstantiation +description: > + AnnexB extension not honored in strict mode, Function declaration + in the `case` clause of a `switch` statement in eval code info: | - Function declaration in the `case` clause of a `switch` statement in eval - code - B.3.3.3 Changes to EvalDeclarationInstantiation 1. If strict is false, then + ... + +flags: [onlyStrict] ---*/ var err; diff --git a/test/language/eval-code/direct/switch-dflt-decl-strict-source.js b/test/language/eval-code/direct/switch-dflt-decl-eval-source-is-strict-nostrict.js similarity index 66% rename from test/language/eval-code/direct/switch-dflt-decl-strict-source.js rename to test/language/eval-code/direct/switch-dflt-decl-eval-source-is-strict-nostrict.js index f601fd23c5c98de581bbaf99b4986735001c9213..4370569bc31f2dbb1b3ae6e629fa073730e7ff47 100644 --- a/test/language/eval-code/direct/switch-dflt-decl-strict-source.js +++ b/test/language/eval-code/direct/switch-dflt-decl-eval-source-is-strict-nostrict.js @@ -1,15 +1,17 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -description: AnnexB extension not honored in strict mode -es6id: B.3.3.3 +esid: sec-web-compat-evaldeclarationinstantiation +description: > + AnnexB extension not honored in strict mode, Function declaration + in the `default` clause of a `switch` statement in eval code info: | - Function declaration in the `default` clause of a `switch` statement in - eval code - B.3.3.3 Changes to EvalDeclarationInstantiation 1. If strict is false, then + ... + +flags: [noStrict] ---*/ var err; diff --git a/test/language/eval-code/direct/switch-dflt-decl-eval-source-is-strict-onlystrict.js b/test/language/eval-code/direct/switch-dflt-decl-eval-source-is-strict-onlystrict.js new file mode 100644 index 0000000000000000000000000000000000000000..fd16e8d14603bf7e86cbbba297d9aef0a3265ad7 --- /dev/null +++ b/test/language/eval-code/direct/switch-dflt-decl-eval-source-is-strict-onlystrict.js @@ -0,0 +1,33 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-web-compat-evaldeclarationinstantiation +description: > + AnnexB extension not honored in strict mode, Function declaration + in the `default` clause of a `switch` statement in eval code +info: | + B.3.3.3 Changes to EvalDeclarationInstantiation + + 1. If strict is false, then + ... + +flags: [onlyStrict] +---*/ + +var err; + +eval('\ + "use strict";\ + switch (1) {\ + default:\ + function f() { }\ + }\ +'); + +try { + f; +} catch (exception) { + err = exception; +} + +assert.sameValue(err.constructor, ReferenceError); diff --git a/test/language/eval-code/direct/switch-dflt-decl-nostrict.js b/test/language/eval-code/direct/switch-dflt-decl-nostrict.js new file mode 100644 index 0000000000000000000000000000000000000000..623e518457c19480f5af81b9ac00dc3609ac26bc --- /dev/null +++ b/test/language/eval-code/direct/switch-dflt-decl-nostrict.js @@ -0,0 +1,32 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-web-compat-evaldeclarationinstantiation +description: > + AnnexB extension not honored in strict mode, Function declaration + in the `default` clause of a `switch` statement in eval code +info: | + B.3.3.3 Changes to EvalDeclarationInstantiation + + 1. If strict is false, then + ... + +flags: [noStrict] +---*/ + +var err; + +eval('\ + switch (1) {\ + default:\ + function f() { }\ + }\ +'); + +try { + f; +} catch (exception) { + err = exception; +} + +assert.sameValue(err, undefined); diff --git a/test/language/eval-code/direct/switch-dflt-decl-strict-caller.js b/test/language/eval-code/direct/switch-dflt-decl-onlystrict.js similarity index 68% rename from test/language/eval-code/direct/switch-dflt-decl-strict-caller.js rename to test/language/eval-code/direct/switch-dflt-decl-onlystrict.js index fcf5e87190f9a41cdc521d44f1900767e77fb044..067ea894eb90470f68c6ceb04f0cd0ad0b18e6f1 100644 --- a/test/language/eval-code/direct/switch-dflt-decl-strict-caller.js +++ b/test/language/eval-code/direct/switch-dflt-decl-onlystrict.js @@ -1,16 +1,17 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -description: AnnexB extension not honored in strict mode -es6id: B.3.3.3 -flags: [onlyStrict] +esid: sec-web-compat-evaldeclarationinstantiation +description: > + AnnexB extension not honored in strict mode: Function declaration + in the `default` clause of a `switch` statement in eval code info: | - Function declaration in the `default` clause of a `switch` statement in - eval code - B.3.3.3 Changes to EvalDeclarationInstantiation 1. If strict is false, then + ... + +flags: [onlyStrict] ---*/ var err; diff --git a/test/language/function-code/block-decl-nostrict.js b/test/language/function-code/block-decl-nostrict.js new file mode 100644 index 0000000000000000000000000000000000000000..9ac8aad8239c82cc716b85f4f77cec01513c7130 --- /dev/null +++ b/test/language/function-code/block-decl-nostrict.js @@ -0,0 +1,38 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-web-compat-functiondeclarationinstantiation +description: > + AnnexB extension not honored in strict mode, Block statement + in function code containing a function declaration +info: | + B.3.3.1 Changes to FunctionDeclarationInstantiation + + 1. If strict is false, then + ... + +flags: [noStrict] +---*/ + +var err1, err2; + +(function() { + try { + f; + } catch (exception) { + err1 = exception; + } + + { + function f() { } + } + + try { + f; + } catch (exception) { + err2 = exception; + } +}()); + +assert.sameValue(err1, undefined); +assert.sameValue(err2, undefined); diff --git a/test/language/function-code/block-decl-strict.js b/test/language/function-code/block-decl-onlystrict.js similarity index 74% rename from test/language/function-code/block-decl-strict.js rename to test/language/function-code/block-decl-onlystrict.js index 573176b80d0382ec91a94e2baa462407f00499df..39342a4d19ee47700fabc594165da62be89d2220 100644 --- a/test/language/function-code/block-decl-strict.js +++ b/test/language/function-code/block-decl-onlystrict.js @@ -1,15 +1,17 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -description: AnnexB extension not honored in strict mode -es6id: B.3.3.1 -flags: [onlyStrict] +esid: sec-web-compat-functiondeclarationinstantiation +description: > + AnnexB extension not honored in strict mode, Block statement + in function code containing a function declaration info: | - Block statement in function code containing a function declaration - B.3.3.1 Changes to FunctionDeclarationInstantiation 1. If strict is false, then + ... + +flags: [onlyStrict] ---*/ var err1, err2; diff --git a/test/language/function-code/switch-case-decl-nostrict.js b/test/language/function-code/switch-case-decl-nostrict.js new file mode 100644 index 0000000000000000000000000000000000000000..6be9587e095017bcb85c0fc4eec949c51371a2c3 --- /dev/null +++ b/test/language/function-code/switch-case-decl-nostrict.js @@ -0,0 +1,39 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-web-compat-functiondeclarationinstantiation +description: > + AnnexB extension not honored in strict mode, Function declaration + in the `case` clause of a `switch` statement in function code +info: | + B.3.3.1 Changes to FunctionDeclarationInstantiation + + 1. If strict is false, then + ... + +flags: [noStrict] +---*/ + +var err1, err2; + +(function() { + try { + f; + } catch (exception) { + err1 = exception; + } + + switch (1) { + case 1: + function f() { } + } + + try { + f; + } catch (exception) { + err2 = exception; + } +}()); + +assert.sameValue(err1, undefined); +assert.sameValue(err2, undefined); diff --git a/test/language/function-code/switch-case-decl-strict.js b/test/language/function-code/switch-case-decl-onlystrict.js similarity index 73% rename from test/language/function-code/switch-case-decl-strict.js rename to test/language/function-code/switch-case-decl-onlystrict.js index 783da6cceb65d0f8857c97478f1d703605e94a0e..045605f8b6d4558a40fb5a72aa1231d9f06659f4 100644 --- a/test/language/function-code/switch-case-decl-strict.js +++ b/test/language/function-code/switch-case-decl-onlystrict.js @@ -1,16 +1,17 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -description: AnnexB extension not honored in strict mode -es6id: B.3.3.1 -flags: [onlyStrict] +esid: sec-web-compat-functiondeclarationinstantiation +description: > + AnnexB extension not honored in strict mode, Function declaration + in the `case` clause of a `switch` statement in function code info: | - Function declaration in the `case` clause of a `switch` statement in - function code - B.3.3.1 Changes to FunctionDeclarationInstantiation 1. If strict is false, then + ... + +flags: [onlyStrict] ---*/ var err1, err2; diff --git a/test/language/function-code/switch-dflt-decl-nostrict.js b/test/language/function-code/switch-dflt-decl-nostrict.js new file mode 100644 index 0000000000000000000000000000000000000000..9b66c97a8f89ff7d2e439fadfbda5e68bd7e876b --- /dev/null +++ b/test/language/function-code/switch-dflt-decl-nostrict.js @@ -0,0 +1,39 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-web-compat-functiondeclarationinstantiation +description: > + AnnexB extension not honored in strict mode, Function declaration + in the `default` clause of a `switch` statement in function code +info: | + B.3.3.1 Changes to FunctionDeclarationInstantiation + + 1. If strict is false, then + ... + +flags: [noStrict] +---*/ + +var err1, err2; + +(function() { + try { + f; + } catch (exception) { + err1 = exception; + } + + switch (1) { + default: + function f() { } + } + + try { + f; + } catch (exception) { + err2 = exception; + } +}()); + +assert.sameValue(err1, undefined); +assert.sameValue(err2, undefined); diff --git a/test/language/function-code/switch-dflt-decl-strict.js b/test/language/function-code/switch-dflt-decl-onlystrict.js similarity index 73% rename from test/language/function-code/switch-dflt-decl-strict.js rename to test/language/function-code/switch-dflt-decl-onlystrict.js index 0b5369db24ee85d4791a3c484fbf575e91170b2d..9b589616559e190ce46fdd9b4ee189bd8cfd951a 100644 --- a/test/language/function-code/switch-dflt-decl-strict.js +++ b/test/language/function-code/switch-dflt-decl-onlystrict.js @@ -1,16 +1,17 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -description: AnnexB extension not honored in strict mode -es6id: B.3.3.1 -flags: [onlyStrict] +esid: sec-web-compat-functiondeclarationinstantiation +description: > + AnnexB extension not honored in strict mode, Function declaration + in the `default` clause of a `switch` statement in function code info: | - Function declaration in the `default` clause of a `switch` statement in - function code - B.3.3.1 Changes to FunctionDeclarationInstantiation 1. If strict is false, then + ... + +flags: [onlyStrict] ---*/ var err1, err2;