Skip to content
Snippets Groups Projects
Commit a7deb7bc authored by Mike Pennisi's avatar Mike Pennisi
Browse files

Add tests for `arguments` within function body

parent aac38cb3
No related branches found
No related tags found
No related merge requests found
Showing
with 230 additions and 0 deletions
// 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) {}
}
// 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) {}
}
// 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;
}
// 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;
}
// 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;
}
// 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;
}
// 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;
}
// 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;
}
// 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;
}
// 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;
}
// 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;
}
// 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;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment