mirror of https://github.com/tc39/test262.git
Merge pull request #469 from bocoup/improve-typed-arrays-coverage
Basic coverage for the %TypedArray% object
This commit is contained in:
commit
afd3c5783e
|
@ -0,0 +1,19 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.2.4
|
||||
description: >
|
||||
@@species property of TypedArray
|
||||
info: >
|
||||
22.2.2.4 get %TypedArray% [ @@species ]
|
||||
|
||||
%TypedArray%[@@species] is an accessor property whose set accessor function
|
||||
is undefined.
|
||||
features: [Symbol.species]
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var desc = Object.getOwnPropertyDescriptor(TypedArray, Symbol.species);
|
||||
|
||||
assert.sameValue(desc.set, undefined);
|
||||
assert.sameValue(typeof desc.get, 'function');
|
|
@ -0,0 +1,18 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.2.4
|
||||
description: >
|
||||
@@species property returns the `this` value
|
||||
info: >
|
||||
22.2.2.4 get %TypedArray% [ @@species ]
|
||||
|
||||
1. Return the this value.
|
||||
features: [Symbol.species]
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var value = {};
|
||||
var getter = Object.getOwnPropertyDescriptor(TypedArray, Symbol.species).get;
|
||||
|
||||
assert.sameValue(getter.call(value), value);
|
|
@ -0,0 +1,26 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.2.1.1
|
||||
description: Returns error produced by accessing array-like's length
|
||||
info: >
|
||||
22.2.2.1.1 Runtime Semantics: TypedArrayFrom( constructor, items, mapfn, thisArg )
|
||||
|
||||
...
|
||||
12. Let len be ToLength(Get(arrayLike, "length")).
|
||||
13. ReturnIfAbrupt(len).
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var arrayLike = {};
|
||||
|
||||
Object.defineProperty(arrayLike, 'length', {
|
||||
get: function() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
});
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
TypedArray.from(arrayLike);
|
||||
});
|
|
@ -0,0 +1,25 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.2.1.1
|
||||
description: Returns error produced by interpreting length property as a length
|
||||
info: >
|
||||
22.2.2.1.1 Runtime Semantics: TypedArrayFrom( constructor, items, mapfn, thisArg )
|
||||
|
||||
...
|
||||
12. Let len be ToLength(Get(arrayLike, "length")).
|
||||
13. ReturnIfAbrupt(len).
|
||||
...
|
||||
features: [Symbol.toPrimitive]
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var arrayLike = { length: {} };
|
||||
|
||||
arrayLike.length[Symbol.toPrimitive] = function() {
|
||||
throw new Test262Error();
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
TypedArray.from(arrayLike);
|
||||
});
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.2.1
|
||||
description: >
|
||||
"from" cannot be invoked as a function
|
||||
info: >
|
||||
22.2.2.1 %TypedArray%.from ( source [ , mapfn [ , thisArg ] ] )
|
||||
|
||||
1. Let C be the this value.
|
||||
2. If IsConstructor(C) is false, throw a TypeError exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var from = TypedArray.from;
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
from([]);
|
||||
});
|
|
@ -0,0 +1,33 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.2.1
|
||||
description: >
|
||||
"from" cannot be invoked as a method of %TypedArray%
|
||||
info: >
|
||||
22.2.2.1 %TypedArray%.from ( source [ , mapfn [ , thisArg ] ] )
|
||||
|
||||
...
|
||||
6. Return TypedArrayFrom(C, source, f, t).
|
||||
|
||||
22.2.2.1.1 Runtime Semantics: TypedArrayFrom( constructor, items, mapfn,
|
||||
thisArg )
|
||||
|
||||
...
|
||||
8. If usingIterator is not undefined, then
|
||||
...
|
||||
g. Let targetObj be AllocateTypedArray(C, len).
|
||||
h. ReturnIfAbrupt(targetObj).
|
||||
...
|
||||
|
||||
22.2.1.2.1 Runtime Semantics: AllocateTypedArray (newTarget, length )
|
||||
|
||||
...
|
||||
2. If SameValue(%TypedArray%, newTarget) is true, throw a TypeError exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
TypedArray.from([]);
|
||||
});
|
|
@ -0,0 +1,27 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.2.1.1
|
||||
description: Returns error produced by accessing @@iterator
|
||||
info: >
|
||||
22.2.2.1.1 Runtime Semantics: TypedArrayFrom( constructor, items, mapfn,
|
||||
thisArg )
|
||||
|
||||
...
|
||||
6. Let usingIterator be GetMethod(items, @@iterator).
|
||||
7. ReturnIfAbrupt(usingIterator).
|
||||
...
|
||||
features: [Symbol.iterator]
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var iter = {};
|
||||
Object.defineProperty(iter, Symbol.iterator, {
|
||||
get: function() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
});
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
TypedArray.from(iter);
|
||||
});
|
|
@ -0,0 +1,26 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.2.1.1
|
||||
description: Returns error produced by invoking @@iterator
|
||||
info: >
|
||||
22.2.2.1.1 Runtime Semantics: TypedArrayFrom( constructor, items, mapfn,
|
||||
thisArg )
|
||||
|
||||
...
|
||||
8. If usingIterator is not undefined, then
|
||||
a. Let iterator be GetIterator(items, usingIterator).
|
||||
b. ReturnIfAbrupt(iterator).
|
||||
...
|
||||
features: [Symbol.iterator]
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var iter = {};
|
||||
iter[Symbol.iterator] = function() {
|
||||
throw new Test262Error();
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
TypedArray.from(iter);
|
||||
});
|
|
@ -0,0 +1,32 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.2.1.1
|
||||
description: Returns error produced by advancing the iterator
|
||||
info: >
|
||||
22.2.2.1.1 Runtime Semantics: TypedArrayFrom( constructor, items, mapfn,
|
||||
thisArg )
|
||||
|
||||
...
|
||||
8. If usingIterator is not undefined, then
|
||||
...
|
||||
e. Repeat, while next is not false
|
||||
i. Let next be IteratorStep(iterator).
|
||||
ii. ReturnIfAbrupt(next).
|
||||
...
|
||||
features: [Symbol.iterator]
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var iter = {};
|
||||
iter[Symbol.iterator] = function() {
|
||||
return {
|
||||
next: function() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
TypedArray.from(iter);
|
||||
});
|
|
@ -0,0 +1,38 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.2.1.1
|
||||
description: Returns error produced by accessing iterated value
|
||||
info: >
|
||||
22.2.2.1.1 Runtime Semantics: TypedArrayFrom( constructor, items, mapfn,
|
||||
thisArg )
|
||||
|
||||
...
|
||||
8. If usingIterator is not undefined, then
|
||||
...
|
||||
e. If next is not false, then
|
||||
i. Let nextValue be IteratorValue(next).
|
||||
ii. ReturnIfAbrupt(nextValue).
|
||||
features: [Symbol.iterator]
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var iter = {};
|
||||
iter[Symbol.iterator] = function() {
|
||||
return {
|
||||
next: function() {
|
||||
var result = {};
|
||||
Object.defineProperty(result, 'value', {
|
||||
get: function() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
TypedArray.from(iter);
|
||||
});
|
|
@ -0,0 +1,16 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.2.1
|
||||
description: >
|
||||
"from" property of TypedArray
|
||||
info: >
|
||||
ES6 section 17: Every other data property described in clauses 18 through 26
|
||||
and in Annex B.2 has the attributes { [[Writable]]: true,
|
||||
[[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js, testTypedArray.js]
|
||||
---*/
|
||||
|
||||
verifyNotEnumerable(TypedArray, 'from');
|
||||
verifyWritable(TypedArray, 'from');
|
||||
verifyConfigurable(TypedArray, 'from');
|
|
@ -0,0 +1,30 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es7id: pending
|
||||
description: TypedArray(length) cannot be direclty invoked as a constructor
|
||||
info: >
|
||||
22.2.1.1 %TypedArray%()#
|
||||
|
||||
1. If NewTarget is undefined, throw a TypeError exception.
|
||||
2. Let here be the active function object.
|
||||
3. If SameValue(NewTarget, here) is true, throw a TypeError exception.
|
||||
...
|
||||
|
||||
Note: there's a breaking change from ES2015's 22.2.1.2 step 7 where calling
|
||||
the %TypedArray% constructor with a floating number as the argument throws a
|
||||
RangeError exception before checking `SameValue(NewTarget, here)`.
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
new TypedArray(1);
|
||||
});
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
new TypedArray({});
|
||||
});
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
new TypedArray(1.1);
|
||||
});
|
|
@ -0,0 +1,17 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.1.2.1
|
||||
description: TypedArray cannot be invoked as a constructor
|
||||
info: >
|
||||
22.2.1.2.1 Runtime Semantics: AllocateTypedArray (newTarget, length )
|
||||
|
||||
...
|
||||
2. If SameValue(%TypedArray%, newTarget) is true, throw a TypeError exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
new TypedArray();
|
||||
});
|
|
@ -0,0 +1,16 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.1.1
|
||||
description: If NewTarget is undefined, throw a TypeError exception.
|
||||
info: >
|
||||
22.2.1.1 %TypedArray% ( )
|
||||
|
||||
1. If NewTarget is undefined, throw a TypeError exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
TypedArray();
|
||||
});
|
|
@ -0,0 +1,24 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.2
|
||||
description: >
|
||||
TypedArray has a "length" property whose value is 3.
|
||||
info: >
|
||||
22.2.2 Properties of the %TypedArray% Intrinsic Object
|
||||
|
||||
Besides a length property whose value is 3 and a name property whose value is
|
||||
"TypedArray", %TypedArray% has the following properties:
|
||||
...
|
||||
|
||||
ES6 section 17: Unless otherwise specified, the length property of a built-in
|
||||
Function object has the attributes { [[Writable]]: false, [[Enumerable]]:
|
||||
false, [[Configurable]]: true }.
|
||||
includes: [propertyHelper.js, testTypedArray.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(TypedArray.length, 3);
|
||||
|
||||
verifyNotEnumerable(TypedArray, 'length');
|
||||
verifyNotWritable(TypedArray, 'length');
|
||||
verifyConfigurable(TypedArray, 'length');
|
|
@ -0,0 +1,24 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.2
|
||||
description: >
|
||||
TypedArray has a 'name' property whose value is "TypedArray".
|
||||
info: >
|
||||
22.2.2 Properties of the %TypedArray% Intrinsic Object
|
||||
|
||||
Besides a length property whose value is 3 and a name property whose value is
|
||||
"TypedArray", %TypedArray% has the following properties:
|
||||
...
|
||||
|
||||
ES6 section 17: Unless otherwise specified, the name property of a built-in
|
||||
Function object, if it exists, has the attributes { [[Writable]]: false,
|
||||
[[Enumerable]]: false, [[Configurable]]: true }.
|
||||
includes: [propertyHelper.js, testTypedArray.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(TypedArray.name, 'TypedArray');
|
||||
|
||||
verifyNotEnumerable(TypedArray, 'name');
|
||||
verifyNotWritable(TypedArray, 'name');
|
||||
verifyConfigurable(TypedArray, 'name');
|
|
@ -0,0 +1,21 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.2.2
|
||||
description: >
|
||||
"of" cannot be invoked as a function
|
||||
info: >
|
||||
22.2.2.2 %TypedArray%.of ( ...items )
|
||||
|
||||
...
|
||||
3. Let C be the this value.
|
||||
4. If IsConstructor(C) is false, throw a TypeError exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var of = TypedArray.of;
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
of();
|
||||
});
|
|
@ -0,0 +1,25 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.2.2
|
||||
description: >
|
||||
"of" cannot be invoked as a method of %TypedArray%
|
||||
info: >
|
||||
22.2.2.2 %TypedArray%.of ( ...items )
|
||||
|
||||
...
|
||||
5. Let newObj be AllocateTypedArray(C, len).
|
||||
6. ReturnIfAbrupt(newObj).
|
||||
...
|
||||
|
||||
22.2.1.2.1 Runtime Semantics: AllocateTypedArray (newTarget, length )
|
||||
|
||||
...
|
||||
2. If SameValue(%TypedArray%, newTarget) is true, throw a TypeError exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
TypedArray.of();
|
||||
});
|
|
@ -0,0 +1,16 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.2.2
|
||||
description: >
|
||||
"of" property of TypedArray
|
||||
info: >
|
||||
ES6 section 17: Every other data property described in clauses 18 through 26
|
||||
and in Annex B.2 has the attributes { [[Writable]]: true,
|
||||
[[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js, testTypedArray.js]
|
||||
---*/
|
||||
|
||||
verifyNotEnumerable(TypedArray, 'of');
|
||||
verifyWritable(TypedArray, 'of');
|
||||
verifyConfigurable(TypedArray, 'of');
|
|
@ -0,0 +1,17 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.2.3
|
||||
description: >
|
||||
"prototype" property of TypedArray
|
||||
info: >
|
||||
22.2.2.3 %TypedArray%.prototype
|
||||
|
||||
This property has the attributes { [[Writable]]: false, [[Enumerable]]:
|
||||
false, [[Configurable]]: false }.
|
||||
includes: [propertyHelper.js, testTypedArray.js]
|
||||
---*/
|
||||
|
||||
verifyNotEnumerable(TypedArray, 'prototype');
|
||||
verifyNotWritable(TypedArray, 'prototype');
|
||||
verifyNotConfigurable(TypedArray, 'prototype');
|
20
test/built-ins/TypedArray/prototype/Symbol.toStringTag/invoked-as-accessor.js
vendored
Normal file
20
test/built-ins/TypedArray/prototype/Symbol.toStringTag/invoked-as-accessor.js
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.31
|
||||
description: >
|
||||
Return undefined if this value does not have a [[TypedArrayName]] internal slot
|
||||
info: >
|
||||
22.2.3.31 get %TypedArray%.prototype [ @@toStringTag ]
|
||||
|
||||
1. Let O be the this value.
|
||||
...
|
||||
3. If O does not have a [[TypedArrayName]] internal slot, return undefined.
|
||||
...
|
||||
features: [Symbol.toStringTag]
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
assert.sameValue(TypedArrayPrototype[Symbol.toStringTag], undefined);
|
|
@ -0,0 +1,21 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.31
|
||||
description: If this value is not Object, return undefined.
|
||||
info: >
|
||||
22.2.3.31 get %TypedArray%.prototype [ @@toStringTag ]
|
||||
|
||||
1. Let O be the this value.
|
||||
2. If Type(O) is not Object, return undefined.
|
||||
...
|
||||
features: [Symbol.toStringTag]
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
var getter = Object.getOwnPropertyDescriptor(
|
||||
TypedArrayPrototype, Symbol.toStringTag
|
||||
).get;
|
||||
|
||||
assert.sameValue(getter(), undefined);
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.31
|
||||
description: >
|
||||
"@@toStringTag" property of TypedArrayPrototype
|
||||
info: >
|
||||
22.2.3.31 get %TypedArray%.prototype [ @@toStringTag ]
|
||||
|
||||
%TypedArray%.prototype[@@toStringTag] is an accessor property whose set
|
||||
accessor function is undefined.
|
||||
...
|
||||
|
||||
This property has the attributes { [[Enumerable]]: false, [[Configurable]]:
|
||||
true }.
|
||||
includes: [propertyHelper.js, testTypedArray.js]
|
||||
features: [Symbol.toStringTag]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
var desc = Object.getOwnPropertyDescriptor(
|
||||
TypedArrayPrototype, Symbol.toStringTag
|
||||
);
|
||||
|
||||
assert.sameValue(desc.set, undefined);
|
||||
assert.sameValue(typeof desc.get, 'function');
|
||||
verifyNotEnumerable(TypedArrayPrototype, Symbol.toStringTag);
|
||||
verifyConfigurable(TypedArrayPrototype, Symbol.toStringTag);
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.1
|
||||
description: >
|
||||
Requires this value to have a [[ViewedArrayBuffer]] internal slot
|
||||
info: >
|
||||
22.2.3.1 get %TypedArray%.prototype.buffer
|
||||
|
||||
1. Let O be the this value.
|
||||
2. If Type(O) is not Object, throw a TypeError exception.
|
||||
3. If O does not have a [[ViewedArrayBuffer]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
TypedArrayPrototype.buffer;
|
||||
});
|
|
@ -0,0 +1,24 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.1
|
||||
description: Throws a TypeError exception when invoked as a function
|
||||
info: >
|
||||
22.2.3.1 get %TypedArray%.prototype.buffer
|
||||
|
||||
1. Let O be the this value.
|
||||
2. If Type(O) is not Object, throw a TypeError exception.
|
||||
3. If O does not have a [[ViewedArrayBuffer]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
var getter = Object.getOwnPropertyDescriptor(
|
||||
TypedArrayPrototype, 'buffer'
|
||||
).get;
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
getter();
|
||||
});
|
|
@ -0,0 +1,17 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.1
|
||||
description: >
|
||||
"buffer" property of TypedArrayPrototype
|
||||
info: >
|
||||
%TypedArray%.prototype.buffer is an accessor property whose set accessor
|
||||
function is undefined.
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
var desc = Object.getOwnPropertyDescriptor(TypedArrayPrototype, 'buffer');
|
||||
|
||||
assert.sameValue(desc.set, undefined);
|
||||
assert.sameValue(typeof desc.get, 'function');
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.2
|
||||
description: >
|
||||
Requires this value to have a [[ViewedArrayBuffer]] internal slot
|
||||
info: >
|
||||
22.2.3.2 get %TypedArray%.prototype.byteLength
|
||||
|
||||
1. Let O be the this value.
|
||||
2. If Type(O) is not Object, throw a TypeError exception.
|
||||
3. If O does not have a [[ViewedArrayBuffer]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
TypedArrayPrototype.byteLength;
|
||||
});
|
|
@ -0,0 +1,24 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.2
|
||||
description: Throws a TypeError exception when invoked as a function
|
||||
info: >
|
||||
22.2.3.2 get %TypedArray%.prototype.byteLength
|
||||
|
||||
1. Let O be the this value.
|
||||
2. If Type(O) is not Object, throw a TypeError exception.
|
||||
3. If O does not have a [[ViewedArrayBuffer]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
var getter = Object.getOwnPropertyDescriptor(
|
||||
TypedArrayPrototype, 'byteLength'
|
||||
).get;
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
getter();
|
||||
});
|
|
@ -0,0 +1,17 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.2
|
||||
description: >
|
||||
"byteLength" property of TypedArrayPrototype
|
||||
info: >
|
||||
%TypedArray%.prototype.byteLength is an accessor property whose set accessor
|
||||
function is undefined.
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
var desc = Object.getOwnPropertyDescriptor(TypedArrayPrototype, 'byteLength');
|
||||
|
||||
assert.sameValue(desc.set, undefined);
|
||||
assert.sameValue(typeof desc.get, 'function');
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.3
|
||||
description: >
|
||||
Requires this value to have a [[ViewedArrayBuffer]] internal slot
|
||||
info: >
|
||||
22.2.3.3 get %TypedArray%.prototype.byteOffset
|
||||
|
||||
1. Let O be the this value.
|
||||
2. If Type(O) is not Object, throw a TypeError exception.
|
||||
3. If O does not have a [[ViewedArrayBuffer]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
TypedArrayPrototype.byteOffset;
|
||||
});
|
|
@ -0,0 +1,24 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.3
|
||||
description: Throws a TypeError exception when invoked as a function
|
||||
info: >
|
||||
22.2.3.3 get %TypedArray%.prototype.byteOffset
|
||||
|
||||
1. Let O be the this value.
|
||||
2. If Type(O) is not Object, throw a TypeError exception.
|
||||
3. If O does not have a [[ViewedArrayBuffer]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
var getter = Object.getOwnPropertyDescriptor(
|
||||
TypedArrayPrototype, 'byteOffset'
|
||||
).get;
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
getter();
|
||||
});
|
|
@ -0,0 +1,17 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.3
|
||||
description: >
|
||||
"byteOffset" property of TypedArrayPrototype
|
||||
info: >
|
||||
%TypedArray%.prototype.byteOffset is an accessor property whose set accessor
|
||||
function is undefined.
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
var desc = Object.getOwnPropertyDescriptor(TypedArrayPrototype, 'byteOffset');
|
||||
|
||||
assert.sameValue(desc.set, undefined);
|
||||
assert.sameValue(typeof desc.get, 'function');
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.5
|
||||
description: Throws a TypeError exception when invoked as a function
|
||||
info: >
|
||||
22.2.3.5 %TypedArray%.prototype.copyWithin (target, start [, end ] )
|
||||
|
||||
This function is not generic. ValidateTypedArray is applied to the this value
|
||||
prior to evaluating the algorithm. If its result is an abrupt completion that
|
||||
exception is thrown instead of evaluating the algorithm.
|
||||
|
||||
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
|
||||
|
||||
1. If Type(O) is not Object, throw a TypeError exception.
|
||||
2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var copyWithin = TypedArray.prototype.copyWithin;
|
||||
|
||||
assert.sameValue(typeof copyWithin, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
copyWithin();
|
||||
});
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.5
|
||||
description: Requires a [[TypedArrayName]] internal slot.
|
||||
info: >
|
||||
22.2.3.5 %TypedArray%.prototype.copyWithin (target, start [, end ] )
|
||||
|
||||
This function is not generic. ValidateTypedArray is applied to the this value
|
||||
prior to evaluating the algorithm. If its result is an abrupt completion that
|
||||
exception is thrown instead of evaluating the algorithm.
|
||||
|
||||
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
|
||||
|
||||
1. If Type(O) is not Object, throw a TypeError exception.
|
||||
2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
assert.sameValue(typeof TypedArrayPrototype.copyWithin, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
TypedArrayPrototype.copyWithin();
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.5
|
||||
description: >
|
||||
"copyWithin" property of TypedArrayPrototype
|
||||
info: >
|
||||
ES6 section 17: Every other data property described in clauses 18 through 26
|
||||
and in Annex B.2 has the attributes { [[Writable]]: true,
|
||||
[[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js, testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
verifyNotEnumerable(TypedArrayPrototype, 'copyWithin');
|
||||
verifyWritable(TypedArrayPrototype, 'copyWithin');
|
||||
verifyConfigurable(TypedArrayPrototype, 'copyWithin');
|
|
@ -0,0 +1,31 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.6
|
||||
description: Throws a TypeError exception when invoked as a function
|
||||
info: >
|
||||
22.2.3.6 %TypedArray%.prototype.entries ( )
|
||||
|
||||
The following steps are taken:
|
||||
|
||||
1. Let O be the this value.
|
||||
2. Let valid be ValidateTypedArray(O).
|
||||
3. ReturnIfAbrupt(valid).
|
||||
...
|
||||
|
||||
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
|
||||
|
||||
1. If Type(O) is not Object, throw a TypeError exception.
|
||||
2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var entries = TypedArray.prototype.entries;
|
||||
|
||||
assert.sameValue(typeof entries, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
entries();
|
||||
});
|
|
@ -0,0 +1,31 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.6
|
||||
description: Requires a [[TypedArrayName]] internal slot.
|
||||
info: >
|
||||
22.2.3.6 %TypedArray%.prototype.entries ( )
|
||||
|
||||
The following steps are taken:
|
||||
|
||||
1. Let O be the this value.
|
||||
2. Let valid be ValidateTypedArray(O).
|
||||
3. ReturnIfAbrupt(valid).
|
||||
...
|
||||
|
||||
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
|
||||
|
||||
1. If Type(O) is not Object, throw a TypeError exception.
|
||||
2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
assert.sameValue(typeof TypedArrayPrototype.entries, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
TypedArrayPrototype.entries();
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.6
|
||||
description: >
|
||||
"entries" property of TypedArrayPrototype
|
||||
info: >
|
||||
ES6 section 17: Every other data property described in clauses 18 through 26
|
||||
and in Annex B.2 has the attributes { [[Writable]]: true,
|
||||
[[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js, testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
verifyNotEnumerable(TypedArrayPrototype, 'entries');
|
||||
verifyWritable(TypedArrayPrototype, 'entries');
|
||||
verifyConfigurable(TypedArrayPrototype, 'entries');
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.7
|
||||
description: Throws a TypeError exception when invoked as a function
|
||||
info: >
|
||||
22.2.3.7 %TypedArray%.prototype.every ( callbackfn [ , thisArg ] )
|
||||
|
||||
This function is not generic. ValidateTypedArray is applied to the this value
|
||||
prior to evaluating the algorithm. If its result is an abrupt completion that
|
||||
exception is thrown instead of evaluating the algorithm.
|
||||
|
||||
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
|
||||
|
||||
1. If Type(O) is not Object, throw a TypeError exception.
|
||||
2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var every = TypedArray.prototype.every;
|
||||
|
||||
assert.sameValue(typeof every, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
every();
|
||||
});
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.7
|
||||
description: Requires a [[TypedArrayName]] internal slot.
|
||||
info: >
|
||||
22.2.3.7 %TypedArray%.prototype.every ( callbackfn [ , thisArg ] )
|
||||
|
||||
This function is not generic. ValidateTypedArray is applied to the this value
|
||||
prior to evaluating the algorithm. If its result is an abrupt completion that
|
||||
exception is thrown instead of evaluating the algorithm.
|
||||
|
||||
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
|
||||
|
||||
1. If Type(O) is not Object, throw a TypeError exception.
|
||||
2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
assert.sameValue(typeof TypedArrayPrototype.every, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
TypedArrayPrototype.every();
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.7
|
||||
description: >
|
||||
"every" property of TypedArrayPrototype
|
||||
info: >
|
||||
ES6 section 17: Every other data property described in clauses 18 through 26
|
||||
and in Annex B.2 has the attributes { [[Writable]]: true,
|
||||
[[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js, testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
verifyNotEnumerable(TypedArrayPrototype, 'every');
|
||||
verifyWritable(TypedArrayPrototype, 'every');
|
||||
verifyConfigurable(TypedArrayPrototype, 'every');
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.8
|
||||
description: Throws a TypeError exception when invoked as a function
|
||||
info: >
|
||||
22.2.3.8 %TypedArray%.prototype.fill (value [ , start [ , end ] ] )
|
||||
|
||||
This function is not generic. ValidateTypedArray is applied to the this value
|
||||
prior to evaluating the algorithm. If its result is an abrupt completion that
|
||||
exception is thrown instead of evaluating the algorithm.
|
||||
|
||||
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
|
||||
|
||||
1. If Type(O) is not Object, throw a TypeError exception.
|
||||
2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var fill = TypedArray.prototype.fill;
|
||||
|
||||
assert.sameValue(typeof fill, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
fill();
|
||||
});
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.8
|
||||
description: Requires a [[TypedArrayName]] internal slot.
|
||||
info: >
|
||||
22.2.3.8 %TypedArray%.prototype.fill (value [ , start [ , end ] ] )
|
||||
|
||||
This function is not generic. ValidateTypedArray is applied to the this value
|
||||
prior to evaluating the algorithm. If its result is an abrupt completion that
|
||||
exception is thrown instead of evaluating the algorithm.
|
||||
|
||||
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
|
||||
|
||||
1. If Type(O) is not Object, throw a TypeError exception.
|
||||
2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
assert.sameValue(typeof TypedArrayPrototype.fill, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
TypedArrayPrototype.fill();
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.8
|
||||
description: >
|
||||
"fill" property of TypedArrayPrototype
|
||||
info: >
|
||||
ES6 section 17: Every other data property described in clauses 18 through 26
|
||||
and in Annex B.2 has the attributes { [[Writable]]: true,
|
||||
[[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js, testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
verifyNotEnumerable(TypedArrayPrototype, 'fill');
|
||||
verifyWritable(TypedArrayPrototype, 'fill');
|
||||
verifyConfigurable(TypedArrayPrototype, 'fill');
|
|
@ -0,0 +1,29 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.9
|
||||
description: Throws a TypeError exception when invoked as a function
|
||||
info: >
|
||||
22.2.3.9 %TypedArray%.prototype.filter ( callbackfn [ , thisArg ] )
|
||||
|
||||
1. Let O be the this value.
|
||||
2. Let valid be ValidateTypedArray(O).
|
||||
3. ReturnIfAbrupt(valid).
|
||||
...
|
||||
|
||||
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
|
||||
|
||||
1. If Type(O) is not Object, throw a TypeError exception.
|
||||
2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var filter = TypedArray.prototype.filter;
|
||||
|
||||
assert.sameValue(typeof filter, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
filter();
|
||||
});
|
|
@ -0,0 +1,29 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.9
|
||||
description: Requires a [[TypedArrayName]] internal slot.
|
||||
info: >
|
||||
22.2.3.9 %TypedArray%.prototype.filter ( callbackfn [ , thisArg ] )
|
||||
|
||||
1. Let O be the this value.
|
||||
2. Let valid be ValidateTypedArray(O).
|
||||
3. ReturnIfAbrupt(valid).
|
||||
...
|
||||
|
||||
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
|
||||
|
||||
1. If Type(O) is not Object, throw a TypeError exception.
|
||||
2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
assert.sameValue(typeof TypedArrayPrototype.filter, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
TypedArrayPrototype.filter();
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.9
|
||||
description: >
|
||||
"filter" property of TypedArrayPrototype
|
||||
info: >
|
||||
ES6 section 17: Every other data property described in clauses 18 through 26
|
||||
and in Annex B.2 has the attributes { [[Writable]]: true,
|
||||
[[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js, testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
verifyNotEnumerable(TypedArrayPrototype, 'filter');
|
||||
verifyWritable(TypedArrayPrototype, 'filter');
|
||||
verifyConfigurable(TypedArrayPrototype, 'filter');
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.10
|
||||
description: Throws a TypeError exception when invoked as a function
|
||||
info: >
|
||||
22.2.3.10 %TypedArray%.prototype.find (predicate [ , thisArg ] )
|
||||
|
||||
This function is not generic. ValidateTypedArray is applied to the this value
|
||||
prior to evaluating the algorithm. If its result is an abrupt completion that
|
||||
exception is thrown instead of evaluating the algorithm.
|
||||
|
||||
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
|
||||
|
||||
1. If Type(O) is not Object, throw a TypeError exception.
|
||||
2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var find = TypedArray.prototype.find;
|
||||
|
||||
assert.sameValue(typeof find, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
find();
|
||||
});
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.10
|
||||
description: Requires a [[TypedArrayName]] internal slot.
|
||||
info: >
|
||||
22.2.3.10 %TypedArray%.prototype.find (predicate [ , thisArg ] )
|
||||
|
||||
This function is not generic. ValidateTypedArray is applied to the this value
|
||||
prior to evaluating the algorithm. If its result is an abrupt completion that
|
||||
exception is thrown instead of evaluating the algorithm.
|
||||
|
||||
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
|
||||
|
||||
1. If Type(O) is not Object, throw a TypeError exception.
|
||||
2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
assert.sameValue(typeof TypedArrayPrototype.find, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
TypedArrayPrototype.find();
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.10
|
||||
description: >
|
||||
"find" property of TypedArrayPrototype
|
||||
info: >
|
||||
ES6 section 17: Every other data property described in clauses 18 through 26
|
||||
and in Annex B.2 has the attributes { [[Writable]]: true,
|
||||
[[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js, testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
verifyNotEnumerable(TypedArrayPrototype, 'find');
|
||||
verifyWritable(TypedArrayPrototype, 'find');
|
||||
verifyConfigurable(TypedArrayPrototype, 'find');
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.11
|
||||
description: Throws a TypeError exception when invoked as a function
|
||||
info: >
|
||||
22.2.3.11 %TypedArray%.prototype.findIndex ( predicate [ , thisArg ] )
|
||||
|
||||
This function is not generic. ValidateTypedArray is applied to the this value
|
||||
prior to evaluating the algorithm. If its result is an abrupt completion that
|
||||
exception is thrown instead of evaluating the algorithm.
|
||||
|
||||
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
|
||||
|
||||
1. If Type(O) is not Object, throw a TypeError exception.
|
||||
2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var findIndex = TypedArray.prototype.findIndex;
|
||||
|
||||
assert.sameValue(typeof findIndex, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
findIndex();
|
||||
});
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.11
|
||||
description: Requires a [[TypedArrayName]] internal slot.
|
||||
info: >
|
||||
22.2.3.11 %TypedArray%.prototype.findIndex ( predicate [ , thisArg ] )
|
||||
|
||||
This function is not generic. ValidateTypedArray is applied to the this value
|
||||
prior to evaluating the algorithm. If its result is an abrupt completion that
|
||||
exception is thrown instead of evaluating the algorithm.
|
||||
|
||||
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
|
||||
|
||||
1. If Type(O) is not Object, throw a TypeError exception.
|
||||
2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
assert.sameValue(typeof TypedArrayPrototype.findIndex, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
TypedArrayPrototype.findIndex();
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.11
|
||||
description: >
|
||||
"findIndex" property of TypedArrayPrototype
|
||||
info: >
|
||||
ES6 section 17: Every other data property described in clauses 18 through 26
|
||||
and in Annex B.2 has the attributes { [[Writable]]: true,
|
||||
[[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js, testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
verifyNotEnumerable(TypedArrayPrototype, 'findIndex');
|
||||
verifyWritable(TypedArrayPrototype, 'findIndex');
|
||||
verifyConfigurable(TypedArrayPrototype, 'findIndex');
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.12
|
||||
description: Throws a TypeError exception when invoked as a function
|
||||
info: >
|
||||
22.2.3.12 %TypedArray%.prototype.forEach ( callbackfn [ , thisArg ] )
|
||||
|
||||
This function is not generic. ValidateTypedArray is applied to the this value
|
||||
prior to evaluating the algorithm. If its result is an abrupt completion that
|
||||
exception is thrown instead of evaluating the algorithm.
|
||||
|
||||
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
|
||||
|
||||
1. If Type(O) is not Object, throw a TypeError exception.
|
||||
2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var forEach = TypedArray.prototype.forEach;
|
||||
|
||||
assert.sameValue(typeof forEach, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
forEach();
|
||||
});
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.12
|
||||
description: Requires a [[TypedArrayName]] internal slot.
|
||||
info: >
|
||||
22.2.3.12 %TypedArray%.prototype.forEach ( callbackfn [ , thisArg ] )
|
||||
|
||||
This function is not generic. ValidateTypedArray is applied to the this value
|
||||
prior to evaluating the algorithm. If its result is an abrupt completion that
|
||||
exception is thrown instead of evaluating the algorithm.
|
||||
|
||||
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
|
||||
|
||||
1. If Type(O) is not Object, throw a TypeError exception.
|
||||
2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
assert.sameValue(typeof TypedArrayPrototype.forEach, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
TypedArrayPrototype.forEach();
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.12
|
||||
description: >
|
||||
"forEach" property of TypedArrayPrototype
|
||||
info: >
|
||||
ES6 section 17: Every other data property described in clauses 18 through 26
|
||||
and in Annex B.2 has the attributes { [[Writable]]: true,
|
||||
[[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js, testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
verifyNotEnumerable(TypedArrayPrototype, 'forEach');
|
||||
verifyWritable(TypedArrayPrototype, 'forEach');
|
||||
verifyConfigurable(TypedArrayPrototype, 'forEach');
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.13
|
||||
description: Throws a TypeError exception when invoked as a function
|
||||
info: >
|
||||
22.2.3.13 %TypedArray%.prototype.indexOf (searchElement [ , fromIndex ] )
|
||||
|
||||
This function is not generic. ValidateTypedArray is applied to the this value
|
||||
prior to evaluating the algorithm. If its result is an abrupt completion that
|
||||
exception is thrown instead of evaluating the algorithm.
|
||||
|
||||
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
|
||||
|
||||
1. If Type(O) is not Object, throw a TypeError exception.
|
||||
2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var indexOf = TypedArray.prototype.indexOf;
|
||||
|
||||
assert.sameValue(typeof indexOf, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
indexOf();
|
||||
});
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.13
|
||||
description: Requires a [[TypedArrayName]] internal slot.
|
||||
info: >
|
||||
22.2.3.13 %TypedArray%.prototype.indexOf (searchElement [ , fromIndex ] )
|
||||
|
||||
This function is not generic. ValidateTypedArray is applied to the this value
|
||||
prior to evaluating the algorithm. If its result is an abrupt completion that
|
||||
exception is thrown instead of evaluating the algorithm.
|
||||
|
||||
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
|
||||
|
||||
1. If Type(O) is not Object, throw a TypeError exception.
|
||||
2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
assert.sameValue(typeof TypedArrayPrototype.indexOf, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
TypedArrayPrototype.indexOf();
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.13
|
||||
description: >
|
||||
"indexOf" property of TypedArrayPrototype
|
||||
info: >
|
||||
ES6 section 17: Every other data property described in clauses 18 through 26
|
||||
and in Annex B.2 has the attributes { [[Writable]]: true,
|
||||
[[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js, testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
verifyNotEnumerable(TypedArrayPrototype, 'indexOf');
|
||||
verifyWritable(TypedArrayPrototype, 'indexOf');
|
||||
verifyConfigurable(TypedArrayPrototype, 'indexOf');
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.14
|
||||
description: Throws a TypeError exception when invoked as a function
|
||||
info: >
|
||||
22.2.3.14 %TypedArray%.prototype.join ( separator )
|
||||
|
||||
This function is not generic. ValidateTypedArray is applied to the this value
|
||||
prior to evaluating the algorithm. If its result is an abrupt completion that
|
||||
exception is thrown instead of evaluating the algorithm.
|
||||
|
||||
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
|
||||
|
||||
1. If Type(O) is not Object, throw a TypeError exception.
|
||||
2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var join = TypedArray.prototype.join;
|
||||
|
||||
assert.sameValue(typeof join, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
join();
|
||||
});
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.14
|
||||
description: Requires a [[TypedArrayName]] internal slot.
|
||||
info: >
|
||||
22.2.3.14 %TypedArray%.prototype.join ( separator )
|
||||
|
||||
This function is not generic. ValidateTypedArray is applied to the this value
|
||||
prior to evaluating the algorithm. If its result is an abrupt completion that
|
||||
exception is thrown instead of evaluating the algorithm.
|
||||
|
||||
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
|
||||
|
||||
1. If Type(O) is not Object, throw a TypeError exception.
|
||||
2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
assert.sameValue(typeof TypedArrayPrototype.join, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
TypedArrayPrototype.join();
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.14
|
||||
description: >
|
||||
"join" property of TypedArrayPrototype
|
||||
info: >
|
||||
ES6 section 17: Every other data property described in clauses 18 through 26
|
||||
and in Annex B.2 has the attributes { [[Writable]]: true,
|
||||
[[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js, testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
verifyNotEnumerable(TypedArrayPrototype, 'join');
|
||||
verifyWritable(TypedArrayPrototype, 'join');
|
||||
verifyConfigurable(TypedArrayPrototype, 'join');
|
|
@ -0,0 +1,29 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.15
|
||||
description: Throws a TypeError exception when invoked as a function
|
||||
info: >
|
||||
22.2.3.15 %TypedArray%.prototype.keys ( )
|
||||
|
||||
1. Let O be the this value.
|
||||
2. Let valid be ValidateTypedArray(O).
|
||||
3. ReturnIfAbrupt(valid).
|
||||
...
|
||||
|
||||
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
|
||||
|
||||
1. If Type(O) is not Object, throw a TypeError exception.
|
||||
2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var keys = TypedArray.prototype.keys;
|
||||
|
||||
assert.sameValue(typeof keys, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
keys();
|
||||
});
|
|
@ -0,0 +1,29 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.15
|
||||
description: Requires a [[TypedArrayName]] internal slot.
|
||||
info: >
|
||||
22.2.3.15 %TypedArray%.prototype.keys ( )
|
||||
|
||||
1. Let O be the this value.
|
||||
2. Let valid be ValidateTypedArray(O).
|
||||
3. ReturnIfAbrupt(valid).
|
||||
...
|
||||
|
||||
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
|
||||
|
||||
1. If Type(O) is not Object, throw a TypeError exception.
|
||||
2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
assert.sameValue(typeof TypedArrayPrototype.keys, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
TypedArrayPrototype.keys();
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.15
|
||||
description: >
|
||||
"keys" property of TypedArrayPrototype
|
||||
info: >
|
||||
ES6 section 17: Every other data property described in clauses 18 through 26
|
||||
and in Annex B.2 has the attributes { [[Writable]]: true,
|
||||
[[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js, testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
verifyNotEnumerable(TypedArrayPrototype, 'keys');
|
||||
verifyWritable(TypedArrayPrototype, 'keys');
|
||||
verifyConfigurable(TypedArrayPrototype, 'keys');
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.16
|
||||
description: Throws a TypeError exception when invoked as a function
|
||||
info: >
|
||||
22.2.3.16 %TypedArray%.prototype.lastIndexOf ( searchElement [ , fromIndex ] )
|
||||
|
||||
This function is not generic. ValidateTypedArray is applied to the this value
|
||||
prior to evaluating the algorithm. If its result is an abrupt completion that
|
||||
exception is thrown instead of evaluating the algorithm.
|
||||
|
||||
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
|
||||
|
||||
1. If Type(O) is not Object, throw a TypeError exception.
|
||||
2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var lastIndexOf = TypedArray.prototype.lastIndexOf;
|
||||
|
||||
assert.sameValue(typeof lastIndexOf, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
lastIndexOf();
|
||||
});
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.16
|
||||
description: Requires a [[TypedArrayName]] internal slot.
|
||||
info: >
|
||||
22.2.3.16 %TypedArray%.prototype.lastIndexOf ( searchElement [ , fromIndex ] )
|
||||
|
||||
This function is not generic. ValidateTypedArray is applied to the this value
|
||||
prior to evaluating the algorithm. If its result is an abrupt completion that
|
||||
exception is thrown instead of evaluating the algorithm.
|
||||
|
||||
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
|
||||
|
||||
1. If Type(O) is not Object, throw a TypeError exception.
|
||||
2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
assert.sameValue(typeof TypedArrayPrototype.lastIndexOf, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
TypedArrayPrototype.lastIndexOf();
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.16
|
||||
description: >
|
||||
"lastIndexOf" property of TypedArrayPrototype
|
||||
info: >
|
||||
ES6 section 17: Every other data property described in clauses 18 through 26
|
||||
and in Annex B.2 has the attributes { [[Writable]]: true,
|
||||
[[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js, testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
verifyNotEnumerable(TypedArrayPrototype, 'lastIndexOf');
|
||||
verifyWritable(TypedArrayPrototype, 'lastIndexOf');
|
||||
verifyConfigurable(TypedArrayPrototype, 'lastIndexOf');
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.17
|
||||
description: >
|
||||
Requires this value to have a [[ViewedArrayBuffer]] internal slot
|
||||
info: >
|
||||
22.2.3.17 get %TypedArray%.prototype.length
|
||||
|
||||
1. Let O be the this value.
|
||||
...
|
||||
3. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
TypedArrayPrototype.length;
|
||||
});
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.17
|
||||
description: Throws a TypeError exception when invoked as a function
|
||||
info: >
|
||||
22.2.3.17 get %TypedArray%.prototype.length
|
||||
|
||||
1. Let O be the this value.
|
||||
2. If Type(O) is not Object, throw a TypeError exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
var getter = Object.getOwnPropertyDescriptor(
|
||||
TypedArrayPrototype, 'length'
|
||||
).get;
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
getter();
|
||||
});
|
|
@ -0,0 +1,17 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.17
|
||||
description: >
|
||||
"length" property of TypedArrayPrototype
|
||||
info: >
|
||||
%TypedArray%.prototype.length is an accessor property whose set accessor
|
||||
function is undefined.
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
var desc = Object.getOwnPropertyDescriptor(TypedArrayPrototype, 'length');
|
||||
|
||||
assert.sameValue(desc.set, undefined);
|
||||
assert.sameValue(typeof desc.get, 'function');
|
|
@ -0,0 +1,29 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.18
|
||||
description: Throws a TypeError exception when invoked as a function
|
||||
info: >
|
||||
22.2.3.18 %TypedArray%.prototype.map ( callbackfn [ , thisArg ] )
|
||||
|
||||
1. Let O be the this value.
|
||||
2. Let valid be ValidateTypedArray(O).
|
||||
3. ReturnIfAbrupt(valid).
|
||||
...
|
||||
|
||||
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
|
||||
|
||||
1. If Type(O) is not Object, throw a TypeError exception.
|
||||
2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var map = TypedArray.prototype.map;
|
||||
|
||||
assert.sameValue(typeof map, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
map();
|
||||
});
|
|
@ -0,0 +1,29 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.18
|
||||
description: Requires a [[TypedArrayName]] internal slot.
|
||||
info: >
|
||||
22.2.3.18 %TypedArray%.prototype.map ( callbackfn [ , thisArg ] )
|
||||
|
||||
1. Let O be the this value.
|
||||
2. Let valid be ValidateTypedArray(O).
|
||||
3. ReturnIfAbrupt(valid).
|
||||
...
|
||||
|
||||
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
|
||||
|
||||
1. If Type(O) is not Object, throw a TypeError exception.
|
||||
2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
assert.sameValue(typeof TypedArrayPrototype.map, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
TypedArrayPrototype.map();
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.18
|
||||
description: >
|
||||
"map" property of TypedArrayPrototype
|
||||
info: >
|
||||
ES6 section 17: Every other data property described in clauses 18 through 26
|
||||
and in Annex B.2 has the attributes { [[Writable]]: true,
|
||||
[[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js, testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
verifyNotEnumerable(TypedArrayPrototype, 'map');
|
||||
verifyWritable(TypedArrayPrototype, 'map');
|
||||
verifyConfigurable(TypedArrayPrototype, 'map');
|
|
@ -0,0 +1,29 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.19
|
||||
description: Throws a TypeError exception when invoked as a function
|
||||
info: >
|
||||
22.2.3.19 %TypedArray%.prototype.reduce ( callbackfn [ , initialValue ] )
|
||||
|
||||
...
|
||||
This function is not generic. ValidateTypedArray is applied to the this value
|
||||
prior to evaluating the algorithm. If its result is an abrupt completion that
|
||||
exception is thrown instead of evaluating the algorithm.
|
||||
|
||||
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
|
||||
|
||||
1. If Type(O) is not Object, throw a TypeError exception.
|
||||
2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var reduce = TypedArray.prototype.reduce;
|
||||
|
||||
assert.sameValue(typeof reduce, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
reduce();
|
||||
});
|
|
@ -0,0 +1,29 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.19
|
||||
description: Requires a [[TypedArrayName]] internal slot.
|
||||
info: >
|
||||
22.2.3.19 %TypedArray%.prototype.reduce ( callbackfn [ , initialValue ] )
|
||||
|
||||
...
|
||||
This function is not generic. ValidateTypedArray is applied to the this value
|
||||
prior to evaluating the algorithm. If its result is an abrupt completion that
|
||||
exception is thrown instead of evaluating the algorithm.
|
||||
|
||||
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
|
||||
|
||||
1. If Type(O) is not Object, throw a TypeError exception.
|
||||
2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
assert.sameValue(typeof TypedArrayPrototype.reduce, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
TypedArrayPrototype.reduce();
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.19
|
||||
description: >
|
||||
"reduce" property of TypedArrayPrototype
|
||||
info: >
|
||||
ES6 section 17: Every other data property described in clauses 18 through 26
|
||||
and in Annex B.2 has the attributes { [[Writable]]: true,
|
||||
[[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js, testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
verifyNotEnumerable(TypedArrayPrototype, 'reduce');
|
||||
verifyWritable(TypedArrayPrototype, 'reduce');
|
||||
verifyConfigurable(TypedArrayPrototype, 'reduce');
|
|
@ -0,0 +1,29 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.20
|
||||
description: Throws a TypeError exception when invoked as a function
|
||||
info: >
|
||||
22.2.3.20 %TypedArray%.prototype.reduceRight ( callbackfn [ , initialValue ] )
|
||||
|
||||
...
|
||||
This function is not generic. ValidateTypedArray is applied to the this value
|
||||
prior to evaluating the algorithm. If its result is an abrupt completion that
|
||||
exception is thrown instead of evaluating the algorithm.
|
||||
|
||||
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
|
||||
|
||||
1. If Type(O) is not Object, throw a TypeError exception.
|
||||
2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var reduceRight = TypedArray.prototype.reduceRight;
|
||||
|
||||
assert.sameValue(typeof reduceRight, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
reduceRight();
|
||||
});
|
|
@ -0,0 +1,29 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.20
|
||||
description: Requires a [[TypedArrayName]] internal slot.
|
||||
info: >
|
||||
22.2.3.20 %TypedArray%.prototype.reduceRight ( callbackfn [ , initialValue ] )
|
||||
|
||||
...
|
||||
This function is not generic. ValidateTypedArray is applied to the this value
|
||||
prior to evaluating the algorithm. If its result is an abrupt completion that
|
||||
exception is thrown instead of evaluating the algorithm.
|
||||
|
||||
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
|
||||
|
||||
1. If Type(O) is not Object, throw a TypeError exception.
|
||||
2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
assert.sameValue(typeof TypedArrayPrototype.reduceRight, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
TypedArrayPrototype.reduceRight();
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.20
|
||||
description: >
|
||||
"reduceRight" property of TypedArrayPrototype
|
||||
info: >
|
||||
ES6 section 17: Every other data property described in clauses 18 through 26
|
||||
and in Annex B.2 has the attributes { [[Writable]]: true,
|
||||
[[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js, testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
verifyNotEnumerable(TypedArrayPrototype, 'reduceRight');
|
||||
verifyWritable(TypedArrayPrototype, 'reduceRight');
|
||||
verifyConfigurable(TypedArrayPrototype, 'reduceRight');
|
|
@ -0,0 +1,29 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.21
|
||||
description: Throws a TypeError exception when invoked as a function
|
||||
info: >
|
||||
22.2.3.21 %TypedArray%.prototype.reverse ( )
|
||||
|
||||
...
|
||||
This function is not generic. ValidateTypedArray is applied to the this value
|
||||
prior to evaluating the algorithm. If its result is an abrupt completion that
|
||||
exception is thrown instead of evaluating the algorithm.
|
||||
|
||||
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
|
||||
|
||||
1. If Type(O) is not Object, throw a TypeError exception.
|
||||
2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var reverse = TypedArray.prototype.reverse;
|
||||
|
||||
assert.sameValue(typeof reverse, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
reverse();
|
||||
});
|
|
@ -0,0 +1,29 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.21
|
||||
description: Requires a [[TypedArrayName]] internal slot.
|
||||
info: >
|
||||
22.2.3.21 %TypedArray%.prototype.reverse ( )
|
||||
|
||||
...
|
||||
This function is not generic. ValidateTypedArray is applied to the this value
|
||||
prior to evaluating the algorithm. If its result is an abrupt completion that
|
||||
exception is thrown instead of evaluating the algorithm.
|
||||
|
||||
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
|
||||
|
||||
1. If Type(O) is not Object, throw a TypeError exception.
|
||||
2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
assert.sameValue(typeof TypedArrayPrototype.reverse, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
TypedArrayPrototype.reverse();
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.21
|
||||
description: >
|
||||
"reverse" property of TypedArrayPrototype
|
||||
info: >
|
||||
ES6 section 17: Every other data property described in clauses 18 through 26
|
||||
and in Annex B.2 has the attributes { [[Writable]]: true,
|
||||
[[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js, testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
verifyNotEnumerable(TypedArrayPrototype, 'reverse');
|
||||
verifyWritable(TypedArrayPrototype, 'reverse');
|
||||
verifyConfigurable(TypedArrayPrototype, 'reverse');
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.22
|
||||
description: Throws a TypeError exception when invoked as a function
|
||||
info: >
|
||||
22.2.3.22 %TypedArray%.prototype.set ( overloaded [ , offset ])
|
||||
|
||||
This function is not generic. The this value must be an object with a
|
||||
[[TypedArrayName]] internal slot.
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var set = TypedArray.prototype.set;
|
||||
|
||||
assert.sameValue(typeof set, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
set();
|
||||
});
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.22
|
||||
description: Requires a [[TypedArrayName]] internal slot.
|
||||
info: >
|
||||
22.2.3.22 %TypedArray%.prototype.set ( overloaded [ , offset ])
|
||||
|
||||
This function is not generic. The this value must be an object with a
|
||||
[[TypedArrayName]] internal slot.
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
assert.sameValue(typeof TypedArrayPrototype.set, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
TypedArrayPrototype.set();
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.22
|
||||
description: >
|
||||
"set" property of TypedArrayPrototype
|
||||
info: >
|
||||
ES6 section 17: Every other data property described in clauses 18 through 26
|
||||
and in Annex B.2 has the attributes { [[Writable]]: true,
|
||||
[[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js, testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
verifyNotEnumerable(TypedArrayPrototype, 'set');
|
||||
verifyWritable(TypedArrayPrototype, 'set');
|
||||
verifyConfigurable(TypedArrayPrototype, 'set');
|
|
@ -0,0 +1,29 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.23
|
||||
description: Throws a TypeError exception when invoked as a function
|
||||
info: >
|
||||
22.2.3.23 %TypedArray%.prototype.slice ( start, end )
|
||||
|
||||
1. Let O be the this value.
|
||||
2. Let valid be ValidateTypedArray(O).
|
||||
3. ReturnIfAbrupt(valid).
|
||||
...
|
||||
|
||||
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
|
||||
|
||||
1. If Type(O) is not Object, throw a TypeError exception.
|
||||
2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var slice = TypedArray.prototype.slice;
|
||||
|
||||
assert.sameValue(typeof slice, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
slice();
|
||||
});
|
|
@ -0,0 +1,29 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.23
|
||||
description: Requires a [[TypedArrayName]] internal slot.
|
||||
info: >
|
||||
22.2.3.23 %TypedArray%.prototype.slice ( start, end )
|
||||
|
||||
1. Let O be the this value.
|
||||
2. Let valid be ValidateTypedArray(O).
|
||||
3. ReturnIfAbrupt(valid).
|
||||
...
|
||||
|
||||
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
|
||||
|
||||
1. If Type(O) is not Object, throw a TypeError exception.
|
||||
2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
assert.sameValue(typeof TypedArrayPrototype.slice, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
TypedArrayPrototype.slice();
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.23
|
||||
description: >
|
||||
"slice" property of TypedArrayPrototype
|
||||
info: >
|
||||
ES6 section 17: Every other data property described in clauses 18 through 26
|
||||
and in Annex B.2 has the attributes { [[Writable]]: true,
|
||||
[[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js, testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
verifyNotEnumerable(TypedArrayPrototype, 'slice');
|
||||
verifyWritable(TypedArrayPrototype, 'slice');
|
||||
verifyConfigurable(TypedArrayPrototype, 'slice');
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.24
|
||||
description: Throws a TypeError exception when invoked as a function
|
||||
info: >
|
||||
22.2.3.24 %TypedArray%.prototype.some ( callbackfn [ , thisArg ] )
|
||||
|
||||
This function is not generic. ValidateTypedArray is applied to the this value
|
||||
prior to evaluating the algorithm. If its result is an abrupt completion that
|
||||
exception is thrown instead of evaluating the algorithm.
|
||||
|
||||
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
|
||||
|
||||
1. If Type(O) is not Object, throw a TypeError exception.
|
||||
2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var some = TypedArray.prototype.some;
|
||||
|
||||
assert.sameValue(typeof some, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
some();
|
||||
});
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.24
|
||||
description: Requires a [[TypedArrayName]] internal slot.
|
||||
info: >
|
||||
22.2.3.24 %TypedArray%.prototype.some ( callbackfn [ , thisArg ] )
|
||||
|
||||
This function is not generic. ValidateTypedArray is applied to the this value
|
||||
prior to evaluating the algorithm. If its result is an abrupt completion that
|
||||
exception is thrown instead of evaluating the algorithm.
|
||||
|
||||
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
|
||||
|
||||
1. If Type(O) is not Object, throw a TypeError exception.
|
||||
2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
assert.sameValue(typeof TypedArrayPrototype.some, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
TypedArrayPrototype.some();
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.24
|
||||
description: >
|
||||
"some" property of TypedArrayPrototype
|
||||
info: >
|
||||
ES6 section 17: Every other data property described in clauses 18 through 26
|
||||
and in Annex B.2 has the attributes { [[Writable]]: true,
|
||||
[[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js, testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
verifyNotEnumerable(TypedArrayPrototype, 'some');
|
||||
verifyWritable(TypedArrayPrototype, 'some');
|
||||
verifyConfigurable(TypedArrayPrototype, 'some');
|
|
@ -0,0 +1,34 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.25
|
||||
description: Throws a TypeError exception when invoked as a function
|
||||
info: >
|
||||
22.2.3.25 %TypedArray%.prototype.sort ( comparefn )
|
||||
|
||||
...
|
||||
This function is not generic. The this value must be an object with a
|
||||
[[TypedArrayName]] internal slot.
|
||||
...
|
||||
|
||||
1. Let obj be the this value as the argument.
|
||||
2. Let buffer be ValidateTypedArray(obj).
|
||||
3. ReturnIfAbrupt(buffer).
|
||||
...
|
||||
|
||||
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
|
||||
|
||||
1. If Type(O) is not Object, throw a TypeError exception.
|
||||
2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var sort = TypedArray.prototype.sort;
|
||||
|
||||
assert.sameValue(typeof sort, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
sort();
|
||||
});
|
|
@ -0,0 +1,34 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.25
|
||||
description: Requires a [[TypedArrayName]] internal slot.
|
||||
info: >
|
||||
22.2.3.25 %TypedArray%.prototype.sort ( comparefn )
|
||||
|
||||
...
|
||||
This function is not generic. The this value must be an object with a
|
||||
[[TypedArrayName]] internal slot.
|
||||
...
|
||||
|
||||
1. Let obj be the this value as the argument.
|
||||
2. Let buffer be ValidateTypedArray(obj).
|
||||
3. ReturnIfAbrupt(buffer).
|
||||
...
|
||||
|
||||
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
|
||||
|
||||
1. If Type(O) is not Object, throw a TypeError exception.
|
||||
2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
assert.sameValue(typeof TypedArrayPrototype.sort, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
TypedArrayPrototype.sort();
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.25
|
||||
description: >
|
||||
"sort" property of TypedArrayPrototype
|
||||
info: >
|
||||
ES6 section 17: Every other data property described in clauses 18 through 26
|
||||
and in Annex B.2 has the attributes { [[Writable]]: true,
|
||||
[[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js, testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
verifyNotEnumerable(TypedArrayPrototype, 'sort');
|
||||
verifyWritable(TypedArrayPrototype, 'sort');
|
||||
verifyConfigurable(TypedArrayPrototype, 'sort');
|
|
@ -0,0 +1,23 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.26
|
||||
description: Throws a TypeError exception when invoked as a function
|
||||
info: >
|
||||
22.2.3.26 %TypedArray%.prototype.subarray( [ begin [ , end ] ] )
|
||||
|
||||
1. Let O be the this value.
|
||||
2. If Type(O) is not Object, throw a TypeError exception.
|
||||
3. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var subarray = TypedArray.prototype.subarray;
|
||||
|
||||
assert.sameValue(typeof subarray, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
subarray();
|
||||
});
|
|
@ -0,0 +1,23 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.26
|
||||
description: Requires a [[TypedArrayName]] internal slot.
|
||||
info: >
|
||||
22.2.3.26 %TypedArray%.prototype.subarray( [ begin [ , end ] ] )
|
||||
|
||||
1. Let O be the this value.
|
||||
2. If Type(O) is not Object, throw a TypeError exception.
|
||||
3. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
assert.sameValue(typeof TypedArrayPrototype.subarray, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
TypedArrayPrototype.subarray();
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.26
|
||||
description: >
|
||||
"subarray" property of TypedArrayPrototype
|
||||
info: >
|
||||
ES6 section 17: Every other data property described in clauses 18 through 26
|
||||
and in Annex B.2 has the attributes { [[Writable]]: true,
|
||||
[[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified.
|
||||
includes: [propertyHelper.js, testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
verifyNotEnumerable(TypedArrayPrototype, 'subarray');
|
||||
verifyWritable(TypedArrayPrototype, 'subarray');
|
||||
verifyConfigurable(TypedArrayPrototype, 'subarray');
|
|
@ -0,0 +1,30 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.27
|
||||
description: Throws a TypeError exception when invoked as a function
|
||||
info: >
|
||||
22.2.3.27 %TypedArray%.prototype.toLocaleString ([ reserved1 [ , reserved2 ] ])
|
||||
|
||||
...
|
||||
|
||||
This function is not generic. ValidateTypedArray is applied to the this
|
||||
value prior to evaluating the algorithm. If its result is an abrupt
|
||||
completion that exception is thrown instead of evaluating the algorithm.
|
||||
|
||||
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
|
||||
|
||||
1. If Type(O) is not Object, throw a TypeError exception.
|
||||
2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var toLocaleString = TypedArray.prototype.toLocaleString;
|
||||
|
||||
assert.sameValue(typeof toLocaleString, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
toLocaleString();
|
||||
});
|
|
@ -0,0 +1,30 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
es6id: 22.2.3.27
|
||||
description: Requires a [[TypedArrayName]] internal slot.
|
||||
info: >
|
||||
22.2.3.27 %TypedArray%.prototype.toLocaleString ([ reserved1 [ , reserved2 ] ])
|
||||
|
||||
...
|
||||
|
||||
This function is not generic. ValidateTypedArray is applied to the this
|
||||
value prior to evaluating the algorithm. If its result is an abrupt
|
||||
completion that exception is thrown instead of evaluating the algorithm.
|
||||
|
||||
22.2.3.5.1 Runtime Semantics: ValidateTypedArray ( O )
|
||||
|
||||
1. If Type(O) is not Object, throw a TypeError exception.
|
||||
2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError
|
||||
exception.
|
||||
...
|
||||
includes: [testTypedArray.js]
|
||||
---*/
|
||||
|
||||
var TypedArrayPrototype = TypedArray.prototype;
|
||||
|
||||
assert.sameValue(typeof TypedArrayPrototype.toLocaleString, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
TypedArrayPrototype.toLocaleString();
|
||||
});
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue