Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / built-ins / TypedArray / from / this-is-not-constructor.js
blob7838753ba5708ab4d0fe1fdb19c597692f2cf48b
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: >
6   Throws a TypeError exception if this is not a constructor
7 info: |
8   22.2.2.1 %TypedArray%.from ( source [ , mapfn [ , thisArg ] ] )
10   1. Let C be the this value.
11   2. If IsConstructor(C) is false, throw a TypeError exception.
12   ...
13 includes: [testTypedArray.js]
14 features: [TypedArray]
15 ---*/
17 var from = TypedArray.from;
18 var m = { m() {} }.m;
20 assert.throws(TypeError, function() {
21   from.call(m, []);
22 });
24 reportCompare(0, 0);