mirror of
https://github.com/tc39/test262.git
synced 2025-04-08 19:35:28 +02:00
Merge pull request #469 from bocoup/improve-typed-arrays-coverage
Basic coverage for the %TypedArray% object
This commit is contained in:
commit
afd3c5783e
test/built-ins/TypedArray
Symbol.species
from
arylk-get-length-error.jsarylk-to-length-error.jsinvoked-as-func.jsinvoked-as-method.jsiter-access-error.jsiter-invoke-error.jsiter-next-error.jsiter-next-value-error.jsprop-desc.js
invoked-as-ctor-with-arguments.jsinvoked-as-ctor.jsinvoked-as-func.jslength.jsname.jsof
prototype.jsprototype
Symbol.toStringTag
buffer
byteLength
byteOffset
copyWithin
entries
every
fill
filter
find
findIndex
forEach
indexOf
join
keys
lastIndexOf
length
map
reduce
reduceRight
reverse
set
slice
some
sort
subarray
toLocaleString
19
test/built-ins/TypedArray/Symbol.species/prop-desc.js
Normal file
19
test/built-ins/TypedArray/Symbol.species/prop-desc.js
Normal file
@ -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');
|
18
test/built-ins/TypedArray/Symbol.species/result.js
Normal file
18
test/built-ins/TypedArray/Symbol.species/result.js
Normal file
@ -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);
|
26
test/built-ins/TypedArray/from/arylk-get-length-error.js
Normal file
26
test/built-ins/TypedArray/from/arylk-get-length-error.js
Normal file
@ -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);
|
||||
});
|
25
test/built-ins/TypedArray/from/arylk-to-length-error.js
Normal file
25
test/built-ins/TypedArray/from/arylk-to-length-error.js
Normal file
@ -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);
|
||||
});
|
20
test/built-ins/TypedArray/from/invoked-as-func.js
Normal file
20
test/built-ins/TypedArray/from/invoked-as-func.js
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.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([]);
|
||||
});
|
33
test/built-ins/TypedArray/from/invoked-as-method.js
Normal file
33
test/built-ins/TypedArray/from/invoked-as-method.js
Normal file
@ -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([]);
|
||||
});
|
27
test/built-ins/TypedArray/from/iter-access-error.js
Normal file
27
test/built-ins/TypedArray/from/iter-access-error.js
Normal file
@ -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);
|
||||
});
|
26
test/built-ins/TypedArray/from/iter-invoke-error.js
Normal file
26
test/built-ins/TypedArray/from/iter-invoke-error.js
Normal file
@ -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);
|
||||
});
|
32
test/built-ins/TypedArray/from/iter-next-error.js
Normal file
32
test/built-ins/TypedArray/from/iter-next-error.js
Normal file
@ -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);
|
||||
});
|
38
test/built-ins/TypedArray/from/iter-next-value-error.js
Normal file
38
test/built-ins/TypedArray/from/iter-next-value-error.js
Normal file
@ -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);
|
||||
});
|
16
test/built-ins/TypedArray/from/prop-desc.js
Normal file
16
test/built-ins/TypedArray/from/prop-desc.js
Normal file
@ -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');
|
30
test/built-ins/TypedArray/invoked-as-ctor-with-arguments.js
Normal file
30
test/built-ins/TypedArray/invoked-as-ctor-with-arguments.js
Normal file
@ -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);
|
||||
});
|
17
test/built-ins/TypedArray/invoked-as-ctor.js
Normal file
17
test/built-ins/TypedArray/invoked-as-ctor.js
Normal file
@ -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();
|
||||
});
|
16
test/built-ins/TypedArray/invoked-as-func.js
Normal file
16
test/built-ins/TypedArray/invoked-as-func.js
Normal file
@ -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();
|
||||
});
|
24
test/built-ins/TypedArray/length.js
Normal file
24
test/built-ins/TypedArray/length.js
Normal file
@ -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');
|
24
test/built-ins/TypedArray/name.js
Normal file
24
test/built-ins/TypedArray/name.js
Normal file
@ -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');
|
21
test/built-ins/TypedArray/of/invoked-as-func.js
Normal file
21
test/built-ins/TypedArray/of/invoked-as-func.js
Normal file
@ -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();
|
||||
});
|
25
test/built-ins/TypedArray/of/invoked-as-method.js
Normal file
25
test/built-ins/TypedArray/of/invoked-as-method.js
Normal file
@ -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();
|
||||
});
|
16
test/built-ins/TypedArray/of/prop-desc.js
Normal file
16
test/built-ins/TypedArray/of/prop-desc.js
Normal file
@ -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');
|
17
test/built-ins/TypedArray/prototype.js
vendored
Normal file
17
test/built-ins/TypedArray/prototype.js
vendored
Normal file
@ -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);
|
21
test/built-ins/TypedArray/prototype/Symbol.toStringTag/invoked-as-func.js
vendored
Normal file
21
test/built-ins/TypedArray/prototype/Symbol.toStringTag/invoked-as-func.js
vendored
Normal file
@ -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);
|
28
test/built-ins/TypedArray/prototype/Symbol.toStringTag/prop-desc.js
vendored
Normal file
28
test/built-ins/TypedArray/prototype/Symbol.toStringTag/prop-desc.js
vendored
Normal file
@ -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);
|
22
test/built-ins/TypedArray/prototype/buffer/invoked-as-accessor.js
vendored
Normal file
22
test/built-ins/TypedArray/prototype/buffer/invoked-as-accessor.js
vendored
Normal file
@ -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;
|
||||
});
|
24
test/built-ins/TypedArray/prototype/buffer/invoked-as-func.js
vendored
Normal file
24
test/built-ins/TypedArray/prototype/buffer/invoked-as-func.js
vendored
Normal file
@ -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();
|
||||
});
|
17
test/built-ins/TypedArray/prototype/buffer/prop-desc.js
vendored
Normal file
17
test/built-ins/TypedArray/prototype/buffer/prop-desc.js
vendored
Normal file
@ -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');
|
22
test/built-ins/TypedArray/prototype/byteLength/invoked-as-accessor.js
vendored
Normal file
22
test/built-ins/TypedArray/prototype/byteLength/invoked-as-accessor.js
vendored
Normal file
@ -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;
|
||||
});
|
24
test/built-ins/TypedArray/prototype/byteLength/invoked-as-func.js
vendored
Normal file
24
test/built-ins/TypedArray/prototype/byteLength/invoked-as-func.js
vendored
Normal file
@ -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();
|
||||
});
|
17
test/built-ins/TypedArray/prototype/byteLength/prop-desc.js
vendored
Normal file
17
test/built-ins/TypedArray/prototype/byteLength/prop-desc.js
vendored
Normal file
@ -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');
|
22
test/built-ins/TypedArray/prototype/byteOffset/invoked-as-accessor.js
vendored
Normal file
22
test/built-ins/TypedArray/prototype/byteOffset/invoked-as-accessor.js
vendored
Normal file
@ -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;
|
||||
});
|
24
test/built-ins/TypedArray/prototype/byteOffset/invoked-as-func.js
vendored
Normal file
24
test/built-ins/TypedArray/prototype/byteOffset/invoked-as-func.js
vendored
Normal file
@ -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();
|
||||
});
|
17
test/built-ins/TypedArray/prototype/byteOffset/prop-desc.js
vendored
Normal file
17
test/built-ins/TypedArray/prototype/byteOffset/prop-desc.js
vendored
Normal file
@ -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');
|
28
test/built-ins/TypedArray/prototype/copyWithin/invoked-as-func.js
vendored
Normal file
28
test/built-ins/TypedArray/prototype/copyWithin/invoked-as-func.js
vendored
Normal file
@ -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();
|
||||
});
|
28
test/built-ins/TypedArray/prototype/copyWithin/invoked-as-method.js
vendored
Normal file
28
test/built-ins/TypedArray/prototype/copyWithin/invoked-as-method.js
vendored
Normal file
@ -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();
|
||||
});
|
18
test/built-ins/TypedArray/prototype/copyWithin/prop-desc.js
vendored
Normal file
18
test/built-ins/TypedArray/prototype/copyWithin/prop-desc.js
vendored
Normal file
@ -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');
|
31
test/built-ins/TypedArray/prototype/entries/invoked-as-func.js
vendored
Normal file
31
test/built-ins/TypedArray/prototype/entries/invoked-as-func.js
vendored
Normal file
@ -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();
|
||||
});
|
31
test/built-ins/TypedArray/prototype/entries/invoked-as-method.js
vendored
Normal file
31
test/built-ins/TypedArray/prototype/entries/invoked-as-method.js
vendored
Normal file
@ -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();
|
||||
});
|
18
test/built-ins/TypedArray/prototype/entries/prop-desc.js
vendored
Normal file
18
test/built-ins/TypedArray/prototype/entries/prop-desc.js
vendored
Normal file
@ -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');
|
28
test/built-ins/TypedArray/prototype/every/invoked-as-func.js
vendored
Normal file
28
test/built-ins/TypedArray/prototype/every/invoked-as-func.js
vendored
Normal file
@ -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();
|
||||
});
|
28
test/built-ins/TypedArray/prototype/every/invoked-as-method.js
vendored
Normal file
28
test/built-ins/TypedArray/prototype/every/invoked-as-method.js
vendored
Normal file
@ -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();
|
||||
});
|
18
test/built-ins/TypedArray/prototype/every/prop-desc.js
vendored
Normal file
18
test/built-ins/TypedArray/prototype/every/prop-desc.js
vendored
Normal file
@ -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');
|
28
test/built-ins/TypedArray/prototype/fill/invoked-as-func.js
vendored
Normal file
28
test/built-ins/TypedArray/prototype/fill/invoked-as-func.js
vendored
Normal file
@ -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();
|
||||
});
|
28
test/built-ins/TypedArray/prototype/fill/invoked-as-method.js
vendored
Normal file
28
test/built-ins/TypedArray/prototype/fill/invoked-as-method.js
vendored
Normal file
@ -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();
|
||||
});
|
18
test/built-ins/TypedArray/prototype/fill/prop-desc.js
vendored
Normal file
18
test/built-ins/TypedArray/prototype/fill/prop-desc.js
vendored
Normal file
@ -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');
|
29
test/built-ins/TypedArray/prototype/filter/invoked-as-func.js
vendored
Normal file
29
test/built-ins/TypedArray/prototype/filter/invoked-as-func.js
vendored
Normal file
@ -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();
|
||||
});
|
29
test/built-ins/TypedArray/prototype/filter/invoked-as-method.js
vendored
Normal file
29
test/built-ins/TypedArray/prototype/filter/invoked-as-method.js
vendored
Normal file
@ -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();
|
||||
});
|
18
test/built-ins/TypedArray/prototype/filter/prop-desc.js
vendored
Normal file
18
test/built-ins/TypedArray/prototype/filter/prop-desc.js
vendored
Normal file
@ -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');
|
28
test/built-ins/TypedArray/prototype/find/invoked-as-func.js
vendored
Normal file
28
test/built-ins/TypedArray/prototype/find/invoked-as-func.js
vendored
Normal file
@ -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();
|
||||
});
|
28
test/built-ins/TypedArray/prototype/find/invoked-as-method.js
vendored
Normal file
28
test/built-ins/TypedArray/prototype/find/invoked-as-method.js
vendored
Normal file
@ -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();
|
||||
});
|
18
test/built-ins/TypedArray/prototype/find/prop-desc.js
vendored
Normal file
18
test/built-ins/TypedArray/prototype/find/prop-desc.js
vendored
Normal file
@ -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');
|
28
test/built-ins/TypedArray/prototype/findIndex/invoked-as-func.js
vendored
Normal file
28
test/built-ins/TypedArray/prototype/findIndex/invoked-as-func.js
vendored
Normal file
@ -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();
|
||||
});
|
28
test/built-ins/TypedArray/prototype/findIndex/invoked-as-method.js
vendored
Normal file
28
test/built-ins/TypedArray/prototype/findIndex/invoked-as-method.js
vendored
Normal file
@ -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();
|
||||
});
|
18
test/built-ins/TypedArray/prototype/findIndex/prop-desc.js
vendored
Normal file
18
test/built-ins/TypedArray/prototype/findIndex/prop-desc.js
vendored
Normal file
@ -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');
|
28
test/built-ins/TypedArray/prototype/forEach/invoked-as-func.js
vendored
Normal file
28
test/built-ins/TypedArray/prototype/forEach/invoked-as-func.js
vendored
Normal file
@ -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();
|
||||
});
|
28
test/built-ins/TypedArray/prototype/forEach/invoked-as-method.js
vendored
Normal file
28
test/built-ins/TypedArray/prototype/forEach/invoked-as-method.js
vendored
Normal file
@ -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();
|
||||
});
|
18
test/built-ins/TypedArray/prototype/forEach/prop-desc.js
vendored
Normal file
18
test/built-ins/TypedArray/prototype/forEach/prop-desc.js
vendored
Normal file
@ -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');
|
28
test/built-ins/TypedArray/prototype/indexOf/invoked-as-func.js
vendored
Normal file
28
test/built-ins/TypedArray/prototype/indexOf/invoked-as-func.js
vendored
Normal file
@ -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();
|
||||
});
|
28
test/built-ins/TypedArray/prototype/indexOf/invoked-as-method.js
vendored
Normal file
28
test/built-ins/TypedArray/prototype/indexOf/invoked-as-method.js
vendored
Normal file
@ -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();
|
||||
});
|
18
test/built-ins/TypedArray/prototype/indexOf/prop-desc.js
vendored
Normal file
18
test/built-ins/TypedArray/prototype/indexOf/prop-desc.js
vendored
Normal file
@ -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');
|
28
test/built-ins/TypedArray/prototype/join/invoked-as-func.js
vendored
Normal file
28
test/built-ins/TypedArray/prototype/join/invoked-as-func.js
vendored
Normal file
@ -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();
|
||||
});
|
28
test/built-ins/TypedArray/prototype/join/invoked-as-method.js
vendored
Normal file
28
test/built-ins/TypedArray/prototype/join/invoked-as-method.js
vendored
Normal file
@ -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();
|
||||
});
|
18
test/built-ins/TypedArray/prototype/join/prop-desc.js
vendored
Normal file
18
test/built-ins/TypedArray/prototype/join/prop-desc.js
vendored
Normal file
@ -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');
|
29
test/built-ins/TypedArray/prototype/keys/invoked-as-func.js
vendored
Normal file
29
test/built-ins/TypedArray/prototype/keys/invoked-as-func.js
vendored
Normal file
@ -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();
|
||||
});
|
29
test/built-ins/TypedArray/prototype/keys/invoked-as-method.js
vendored
Normal file
29
test/built-ins/TypedArray/prototype/keys/invoked-as-method.js
vendored
Normal file
@ -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();
|
||||
});
|
18
test/built-ins/TypedArray/prototype/keys/prop-desc.js
vendored
Normal file
18
test/built-ins/TypedArray/prototype/keys/prop-desc.js
vendored
Normal file
@ -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');
|
28
test/built-ins/TypedArray/prototype/lastIndexOf/invoked-as-func.js
vendored
Normal file
28
test/built-ins/TypedArray/prototype/lastIndexOf/invoked-as-func.js
vendored
Normal file
@ -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();
|
||||
});
|
28
test/built-ins/TypedArray/prototype/lastIndexOf/invoked-as-method.js
vendored
Normal file
28
test/built-ins/TypedArray/prototype/lastIndexOf/invoked-as-method.js
vendored
Normal file
@ -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();
|
||||
});
|
18
test/built-ins/TypedArray/prototype/lastIndexOf/prop-desc.js
vendored
Normal file
18
test/built-ins/TypedArray/prototype/lastIndexOf/prop-desc.js
vendored
Normal file
@ -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');
|
22
test/built-ins/TypedArray/prototype/length/invoked-as-accessor.js
vendored
Normal file
22
test/built-ins/TypedArray/prototype/length/invoked-as-accessor.js
vendored
Normal file
@ -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;
|
||||
});
|
22
test/built-ins/TypedArray/prototype/length/invoked-as-func.js
vendored
Normal file
22
test/built-ins/TypedArray/prototype/length/invoked-as-func.js
vendored
Normal file
@ -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();
|
||||
});
|
17
test/built-ins/TypedArray/prototype/length/prop-desc.js
vendored
Normal file
17
test/built-ins/TypedArray/prototype/length/prop-desc.js
vendored
Normal file
@ -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');
|
29
test/built-ins/TypedArray/prototype/map/invoked-as-func.js
vendored
Normal file
29
test/built-ins/TypedArray/prototype/map/invoked-as-func.js
vendored
Normal file
@ -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();
|
||||
});
|
29
test/built-ins/TypedArray/prototype/map/invoked-as-method.js
vendored
Normal file
29
test/built-ins/TypedArray/prototype/map/invoked-as-method.js
vendored
Normal file
@ -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();
|
||||
});
|
18
test/built-ins/TypedArray/prototype/map/prop-desc.js
vendored
Normal file
18
test/built-ins/TypedArray/prototype/map/prop-desc.js
vendored
Normal file
@ -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');
|
29
test/built-ins/TypedArray/prototype/reduce/invoked-as-func.js
vendored
Normal file
29
test/built-ins/TypedArray/prototype/reduce/invoked-as-func.js
vendored
Normal file
@ -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();
|
||||
});
|
29
test/built-ins/TypedArray/prototype/reduce/invoked-as-method.js
vendored
Normal file
29
test/built-ins/TypedArray/prototype/reduce/invoked-as-method.js
vendored
Normal file
@ -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();
|
||||
});
|
18
test/built-ins/TypedArray/prototype/reduce/prop-desc.js
vendored
Normal file
18
test/built-ins/TypedArray/prototype/reduce/prop-desc.js
vendored
Normal file
@ -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');
|
29
test/built-ins/TypedArray/prototype/reduceRight/invoked-as-func.js
vendored
Normal file
29
test/built-ins/TypedArray/prototype/reduceRight/invoked-as-func.js
vendored
Normal file
@ -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();
|
||||
});
|
29
test/built-ins/TypedArray/prototype/reduceRight/invoked-as-method.js
vendored
Normal file
29
test/built-ins/TypedArray/prototype/reduceRight/invoked-as-method.js
vendored
Normal file
@ -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();
|
||||
});
|
18
test/built-ins/TypedArray/prototype/reduceRight/prop-desc.js
vendored
Normal file
18
test/built-ins/TypedArray/prototype/reduceRight/prop-desc.js
vendored
Normal file
@ -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');
|
29
test/built-ins/TypedArray/prototype/reverse/invoked-as-func.js
vendored
Normal file
29
test/built-ins/TypedArray/prototype/reverse/invoked-as-func.js
vendored
Normal file
@ -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();
|
||||
});
|
29
test/built-ins/TypedArray/prototype/reverse/invoked-as-method.js
vendored
Normal file
29
test/built-ins/TypedArray/prototype/reverse/invoked-as-method.js
vendored
Normal file
@ -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();
|
||||
});
|
18
test/built-ins/TypedArray/prototype/reverse/prop-desc.js
vendored
Normal file
18
test/built-ins/TypedArray/prototype/reverse/prop-desc.js
vendored
Normal file
@ -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');
|
20
test/built-ins/TypedArray/prototype/set/invoked-as-func.js
vendored
Normal file
20
test/built-ins/TypedArray/prototype/set/invoked-as-func.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.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();
|
||||
});
|
20
test/built-ins/TypedArray/prototype/set/invoked-as-method.js
vendored
Normal file
20
test/built-ins/TypedArray/prototype/set/invoked-as-method.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.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();
|
||||
});
|
18
test/built-ins/TypedArray/prototype/set/prop-desc.js
vendored
Normal file
18
test/built-ins/TypedArray/prototype/set/prop-desc.js
vendored
Normal file
@ -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');
|
29
test/built-ins/TypedArray/prototype/slice/invoked-as-func.js
vendored
Normal file
29
test/built-ins/TypedArray/prototype/slice/invoked-as-func.js
vendored
Normal file
@ -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();
|
||||
});
|
29
test/built-ins/TypedArray/prototype/slice/invoked-as-method.js
vendored
Normal file
29
test/built-ins/TypedArray/prototype/slice/invoked-as-method.js
vendored
Normal file
@ -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();
|
||||
});
|
18
test/built-ins/TypedArray/prototype/slice/prop-desc.js
vendored
Normal file
18
test/built-ins/TypedArray/prototype/slice/prop-desc.js
vendored
Normal file
@ -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');
|
28
test/built-ins/TypedArray/prototype/some/invoked-as-func.js
vendored
Normal file
28
test/built-ins/TypedArray/prototype/some/invoked-as-func.js
vendored
Normal file
@ -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();
|
||||
});
|
28
test/built-ins/TypedArray/prototype/some/invoked-as-method.js
vendored
Normal file
28
test/built-ins/TypedArray/prototype/some/invoked-as-method.js
vendored
Normal file
@ -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();
|
||||
});
|
18
test/built-ins/TypedArray/prototype/some/prop-desc.js
vendored
Normal file
18
test/built-ins/TypedArray/prototype/some/prop-desc.js
vendored
Normal file
@ -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');
|
34
test/built-ins/TypedArray/prototype/sort/invoked-as-func.js
vendored
Normal file
34
test/built-ins/TypedArray/prototype/sort/invoked-as-func.js
vendored
Normal file
@ -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();
|
||||
});
|
34
test/built-ins/TypedArray/prototype/sort/invoked-as-method.js
vendored
Normal file
34
test/built-ins/TypedArray/prototype/sort/invoked-as-method.js
vendored
Normal file
@ -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();
|
||||
});
|
18
test/built-ins/TypedArray/prototype/sort/prop-desc.js
vendored
Normal file
18
test/built-ins/TypedArray/prototype/sort/prop-desc.js
vendored
Normal file
@ -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');
|
23
test/built-ins/TypedArray/prototype/subarray/invoked-as-func.js
vendored
Normal file
23
test/built-ins/TypedArray/prototype/subarray/invoked-as-func.js
vendored
Normal file
@ -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();
|
||||
});
|
23
test/built-ins/TypedArray/prototype/subarray/invoked-as-method.js
vendored
Normal file
23
test/built-ins/TypedArray/prototype/subarray/invoked-as-method.js
vendored
Normal file
@ -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();
|
||||
});
|
18
test/built-ins/TypedArray/prototype/subarray/prop-desc.js
vendored
Normal file
18
test/built-ins/TypedArray/prototype/subarray/prop-desc.js
vendored
Normal file
@ -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');
|
30
test/built-ins/TypedArray/prototype/toLocaleString/invoked-as-func.js
vendored
Normal file
30
test/built-ins/TypedArray/prototype/toLocaleString/invoked-as-func.js
vendored
Normal file
@ -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();
|
||||
});
|
30
test/built-ins/TypedArray/prototype/toLocaleString/invoked-as-method.js
vendored
Normal file
30
test/built-ins/TypedArray/prototype/toLocaleString/invoked-as-method.js
vendored
Normal file
@ -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…
x
Reference in New Issue
Block a user