arguments object, non-strict immutable name binding fixup (#1278)

This commit is contained in:
Rick Waldron 2017-10-16 13:01:32 -04:00 committed by Leo Balter
parent 5d4c667b27
commit 9e3ff9a232
2 changed files with 21 additions and 20 deletions

View File

@ -1,20 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: >
The activation object is initialised with a property with name arguments
and attributes {DontDelete}
es5id: 10.1.6_A1_T3
description: Checking function which returns "this"
flags: [noStrict]
---*/
function f1() {
if (delete arguments) {
$ERROR("#1: Function parameters have attribute {DontDelete}" + arguments);
}
return arguments;
}
f1();

View File

@ -0,0 +1,21 @@
// Copyright 2017 Rick Waldron. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-functiondeclarationinstantiation
description: Non-strict mode function execution context has a mutable "arguments" binding, however it is created with a "false" argument, which means it may not be deleted.
info: |
envRec.CreateMutableBinding("arguments", false).
CreateMutableBinding(N, D)
Create a new but uninitialized mutable binding in an Environment Record. The String value N is the text of the bound name. If the Boolean argument D is true the binding may be subsequently deleted.
flags: [noStrict]
---*/
function f1() {
assert.sameValue(delete arguments, false);
}
f1();