mirror of
https://github.com/tc39/test262.git
synced 2025-05-29 11:10:32 +02:00
Array#shift throws TypeError if this value's "length" property was defined with [[Writable]]: false. Fixes gh-2773
This commit is contained in:
parent
9fc299915d
commit
f94fc660cc
@ -3,7 +3,7 @@
|
|||||||
/*---
|
/*---
|
||||||
esid: sec-array.prototype.shift
|
esid: sec-array.prototype.shift
|
||||||
description: >
|
description: >
|
||||||
Array#shift throws TypeError upon attempting to modify a string
|
Array#shift throws TypeError if this value's "length" property was defined with [[Writable]]: false.
|
||||||
info: |
|
info: |
|
||||||
Array.prototype.shift ( )
|
Array.prototype.shift ( )
|
||||||
...
|
...
|
||||||
@ -25,3 +25,11 @@ assert.throws(TypeError, () => {
|
|||||||
assert.throws(TypeError, () => {
|
assert.throws(TypeError, () => {
|
||||||
Array.prototype.shift.call('abc');
|
Array.prototype.shift.call('abc');
|
||||||
}, "Array.prototype.shift.call('abc')");
|
}, "Array.prototype.shift.call('abc')");
|
||||||
|
|
||||||
|
assert.throws(TypeError, () => {
|
||||||
|
Array.prototype.shift.call(function() {});
|
||||||
|
}, "Array.prototype.shift.call(function() {})");
|
||||||
|
|
||||||
|
assert.throws(TypeError, () => {
|
||||||
|
Array.prototype.shift.call(Object.defineProperty({}, 'length', {writable: false}));
|
||||||
|
}, "Array.prototype.shift.call(Object.defineProperty({}, 'length', {writable: false}))");
|
Loading…
x
Reference in New Issue
Block a user