mirror of
https://github.com/tc39/test262.git
synced 2025-04-08 19:35:28 +02:00
Attempting to set a value to a binding that no longer exists must throw a ReferenceError exception in strict mode code. Fixes gh-427
This commit is contained in:
parent
8a2bfb48d4
commit
92a200b29f
@ -0,0 +1,41 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object-environment-records-setmutablebinding-n-v-s
|
||||
description: >
|
||||
Assignment Operator calls PutValue(lref, rval) (formerly S11.13.1_A5_T5)
|
||||
info: |
|
||||
The concrete Environment Record method SetMutableBinding for object Environment
|
||||
Records attempts to set the value of the Environment Record's associated binding
|
||||
object's property whose name is the value of the argument N to the value of argument V.
|
||||
A property named N normally already exists but if it does not or is not currently writable,
|
||||
error handling is determined by the value of the Boolean argument S.
|
||||
|
||||
Let stillExists be ? HasProperty(bindings, N).
|
||||
If stillExists is false and S is true, throw a ReferenceError exception.
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
|
||||
var count = 0;
|
||||
var global = this;
|
||||
|
||||
Object.defineProperty(this, "x", {
|
||||
configurable: true,
|
||||
value: 1
|
||||
});
|
||||
|
||||
(function() {
|
||||
"use strict";
|
||||
assert.throws(ReferenceError, () => {
|
||||
count++;
|
||||
x = (delete global.x, 2);
|
||||
count++;
|
||||
});
|
||||
count++;
|
||||
})();
|
||||
|
||||
assert.sameValue(count, 2);
|
||||
assert(!('x' in this));
|
||||
assert(!('x' in global));
|
||||
|
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object-environment-records-setmutablebinding-n-v-s
|
||||
description: >
|
||||
Assignment Operator calls PutValue(lref, rval) (formerly S11.13.1_A5_T4)
|
||||
info: |
|
||||
The concrete Environment Record method SetMutableBinding for object Environment
|
||||
Records attempts to set the value of the Environment Record's associated binding
|
||||
object's property whose name is the value of the argument N to the value of argument V.
|
||||
A property named N normally already exists but if it does not or is not currently writable,
|
||||
error handling is determined by the value of the Boolean argument S.
|
||||
|
||||
Let stillExists be ? HasProperty(bindings, N).
|
||||
If stillExists is false and S is true, throw a ReferenceError exception.
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
|
||||
var count = 0;
|
||||
var scope = {x: 1};
|
||||
|
||||
with (scope) {
|
||||
(function() {
|
||||
"use strict";
|
||||
assert.throws(ReferenceError, () => {
|
||||
count++;
|
||||
x = (delete scope.x, 2);
|
||||
count++;
|
||||
});
|
||||
count++;
|
||||
})();
|
||||
}
|
||||
|
||||
assert.sameValue(count, 2);
|
||||
assert(!('x' in scope));
|
@ -0,0 +1,40 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object-environment-records-setmutablebinding-n-v-s
|
||||
description: >
|
||||
Compound Assignment Operator calls PutValue(lref, v) (formerly S11.13.2_A5.10_T5)
|
||||
info: |
|
||||
The concrete Environment Record method SetMutableBinding for object Environment
|
||||
Records attempts to set the value of the Environment Record's associated binding
|
||||
object's property whose name is the value of the argument N to the value of argument V.
|
||||
A property named N normally already exists but if it does not or is not currently writable,
|
||||
error handling is determined by the value of the Boolean argument S.
|
||||
|
||||
Let stillExists be ? HasProperty(bindings, N).
|
||||
If stillExists is false and S is true, throw a ReferenceError exception.
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
var count = 0;
|
||||
|
||||
Object.defineProperty(this, "x", {
|
||||
configurable: true,
|
||||
get: function() {
|
||||
delete this.x;
|
||||
return 2;
|
||||
}
|
||||
});
|
||||
|
||||
(function() {
|
||||
"use strict";
|
||||
assert.throws(ReferenceError, () => {
|
||||
count++;
|
||||
x ^= 3;
|
||||
count++;
|
||||
});
|
||||
count++;
|
||||
})();
|
||||
|
||||
assert.sameValue(count, 2);
|
||||
assert(!('x' in this));
|
@ -0,0 +1,41 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object-environment-records-setmutablebinding-n-v-s
|
||||
description: >
|
||||
Compound Assignment Operator calls PutValue(lref, v) (formerly S11.13.2_A5.4_T4)
|
||||
info: |
|
||||
The concrete Environment Record method SetMutableBinding for object Environment
|
||||
Records attempts to set the value of the Environment Record's associated binding
|
||||
object's property whose name is the value of the argument N to the value of argument V.
|
||||
A property named N normally already exists but if it does not or is not currently writable,
|
||||
error handling is determined by the value of the Boolean argument S.
|
||||
|
||||
Let stillExists be ? HasProperty(bindings, N).
|
||||
If stillExists is false and S is true, throw a ReferenceError exception.
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
|
||||
var count = 0;
|
||||
var scope = {
|
||||
get x() {
|
||||
delete this.x;
|
||||
return 2;
|
||||
}
|
||||
};
|
||||
|
||||
with (scope) {
|
||||
(function() {
|
||||
"use strict";
|
||||
assert.throws(ReferenceError, () => {
|
||||
count++;
|
||||
x += 1;
|
||||
count++;
|
||||
});
|
||||
count++;
|
||||
})();
|
||||
}
|
||||
|
||||
assert.sameValue(count, 2);
|
||||
assert(!('x' in scope));
|
@ -0,0 +1,40 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object-environment-records-setmutablebinding-n-v-s
|
||||
description: >
|
||||
Compound Assignment Operator calls PutValue(lref, v) (formerly S11.13.2_A5.4_T5)
|
||||
info: |
|
||||
The concrete Environment Record method SetMutableBinding for object Environment
|
||||
Records attempts to set the value of the Environment Record's associated binding
|
||||
object's property whose name is the value of the argument N to the value of argument V.
|
||||
A property named N normally already exists but if it does not or is not currently writable,
|
||||
error handling is determined by the value of the Boolean argument S.
|
||||
|
||||
Let stillExists be ? HasProperty(bindings, N).
|
||||
If stillExists is false and S is true, throw a ReferenceError exception.
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
var count = 0;
|
||||
Object.defineProperty(this, "x", {
|
||||
configurable: true,
|
||||
get: function() {
|
||||
delete this.x;
|
||||
return 2;
|
||||
}
|
||||
});
|
||||
|
||||
(function() {
|
||||
"use strict";
|
||||
assert.throws(ReferenceError, () => {
|
||||
count++;
|
||||
x += 1;
|
||||
count++;
|
||||
});
|
||||
count++;
|
||||
})();
|
||||
|
||||
assert.sameValue(count, 2);
|
||||
assert(!('x' in this));
|
||||
|
@ -0,0 +1,41 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object-environment-records-setmutablebinding-n-v-s
|
||||
description: >
|
||||
Compound Assignment Operator calls PutValue(lref, v) (formerly S11.13.2_A5.5_T4)
|
||||
info: |
|
||||
The concrete Environment Record method SetMutableBinding for object Environment
|
||||
Records attempts to set the value of the Environment Record's associated binding
|
||||
object's property whose name is the value of the argument N to the value of argument V.
|
||||
A property named N normally already exists but if it does not or is not currently writable,
|
||||
error handling is determined by the value of the Boolean argument S.
|
||||
|
||||
Let stillExists be ? HasProperty(bindings, N).
|
||||
If stillExists is false and S is true, throw a ReferenceError exception.
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
var count = 0;
|
||||
var scope = {
|
||||
get x() {
|
||||
delete this.x;
|
||||
return 2;
|
||||
}
|
||||
};
|
||||
|
||||
with (scope) {
|
||||
(function() {
|
||||
"use strict";
|
||||
assert.throws(ReferenceError, () => {
|
||||
count++;
|
||||
x -= 1;
|
||||
count++;
|
||||
});
|
||||
count++;
|
||||
})();
|
||||
}
|
||||
|
||||
assert.sameValue(count, 2);
|
||||
assert(!('x' in scope));
|
||||
|
@ -0,0 +1,39 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object-environment-records-setmutablebinding-n-v-s
|
||||
description: >
|
||||
Compound Assignment Operator calls PutValue(lref, v) (formerly S11.13.2_A5.5_T5)
|
||||
info: |
|
||||
The concrete Environment Record method SetMutableBinding for object Environment
|
||||
Records attempts to set the value of the Environment Record's associated binding
|
||||
object's property whose name is the value of the argument N to the value of argument V.
|
||||
A property named N normally already exists but if it does not or is not currently writable,
|
||||
error handling is determined by the value of the Boolean argument S.
|
||||
|
||||
Let stillExists be ? HasProperty(bindings, N).
|
||||
If stillExists is false and S is true, throw a ReferenceError exception.
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
var count = 0;
|
||||
Object.defineProperty(this, "x", {
|
||||
configurable: true,
|
||||
get: function() {
|
||||
delete this.x;
|
||||
return 2;
|
||||
}
|
||||
});
|
||||
|
||||
(function() {
|
||||
"use strict";
|
||||
assert.throws(ReferenceError, () => {
|
||||
count++;
|
||||
x -= 1;
|
||||
count++;
|
||||
});
|
||||
count++;
|
||||
})();
|
||||
|
||||
assert.sameValue(count, 2);
|
||||
assert(!('x' in this));
|
@ -0,0 +1,40 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object-environment-records-setmutablebinding-n-v-s
|
||||
description: >
|
||||
Compound Assignment Operator calls PutValue(lref, v) (formerly S11.13.2_A5.6_T4)
|
||||
info: |
|
||||
The concrete Environment Record method SetMutableBinding for object Environment
|
||||
Records attempts to set the value of the Environment Record's associated binding
|
||||
object's property whose name is the value of the argument N to the value of argument V.
|
||||
A property named N normally already exists but if it does not or is not currently writable,
|
||||
error handling is determined by the value of the Boolean argument S.
|
||||
|
||||
Let stillExists be ? HasProperty(bindings, N).
|
||||
If stillExists is false and S is true, throw a ReferenceError exception.
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
var count = 0;
|
||||
var scope = {
|
||||
get x() {
|
||||
delete this.x;
|
||||
return 2;
|
||||
}
|
||||
};
|
||||
|
||||
with (scope) {
|
||||
(function() {
|
||||
"use strict";
|
||||
assert.throws(ReferenceError, () => {
|
||||
count++;
|
||||
x <<= 3;
|
||||
count++;
|
||||
});
|
||||
count++;
|
||||
})();
|
||||
}
|
||||
|
||||
assert.sameValue(count, 2);
|
||||
assert(!('x' in scope));
|
@ -0,0 +1,39 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object-environment-records-setmutablebinding-n-v-s
|
||||
description: >
|
||||
Compound Assignment Operator calls PutValue(lref, v) (formerly S11.13.2_A5.6_T5)
|
||||
info: |
|
||||
The concrete Environment Record method SetMutableBinding for object Environment
|
||||
Records attempts to set the value of the Environment Record's associated binding
|
||||
object's property whose name is the value of the argument N to the value of argument V.
|
||||
A property named N normally already exists but if it does not or is not currently writable,
|
||||
error handling is determined by the value of the Boolean argument S.
|
||||
|
||||
Let stillExists be ? HasProperty(bindings, N).
|
||||
If stillExists is false and S is true, throw a ReferenceError exception.
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
var count = 0;
|
||||
Object.defineProperty(this, "x", {
|
||||
configurable: true,
|
||||
get: function() {
|
||||
delete this.x;
|
||||
return 2;
|
||||
}
|
||||
});
|
||||
|
||||
(function() {
|
||||
"use strict";
|
||||
assert.throws(ReferenceError, () => {
|
||||
count++;
|
||||
x <<= 3;
|
||||
count++;
|
||||
});
|
||||
count++;
|
||||
})();
|
||||
|
||||
assert.sameValue(count, 2);
|
||||
assert(!('x' in this));
|
@ -0,0 +1,40 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object-environment-records-setmutablebinding-n-v-s
|
||||
description: >
|
||||
Compound Assignment Operator calls PutValue(lref, v) (formerly S11.13.2_A5.7_T4)
|
||||
info: |
|
||||
The concrete Environment Record method SetMutableBinding for object Environment
|
||||
Records attempts to set the value of the Environment Record's associated binding
|
||||
object's property whose name is the value of the argument N to the value of argument V.
|
||||
A property named N normally already exists but if it does not or is not currently writable,
|
||||
error handling is determined by the value of the Boolean argument S.
|
||||
|
||||
Let stillExists be ? HasProperty(bindings, N).
|
||||
If stillExists is false and S is true, throw a ReferenceError exception.
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
var count = 0;
|
||||
var scope = {
|
||||
get x() {
|
||||
delete this.x;
|
||||
return 16;
|
||||
}
|
||||
};
|
||||
|
||||
with (scope) {
|
||||
(function() {
|
||||
"use strict";
|
||||
assert.throws(ReferenceError, () => {
|
||||
count++;
|
||||
x >>= 3;
|
||||
count++;
|
||||
});
|
||||
count++;
|
||||
})();
|
||||
}
|
||||
|
||||
assert.sameValue(count, 2);
|
||||
assert(!('x' in scope));
|
@ -0,0 +1,39 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object-environment-records-setmutablebinding-n-v-s
|
||||
description: >
|
||||
Compound Assignment Operator calls PutValue(lref, v) (formerly S11.13.2_A5.7_T5)
|
||||
info: |
|
||||
The concrete Environment Record method SetMutableBinding for object Environment
|
||||
Records attempts to set the value of the Environment Record's associated binding
|
||||
object's property whose name is the value of the argument N to the value of argument V.
|
||||
A property named N normally already exists but if it does not or is not currently writable,
|
||||
error handling is determined by the value of the Boolean argument S.
|
||||
|
||||
Let stillExists be ? HasProperty(bindings, N).
|
||||
If stillExists is false and S is true, throw a ReferenceError exception.
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
var count = 0;
|
||||
Object.defineProperty(this, "x", {
|
||||
configurable: true,
|
||||
get: function() {
|
||||
delete this.x;
|
||||
return 16;
|
||||
}
|
||||
});
|
||||
|
||||
(function() {
|
||||
"use strict";
|
||||
assert.throws(ReferenceError, () => {
|
||||
count++;
|
||||
x >>= 3;
|
||||
count++;
|
||||
});
|
||||
count++;
|
||||
})();
|
||||
|
||||
assert.sameValue(count, 2);
|
||||
assert(!('x' in this));
|
@ -0,0 +1,40 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object-environment-records-setmutablebinding-n-v-s
|
||||
description: >
|
||||
Compound Assignment Operator calls PutValue(lref, v) (formerly S11.13.2_A5.8_T4)
|
||||
info: |
|
||||
The concrete Environment Record method SetMutableBinding for object Environment
|
||||
Records attempts to set the value of the Environment Record's associated binding
|
||||
object's property whose name is the value of the argument N to the value of argument V.
|
||||
A property named N normally already exists but if it does not or is not currently writable,
|
||||
error handling is determined by the value of the Boolean argument S.
|
||||
|
||||
Let stillExists be ? HasProperty(bindings, N).
|
||||
If stillExists is false and S is true, throw a ReferenceError exception.
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
var count = 0;
|
||||
var scope = {
|
||||
get x() {
|
||||
delete this.x;
|
||||
return 16;
|
||||
}
|
||||
};
|
||||
|
||||
with (scope) {
|
||||
(function() {
|
||||
"use strict";
|
||||
assert.throws(ReferenceError, () => {
|
||||
count++;
|
||||
x >>>= 3;
|
||||
count++;
|
||||
});
|
||||
count++;
|
||||
})();
|
||||
}
|
||||
|
||||
assert.sameValue(count, 2);
|
||||
assert(!('x' in scope));
|
@ -0,0 +1,39 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object-environment-records-setmutablebinding-n-v-s
|
||||
description: >
|
||||
Compound Assignment Operator calls PutValue(lref, v) (formerly S11.13.2_A5.8_T5)
|
||||
info: |
|
||||
The concrete Environment Record method SetMutableBinding for object Environment
|
||||
Records attempts to set the value of the Environment Record's associated binding
|
||||
object's property whose name is the value of the argument N to the value of argument V.
|
||||
A property named N normally already exists but if it does not or is not currently writable,
|
||||
error handling is determined by the value of the Boolean argument S.
|
||||
|
||||
Let stillExists be ? HasProperty(bindings, N).
|
||||
If stillExists is false and S is true, throw a ReferenceError exception.
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
var count = 0;
|
||||
Object.defineProperty(this, "x", {
|
||||
configurable: true,
|
||||
get: function() {
|
||||
delete this.x;
|
||||
return 16;
|
||||
}
|
||||
});
|
||||
|
||||
(function() {
|
||||
"use strict";
|
||||
assert.throws(ReferenceError, () => {
|
||||
count++;
|
||||
x >>>= 3;
|
||||
count++;
|
||||
});
|
||||
count++;
|
||||
})();
|
||||
|
||||
assert.sameValue(count, 2);
|
||||
assert(!('x' in this));
|
@ -0,0 +1,40 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object-environment-records-setmutablebinding-n-v-s
|
||||
description: >
|
||||
Compound Assignment Operator calls PutValue(lref, v) (formerly S11.13.2_A5.11_T4)
|
||||
info: |
|
||||
The concrete Environment Record method SetMutableBinding for object Environment
|
||||
Records attempts to set the value of the Environment Record's associated binding
|
||||
object's property whose name is the value of the argument N to the value of argument V.
|
||||
A property named N normally already exists but if it does not or is not currently writable,
|
||||
error handling is determined by the value of the Boolean argument S.
|
||||
|
||||
Let stillExists be ? HasProperty(bindings, N).
|
||||
If stillExists is false and S is true, throw a ReferenceError exception.
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
var count = 0;
|
||||
var scope = {
|
||||
get x() {
|
||||
delete this.x;
|
||||
return 2;
|
||||
}
|
||||
};
|
||||
|
||||
with (scope) {
|
||||
(function() {
|
||||
"use strict";
|
||||
assert.throws(ReferenceError, () => {
|
||||
count++;
|
||||
x |= 4;
|
||||
count++;
|
||||
});
|
||||
count++;
|
||||
})();
|
||||
}
|
||||
|
||||
assert.sameValue(count, 2);
|
||||
assert(!('x' in scope));
|
@ -0,0 +1,40 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object-environment-records-setmutablebinding-n-v-s
|
||||
description: >
|
||||
Compound Assignment Operator calls PutValue(lref, v) (formerly S11.13.2_A5.9_T4)
|
||||
info: |
|
||||
The concrete Environment Record method SetMutableBinding for object Environment
|
||||
Records attempts to set the value of the Environment Record's associated binding
|
||||
object's property whose name is the value of the argument N to the value of argument V.
|
||||
A property named N normally already exists but if it does not or is not currently writable,
|
||||
error handling is determined by the value of the Boolean argument S.
|
||||
|
||||
Let stillExists be ? HasProperty(bindings, N).
|
||||
If stillExists is false and S is true, throw a ReferenceError exception.
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
var count = 0;
|
||||
var scope = {
|
||||
get x() {
|
||||
delete this.x;
|
||||
return 5;
|
||||
}
|
||||
};
|
||||
|
||||
with (scope) {
|
||||
(function() {
|
||||
"use strict";
|
||||
assert.throws(ReferenceError, () => {
|
||||
count++;
|
||||
x &= 3;
|
||||
count++;
|
||||
});
|
||||
count++;
|
||||
})();
|
||||
}
|
||||
|
||||
assert.sameValue(count, 2);
|
||||
assert(!('x' in scope));
|
@ -0,0 +1,39 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object-environment-records-setmutablebinding-n-v-s
|
||||
description: >
|
||||
Compound Assignment Operator calls PutValue(lref, v) (formerly S11.13.2_A5.9_T5)
|
||||
info: |
|
||||
The concrete Environment Record method SetMutableBinding for object Environment
|
||||
Records attempts to set the value of the Environment Record's associated binding
|
||||
object's property whose name is the value of the argument N to the value of argument V.
|
||||
A property named N normally already exists but if it does not or is not currently writable,
|
||||
error handling is determined by the value of the Boolean argument S.
|
||||
|
||||
Let stillExists be ? HasProperty(bindings, N).
|
||||
If stillExists is false and S is true, throw a ReferenceError exception.
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
var count = 0;
|
||||
Object.defineProperty(this, "x", {
|
||||
configurable: true,
|
||||
get: function() {
|
||||
delete this.x;
|
||||
return 5;
|
||||
}
|
||||
});
|
||||
|
||||
(function() {
|
||||
"use strict";
|
||||
assert.throws(ReferenceError, () => {
|
||||
count++;
|
||||
x &= 3;
|
||||
count++;
|
||||
});
|
||||
count++;
|
||||
})();
|
||||
|
||||
assert.sameValue(count, 2);
|
||||
assert(!('x' in this));
|
@ -0,0 +1,39 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object-environment-records-setmutablebinding-n-v-s
|
||||
description: >
|
||||
Compound Assignment Operator calls PutValue(lref, v) (formerly S11.13.2_A5.11_T5)
|
||||
info: |
|
||||
The concrete Environment Record method SetMutableBinding for object Environment
|
||||
Records attempts to set the value of the Environment Record's associated binding
|
||||
object's property whose name is the value of the argument N to the value of argument V.
|
||||
A property named N normally already exists but if it does not or is not currently writable,
|
||||
error handling is determined by the value of the Boolean argument S.
|
||||
|
||||
Let stillExists be ? HasProperty(bindings, N).
|
||||
If stillExists is false and S is true, throw a ReferenceError exception.
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
var count = 0;
|
||||
Object.defineProperty(this, "x", {
|
||||
configurable: true,
|
||||
get: function() {
|
||||
delete this.x;
|
||||
return 2;
|
||||
}
|
||||
});
|
||||
|
||||
(function() {
|
||||
"use strict";
|
||||
assert.throws(ReferenceError, () => {
|
||||
count++;
|
||||
x |= 4;
|
||||
count++;
|
||||
});
|
||||
count++;
|
||||
})();
|
||||
|
||||
assert.sameValue(count, 2);
|
||||
assert(!('x' in this));
|
@ -0,0 +1,40 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object-environment-records-setmutablebinding-n-v-s
|
||||
description: >
|
||||
Compound Assignment Operator calls PutValue(lref, v) (formerly S11.13.2_A5.1_T4)
|
||||
info: |
|
||||
The concrete Environment Record method SetMutableBinding for object Environment
|
||||
Records attempts to set the value of the Environment Record's associated binding
|
||||
object's property whose name is the value of the argument N to the value of argument V.
|
||||
A property named N normally already exists but if it does not or is not currently writable,
|
||||
error handling is determined by the value of the Boolean argument S.
|
||||
|
||||
Let stillExists be ? HasProperty(bindings, N).
|
||||
If stillExists is false and S is true, throw a ReferenceError exception.
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
var count = 0;
|
||||
var scope = {
|
||||
get x() {
|
||||
delete this.x;
|
||||
return 2;
|
||||
}
|
||||
};
|
||||
|
||||
with (scope) {
|
||||
(function() {
|
||||
"use strict";
|
||||
assert.throws(ReferenceError, () => {
|
||||
count++;
|
||||
x *= 3;
|
||||
count++;
|
||||
});
|
||||
count++;
|
||||
})();
|
||||
}
|
||||
|
||||
assert.sameValue(count, 2);
|
||||
assert(!('x' in scope));
|
@ -0,0 +1,39 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object-environment-records-setmutablebinding-n-v-s
|
||||
description: >
|
||||
Compound Assignment Operator calls PutValue(lref, v) (formerly S11.13.2_A5.1_T5)
|
||||
info: |
|
||||
The concrete Environment Record method SetMutableBinding for object Environment
|
||||
Records attempts to set the value of the Environment Record's associated binding
|
||||
object's property whose name is the value of the argument N to the value of argument V.
|
||||
A property named N normally already exists but if it does not or is not currently writable,
|
||||
error handling is determined by the value of the Boolean argument S.
|
||||
|
||||
Let stillExists be ? HasProperty(bindings, N).
|
||||
If stillExists is false and S is true, throw a ReferenceError exception.
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
var count = 0;
|
||||
Object.defineProperty(this, "x", {
|
||||
configurable: true,
|
||||
get: function() {
|
||||
delete this.x;
|
||||
return 2;
|
||||
}
|
||||
});
|
||||
|
||||
(function() {
|
||||
"use strict";
|
||||
assert.throws(ReferenceError, () => {
|
||||
count++;
|
||||
x *= 3;
|
||||
count++;
|
||||
});
|
||||
count++;
|
||||
})();
|
||||
|
||||
assert.sameValue(count, 2);
|
||||
assert(!('x' in this));
|
@ -0,0 +1,40 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object-environment-records-setmutablebinding-n-v-s
|
||||
description: >
|
||||
Compound Assignment Operator calls PutValue(lref, v) (formerly S11.13.2_A5.2_T4)
|
||||
info: |
|
||||
The concrete Environment Record method SetMutableBinding for object Environment
|
||||
Records attempts to set the value of the Environment Record's associated binding
|
||||
object's property whose name is the value of the argument N to the value of argument V.
|
||||
A property named N normally already exists but if it does not or is not currently writable,
|
||||
error handling is determined by the value of the Boolean argument S.
|
||||
|
||||
Let stillExists be ? HasProperty(bindings, N).
|
||||
If stillExists is false and S is true, throw a ReferenceError exception.
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
var count = 0;
|
||||
var scope = {
|
||||
get x() {
|
||||
delete this.x;
|
||||
return 6;
|
||||
}
|
||||
};
|
||||
|
||||
with (scope) {
|
||||
(function() {
|
||||
"use strict";
|
||||
assert.throws(ReferenceError, () => {
|
||||
count++;
|
||||
x /= 3;
|
||||
count++;
|
||||
});
|
||||
count++;
|
||||
})();
|
||||
}
|
||||
|
||||
assert.sameValue(count, 2);
|
||||
assert(!('x' in scope));
|
@ -0,0 +1,39 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object-environment-records-setmutablebinding-n-v-s
|
||||
description: >
|
||||
Compound Assignment Operator calls PutValue(lref, v) (formerly S11.13.2_A5.2_T5)
|
||||
info: |
|
||||
The concrete Environment Record method SetMutableBinding for object Environment
|
||||
Records attempts to set the value of the Environment Record's associated binding
|
||||
object's property whose name is the value of the argument N to the value of argument V.
|
||||
A property named N normally already exists but if it does not or is not currently writable,
|
||||
error handling is determined by the value of the Boolean argument S.
|
||||
|
||||
Let stillExists be ? HasProperty(bindings, N).
|
||||
If stillExists is false and S is true, throw a ReferenceError exception.
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
var count = 0;
|
||||
Object.defineProperty(this, "x", {
|
||||
configurable: true,
|
||||
get: function() {
|
||||
delete this.x;
|
||||
return 6;
|
||||
}
|
||||
});
|
||||
|
||||
(function() {
|
||||
"use strict";
|
||||
assert.throws(ReferenceError, () => {
|
||||
count++;
|
||||
x /= 3;
|
||||
count++;
|
||||
});
|
||||
count++;
|
||||
})();
|
||||
|
||||
assert.sameValue(count, 2);
|
||||
assert(!('x' in this));
|
@ -0,0 +1,40 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object-environment-records-setmutablebinding-n-v-s
|
||||
description: >
|
||||
Compound Assignment Operator calls PutValue(lref, v) (formerly S11.13.2_A5.3_T4)
|
||||
info: |
|
||||
The concrete Environment Record method SetMutableBinding for object Environment
|
||||
Records attempts to set the value of the Environment Record's associated binding
|
||||
object's property whose name is the value of the argument N to the value of argument V.
|
||||
A property named N normally already exists but if it does not or is not currently writable,
|
||||
error handling is determined by the value of the Boolean argument S.
|
||||
|
||||
Let stillExists be ? HasProperty(bindings, N).
|
||||
If stillExists is false and S is true, throw a ReferenceError exception.
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
var count = 0;
|
||||
var scope = {
|
||||
get x() {
|
||||
delete this.x;
|
||||
return 5;
|
||||
}
|
||||
};
|
||||
|
||||
with (scope) {
|
||||
(function() {
|
||||
"use strict";
|
||||
assert.throws(ReferenceError, () => {
|
||||
count++;
|
||||
x %= 3;
|
||||
count++;
|
||||
});
|
||||
count++;
|
||||
})();
|
||||
}
|
||||
|
||||
assert.sameValue(count, 2);
|
||||
assert(!('x' in scope));
|
@ -0,0 +1,39 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object-environment-records-setmutablebinding-n-v-s
|
||||
description: >
|
||||
Compound Assignment Operator calls PutValue(lref, v) (formerly S11.13.2_A5.3_T5)
|
||||
info: |
|
||||
The concrete Environment Record method SetMutableBinding for object Environment
|
||||
Records attempts to set the value of the Environment Record's associated binding
|
||||
object's property whose name is the value of the argument N to the value of argument V.
|
||||
A property named N normally already exists but if it does not or is not currently writable,
|
||||
error handling is determined by the value of the Boolean argument S.
|
||||
|
||||
Let stillExists be ? HasProperty(bindings, N).
|
||||
If stillExists is false and S is true, throw a ReferenceError exception.
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
var count = 0;
|
||||
Object.defineProperty(this, "x", {
|
||||
configurable: true,
|
||||
get: function() {
|
||||
delete this.x;
|
||||
return 5;
|
||||
}
|
||||
});
|
||||
|
||||
(function() {
|
||||
"use strict";
|
||||
assert.throws(ReferenceError, () => {
|
||||
count++;
|
||||
x %= 3;
|
||||
count++;
|
||||
});
|
||||
count++;
|
||||
})();
|
||||
|
||||
assert.sameValue(count, 2);
|
||||
assert(!('x' in this));
|
@ -0,0 +1,40 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object-environment-records-setmutablebinding-n-v-s
|
||||
description: >
|
||||
Compound Assignment Operator calls PutValue(lref, v) (formerly S11.13.2_A5.10_T4)
|
||||
info: |
|
||||
The concrete Environment Record method SetMutableBinding for object Environment
|
||||
Records attempts to set the value of the Environment Record's associated binding
|
||||
object's property whose name is the value of the argument N to the value of argument V.
|
||||
A property named N normally already exists but if it does not or is not currently writable,
|
||||
error handling is determined by the value of the Boolean argument S.
|
||||
|
||||
Let stillExists be ? HasProperty(bindings, N).
|
||||
If stillExists is false and S is true, throw a ReferenceError exception.
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
var count = 0;
|
||||
var scope = {
|
||||
get x() {
|
||||
delete this.x;
|
||||
return 2;
|
||||
}
|
||||
};
|
||||
|
||||
with (scope) {
|
||||
(function() {
|
||||
"use strict";
|
||||
assert.throws(ReferenceError, () => {
|
||||
count++;
|
||||
x ^= 3;
|
||||
count++;
|
||||
});
|
||||
count++;
|
||||
})();
|
||||
}
|
||||
|
||||
assert.sameValue(count, 2);
|
||||
assert(!('x' in scope));
|
@ -0,0 +1,39 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object-environment-records-setmutablebinding-n-v-s
|
||||
description: >
|
||||
Operator x-- calls PutValue(lhs, newValue) (formerly S11.3.2_A5_T5)
|
||||
info: |
|
||||
The concrete Environment Record method SetMutableBinding for object Environment
|
||||
Records attempts to set the value of the Environment Record's associated binding
|
||||
object's property whose name is the value of the argument N to the value of argument V.
|
||||
A property named N normally already exists but if it does not or is not currently writable,
|
||||
error handling is determined by the value of the Boolean argument S.
|
||||
|
||||
Let stillExists be ? HasProperty(bindings, N).
|
||||
If stillExists is false and S is true, throw a ReferenceError exception.
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
var count = 0;
|
||||
Object.defineProperty(this, "x", {
|
||||
configurable: true,
|
||||
get: function() {
|
||||
delete this.x;
|
||||
return 2;
|
||||
}
|
||||
});
|
||||
|
||||
(function() {
|
||||
"use strict";
|
||||
assert.throws(ReferenceError, () => {
|
||||
count++;
|
||||
x--;
|
||||
count++;
|
||||
});
|
||||
count++;
|
||||
})();
|
||||
|
||||
assert.sameValue(count, 2);
|
||||
assert(!('x' in this));
|
@ -0,0 +1,40 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object-environment-records-setmutablebinding-n-v-s
|
||||
description: >
|
||||
Operator x-- calls PutValue(lhs, newValue) (formerly S11.3.2_A5_T4)
|
||||
info: |
|
||||
The concrete Environment Record method SetMutableBinding for object Environment
|
||||
Records attempts to set the value of the Environment Record's associated binding
|
||||
object's property whose name is the value of the argument N to the value of argument V.
|
||||
A property named N normally already exists but if it does not or is not currently writable,
|
||||
error handling is determined by the value of the Boolean argument S.
|
||||
|
||||
Let stillExists be ? HasProperty(bindings, N).
|
||||
If stillExists is false and S is true, throw a ReferenceError exception.
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
var count = 0;
|
||||
var scope = {
|
||||
get x() {
|
||||
delete this.x;
|
||||
return 2;
|
||||
}
|
||||
};
|
||||
|
||||
with (scope) {
|
||||
(function() {
|
||||
"use strict";
|
||||
assert.throws(ReferenceError, () => {
|
||||
count++;
|
||||
x--;
|
||||
count++;
|
||||
});
|
||||
count++;
|
||||
})();
|
||||
}
|
||||
|
||||
assert.sameValue(count, 2);
|
||||
assert(!('x' in scope));
|
@ -0,0 +1,39 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object-environment-records-setmutablebinding-n-v-s
|
||||
description: >
|
||||
Operator x++ calls PutValue(lhs, newValue) (formerly S11.3.1_A5_T5)
|
||||
info: |
|
||||
The concrete Environment Record method SetMutableBinding for object Environment
|
||||
Records attempts to set the value of the Environment Record's associated binding
|
||||
object's property whose name is the value of the argument N to the value of argument V.
|
||||
A property named N normally already exists but if it does not or is not currently writable,
|
||||
error handling is determined by the value of the Boolean argument S.
|
||||
|
||||
Let stillExists be ? HasProperty(bindings, N).
|
||||
If stillExists is false and S is true, throw a ReferenceError exception.
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
var count = 0;
|
||||
Object.defineProperty(this, "x", {
|
||||
configurable: true,
|
||||
get: function() {
|
||||
delete this.x;
|
||||
return 2;
|
||||
}
|
||||
});
|
||||
|
||||
(function() {
|
||||
"use strict";
|
||||
assert.throws(ReferenceError, () => {
|
||||
count++;
|
||||
x++;
|
||||
count++;
|
||||
});
|
||||
count++;
|
||||
})();
|
||||
|
||||
assert.sameValue(count, 2);
|
||||
assert(!('x' in this));
|
@ -0,0 +1,40 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object-environment-records-setmutablebinding-n-v-s
|
||||
description: >
|
||||
Operator x++ calls PutValue(lhs, newValue) (formerly S11.3.1_A5_T4)
|
||||
info: |
|
||||
The concrete Environment Record method SetMutableBinding for object Environment
|
||||
Records attempts to set the value of the Environment Record's associated binding
|
||||
object's property whose name is the value of the argument N to the value of argument V.
|
||||
A property named N normally already exists but if it does not or is not currently writable,
|
||||
error handling is determined by the value of the Boolean argument S.
|
||||
|
||||
Let stillExists be ? HasProperty(bindings, N).
|
||||
If stillExists is false and S is true, throw a ReferenceError exception.
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
var count = 0;
|
||||
var scope = {
|
||||
get x() {
|
||||
delete this.x;
|
||||
return 2;
|
||||
}
|
||||
};
|
||||
|
||||
with (scope) {
|
||||
(function() {
|
||||
"use strict";
|
||||
assert.throws(ReferenceError, () => {
|
||||
count++;
|
||||
x++;
|
||||
count++;
|
||||
});
|
||||
count++;
|
||||
})();
|
||||
}
|
||||
|
||||
assert.sameValue(count, 2);
|
||||
assert(!('x' in scope));
|
@ -0,0 +1,39 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object-environment-records-setmutablebinding-n-v-s
|
||||
description: >
|
||||
Operator --x calls PutValue(lhs, newValue) (formerly S11.4.5_A5_T5)
|
||||
info: |
|
||||
The concrete Environment Record method SetMutableBinding for object Environment
|
||||
Records attempts to set the value of the Environment Record's associated binding
|
||||
object's property whose name is the value of the argument N to the value of argument V.
|
||||
A property named N normally already exists but if it does not or is not currently writable,
|
||||
error handling is determined by the value of the Boolean argument S.
|
||||
|
||||
Let stillExists be ? HasProperty(bindings, N).
|
||||
If stillExists is false and S is true, throw a ReferenceError exception.
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
var count = 0;
|
||||
Object.defineProperty(this, "x", {
|
||||
configurable: true,
|
||||
get: function() {
|
||||
delete this.x;
|
||||
return 2;
|
||||
}
|
||||
});
|
||||
|
||||
(function() {
|
||||
"use strict";
|
||||
assert.throws(ReferenceError, () => {
|
||||
count++;
|
||||
--x;
|
||||
count++;
|
||||
});
|
||||
count++;
|
||||
})();
|
||||
|
||||
assert.sameValue(count, 2);
|
||||
assert(!('x' in this));
|
@ -0,0 +1,40 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object-environment-records-setmutablebinding-n-v-s
|
||||
description: >
|
||||
Operator --x calls PutValue(lhs, newValue) (formerly S11.4.5_A5_T4)
|
||||
info: |
|
||||
The concrete Environment Record method SetMutableBinding for object Environment
|
||||
Records attempts to set the value of the Environment Record's associated binding
|
||||
object's property whose name is the value of the argument N to the value of argument V.
|
||||
A property named N normally already exists but if it does not or is not currently writable,
|
||||
error handling is determined by the value of the Boolean argument S.
|
||||
|
||||
Let stillExists be ? HasProperty(bindings, N).
|
||||
If stillExists is false and S is true, throw a ReferenceError exception.
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
var count = 0;
|
||||
var scope = {
|
||||
get x() {
|
||||
delete this.x;
|
||||
return 2;
|
||||
}
|
||||
};
|
||||
|
||||
with (scope) {
|
||||
(function() {
|
||||
"use strict";
|
||||
assert.throws(ReferenceError, () => {
|
||||
count++;
|
||||
--x;
|
||||
count++;
|
||||
});
|
||||
count++;
|
||||
})();
|
||||
}
|
||||
|
||||
assert.sameValue(count, 2);
|
||||
assert(!('x' in scope));
|
@ -0,0 +1,39 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object-environment-records-setmutablebinding-n-v-s
|
||||
description: >
|
||||
Operator ++x calls PutValue(lhs, newValue) (formerly S11.4.4_A5_T5)
|
||||
info: |
|
||||
The concrete Environment Record method SetMutableBinding for object Environment
|
||||
Records attempts to set the value of the Environment Record's associated binding
|
||||
object's property whose name is the value of the argument N to the value of argument V.
|
||||
A property named N normally already exists but if it does not or is not currently writable,
|
||||
error handling is determined by the value of the Boolean argument S.
|
||||
|
||||
Let stillExists be ? HasProperty(bindings, N).
|
||||
If stillExists is false and S is true, throw a ReferenceError exception.
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
var count = 0;
|
||||
Object.defineProperty(this, "x", {
|
||||
configurable: true,
|
||||
get: function() {
|
||||
delete this.x;
|
||||
return 2;
|
||||
}
|
||||
});
|
||||
|
||||
(function() {
|
||||
"use strict";
|
||||
assert.throws(ReferenceError, () => {
|
||||
count++;
|
||||
++x;
|
||||
count++;
|
||||
});
|
||||
count++;
|
||||
})();
|
||||
|
||||
assert.sameValue(count, 2);
|
||||
assert(!('x' in this));
|
@ -0,0 +1,40 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-object-environment-records-setmutablebinding-n-v-s
|
||||
description: >
|
||||
Operator ++x calls PutValue(lhs, newValue) (formerly S11.4.4_A5_T4)
|
||||
info: |
|
||||
The concrete Environment Record method SetMutableBinding for object Environment
|
||||
Records attempts to set the value of the Environment Record's associated binding
|
||||
object's property whose name is the value of the argument N to the value of argument V.
|
||||
A property named N normally already exists but if it does not or is not currently writable,
|
||||
error handling is determined by the value of the Boolean argument S.
|
||||
|
||||
Let stillExists be ? HasProperty(bindings, N).
|
||||
If stillExists is false and S is true, throw a ReferenceError exception.
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
var count = 0;
|
||||
var scope = {
|
||||
get x() {
|
||||
delete this.x;
|
||||
return 2;
|
||||
}
|
||||
};
|
||||
|
||||
with (scope) {
|
||||
(function() {
|
||||
"use strict";
|
||||
assert.throws(ReferenceError, () => {
|
||||
count++;
|
||||
++x;
|
||||
count++;
|
||||
});
|
||||
count++;
|
||||
})();
|
||||
}
|
||||
|
||||
assert.sameValue(count, 2);
|
||||
assert(!('x' in scope));
|
Loading…
x
Reference in New Issue
Block a user