Debian Codegraph @

js/src/tests/test262/built-ins/Array/length/S15.4.5.1_A1.2_T3.js

raw
1 // Copyright 2009 the Sputnik authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 esid: sec-array-exotic-objects-defineownproperty-p-desc
6 info: |
7 For every integer k that is less than the value of
8 the length property of A but not less than ToUint32(length),
9 if A itself has a property (not an inherited property) named ToString(k),
10 then delete that property
11 es5id: 15.4.5.1_A1.2_T3
12 description: Checking an inherited property
13 ---*/
14
15 Array.prototype[2] = 2;
16 var x = [0, 1];
17 x.length = 3;
18 assert.sameValue(x.hasOwnProperty('2'), false, 'x.hasOwnProperty("2") must return false');
19
20 x.length = 2;
21 assert.sameValue(x[2], 2, 'The value of x[2] is expected to be 2');
22
23 reportCompare(0, 0);