mirror of https://github.com/tc39/test262.git
Add tests for `arguments` within function body
This commit is contained in:
parent
aac38cb368
commit
a7deb7bcce
|
@ -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) {}
|
||||||
|
}
|
|
@ -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) {}
|
||||||
|
}
|
|
@ -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;
|
||||||
|
}
|
|
@ -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;
|
||||||
|
}
|
|
@ -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;
|
||||||
|
}
|
|
@ -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;
|
||||||
|
}
|
|
@ -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;
|
||||||
|
}
|
|
@ -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;
|
||||||
|
}
|
|
@ -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;
|
||||||
|
}
|
|
@ -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;
|
||||||
|
}
|
|
@ -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;
|
||||||
|
}
|
|
@ -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;
|
||||||
|
}
|
Loading…
Reference in New Issue