mirror of https://github.com/tc39/test262.git
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.
|
||||
// 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;
|
|
@ -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);
|
||||
|
|
@ -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.
|
||||
// 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;
|
|
@ -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;
|
|
@ -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);
|
|
@ -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.
|
||||
// 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;
|
|
@ -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;
|
|
@ -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);
|
|
@ -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.
|
||||
// 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;
|
|
@ -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.
|
||||
// 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;
|
|
@ -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.
|
||||
// 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;
|
|
@ -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.
|
||||
// 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;
|
Loading…
Reference in New Issue