Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / built-ins / TypedArray / from / iter-invoke-error.js
blobde395eb2dc761f3324a073d316f29f4cd3c51eca
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 invoking @@iterator
6 info: |
7   22.2.2.1 %TypedArray%.from ( source [ , mapfn [ , thisArg ] ] )
9   ...
10   6. Let arrayLike be ? IterableToArrayLike(source).
11   ...
13   22.2.2.1.1 Runtime Semantics: IterableToArrayLike( items )
15   1. Let usingIterator be ? GetMethod(items, @@iterator).
16   2. If usingIterator is not undefined, then
17     a. Let iterator be ? GetIterator(items, usingIterator).
18   ...
19 includes: [testTypedArray.js]
20 features: [Symbol.iterator, TypedArray]
21 ---*/
23 var iter = {};
24 iter[Symbol.iterator] = function() {
25   throw new Test262Error();
28 assert.throws(Test262Error, function() {
29   TypedArray.from(iter);
30 });
32 reportCompare(0, 0);