You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[1.10>master] [MERGE #5530 @irinayat-MS] 'length' property of arrays should have same delete semantics as own non-indexed non-configurable props
Merge pull request #5530 from irinayat-MS:DeleteArrayLength
Fixes OS#16382392
The assert has caught non-conforming behaviour of delete on 'length' property of Arrays. In strict mode delete should throw because 'length' is own and non-configurable.
assert.areEqual(false,res,"delete of non-configurable property should fail");
32
34
assert.areEqual(17,ta[id],"ta['id'] value after failed delete");
33
35
34
-
assert.throws(function(){'use strict';deleteta[id];},TypeError,"Should throw on delete of indexed property in typed array","Calling delete on 'id' is not allowed in strict mode");
36
+
assert.throws(function(){'use strict';deleteta[id];},TypeError,"Should throw on delete of non-indexed property in typed array","Calling delete on 'id' is not allowed in strict mode");
35
37
}
36
38
},
37
39
{
38
40
name: "Typed arrays don't support delete of indexed properties",
39
41
body: function(){
40
42
constta=Int8Array.of(42);
41
43
42
-
deleteta[0];
44
+
varres=deleteta[0];
45
+
assert.areEqual(false,res,"delete of ta[0] should fail");
43
46
assert.areEqual(42,ta[0],"ta[0] value after failed delete");
44
47
45
48
assert.throws(function(){'use strict';deleteta[0];},TypeError,"Should throw on delete of indexed property in typed array","Calling delete on '0' is not allowed in strict mode");
46
49
}
47
-
}
50
+
},
51
+
{
52
+
name: "Typed arrays ignore delete of the inherited 'length' property",
53
+
body: function(){
54
+
constta=Int8Array.of(42);
55
+
56
+
varres=deleteta.length;
57
+
assert.areEqual(true,res,"delete of ta.length should succeed (as noop)");
58
+
assert.areEqual(1,ta.length,"ta.length after attempting to delete it");
0 commit comments