diff options
Diffstat (limited to 'test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-13.js')
-rw-r--r-- | test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-13.js | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-13.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-13.js new file mode 100644 index 000000000..ecd26ca20 --- /dev/null +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-13.js @@ -0,0 +1,38 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// Ecma International makes this code available under the terms and conditions set +// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the +// "Use Terms"). Any redistribution of this code must retain the above +// copyright and this notice and otherwise comply with the Use Terms. + +/*--- +es5id: 15.4.4.14-9-b-i-13 +description: > + Array.prototype.indexOf - element to be retrieved is own accessor + property that overrides an inherited accessor property on an Array +includes: [runTestCase.js] +---*/ + +function testcase() { + + var arr = []; + try { + Object.defineProperty(Array.prototype, "0", { + get: function () { + return false; + }, + configurable: true + }); + + Object.defineProperty(arr, "0", { + get: function () { + return true; + }, + configurable: true + }); + + return 0 === arr.indexOf(true); + } finally { + delete Array.prototype[0]; + } + } +runTestCase(testcase); |