Corrections to sec-web-compat-evaldeclarationinstantiation and sec-web-compat-functiondeclarationinstantiation tests. Fixes gh-1364 (#1509)

This commit is contained in:
Rick Waldron 2018-04-18 16:54:30 -04:00 committed by Leo Balter
parent 14931c923f
commit a1a4e2b1b8
18 changed files with 364 additions and 48 deletions

View File

@ -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;

View File

@ -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);

View 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);

View File

@ -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;

View File

@ -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;

View File

@ -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);

View 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);

View File

@ -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;

View File

@ -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;

View File

@ -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);

View 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);

View File

@ -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;

View 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);

View File

@ -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;

View 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);

View File

@ -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;

View 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);

View File

@ -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;