mirror of
https://github.com/tc39/test262.git
synced 2025-04-08 19:35:28 +02:00
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) {}
|
||||
}
|
19
test/language/statements/for-in/var-arguments-fn-strict.js
Normal file
19
test/language/statements/for-in/var-arguments-fn-strict.js
Normal 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) {}
|
||||
}
|
14
test/language/statements/variable/arguments-fn-non-strict.js
Normal file
14
test/language/statements/variable/arguments-fn-non-strict.js
Normal 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;
|
||||
}
|
@ -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…
x
Reference in New Issue
Block a user