Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / built-ins / TypedArray / from / arylk-to-length-error.js
blobe4ab814d5fb000d961806fbcc95d2585bee671f9
1 // Copyright (C) 2016 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-%typedarray%.from
5 description: Returns error produced by interpreting length property as a length
6 info: |
7   22.2.2.1 %TypedArray%.from ( source [ , mapfn [ , thisArg ] ] )
9   ...
10   7. Let len be ? ToLength(? Get(arrayLike, "length")).
11   ...
12 includes: [testTypedArray.js]
13 features: [TypedArray]
14 ---*/
16 var arrayLike = { length: {} };
18 arrayLike.length = {
19   valueOf: function() {
20     throw new Test262Error();
21   }
24 assert.throws(Test262Error, function() {
25   TypedArray.from(arrayLike);
26 });
28 reportCompare(0, 0);