mirror of
https://github.com/tc39/test262.git
synced 2025-07-23 05:55:36 +02:00
Corrections to sec-web-compat-evaldeclarationinstantiation and sec-web-compat-functiondeclarationinstantiation tests. Fixes gh-1364 (#1509)
This commit is contained in:
parent
14931c923f
commit
a1a4e2b1b8
@ -1,14 +1,17 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
description: AnnexB extension not honored in strict mode
|
esid: sec-web-compat-evaldeclarationinstantiation
|
||||||
es6id: B.3.3.2
|
description: >
|
||||||
|
AnnexB extension not honored in strict mode, Block statement
|
||||||
|
in eval code containing a function declaration
|
||||||
info: |
|
info: |
|
||||||
Block statement in eval code containing a function declaration
|
|
||||||
|
|
||||||
B.3.3.3 Changes to EvalDeclarationInstantiation
|
B.3.3.3 Changes to EvalDeclarationInstantiation
|
||||||
|
|
||||||
1. If strict is false, then
|
1. If strict is false, then
|
||||||
|
...
|
||||||
|
|
||||||
|
flags: [noStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var err;
|
var err;
|
@ -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);
|
||||||
|
|
27
test/language/eval-code/direct/block-decl-nostrict.js
Normal file
27
test/language/eval-code/direct/block-decl-nostrict.js
Normal file
@ -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);
|
@ -1,15 +1,17 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
description: AnnexB extension not honored in strict mode
|
esid: sec-web-compat-evaldeclarationinstantiation
|
||||||
es6id: B.3.3.2
|
description: >
|
||||||
flags: [onlyStrict]
|
AnnexB extension not honored in strict mode, Block statement
|
||||||
|
in eval code containing a function declaration
|
||||||
info: |
|
info: |
|
||||||
Block statement in eval code containing a function declaration
|
|
||||||
|
|
||||||
B.3.3.3 Changes to EvalDeclarationInstantiation
|
B.3.3.3 Changes to EvalDeclarationInstantiation
|
||||||
|
|
||||||
1. If strict is false, then
|
1. If strict is false, then
|
||||||
|
...
|
||||||
|
|
||||||
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var err;
|
var err;
|
@ -1,15 +1,17 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
description: AnnexB extension not honored in strict mode
|
esid: sec-web-compat-evaldeclarationinstantiation
|
||||||
es6id: B.3.3.3
|
description: >
|
||||||
|
AnnexB extension not honored in strict mode, Function declaration
|
||||||
|
in the `case` clause of a `switch` statement in eval code
|
||||||
info: |
|
info: |
|
||||||
Function declaration in the `case` clause of a `switch` statement in eval
|
|
||||||
code
|
|
||||||
|
|
||||||
B.3.3.3 Changes to EvalDeclarationInstantiation
|
B.3.3.3 Changes to EvalDeclarationInstantiation
|
||||||
|
|
||||||
1. If strict is false, then
|
1. If strict is false, then
|
||||||
|
...
|
||||||
|
|
||||||
|
flags: [noStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var err;
|
var err;
|
@ -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);
|
32
test/language/eval-code/direct/switch-case-decl-nostrict.js
Normal file
32
test/language/eval-code/direct/switch-case-decl-nostrict.js
Normal file
@ -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);
|
@ -1,16 +1,17 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
description: AnnexB extension not honored in strict mode
|
esid: sec-web-compat-evaldeclarationinstantiation
|
||||||
es6id: B.3.3.3
|
description: >
|
||||||
flags: [onlyStrict]
|
AnnexB extension not honored in strict mode, Function declaration
|
||||||
|
in the `case` clause of a `switch` statement in eval code
|
||||||
info: |
|
info: |
|
||||||
Function declaration in the `case` clause of a `switch` statement in eval
|
|
||||||
code
|
|
||||||
|
|
||||||
B.3.3.3 Changes to EvalDeclarationInstantiation
|
B.3.3.3 Changes to EvalDeclarationInstantiation
|
||||||
|
|
||||||
1. If strict is false, then
|
1. If strict is false, then
|
||||||
|
...
|
||||||
|
|
||||||
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var err;
|
var err;
|
@ -1,15 +1,17 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
description: AnnexB extension not honored in strict mode
|
esid: sec-web-compat-evaldeclarationinstantiation
|
||||||
es6id: B.3.3.3
|
description: >
|
||||||
|
AnnexB extension not honored in strict mode, Function declaration
|
||||||
|
in the `default` clause of a `switch` statement in eval code
|
||||||
info: |
|
info: |
|
||||||
Function declaration in the `default` clause of a `switch` statement in
|
|
||||||
eval code
|
|
||||||
|
|
||||||
B.3.3.3 Changes to EvalDeclarationInstantiation
|
B.3.3.3 Changes to EvalDeclarationInstantiation
|
||||||
|
|
||||||
1. If strict is false, then
|
1. If strict is false, then
|
||||||
|
...
|
||||||
|
|
||||||
|
flags: [noStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var err;
|
var err;
|
@ -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);
|
32
test/language/eval-code/direct/switch-dflt-decl-nostrict.js
Normal file
32
test/language/eval-code/direct/switch-dflt-decl-nostrict.js
Normal file
@ -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);
|
@ -1,16 +1,17 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
description: AnnexB extension not honored in strict mode
|
esid: sec-web-compat-evaldeclarationinstantiation
|
||||||
es6id: B.3.3.3
|
description: >
|
||||||
flags: [onlyStrict]
|
AnnexB extension not honored in strict mode: Function declaration
|
||||||
|
in the `default` clause of a `switch` statement in eval code
|
||||||
info: |
|
info: |
|
||||||
Function declaration in the `default` clause of a `switch` statement in
|
|
||||||
eval code
|
|
||||||
|
|
||||||
B.3.3.3 Changes to EvalDeclarationInstantiation
|
B.3.3.3 Changes to EvalDeclarationInstantiation
|
||||||
|
|
||||||
1. If strict is false, then
|
1. If strict is false, then
|
||||||
|
...
|
||||||
|
|
||||||
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var err;
|
var err;
|
38
test/language/function-code/block-decl-nostrict.js
Normal file
38
test/language/function-code/block-decl-nostrict.js
Normal file
@ -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);
|
@ -1,15 +1,17 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
description: AnnexB extension not honored in strict mode
|
esid: sec-web-compat-functiondeclarationinstantiation
|
||||||
es6id: B.3.3.1
|
description: >
|
||||||
flags: [onlyStrict]
|
AnnexB extension not honored in strict mode, Block statement
|
||||||
|
in function code containing a function declaration
|
||||||
info: |
|
info: |
|
||||||
Block statement in function code containing a function declaration
|
|
||||||
|
|
||||||
B.3.3.1 Changes to FunctionDeclarationInstantiation
|
B.3.3.1 Changes to FunctionDeclarationInstantiation
|
||||||
|
|
||||||
1. If strict is false, then
|
1. If strict is false, then
|
||||||
|
...
|
||||||
|
|
||||||
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var err1, err2;
|
var err1, err2;
|
39
test/language/function-code/switch-case-decl-nostrict.js
Normal file
39
test/language/function-code/switch-case-decl-nostrict.js
Normal file
@ -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);
|
@ -1,16 +1,17 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
description: AnnexB extension not honored in strict mode
|
esid: sec-web-compat-functiondeclarationinstantiation
|
||||||
es6id: B.3.3.1
|
description: >
|
||||||
flags: [onlyStrict]
|
AnnexB extension not honored in strict mode, Function declaration
|
||||||
|
in the `case` clause of a `switch` statement in function code
|
||||||
info: |
|
info: |
|
||||||
Function declaration in the `case` clause of a `switch` statement in
|
|
||||||
function code
|
|
||||||
|
|
||||||
B.3.3.1 Changes to FunctionDeclarationInstantiation
|
B.3.3.1 Changes to FunctionDeclarationInstantiation
|
||||||
|
|
||||||
1. If strict is false, then
|
1. If strict is false, then
|
||||||
|
...
|
||||||
|
|
||||||
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var err1, err2;
|
var err1, err2;
|
39
test/language/function-code/switch-dflt-decl-nostrict.js
Normal file
39
test/language/function-code/switch-dflt-decl-nostrict.js
Normal file
@ -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);
|
@ -1,16 +1,17 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
description: AnnexB extension not honored in strict mode
|
esid: sec-web-compat-functiondeclarationinstantiation
|
||||||
es6id: B.3.3.1
|
description: >
|
||||||
flags: [onlyStrict]
|
AnnexB extension not honored in strict mode, Function declaration
|
||||||
|
in the `default` clause of a `switch` statement in function code
|
||||||
info: |
|
info: |
|
||||||
Function declaration in the `default` clause of a `switch` statement in
|
|
||||||
function code
|
|
||||||
|
|
||||||
B.3.3.1 Changes to FunctionDeclarationInstantiation
|
B.3.3.1 Changes to FunctionDeclarationInstantiation
|
||||||
|
|
||||||
1. If strict is false, then
|
1. If strict is false, then
|
||||||
|
...
|
||||||
|
|
||||||
|
flags: [onlyStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var err1, err2;
|
var err1, err2;
|
Loading…
x
Reference in New Issue
Block a user