Backed out 3 changesets (bug 1892041) for causing failures on async-module-does-not...
[gecko.git] / js / src / tests / test262 / built-ins / Array / prototype / findIndex / return-abrupt-from-property.js
blob641f324b1349b547c93431b83e5d812a1ee5604f
1 // Copyright (C) 2015 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3 /*---
4 esid: sec-array.prototype.findindex
5 description: >
6   Returns abrupt from getting property value from `this`.
7 info: |
8   22.1.3.9 Array.prototype.findIndex ( predicate[ , thisArg ] )
10   ...
11   7. Let k be 0.
12   8. Repeat, while k < len
13     a. Let Pk be ToString(k).
14     b. Let kValue be Get(O, Pk).
15     c. ReturnIfAbrupt(kValue).
16   ...
17 ---*/
19 var o = {
20   length: 1
23 Object.defineProperty(o, 0, {
24   get: function() {
25     throw new Test262Error();
26   }
27 });
29 assert.throws(Test262Error, function() {
30   [].findIndex.call(o, function() {});
31 });
33 reportCompare(0, 0);