Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / built-ins / TypedArray / prototype / join / return-abrupt-from-separator.js
bloba530a4714b8aefd2137ea1b22b770b4033d2308c
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%.prototype.join
5 description: Return abrupt from ToString(separator)
6 info: |
7   22.2.3.15 %TypedArray%.prototype.join ( separator )
9   %TypedArray%.prototype.join is a distinct function that implements the same
10   algorithm as Array.prototype.join as defined in 22.1.3.13 except that the this
11   object's [[ArrayLength]] internal slot is accessed in place of performing a
12   [[Get]] of "length".
14   22.1.3.13 Array.prototype.join (separator)
16   ...
17   4. Let sep be ? ToString(separator).
18   5. If len is zero, return the empty String.
19   ...
20 includes: [testTypedArray.js]
21 features: [TypedArray]
22 ---*/
24 var obj = {
25   toString: function() {
26     throw new Test262Error();
27   }
30 testWithTypedArrayConstructors(function(TA) {
31   var sample = new TA();
33   assert.throws(Test262Error, function() {
34     sample.join(obj);
35   });
36 });
38 reportCompare(0, 0);