Add tests for `arguments` within function body

This commit is contained in:
Mike Pennisi 2018-10-28 16:07:20 -04:00
parent aac38cb368
commit a7deb7bcce
12 changed files with 230 additions and 0 deletions

View File

@ -0,0 +1,19 @@
// Copyright (c) 2018 Mike Pennisi. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-for-statement
description: >
'for(var arguments = 42 in ...) {...}' throws SyntaxError in
strict mode within a function declaration
flags: [onlyStrict]
negative:
phase: parse
type: SyntaxError
---*/
throw "Test262: This statement should not be evaluated.";
function f() {
for (var arguments = 42 in null) {}
}

View File

@ -0,0 +1,19 @@
// Copyright (c) 2018 Mike Pennisi. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-for-statement
description: >
'for(var arguments in ...) {...}' throws SyntaxError in strict mode within a
function declaration
flags: [onlyStrict]
negative:
phase: parse
type: SyntaxError
---*/
throw "Test262: This statement should not be evaluated.";
function f() {
for (var arguments in null) {}
}

View File

@ -0,0 +1,14 @@
// Copyright (c) 2018 Mike Pennisi. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 12.2.1-12
esid: sec-variable-statement
description: >
arguments as local var identifier is allowed within a function declaration
flags: [noStrict]
---*/
function f() {
var arguments;
}

View File

@ -0,0 +1,20 @@
// Copyright (c) 2018 Mike Pennisi. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 12.2.1-28-s
esid: sec-variable-statement
description: >
arguments as local var identifier assigned to throws SyntaxError
in strict mode within a function declaration
flags: [onlyStrict]
negative:
phase: parse
type: SyntaxError
---*/
throw "Test262: This statement should not be evaluated.";
function f() {
var a, arguments = 42;
}

View File

@ -0,0 +1,20 @@
// Copyright (c) 2018 Mike Pennisi. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 12.2.1-30-s
esid: sec-variable-statement
description: >
arguments as local var identifier throws SyntaxError in strict mode within a
function declaration
flags: [onlyStrict]
negative:
phase: parse
type: SyntaxError
---*/
throw "Test262: This statement should not be evaluated.";
function f() {
var a = 42, arguments;
}

View File

@ -0,0 +1,19 @@
// Copyright (c) 2018 Mike Pennisi. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-variable-statement
description: >
arguments as local var identifier throws SyntaxError in strict mode within a
function declaration
flags: [onlyStrict]
negative:
phase: parse
type: SyntaxError
---*/
throw "Test262: This statement should not be evaluated.";
function f() {
var arguments = 42, a;
}

View File

@ -0,0 +1,20 @@
// Copyright (c) 2018 Mike Pennisi. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 12.2.1-25-s
esid: sec-variable-statement
description: >
arguments as local var identifier throws SyntaxError in strict mode within a
function declaration
flags: [onlyStrict]
negative:
phase: parse
type: SyntaxError
---*/
throw "Test262: This statement should not be evaluated.";
function f() {
var arguments, a;
}

View File

@ -0,0 +1,19 @@
// Copyright (c) 2018 Mike Pennisi. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-variable-statement
description: >
arguments as local var identifier throws SyntaxError in strict mode within a
function declaration
flags: [onlyStrict]
negative:
phase: parse
type: SyntaxError
---*/
throw "Test262: This statement should not be evaluated.";
function f() {
var a, arguments = 42, b;
}

View File

@ -0,0 +1,20 @@
// Copyright (c) 2018 Mike Pennisi. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 12.2.1-33-s
esid: sec-variable-statement
description: >
arguments as local var identifier throws SyntaxError in strict mode within a
function declaration
flags: [onlyStrict]
negative:
phase: parse
type: SyntaxError
---*/
throw "Test262: This statement should not be evaluated.";
function f() {
var a, arguments, b;
}

View File

@ -0,0 +1,20 @@
// Copyright (c) 2018 Mike Pennisi. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 12.2.1-32-s
esid: sec-variable-statement
description: >
arguments as local var identifier defined twice and assigned once
throws SyntaxError in strict mode within a function declaration
flags: [onlyStrict]
negative:
phase: parse
type: SyntaxError
---*/
throw "Test262: This statement should not be evaluated.";
function f() {
var arguments, arguments = 42;
}

View File

@ -0,0 +1,20 @@
// Copyright (c) 2018 Mike Pennisi. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 12.2.1-23-s
esid: sec-variable-statement
description: >
arguments as local var identifier assigned to throws SyntaxError
in strict mode within a function declaration
flags: [onlyStrict]
negative:
phase: parse
type: SyntaxError
---*/
throw "Test262: This statement should not be evaluated.";
function f() {
var arguments = 42;
}

View File

@ -0,0 +1,20 @@
// Copyright (c) 2018 Mike Pennisi. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 12.2.1-12-s
esid: sec-variable-statement
description: >
arguments as local var identifier throws SyntaxError in strict mode within a
function declaration
flags: [onlyStrict]
negative:
phase: parse
type: SyntaxError
---*/
throw "Test262: This statement should not be evaluated.";
function f() {
var arguments;
}