diff --git a/test/built-ins/TypedArrays/Float32Array/BYTES_PER_ELEMENT.js b/test/built-ins/TypedArrays/Float32Array/BYTES_PER_ELEMENT.js new file mode 100755 index 0000000000000000000000000000000000000000..e10e79870f6b7ea8dcaba43c24ac96e7f6f4ee9f --- /dev/null +++ b/test/built-ins/TypedArrays/Float32Array/BYTES_PER_ELEMENT.js @@ -0,0 +1,20 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5.1 +description: > + The initial value of Float32Array.BYTES_PER_ELEMENT is 4. +info: > + The value of TypedArray.BYTES_PER_ELEMENT is the Number value of the + Element Size value specified in Table 49 for TypedArray. + + This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Float32Array.BYTES_PER_ELEMENT, 4); + +verifyNotEnumerable(Float32Array, "BYTES_PER_ELEMENT"); +verifyNotWritable(Float32Array, "BYTES_PER_ELEMENT"); +verifyNotConfigurable(Float32Array, "BYTES_PER_ELEMENT"); diff --git a/test/built-ins/TypedArrays/Float32Array/constructor.js b/test/built-ins/TypedArrays/Float32Array/constructor.js new file mode 100755 index 0000000000000000000000000000000000000000..8bafaf604ad850f7ab9c78e3501c6530c0172990 --- /dev/null +++ b/test/built-ins/TypedArrays/Float32Array/constructor.js @@ -0,0 +1,10 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.4 +description: > + Float32Array is a constructor function. +---*/ + +assert.sameValue(typeof Float32Array, 'function', 'typeof Float32Array is "function"'); diff --git a/test/built-ins/TypedArrays/Float32Array/length.js b/test/built-ins/TypedArrays/Float32Array/length.js new file mode 100755 index 0000000000000000000000000000000000000000..87e51768c7f2ae7675fb771faebf2e02b57c1dac --- /dev/null +++ b/test/built-ins/TypedArrays/Float32Array/length.js @@ -0,0 +1,29 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5 +description: > + Float32Array.length is 3. +info: > + Besides a length property (whose value is 3), [...]. + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, has a length + property whose value is an integer. Unless otherwise specified, this + value is equal to the largest number of named arguments shown in the + subclause headings for the function description, including optional + parameters. However, rest parameters shown using the form “...name†+ are not included in the default argument count. + + Unless otherwise specified, the length property of a built-in Function + object has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Float32Array.length, 3); + +verifyNotEnumerable(Float32Array, "length"); +verifyNotWritable(Float32Array, "length"); +verifyConfigurable(Float32Array, "length"); diff --git a/test/built-ins/TypedArrays/Float32Array/name.js b/test/built-ins/TypedArrays/Float32Array/name.js new file mode 100755 index 0000000000000000000000000000000000000000..9cc98e9ce312651222d0ea329fe0b215bde7e064 --- /dev/null +++ b/test/built-ins/TypedArrays/Float32Array/name.js @@ -0,0 +1,27 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5 +description: > + Float32Array.name is "Float32Array". +info: > + Each TypedArray constructor has a name property whose value is the + String value of the constructor name specified for it in Table 49. + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, that is not + identified as an anonymous function has a name property whose value + is a String. + + 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] +---*/ + +assert.sameValue(Float32Array.name, "Float32Array"); + +verifyNotEnumerable(Float32Array, "name"); +verifyNotWritable(Float32Array, "name"); +verifyConfigurable(Float32Array, "name"); diff --git a/test/built-ins/TypedArrays/Float32Array/proto.js b/test/built-ins/TypedArrays/Float32Array/proto.js new file mode 100755 index 0000000000000000000000000000000000000000..c1ec88e210872047d6cd6fdaed4f90b93d1e831b --- /dev/null +++ b/test/built-ins/TypedArrays/Float32Array/proto.js @@ -0,0 +1,13 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5 +description: > + The prototype of Float32Array is %TypedArray%. +info: > + The value of the [[Prototype]] internal slot of each TypedArray constructor is the %TypedArray% intrinsic object (22.2.1). +includes: [testTypedArray.js] +---*/ + +assert.sameValue(Object.getPrototypeOf(Float32Array), TypedArray); diff --git a/test/built-ins/TypedArrays/Float32Array/prototype.js b/test/built-ins/TypedArrays/Float32Array/prototype.js new file mode 100755 index 0000000000000000000000000000000000000000..d89d5a0832637d34bf844f7e86ead3e95648e9fa --- /dev/null +++ b/test/built-ins/TypedArrays/Float32Array/prototype.js @@ -0,0 +1,19 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5.2 +description: > + The initial value of Float32Array.prototype is the Float32Array prototype object. +info: > + The initial value of TypedArray.prototype is the corresponding TypedArray prototype intrinsic object (22.2.6). + + This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Float32Array.prototype, Object.getPrototypeOf(new Float32Array(0))); + +verifyNotEnumerable(Float32Array, "prototype"); +verifyNotWritable(Float32Array, "prototype"); +verifyNotConfigurable(Float32Array, "prototype"); diff --git a/test/built-ins/TypedArrays/Float32Array/prototype/BYTES_PER_ELEMENT.js b/test/built-ins/TypedArrays/Float32Array/prototype/BYTES_PER_ELEMENT.js new file mode 100755 index 0000000000000000000000000000000000000000..704a81250af8263095904529437e56b361e47cc8 --- /dev/null +++ b/test/built-ins/TypedArrays/Float32Array/prototype/BYTES_PER_ELEMENT.js @@ -0,0 +1,20 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.6.1 +description: > + The initial value of Float32Array.prototype.BYTES_PER_ELEMENT is 4. +info: > + The value of TypedArray.prototype.BYTES_PER_ELEMENT is the Number value + of the Element Size value specified in Table 49 for TypedArray. + + This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Float32Array.prototype.BYTES_PER_ELEMENT, 4); + +verifyNotEnumerable(Float32Array.prototype, "BYTES_PER_ELEMENT"); +verifyNotWritable(Float32Array.prototype, "BYTES_PER_ELEMENT"); +verifyNotConfigurable(Float32Array.prototype, "BYTES_PER_ELEMENT"); diff --git a/test/built-ins/TypedArrays/Float32Array/prototype/constructor.js b/test/built-ins/TypedArrays/Float32Array/prototype/constructor.js new file mode 100755 index 0000000000000000000000000000000000000000..20ae26cbac508261ce1beca09fdf9dd09220fac4 --- /dev/null +++ b/test/built-ins/TypedArrays/Float32Array/prototype/constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.6.2 +description: > + The initial value of Float32Array.prototype.constructor is the Float32Array object. +info: > + The initial value of Float32Array.prototype.constructor is the intrinsic + object %Float32Array%. + + 17 ECMAScript Standard Built-in Objects: + 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] +---*/ + +assert.sameValue(Float32Array.prototype.constructor, Float32Array); + +verifyNotEnumerable(Float32Array.prototype, "constructor"); +verifyWritable(Float32Array.prototype, "constructor"); +verifyConfigurable(Float32Array.prototype, "constructor"); diff --git a/test/built-ins/TypedArrays/Float32Array/prototype/not-typedarray-object.js b/test/built-ins/TypedArrays/Float32Array/prototype/not-typedarray-object.js new file mode 100755 index 0000000000000000000000000000000000000000..040cfdfd9248ba62efce61cb62681cfcb5b69162 --- /dev/null +++ b/test/built-ins/TypedArrays/Float32Array/prototype/not-typedarray-object.js @@ -0,0 +1,16 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.6 +description: > + Float64Array.prototype is not a TypedArray instance object. +info: > + A TypedArray prototype object is an ordinary object. It does not have + a [[ViewedArrayBuffer]] or any other of the internal slots that are + specific to TypedArray instance objects. +---*/ + +assert.throws(TypeError, function() { + Float64Array.prototype.buffer; +}); diff --git a/test/built-ins/TypedArrays/Float32Array/prototype/proto.js b/test/built-ins/TypedArrays/Float32Array/prototype/proto.js new file mode 100755 index 0000000000000000000000000000000000000000..be7aa52fc935ceac1aca07705fe07807bbec4a49 --- /dev/null +++ b/test/built-ins/TypedArrays/Float32Array/prototype/proto.js @@ -0,0 +1,14 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.6 +description: > + The prototype of Float32Array.prototype is %TypedArrayPrototype%. +info: > + The value of the [[Prototype]] internal slot of a TypedArray prototype + object is the intrinsic object %TypedArrayPrototype% (22.2.3). +includes: [testTypedArray.js] +---*/ + +assert.sameValue(Object.getPrototypeOf(Float32Array.prototype), TypedArray.prototype); diff --git a/test/built-ins/TypedArrays/Float32Array/undefined-newtarget.js b/test/built-ins/TypedArrays/Float32Array/undefined-newtarget.js new file mode 100755 index 0000000000000000000000000000000000000000..35478521bedb106f69714ccdb8ffc16093c29589 --- /dev/null +++ b/test/built-ins/TypedArrays/Float32Array/undefined-newtarget.js @@ -0,0 +1,32 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.4.1 +description: > + Throws a TypeError if NewTarget is undefined. +info: > + TypedArray( ... argumentsList) + + 1. If NewTarget is undefined, throw a TypeError exception. +---*/ + +assert.throws(TypeError, function() { + Float32Array(); +}, "Float32Array()"); + +assert.throws(TypeError, function() { + Float32Array(0); +}, "Float32Array(0)"); + +assert.throws(TypeError, function() { + Float32Array(new Float32Array(1)); +}, "Float32Array(float32Array)"); + +assert.throws(TypeError, function() { + Float32Array([]); +}, "Float32Array(array)"); + +assert.throws(TypeError, function() { + Float32Array(new ArrayBuffer(8)); +}, "Float32Array(arrayBuffer)"); diff --git a/test/built-ins/TypedArrays/Float64Array/BYTES_PER_ELEMENT.js b/test/built-ins/TypedArrays/Float64Array/BYTES_PER_ELEMENT.js new file mode 100755 index 0000000000000000000000000000000000000000..c7f757a45ae98ded2c1795dcec9c7020d9044519 --- /dev/null +++ b/test/built-ins/TypedArrays/Float64Array/BYTES_PER_ELEMENT.js @@ -0,0 +1,20 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5.1 +description: > + The initial value of Float64Array.BYTES_PER_ELEMENT is 8. +info: > + The value of TypedArray.BYTES_PER_ELEMENT is the Number value of the + Element Size value specified in Table 49 for TypedArray. + + This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Float64Array.BYTES_PER_ELEMENT, 8); + +verifyNotEnumerable(Float64Array, "BYTES_PER_ELEMENT"); +verifyNotWritable(Float64Array, "BYTES_PER_ELEMENT"); +verifyNotConfigurable(Float64Array, "BYTES_PER_ELEMENT"); diff --git a/test/built-ins/TypedArrays/Float64Array/constructor.js b/test/built-ins/TypedArrays/Float64Array/constructor.js new file mode 100755 index 0000000000000000000000000000000000000000..ffe659ff7082ffdcd56abfaac444408337f9bbfb --- /dev/null +++ b/test/built-ins/TypedArrays/Float64Array/constructor.js @@ -0,0 +1,10 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.4 +description: > + Float64Array is a constructor function. +---*/ + +assert.sameValue(typeof Float64Array, 'function', 'typeof Float64Array is "function"'); diff --git a/test/built-ins/TypedArrays/Float64Array/length.js b/test/built-ins/TypedArrays/Float64Array/length.js new file mode 100755 index 0000000000000000000000000000000000000000..8d4cf37fc209f90afff096234c81ab2949470d27 --- /dev/null +++ b/test/built-ins/TypedArrays/Float64Array/length.js @@ -0,0 +1,29 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5 +description: > + Float64Array.length is 3. +info: > + Besides a length property (whose value is 3), [...]. + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, has a length + property whose value is an integer. Unless otherwise specified, this + value is equal to the largest number of named arguments shown in the + subclause headings for the function description, including optional + parameters. However, rest parameters shown using the form “...name†+ are not included in the default argument count. + + Unless otherwise specified, the length property of a built-in Function + object has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Float64Array.length, 3); + +verifyNotEnumerable(Float64Array, "length"); +verifyNotWritable(Float64Array, "length"); +verifyConfigurable(Float64Array, "length"); diff --git a/test/built-ins/TypedArrays/Float64Array/name.js b/test/built-ins/TypedArrays/Float64Array/name.js new file mode 100755 index 0000000000000000000000000000000000000000..1b26bf941fbc224e139b74957d612e5a1a4b0524 --- /dev/null +++ b/test/built-ins/TypedArrays/Float64Array/name.js @@ -0,0 +1,27 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5 +description: > + Float64Array.name is "Float64Array". +info: > + Each TypedArray constructor has a name property whose value is the + String value of the constructor name specified for it in Table 49. + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, that is not + identified as an anonymous function has a name property whose value + is a String. + + 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] +---*/ + +assert.sameValue(Float64Array.name, "Float64Array"); + +verifyNotEnumerable(Float64Array, "name"); +verifyNotWritable(Float64Array, "name"); +verifyConfigurable(Float64Array, "name"); diff --git a/test/built-ins/TypedArrays/Float64Array/proto.js b/test/built-ins/TypedArrays/Float64Array/proto.js new file mode 100755 index 0000000000000000000000000000000000000000..1593f7b46060d0bd6bca46b110658193865e174e --- /dev/null +++ b/test/built-ins/TypedArrays/Float64Array/proto.js @@ -0,0 +1,13 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5 +description: > + The prototype of Float64Array is %TypedArray%. +info: > + The value of the [[Prototype]] internal slot of each TypedArray constructor is the %TypedArray% intrinsic object (22.2.1). +includes: [testTypedArray.js] +---*/ + +assert.sameValue(Object.getPrototypeOf(Float64Array), TypedArray); diff --git a/test/built-ins/TypedArrays/Float64Array/prototype.js b/test/built-ins/TypedArrays/Float64Array/prototype.js new file mode 100755 index 0000000000000000000000000000000000000000..6a4fc7d46bfc846984c795202365a9bff9d80f2d --- /dev/null +++ b/test/built-ins/TypedArrays/Float64Array/prototype.js @@ -0,0 +1,19 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5.2 +description: > + The initial value of Float64Array.prototype is the Float64Array prototype object. +info: > + The initial value of TypedArray.prototype is the corresponding TypedArray prototype intrinsic object (22.2.6). + + This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Float64Array.prototype, Object.getPrototypeOf(new Float64Array(0))); + +verifyNotEnumerable(Float64Array, "prototype"); +verifyNotWritable(Float64Array, "prototype"); +verifyNotConfigurable(Float64Array, "prototype"); diff --git a/test/built-ins/TypedArrays/Float64Array/prototype/BYTES_PER_ELEMENT.js b/test/built-ins/TypedArrays/Float64Array/prototype/BYTES_PER_ELEMENT.js new file mode 100755 index 0000000000000000000000000000000000000000..00200772b20d0590300a4651828ae180e039f71c --- /dev/null +++ b/test/built-ins/TypedArrays/Float64Array/prototype/BYTES_PER_ELEMENT.js @@ -0,0 +1,20 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.6.1 +description: > + The initial value of Float64Array.prototype.BYTES_PER_ELEMENT is 8. +info: > + The value of TypedArray.prototype.BYTES_PER_ELEMENT is the Number value + of the Element Size value specified in Table 49 for TypedArray. + + This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Float64Array.prototype.BYTES_PER_ELEMENT, 8); + +verifyNotEnumerable(Float64Array.prototype, "BYTES_PER_ELEMENT"); +verifyNotWritable(Float64Array.prototype, "BYTES_PER_ELEMENT"); +verifyNotConfigurable(Float64Array.prototype, "BYTES_PER_ELEMENT"); diff --git a/test/built-ins/TypedArrays/Float64Array/prototype/constructor.js b/test/built-ins/TypedArrays/Float64Array/prototype/constructor.js new file mode 100755 index 0000000000000000000000000000000000000000..1b7f70d84c0313ee459d25a4b4493d2e6aaf0477 --- /dev/null +++ b/test/built-ins/TypedArrays/Float64Array/prototype/constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.6.2 +description: > + The initial value of Float64Array.prototype.constructor is the Float64Array object. +info: > + The initial value of Float64Array.prototype.constructor is the intrinsic + object %Float64Array%. + + 17 ECMAScript Standard Built-in Objects: + 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] +---*/ + +assert.sameValue(Float64Array.prototype.constructor, Float64Array); + +verifyNotEnumerable(Float64Array.prototype, "constructor"); +verifyWritable(Float64Array.prototype, "constructor"); +verifyConfigurable(Float64Array.prototype, "constructor"); diff --git a/test/built-ins/TypedArrays/Float64Array/prototype/not-typedarray-object.js b/test/built-ins/TypedArrays/Float64Array/prototype/not-typedarray-object.js new file mode 100755 index 0000000000000000000000000000000000000000..040cfdfd9248ba62efce61cb62681cfcb5b69162 --- /dev/null +++ b/test/built-ins/TypedArrays/Float64Array/prototype/not-typedarray-object.js @@ -0,0 +1,16 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.6 +description: > + Float64Array.prototype is not a TypedArray instance object. +info: > + A TypedArray prototype object is an ordinary object. It does not have + a [[ViewedArrayBuffer]] or any other of the internal slots that are + specific to TypedArray instance objects. +---*/ + +assert.throws(TypeError, function() { + Float64Array.prototype.buffer; +}); diff --git a/test/built-ins/TypedArrays/Float64Array/prototype/proto.js b/test/built-ins/TypedArrays/Float64Array/prototype/proto.js new file mode 100755 index 0000000000000000000000000000000000000000..8723c653e48c1bf665d490e712a03e469f45a502 --- /dev/null +++ b/test/built-ins/TypedArrays/Float64Array/prototype/proto.js @@ -0,0 +1,14 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.6 +description: > + The prototype of Float64Array.prototype is %TypedArrayPrototype%. +info: > + The value of the [[Prototype]] internal slot of a TypedArray prototype + object is the intrinsic object %TypedArrayPrototype% (22.2.3). +includes: [testTypedArray.js] +---*/ + +assert.sameValue(Object.getPrototypeOf(Float64Array.prototype), TypedArray.prototype); diff --git a/test/built-ins/TypedArrays/Float64Array/undefined-newtarget.js b/test/built-ins/TypedArrays/Float64Array/undefined-newtarget.js new file mode 100755 index 0000000000000000000000000000000000000000..32ed0fb33b69a9dfa2bbcbeca330de3894c631ae --- /dev/null +++ b/test/built-ins/TypedArrays/Float64Array/undefined-newtarget.js @@ -0,0 +1,32 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.4.1 +description: > + Throws a TypeError if NewTarget is undefined. +info: > + TypedArray( ... argumentsList) + + 1. If NewTarget is undefined, throw a TypeError exception. +---*/ + +assert.throws(TypeError, function() { + Float64Array(); +}, "Float64Array()"); + +assert.throws(TypeError, function() { + Float64Array(0); +}, "Float64Array(0)"); + +assert.throws(TypeError, function() { + Float64Array(new Float64Array(1)); +}, "Float64Array(float64Array)"); + +assert.throws(TypeError, function() { + Float64Array([]); +}, "Float64Array(array)"); + +assert.throws(TypeError, function() { + Float64Array(new ArrayBuffer(8)); +}, "Float64Array(arrayBuffer)"); diff --git a/test/built-ins/TypedArrays/Int16Array/BYTES_PER_ELEMENT.js b/test/built-ins/TypedArrays/Int16Array/BYTES_PER_ELEMENT.js new file mode 100755 index 0000000000000000000000000000000000000000..9968e7e035380bb0a2a87af218c32cdc13b0448d --- /dev/null +++ b/test/built-ins/TypedArrays/Int16Array/BYTES_PER_ELEMENT.js @@ -0,0 +1,20 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5.1 +description: > + The initial value of Int16Array.BYTES_PER_ELEMENT is 2. +info: > + The value of TypedArray.BYTES_PER_ELEMENT is the Number value of the + Element Size value specified in Table 49 for TypedArray. + + This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Int16Array.BYTES_PER_ELEMENT, 2); + +verifyNotEnumerable(Int16Array, "BYTES_PER_ELEMENT"); +verifyNotWritable(Int16Array, "BYTES_PER_ELEMENT"); +verifyNotConfigurable(Int16Array, "BYTES_PER_ELEMENT"); diff --git a/test/built-ins/TypedArrays/Int16Array/constructor.js b/test/built-ins/TypedArrays/Int16Array/constructor.js new file mode 100755 index 0000000000000000000000000000000000000000..d87ba38233c68a9e8c2907672603ca75598ad43a --- /dev/null +++ b/test/built-ins/TypedArrays/Int16Array/constructor.js @@ -0,0 +1,10 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.4 +description: > + Int16Array is a constructor function. +---*/ + +assert.sameValue(typeof Int16Array, 'function', 'typeof Int16Array is "function"'); diff --git a/test/built-ins/TypedArrays/Int16Array/length.js b/test/built-ins/TypedArrays/Int16Array/length.js new file mode 100755 index 0000000000000000000000000000000000000000..6d0286c869cc3d38b3068a8340d65fd4a45afed5 --- /dev/null +++ b/test/built-ins/TypedArrays/Int16Array/length.js @@ -0,0 +1,29 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5 +description: > + Int16Array.length is 3. +info: > + Besides a length property (whose value is 3), [...]. + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, has a length + property whose value is an integer. Unless otherwise specified, this + value is equal to the largest number of named arguments shown in the + subclause headings for the function description, including optional + parameters. However, rest parameters shown using the form “...name†+ are not included in the default argument count. + + Unless otherwise specified, the length property of a built-in Function + object has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Int16Array.length, 3); + +verifyNotEnumerable(Int16Array, "length"); +verifyNotWritable(Int16Array, "length"); +verifyConfigurable(Int16Array, "length"); diff --git a/test/built-ins/TypedArrays/Int16Array/name.js b/test/built-ins/TypedArrays/Int16Array/name.js new file mode 100755 index 0000000000000000000000000000000000000000..a5ff20f99f3fb6094eb58efbb5960d3844377f3a --- /dev/null +++ b/test/built-ins/TypedArrays/Int16Array/name.js @@ -0,0 +1,27 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5 +description: > + Int16Array.name is "Int16Array". +info: > + Each TypedArray constructor has a name property whose value is the + String value of the constructor name specified for it in Table 49. + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, that is not + identified as an anonymous function has a name property whose value + is a String. + + 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] +---*/ + +assert.sameValue(Int16Array.name, "Int16Array"); + +verifyNotEnumerable(Int16Array, "name"); +verifyNotWritable(Int16Array, "name"); +verifyConfigurable(Int16Array, "name"); diff --git a/test/built-ins/TypedArrays/Int16Array/proto.js b/test/built-ins/TypedArrays/Int16Array/proto.js new file mode 100755 index 0000000000000000000000000000000000000000..d1fa53bbc8ac9c6293f2be60c5077333e7021c8a --- /dev/null +++ b/test/built-ins/TypedArrays/Int16Array/proto.js @@ -0,0 +1,13 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5 +description: > + The prototype of Int16Array is %TypedArray%. +info: > + The value of the [[Prototype]] internal slot of each TypedArray constructor is the %TypedArray% intrinsic object (22.2.1). +includes: [testTypedArray.js] +---*/ + +assert.sameValue(Object.getPrototypeOf(Int16Array), TypedArray); diff --git a/test/built-ins/TypedArrays/Int16Array/prototype.js b/test/built-ins/TypedArrays/Int16Array/prototype.js new file mode 100755 index 0000000000000000000000000000000000000000..0ef409d14e94b92e7b33805ebb74c7176238e17b --- /dev/null +++ b/test/built-ins/TypedArrays/Int16Array/prototype.js @@ -0,0 +1,19 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5.2 +description: > + The initial value of Int16Array.prototype is the Int16Array prototype object. +info: > + The initial value of TypedArray.prototype is the corresponding TypedArray prototype intrinsic object (22.2.6). + + This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Int16Array.prototype, Object.getPrototypeOf(new Int16Array(0))); + +verifyNotEnumerable(Int16Array, "prototype"); +verifyNotWritable(Int16Array, "prototype"); +verifyNotConfigurable(Int16Array, "prototype"); diff --git a/test/built-ins/TypedArrays/Int16Array/prototype/BYTES_PER_ELEMENT.js b/test/built-ins/TypedArrays/Int16Array/prototype/BYTES_PER_ELEMENT.js new file mode 100755 index 0000000000000000000000000000000000000000..d16dbb254684a7aa3f67655bda72c10c8da4de9e --- /dev/null +++ b/test/built-ins/TypedArrays/Int16Array/prototype/BYTES_PER_ELEMENT.js @@ -0,0 +1,20 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.6.1 +description: > + The initial value of Int16Array.prototype.BYTES_PER_ELEMENT is 2. +info: > + The value of TypedArray.prototype.BYTES_PER_ELEMENT is the Number value + of the Element Size value specified in Table 49 for TypedArray. + + This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Int16Array.prototype.BYTES_PER_ELEMENT, 2); + +verifyNotEnumerable(Int16Array.prototype, "BYTES_PER_ELEMENT"); +verifyNotWritable(Int16Array.prototype, "BYTES_PER_ELEMENT"); +verifyNotConfigurable(Int16Array.prototype, "BYTES_PER_ELEMENT"); diff --git a/test/built-ins/TypedArrays/Int16Array/prototype/constructor.js b/test/built-ins/TypedArrays/Int16Array/prototype/constructor.js new file mode 100755 index 0000000000000000000000000000000000000000..e1a40604c3264cca6f80f6dd1024593d71415b77 --- /dev/null +++ b/test/built-ins/TypedArrays/Int16Array/prototype/constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.6.2 +description: > + The initial value of Int16Array.prototype.constructor is the Int16Array object. +info: > + The initial value of Int16Array.prototype.constructor is the intrinsic + object %Int16Array%. + + 17 ECMAScript Standard Built-in Objects: + 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] +---*/ + +assert.sameValue(Int16Array.prototype.constructor, Int16Array); + +verifyNotEnumerable(Int16Array.prototype, "constructor"); +verifyWritable(Int16Array.prototype, "constructor"); +verifyConfigurable(Int16Array.prototype, "constructor"); diff --git a/test/built-ins/TypedArrays/Int16Array/prototype/not-typedarray-object.js b/test/built-ins/TypedArrays/Int16Array/prototype/not-typedarray-object.js new file mode 100755 index 0000000000000000000000000000000000000000..b277f1a3ac40397a729d08e43c8483e73527571c --- /dev/null +++ b/test/built-ins/TypedArrays/Int16Array/prototype/not-typedarray-object.js @@ -0,0 +1,16 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.6 +description: > + Int16Array.prototype is not a TypedArray instance object. +info: > + A TypedArray prototype object is an ordinary object. It does not have + a [[ViewedArrayBuffer]] or any other of the internal slots that are + specific to TypedArray instance objects. +---*/ + +assert.throws(TypeError, function() { + Int16Array.prototype.buffer; +}); diff --git a/test/built-ins/TypedArrays/Int16Array/prototype/proto.js b/test/built-ins/TypedArrays/Int16Array/prototype/proto.js new file mode 100755 index 0000000000000000000000000000000000000000..6062dc8a50b7362246e3faa8627313476f20175e --- /dev/null +++ b/test/built-ins/TypedArrays/Int16Array/prototype/proto.js @@ -0,0 +1,14 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.6 +description: > + The prototype of Int16Array.prototype is %TypedArrayPrototype%. +info: > + The value of the [[Prototype]] internal slot of a TypedArray prototype + object is the intrinsic object %TypedArrayPrototype% (22.2.3). +includes: [testTypedArray.js] +---*/ + +assert.sameValue(Object.getPrototypeOf(Int16Array.prototype), TypedArray.prototype); diff --git a/test/built-ins/TypedArrays/Int16Array/undefined-newtarget.js b/test/built-ins/TypedArrays/Int16Array/undefined-newtarget.js new file mode 100755 index 0000000000000000000000000000000000000000..664fc5ba0a52b5336101288d285704edbc01a69f --- /dev/null +++ b/test/built-ins/TypedArrays/Int16Array/undefined-newtarget.js @@ -0,0 +1,32 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.4.1 +description: > + Throws a TypeError if NewTarget is undefined. +info: > + TypedArray( ... argumentsList) + + 1. If NewTarget is undefined, throw a TypeError exception. +---*/ + +assert.throws(TypeError, function() { + Int16Array(); +}, "Int16Array()"); + +assert.throws(TypeError, function() { + Int16Array(0); +}, "Int16Array(0)"); + +assert.throws(TypeError, function() { + Int16Array(new Int16Array(1)); +}, "Int16Array(int16Array)"); + +assert.throws(TypeError, function() { + Int16Array([]); +}, "Int16Array(array)"); + +assert.throws(TypeError, function() { + Int16Array(new ArrayBuffer(8)); +}, "Int16Array(arrayBuffer)"); diff --git a/test/built-ins/TypedArrays/Int32Array/BYTES_PER_ELEMENT.js b/test/built-ins/TypedArrays/Int32Array/BYTES_PER_ELEMENT.js new file mode 100755 index 0000000000000000000000000000000000000000..b7d62cce6aeeee0571f240475006f39d7db8b09d --- /dev/null +++ b/test/built-ins/TypedArrays/Int32Array/BYTES_PER_ELEMENT.js @@ -0,0 +1,20 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5.1 +description: > + The initial value of Int32Array.BYTES_PER_ELEMENT is 4. +info: > + The value of TypedArray.BYTES_PER_ELEMENT is the Number value of the + Element Size value specified in Table 49 for TypedArray. + + This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Int32Array.BYTES_PER_ELEMENT, 4); + +verifyNotEnumerable(Int32Array, "BYTES_PER_ELEMENT"); +verifyNotWritable(Int32Array, "BYTES_PER_ELEMENT"); +verifyNotConfigurable(Int32Array, "BYTES_PER_ELEMENT"); diff --git a/test/built-ins/TypedArrays/Int32Array/constructor.js b/test/built-ins/TypedArrays/Int32Array/constructor.js new file mode 100755 index 0000000000000000000000000000000000000000..0ecfe5a2c1452122c2b3fd3f24a3e20a2fe29606 --- /dev/null +++ b/test/built-ins/TypedArrays/Int32Array/constructor.js @@ -0,0 +1,10 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.4 +description: > + Int32Array is a constructor function. +---*/ + +assert.sameValue(typeof Int32Array, 'function', 'typeof Int32Array is "function"'); diff --git a/test/built-ins/TypedArrays/Int32Array/length.js b/test/built-ins/TypedArrays/Int32Array/length.js new file mode 100755 index 0000000000000000000000000000000000000000..c7aa8177cc572b853fb5b0a57039c4fbd0816a42 --- /dev/null +++ b/test/built-ins/TypedArrays/Int32Array/length.js @@ -0,0 +1,29 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5 +description: > + Int32Array.length is 3. +info: > + Besides a length property (whose value is 3), [...]. + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, has a length + property whose value is an integer. Unless otherwise specified, this + value is equal to the largest number of named arguments shown in the + subclause headings for the function description, including optional + parameters. However, rest parameters shown using the form “...name†+ are not included in the default argument count. + + Unless otherwise specified, the length property of a built-in Function + object has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Int32Array.length, 3); + +verifyNotEnumerable(Int32Array, "length"); +verifyNotWritable(Int32Array, "length"); +verifyConfigurable(Int32Array, "length"); diff --git a/test/built-ins/TypedArrays/Int32Array/name.js b/test/built-ins/TypedArrays/Int32Array/name.js new file mode 100755 index 0000000000000000000000000000000000000000..04ed0815641d7a5818cf4b8566eb550e88e1fdd0 --- /dev/null +++ b/test/built-ins/TypedArrays/Int32Array/name.js @@ -0,0 +1,27 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5 +description: > + Int32Array.name is "Int32Array". +info: > + Each TypedArray constructor has a name property whose value is the + String value of the constructor name specified for it in Table 49. + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, that is not + identified as an anonymous function has a name property whose value + is a String. + + 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] +---*/ + +assert.sameValue(Int32Array.name, "Int32Array"); + +verifyNotEnumerable(Int32Array, "name"); +verifyNotWritable(Int32Array, "name"); +verifyConfigurable(Int32Array, "name"); diff --git a/test/built-ins/TypedArrays/Int32Array/proto.js b/test/built-ins/TypedArrays/Int32Array/proto.js new file mode 100755 index 0000000000000000000000000000000000000000..7c66d3dfcd8a098f1027e15f34f737b01dcfdd7c --- /dev/null +++ b/test/built-ins/TypedArrays/Int32Array/proto.js @@ -0,0 +1,13 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5 +description: > + The prototype of Int32Array is %TypedArray%. +info: > + The value of the [[Prototype]] internal slot of each TypedArray constructor is the %TypedArray% intrinsic object (22.2.1). +includes: [testTypedArray.js] +---*/ + +assert.sameValue(Object.getPrototypeOf(Int32Array), TypedArray); diff --git a/test/built-ins/TypedArrays/Int32Array/prototype.js b/test/built-ins/TypedArrays/Int32Array/prototype.js new file mode 100755 index 0000000000000000000000000000000000000000..3fffdbf165e82c202618737d468451607d4bbea9 --- /dev/null +++ b/test/built-ins/TypedArrays/Int32Array/prototype.js @@ -0,0 +1,19 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5.2 +description: > + The initial value of Int32Array.prototype is the Int32Array prototype object. +info: > + The initial value of TypedArray.prototype is the corresponding TypedArray prototype intrinsic object (22.2.6). + + This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Int32Array.prototype, Object.getPrototypeOf(new Int32Array(0))); + +verifyNotEnumerable(Int32Array, "prototype"); +verifyNotWritable(Int32Array, "prototype"); +verifyNotConfigurable(Int32Array, "prototype"); diff --git a/test/built-ins/TypedArrays/Int32Array/prototype/BYTES_PER_ELEMENT.js b/test/built-ins/TypedArrays/Int32Array/prototype/BYTES_PER_ELEMENT.js new file mode 100755 index 0000000000000000000000000000000000000000..7cf54d8bfb6c6e0fc00f191792cf74784a64debd --- /dev/null +++ b/test/built-ins/TypedArrays/Int32Array/prototype/BYTES_PER_ELEMENT.js @@ -0,0 +1,20 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.6.1 +description: > + The initial value of Int32Array.prototype.BYTES_PER_ELEMENT is 4. +info: > + The value of TypedArray.prototype.BYTES_PER_ELEMENT is the Number value + of the Element Size value specified in Table 49 for TypedArray. + + This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Int32Array.prototype.BYTES_PER_ELEMENT, 4); + +verifyNotEnumerable(Int32Array.prototype, "BYTES_PER_ELEMENT"); +verifyNotWritable(Int32Array.prototype, "BYTES_PER_ELEMENT"); +verifyNotConfigurable(Int32Array.prototype, "BYTES_PER_ELEMENT"); diff --git a/test/built-ins/TypedArrays/Int32Array/prototype/constructor.js b/test/built-ins/TypedArrays/Int32Array/prototype/constructor.js new file mode 100755 index 0000000000000000000000000000000000000000..fe8fd8fbf66ed8c73d1e376975412523c2561aaa --- /dev/null +++ b/test/built-ins/TypedArrays/Int32Array/prototype/constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.6.2 +description: > + The initial value of Int32Array.prototype.constructor is the Int32Array object. +info: > + The initial value of Int32Array.prototype.constructor is the intrinsic + object %Int32Array%. + + 17 ECMAScript Standard Built-in Objects: + 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] +---*/ + +assert.sameValue(Int32Array.prototype.constructor, Int32Array); + +verifyNotEnumerable(Int32Array.prototype, "constructor"); +verifyWritable(Int32Array.prototype, "constructor"); +verifyConfigurable(Int32Array.prototype, "constructor"); diff --git a/test/built-ins/TypedArrays/Int32Array/prototype/not-typedarray-object.js b/test/built-ins/TypedArrays/Int32Array/prototype/not-typedarray-object.js new file mode 100755 index 0000000000000000000000000000000000000000..0fd9b8948405d0eb09c62fc8adbd550a18b9762f --- /dev/null +++ b/test/built-ins/TypedArrays/Int32Array/prototype/not-typedarray-object.js @@ -0,0 +1,16 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.6 +description: > + Int32Array.prototype is not a TypedArray instance object. +info: > + A TypedArray prototype object is an ordinary object. It does not have + a [[ViewedArrayBuffer]] or any other of the internal slots that are + specific to TypedArray instance objects. +---*/ + +assert.throws(TypeError, function() { + Int32Array.prototype.buffer; +}); diff --git a/test/built-ins/TypedArrays/Int32Array/prototype/proto.js b/test/built-ins/TypedArrays/Int32Array/prototype/proto.js new file mode 100755 index 0000000000000000000000000000000000000000..5a08b728210afccb05dd5b761b137687826cf16c --- /dev/null +++ b/test/built-ins/TypedArrays/Int32Array/prototype/proto.js @@ -0,0 +1,14 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.6 +description: > + The prototype of Int32Array.prototype is %TypedArrayPrototype%. +info: > + The value of the [[Prototype]] internal slot of a TypedArray prototype + object is the intrinsic object %TypedArrayPrototype% (22.2.3). +includes: [testTypedArray.js] +---*/ + +assert.sameValue(Object.getPrototypeOf(Int32Array.prototype), TypedArray.prototype); diff --git a/test/built-ins/TypedArrays/Int32Array/undefined-newtarget.js b/test/built-ins/TypedArrays/Int32Array/undefined-newtarget.js new file mode 100755 index 0000000000000000000000000000000000000000..6f42e423c479479fd638c1b5b304ca63e1ecf650 --- /dev/null +++ b/test/built-ins/TypedArrays/Int32Array/undefined-newtarget.js @@ -0,0 +1,32 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.4.1 +description: > + Throws a TypeError if NewTarget is undefined. +info: > + TypedArray( ... argumentsList) + + 1. If NewTarget is undefined, throw a TypeError exception. +---*/ + +assert.throws(TypeError, function() { + Int32Array(); +}, "Int32Array()"); + +assert.throws(TypeError, function() { + Int32Array(0); +}, "Int32Array(0)"); + +assert.throws(TypeError, function() { + Int32Array(new Int32Array(1)); +}, "Int32Array(int32Array)"); + +assert.throws(TypeError, function() { + Int32Array([]); +}, "Int32Array(array)"); + +assert.throws(TypeError, function() { + Int32Array(new ArrayBuffer(8)); +}, "Int32Array(arrayBuffer)"); diff --git a/test/built-ins/TypedArrays/Int8Array/BYTES_PER_ELEMENT.js b/test/built-ins/TypedArrays/Int8Array/BYTES_PER_ELEMENT.js new file mode 100755 index 0000000000000000000000000000000000000000..ead0674eaa7101f5ce8bbf6e2e9928d9c3370d82 --- /dev/null +++ b/test/built-ins/TypedArrays/Int8Array/BYTES_PER_ELEMENT.js @@ -0,0 +1,20 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5.1 +description: > + The initial value of Int8Array.BYTES_PER_ELEMENT is 1. +info: > + The value of TypedArray.BYTES_PER_ELEMENT is the Number value of the + Element Size value specified in Table 49 for TypedArray. + + This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Int8Array.BYTES_PER_ELEMENT, 1); + +verifyNotEnumerable(Int8Array, "BYTES_PER_ELEMENT"); +verifyNotWritable(Int8Array, "BYTES_PER_ELEMENT"); +verifyNotConfigurable(Int8Array, "BYTES_PER_ELEMENT"); diff --git a/test/built-ins/TypedArrays/Int8Array/constructor.js b/test/built-ins/TypedArrays/Int8Array/constructor.js new file mode 100755 index 0000000000000000000000000000000000000000..7dd8e916d39bfc105fd19622be09b6feed29a236 --- /dev/null +++ b/test/built-ins/TypedArrays/Int8Array/constructor.js @@ -0,0 +1,10 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.4 +description: > + Int8Array is a constructor function. +---*/ + +assert.sameValue(typeof Int8Array, 'function', 'typeof Int8Array is "function"'); diff --git a/test/built-ins/TypedArrays/Int8Array/length.js b/test/built-ins/TypedArrays/Int8Array/length.js new file mode 100755 index 0000000000000000000000000000000000000000..042071baf73074cb86983557a47ed31ab32991e7 --- /dev/null +++ b/test/built-ins/TypedArrays/Int8Array/length.js @@ -0,0 +1,29 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5 +description: > + Int8Array.length is 3. +info: > + Besides a length property (whose value is 3), [...]. + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, has a length + property whose value is an integer. Unless otherwise specified, this + value is equal to the largest number of named arguments shown in the + subclause headings for the function description, including optional + parameters. However, rest parameters shown using the form “...name†+ are not included in the default argument count. + + Unless otherwise specified, the length property of a built-in Function + object has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Int8Array.length, 3); + +verifyNotEnumerable(Int8Array, "length"); +verifyNotWritable(Int8Array, "length"); +verifyConfigurable(Int8Array, "length"); diff --git a/test/built-ins/TypedArrays/Int8Array/name.js b/test/built-ins/TypedArrays/Int8Array/name.js new file mode 100755 index 0000000000000000000000000000000000000000..f6f06b97c3d15b026f4a1b195411fa819d7f3cd0 --- /dev/null +++ b/test/built-ins/TypedArrays/Int8Array/name.js @@ -0,0 +1,27 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5 +description: > + Int8Array.name is "Int8Array". +info: > + Each TypedArray constructor has a name property whose value is the + String value of the constructor name specified for it in Table 49. + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, that is not + identified as an anonymous function has a name property whose value + is a String. + + 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] +---*/ + +assert.sameValue(Int8Array.name, "Int8Array"); + +verifyNotEnumerable(Int8Array, "name"); +verifyNotWritable(Int8Array, "name"); +verifyConfigurable(Int8Array, "name"); diff --git a/test/built-ins/TypedArrays/Int8Array/proto.js b/test/built-ins/TypedArrays/Int8Array/proto.js new file mode 100755 index 0000000000000000000000000000000000000000..d9a6b7445521657073bda81ff4c21f76b75a8b78 --- /dev/null +++ b/test/built-ins/TypedArrays/Int8Array/proto.js @@ -0,0 +1,13 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5 +description: > + The prototype of Int8Array is %TypedArray%. +info: > + The value of the [[Prototype]] internal slot of each TypedArray constructor is the %TypedArray% intrinsic object (22.2.1). +includes: [testTypedArray.js] +---*/ + +assert.sameValue(Object.getPrototypeOf(Int8Array), TypedArray); diff --git a/test/built-ins/TypedArrays/Int8Array/prototype.js b/test/built-ins/TypedArrays/Int8Array/prototype.js new file mode 100755 index 0000000000000000000000000000000000000000..776d23e5b4de22072f519669cb95fb77d8d49c98 --- /dev/null +++ b/test/built-ins/TypedArrays/Int8Array/prototype.js @@ -0,0 +1,19 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5.2 +description: > + The initial value of Int8Array.prototype is the Int8Array prototype object. +info: > + The initial value of TypedArray.prototype is the corresponding TypedArray prototype intrinsic object (22.2.6). + + This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Int8Array.prototype, Object.getPrototypeOf(new Int8Array(0))); + +verifyNotEnumerable(Int8Array, "prototype"); +verifyNotWritable(Int8Array, "prototype"); +verifyNotConfigurable(Int8Array, "prototype"); diff --git a/test/built-ins/TypedArrays/Int8Array/prototype/BYTES_PER_ELEMENT.js b/test/built-ins/TypedArrays/Int8Array/prototype/BYTES_PER_ELEMENT.js new file mode 100755 index 0000000000000000000000000000000000000000..7ea04b4dc7cca131df9c8b5f7a4b2bbf23b20ea5 --- /dev/null +++ b/test/built-ins/TypedArrays/Int8Array/prototype/BYTES_PER_ELEMENT.js @@ -0,0 +1,20 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.6.1 +description: > + The initial value of Int8Array.prototype.BYTES_PER_ELEMENT is 1. +info: > + The value of TypedArray.prototype.BYTES_PER_ELEMENT is the Number value + of the Element Size value specified in Table 49 for TypedArray. + + This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Int8Array.prototype.BYTES_PER_ELEMENT, 1); + +verifyNotEnumerable(Int8Array.prototype, "BYTES_PER_ELEMENT"); +verifyNotWritable(Int8Array.prototype, "BYTES_PER_ELEMENT"); +verifyNotConfigurable(Int8Array.prototype, "BYTES_PER_ELEMENT"); diff --git a/test/built-ins/TypedArrays/Int8Array/prototype/constructor.js b/test/built-ins/TypedArrays/Int8Array/prototype/constructor.js new file mode 100755 index 0000000000000000000000000000000000000000..3eff21994160c10f2a8077fe9314b414b55a2cbd --- /dev/null +++ b/test/built-ins/TypedArrays/Int8Array/prototype/constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.6.2 +description: > + The initial value of Int8Array.prototype.constructor is the Int8Array object. +info: > + The initial value of Int8Array.prototype.constructor is the intrinsic + object %Int8Array%. + + 17 ECMAScript Standard Built-in Objects: + 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] +---*/ + +assert.sameValue(Int8Array.prototype.constructor, Int8Array); + +verifyNotEnumerable(Int8Array.prototype, "constructor"); +verifyWritable(Int8Array.prototype, "constructor"); +verifyConfigurable(Int8Array.prototype, "constructor"); diff --git a/test/built-ins/TypedArrays/Int8Array/prototype/not-typedarray-object.js b/test/built-ins/TypedArrays/Int8Array/prototype/not-typedarray-object.js new file mode 100755 index 0000000000000000000000000000000000000000..263b4115b5c8615754934936bb0f4331e5e0f3ae --- /dev/null +++ b/test/built-ins/TypedArrays/Int8Array/prototype/not-typedarray-object.js @@ -0,0 +1,16 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.6 +description: > + Int8Array.prototype is not a TypedArray instance object. +info: > + A TypedArray prototype object is an ordinary object. It does not have + a [[ViewedArrayBuffer]] or any other of the internal slots that are + specific to TypedArray instance objects. +---*/ + +assert.throws(TypeError, function() { + Int8Array.prototype.buffer; +}); diff --git a/test/built-ins/TypedArrays/Int8Array/prototype/proto.js b/test/built-ins/TypedArrays/Int8Array/prototype/proto.js new file mode 100755 index 0000000000000000000000000000000000000000..c65de67f186fd719ef66595d8284e51ba26b5da9 --- /dev/null +++ b/test/built-ins/TypedArrays/Int8Array/prototype/proto.js @@ -0,0 +1,14 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.6 +description: > + The prototype of Int8Array.prototype is %TypedArrayPrototype%. +info: > + The value of the [[Prototype]] internal slot of a TypedArray prototype + object is the intrinsic object %TypedArrayPrototype% (22.2.3). +includes: [testTypedArray.js] +---*/ + +assert.sameValue(Object.getPrototypeOf(Int8Array.prototype), TypedArray.prototype); diff --git a/test/built-ins/TypedArrays/Int8Array/undefined-newtarget.js b/test/built-ins/TypedArrays/Int8Array/undefined-newtarget.js new file mode 100755 index 0000000000000000000000000000000000000000..4a3f8dc17e14dc86322776b6153f81246935ba13 --- /dev/null +++ b/test/built-ins/TypedArrays/Int8Array/undefined-newtarget.js @@ -0,0 +1,32 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.4.1 +description: > + Throws a TypeError if NewTarget is undefined. +info: > + TypedArray( ... argumentsList) + + 1. If NewTarget is undefined, throw a TypeError exception. +---*/ + +assert.throws(TypeError, function() { + Int8Array(); +}, "Int8Array()"); + +assert.throws(TypeError, function() { + Int8Array(0); +}, "Int8Array(0)"); + +assert.throws(TypeError, function() { + Int8Array(new Int8Array(1)); +}, "Int8Array(int8Array)"); + +assert.throws(TypeError, function() { + Int8Array([]); +}, "Int8Array(array)"); + +assert.throws(TypeError, function() { + Int8Array(new ArrayBuffer(8)); +}, "Int8Array(arrayBuffer)"); diff --git a/test/built-ins/TypedArrays/Uint16Array/BYTES_PER_ELEMENT.js b/test/built-ins/TypedArrays/Uint16Array/BYTES_PER_ELEMENT.js new file mode 100755 index 0000000000000000000000000000000000000000..1a5205892525b503355f1e92f9a2da76c4847af4 --- /dev/null +++ b/test/built-ins/TypedArrays/Uint16Array/BYTES_PER_ELEMENT.js @@ -0,0 +1,20 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5.1 +description: > + The initial value of Uint16Array.BYTES_PER_ELEMENT is 2. +info: > + The value of TypedArray.BYTES_PER_ELEMENT is the Number value of the + Element Size value specified in Table 49 for TypedArray. + + This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Uint16Array.BYTES_PER_ELEMENT, 2); + +verifyNotEnumerable(Uint16Array, "BYTES_PER_ELEMENT"); +verifyNotWritable(Uint16Array, "BYTES_PER_ELEMENT"); +verifyNotConfigurable(Uint16Array, "BYTES_PER_ELEMENT"); diff --git a/test/built-ins/TypedArrays/Uint16Array/constructor.js b/test/built-ins/TypedArrays/Uint16Array/constructor.js new file mode 100755 index 0000000000000000000000000000000000000000..79dbf82aef390d83f6f26842ebc9b7e478897f1a --- /dev/null +++ b/test/built-ins/TypedArrays/Uint16Array/constructor.js @@ -0,0 +1,10 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.4 +description: > + Uint16Array is a constructor function. +---*/ + +assert.sameValue(typeof Uint16Array, 'function', 'typeof Uint16Array is "function"'); diff --git a/test/built-ins/TypedArrays/Uint16Array/length.js b/test/built-ins/TypedArrays/Uint16Array/length.js new file mode 100755 index 0000000000000000000000000000000000000000..9b54e8b91c1c062731ec2b5a9f844cd5237bf8f1 --- /dev/null +++ b/test/built-ins/TypedArrays/Uint16Array/length.js @@ -0,0 +1,29 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5 +description: > + Uint16Array.length is 3. +info: > + Besides a length property (whose value is 3), [...]. + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, has a length + property whose value is an integer. Unless otherwise specified, this + value is equal to the largest number of named arguments shown in the + subclause headings for the function description, including optional + parameters. However, rest parameters shown using the form “...name†+ are not included in the default argument count. + + Unless otherwise specified, the length property of a built-in Function + object has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Uint16Array.length, 3); + +verifyNotEnumerable(Uint16Array, "length"); +verifyNotWritable(Uint16Array, "length"); +verifyConfigurable(Uint16Array, "length"); diff --git a/test/built-ins/TypedArrays/Uint16Array/name.js b/test/built-ins/TypedArrays/Uint16Array/name.js new file mode 100755 index 0000000000000000000000000000000000000000..e26a811db1781e7cf6dcd64d13dc0e28a51f81c8 --- /dev/null +++ b/test/built-ins/TypedArrays/Uint16Array/name.js @@ -0,0 +1,27 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5 +description: > + Uint16Array.name is "Uint16Array". +info: > + Each TypedArray constructor has a name property whose value is the + String value of the constructor name specified for it in Table 49. + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, that is not + identified as an anonymous function has a name property whose value + is a String. + + 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] +---*/ + +assert.sameValue(Uint16Array.name, "Uint16Array"); + +verifyNotEnumerable(Uint16Array, "name"); +verifyNotWritable(Uint16Array, "name"); +verifyConfigurable(Uint16Array, "name"); diff --git a/test/built-ins/TypedArrays/Uint16Array/proto.js b/test/built-ins/TypedArrays/Uint16Array/proto.js new file mode 100755 index 0000000000000000000000000000000000000000..0dbb97a4a9df7075db655e6fe5ab0af51df62d1c --- /dev/null +++ b/test/built-ins/TypedArrays/Uint16Array/proto.js @@ -0,0 +1,13 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5 +description: > + The prototype of Uint16Array is %TypedArray%. +info: > + The value of the [[Prototype]] internal slot of each TypedArray constructor is the %TypedArray% intrinsic object (22.2.1). +includes: [testTypedArray.js] +---*/ + +assert.sameValue(Object.getPrototypeOf(Uint16Array), TypedArray); diff --git a/test/built-ins/TypedArrays/Uint16Array/prototype.js b/test/built-ins/TypedArrays/Uint16Array/prototype.js new file mode 100755 index 0000000000000000000000000000000000000000..0decd7356f9481309df6cc6499482bdbd8e63c48 --- /dev/null +++ b/test/built-ins/TypedArrays/Uint16Array/prototype.js @@ -0,0 +1,19 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5.2 +description: > + The initial value of Uint16Array.prototype is the Uint16Array prototype object. +info: > + The initial value of TypedArray.prototype is the corresponding TypedArray prototype intrinsic object (22.2.6). + + This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Uint16Array.prototype, Object.getPrototypeOf(new Uint16Array(0))); + +verifyNotEnumerable(Uint16Array, "prototype"); +verifyNotWritable(Uint16Array, "prototype"); +verifyNotConfigurable(Uint16Array, "prototype"); diff --git a/test/built-ins/TypedArrays/Uint16Array/prototype/BYTES_PER_ELEMENT.js b/test/built-ins/TypedArrays/Uint16Array/prototype/BYTES_PER_ELEMENT.js new file mode 100755 index 0000000000000000000000000000000000000000..f0e11a48fc51da1395afb40b552a1afdc4cd62a5 --- /dev/null +++ b/test/built-ins/TypedArrays/Uint16Array/prototype/BYTES_PER_ELEMENT.js @@ -0,0 +1,20 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.6.1 +description: > + The initial value of Uint16Array.prototype.BYTES_PER_ELEMENT is 2. +info: > + The value of TypedArray.prototype.BYTES_PER_ELEMENT is the Number value + of the Element Size value specified in Table 49 for TypedArray. + + This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Uint16Array.prototype.BYTES_PER_ELEMENT, 2); + +verifyNotEnumerable(Uint16Array.prototype, "BYTES_PER_ELEMENT"); +verifyNotWritable(Uint16Array.prototype, "BYTES_PER_ELEMENT"); +verifyNotConfigurable(Uint16Array.prototype, "BYTES_PER_ELEMENT"); diff --git a/test/built-ins/TypedArrays/Uint16Array/prototype/constructor.js b/test/built-ins/TypedArrays/Uint16Array/prototype/constructor.js new file mode 100755 index 0000000000000000000000000000000000000000..48653c2826dd7f7514cd7aabc138658190da3d3d --- /dev/null +++ b/test/built-ins/TypedArrays/Uint16Array/prototype/constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.6.2 +description: > + The initial value of Uint16Array.prototype.constructor is the Uint16Array object. +info: > + The initial value of Uint16Array.prototype.constructor is the intrinsic + object %Uint16Array%. + + 17 ECMAScript Standard Built-in Objects: + 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] +---*/ + +assert.sameValue(Uint16Array.prototype.constructor, Uint16Array); + +verifyNotEnumerable(Uint16Array.prototype, "constructor"); +verifyWritable(Uint16Array.prototype, "constructor"); +verifyConfigurable(Uint16Array.prototype, "constructor"); diff --git a/test/built-ins/TypedArrays/Uint16Array/prototype/not-typedarray-object.js b/test/built-ins/TypedArrays/Uint16Array/prototype/not-typedarray-object.js new file mode 100755 index 0000000000000000000000000000000000000000..4f24c6373c102ceb0fc9a54048081205c5b20729 --- /dev/null +++ b/test/built-ins/TypedArrays/Uint16Array/prototype/not-typedarray-object.js @@ -0,0 +1,16 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.6 +description: > + Uint16Array.prototype is not a TypedArray instance object. +info: > + A TypedArray prototype object is an ordinary object. It does not have + a [[ViewedArrayBuffer]] or any other of the internal slots that are + specific to TypedArray instance objects. +---*/ + +assert.throws(TypeError, function() { + Uint16Array.prototype.buffer; +}); diff --git a/test/built-ins/TypedArrays/Uint16Array/prototype/proto.js b/test/built-ins/TypedArrays/Uint16Array/prototype/proto.js new file mode 100755 index 0000000000000000000000000000000000000000..370c91c9bc0155e5b724bdcf0a2f39a85681f7c2 --- /dev/null +++ b/test/built-ins/TypedArrays/Uint16Array/prototype/proto.js @@ -0,0 +1,14 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.6 +description: > + The prototype of Uint16Array.prototype is %TypedArrayPrototype%. +info: > + The value of the [[Prototype]] internal slot of a TypedArray prototype + object is the intrinsic object %TypedArrayPrototype% (22.2.3). +includes: [testTypedArray.js] +---*/ + +assert.sameValue(Object.getPrototypeOf(Uint16Array.prototype), TypedArray.prototype); diff --git a/test/built-ins/TypedArrays/Uint16Array/undefined-newtarget.js b/test/built-ins/TypedArrays/Uint16Array/undefined-newtarget.js new file mode 100755 index 0000000000000000000000000000000000000000..fbbd92d4dd34e9467ae1376917e0026287c1722c --- /dev/null +++ b/test/built-ins/TypedArrays/Uint16Array/undefined-newtarget.js @@ -0,0 +1,32 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.4.1 +description: > + Throws a TypeError if NewTarget is undefined. +info: > + TypedArray( ... argumentsList) + + 1. If NewTarget is undefined, throw a TypeError exception. +---*/ + +assert.throws(TypeError, function() { + Uint16Array(); +}, "Uint16Array()"); + +assert.throws(TypeError, function() { + Uint16Array(0); +}, "Uint16Array(0)"); + +assert.throws(TypeError, function() { + Uint16Array(new Uint16Array(1)); +}, "Uint16Array(uint16Array)"); + +assert.throws(TypeError, function() { + Uint16Array([]); +}, "Uint16Array(array)"); + +assert.throws(TypeError, function() { + Uint16Array(new ArrayBuffer(8)); +}, "Uint16Array(arrayBuffer)"); diff --git a/test/built-ins/TypedArrays/Uint32Array/BYTES_PER_ELEMENT.js b/test/built-ins/TypedArrays/Uint32Array/BYTES_PER_ELEMENT.js new file mode 100755 index 0000000000000000000000000000000000000000..02ecbfe29acdbc6b6618189ce4e23cdb6fd7c77d --- /dev/null +++ b/test/built-ins/TypedArrays/Uint32Array/BYTES_PER_ELEMENT.js @@ -0,0 +1,20 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5.1 +description: > + The initial value of Uint32Array.BYTES_PER_ELEMENT is 4. +info: > + The value of TypedArray.BYTES_PER_ELEMENT is the Number value of the + Element Size value specified in Table 49 for TypedArray. + + This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Uint32Array.BYTES_PER_ELEMENT, 4); + +verifyNotEnumerable(Uint32Array, "BYTES_PER_ELEMENT"); +verifyNotWritable(Uint32Array, "BYTES_PER_ELEMENT"); +verifyNotConfigurable(Uint32Array, "BYTES_PER_ELEMENT"); diff --git a/test/built-ins/TypedArrays/Uint32Array/constructor.js b/test/built-ins/TypedArrays/Uint32Array/constructor.js new file mode 100755 index 0000000000000000000000000000000000000000..9b4c82d7098f3b575d974e139500518521d186bd --- /dev/null +++ b/test/built-ins/TypedArrays/Uint32Array/constructor.js @@ -0,0 +1,10 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.4 +description: > + Uint32Array is a constructor function. +---*/ + +assert.sameValue(typeof Uint32Array, 'function', 'typeof Uint32Array is "function"'); diff --git a/test/built-ins/TypedArrays/Uint32Array/length.js b/test/built-ins/TypedArrays/Uint32Array/length.js new file mode 100755 index 0000000000000000000000000000000000000000..56db251b372cff19cb3eb44b745851e9f45fe9d2 --- /dev/null +++ b/test/built-ins/TypedArrays/Uint32Array/length.js @@ -0,0 +1,29 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5 +description: > + Uint32Array.length is 3. +info: > + Besides a length property (whose value is 3), [...]. + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, has a length + property whose value is an integer. Unless otherwise specified, this + value is equal to the largest number of named arguments shown in the + subclause headings for the function description, including optional + parameters. However, rest parameters shown using the form “...name†+ are not included in the default argument count. + + Unless otherwise specified, the length property of a built-in Function + object has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Uint32Array.length, 3); + +verifyNotEnumerable(Uint32Array, "length"); +verifyNotWritable(Uint32Array, "length"); +verifyConfigurable(Uint32Array, "length"); diff --git a/test/built-ins/TypedArrays/Uint32Array/name.js b/test/built-ins/TypedArrays/Uint32Array/name.js new file mode 100755 index 0000000000000000000000000000000000000000..5d3d0ae63e2328ae9b2d5afda77f939effc010b8 --- /dev/null +++ b/test/built-ins/TypedArrays/Uint32Array/name.js @@ -0,0 +1,27 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5 +description: > + Uint32Array.name is "Uint32Array". +info: > + Each TypedArray constructor has a name property whose value is the + String value of the constructor name specified for it in Table 49. + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, that is not + identified as an anonymous function has a name property whose value + is a String. + + 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] +---*/ + +assert.sameValue(Uint32Array.name, "Uint32Array"); + +verifyNotEnumerable(Uint32Array, "name"); +verifyNotWritable(Uint32Array, "name"); +verifyConfigurable(Uint32Array, "name"); diff --git a/test/built-ins/TypedArrays/Uint32Array/proto.js b/test/built-ins/TypedArrays/Uint32Array/proto.js new file mode 100755 index 0000000000000000000000000000000000000000..e62f2d711902060d4970e1dfe555b6fc50670ad3 --- /dev/null +++ b/test/built-ins/TypedArrays/Uint32Array/proto.js @@ -0,0 +1,13 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5 +description: > + The prototype of Uint32Array is %TypedArray%. +info: > + The value of the [[Prototype]] internal slot of each TypedArray constructor is the %TypedArray% intrinsic object (22.2.1). +includes: [testTypedArray.js] +---*/ + +assert.sameValue(Object.getPrototypeOf(Uint32Array), TypedArray); diff --git a/test/built-ins/TypedArrays/Uint32Array/prototype.js b/test/built-ins/TypedArrays/Uint32Array/prototype.js new file mode 100755 index 0000000000000000000000000000000000000000..cabdeffb0a2299e0d206c0fc1621e9c2679698d4 --- /dev/null +++ b/test/built-ins/TypedArrays/Uint32Array/prototype.js @@ -0,0 +1,19 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5.2 +description: > + The initial value of Uint32Array.prototype is the Uint32Array prototype object. +info: > + The initial value of TypedArray.prototype is the corresponding TypedArray prototype intrinsic object (22.2.6). + + This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Uint32Array.prototype, Object.getPrototypeOf(new Uint32Array(0))); + +verifyNotEnumerable(Uint32Array, "prototype"); +verifyNotWritable(Uint32Array, "prototype"); +verifyNotConfigurable(Uint32Array, "prototype"); diff --git a/test/built-ins/TypedArrays/Uint32Array/prototype/BYTES_PER_ELEMENT.js b/test/built-ins/TypedArrays/Uint32Array/prototype/BYTES_PER_ELEMENT.js new file mode 100755 index 0000000000000000000000000000000000000000..8039eb14c2c78b366c33e768569e688dc419c2d1 --- /dev/null +++ b/test/built-ins/TypedArrays/Uint32Array/prototype/BYTES_PER_ELEMENT.js @@ -0,0 +1,20 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.6.1 +description: > + The initial value of Uint32Array.prototype.BYTES_PER_ELEMENT is 4. +info: > + The value of TypedArray.prototype.BYTES_PER_ELEMENT is the Number value + of the Element Size value specified in Table 49 for TypedArray. + + This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Uint32Array.prototype.BYTES_PER_ELEMENT, 4); + +verifyNotEnumerable(Uint32Array.prototype, "BYTES_PER_ELEMENT"); +verifyNotWritable(Uint32Array.prototype, "BYTES_PER_ELEMENT"); +verifyNotConfigurable(Uint32Array.prototype, "BYTES_PER_ELEMENT"); diff --git a/test/built-ins/TypedArrays/Uint32Array/prototype/constructor.js b/test/built-ins/TypedArrays/Uint32Array/prototype/constructor.js new file mode 100755 index 0000000000000000000000000000000000000000..509a06737e7b15a466d019ef61a94216697b0e96 --- /dev/null +++ b/test/built-ins/TypedArrays/Uint32Array/prototype/constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.6.2 +description: > + The initial value of Uint32Array.prototype.constructor is the Uint32Array object. +info: > + The initial value of Uint32Array.prototype.constructor is the intrinsic + object %Uint32Array%. + + 17 ECMAScript Standard Built-in Objects: + 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] +---*/ + +assert.sameValue(Uint32Array.prototype.constructor, Uint32Array); + +verifyNotEnumerable(Uint32Array.prototype, "constructor"); +verifyWritable(Uint32Array.prototype, "constructor"); +verifyConfigurable(Uint32Array.prototype, "constructor"); diff --git a/test/built-ins/TypedArrays/Uint32Array/prototype/not-typedarray-object.js b/test/built-ins/TypedArrays/Uint32Array/prototype/not-typedarray-object.js new file mode 100755 index 0000000000000000000000000000000000000000..a6720280b0c48376c75d76b7f4c17c2edc42c6a6 --- /dev/null +++ b/test/built-ins/TypedArrays/Uint32Array/prototype/not-typedarray-object.js @@ -0,0 +1,16 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.6 +description: > + Uint32Array.prototype is not a TypedArray instance object. +info: > + A TypedArray prototype object is an ordinary object. It does not have + a [[ViewedArrayBuffer]] or any other of the internal slots that are + specific to TypedArray instance objects. +---*/ + +assert.throws(TypeError, function() { + Uint32Array.prototype.buffer; +}); diff --git a/test/built-ins/TypedArrays/Uint32Array/prototype/proto.js b/test/built-ins/TypedArrays/Uint32Array/prototype/proto.js new file mode 100755 index 0000000000000000000000000000000000000000..92c68297f05a0f5748c63ccc5481eeb82af110c9 --- /dev/null +++ b/test/built-ins/TypedArrays/Uint32Array/prototype/proto.js @@ -0,0 +1,14 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.6 +description: > + The prototype of Uint32Array.prototype is %TypedArrayPrototype%. +info: > + The value of the [[Prototype]] internal slot of a TypedArray prototype + object is the intrinsic object %TypedArrayPrototype% (22.2.3). +includes: [testTypedArray.js] +---*/ + +assert.sameValue(Object.getPrototypeOf(Uint32Array.prototype), TypedArray.prototype); diff --git a/test/built-ins/TypedArrays/Uint32Array/undefined-newtarget.js b/test/built-ins/TypedArrays/Uint32Array/undefined-newtarget.js new file mode 100755 index 0000000000000000000000000000000000000000..d74e02736a8ebab12ceb31f15b072f90621009fd --- /dev/null +++ b/test/built-ins/TypedArrays/Uint32Array/undefined-newtarget.js @@ -0,0 +1,32 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.4.1 +description: > + Throws a TypeError if NewTarget is undefined. +info: > + TypedArray( ... argumentsList) + + 1. If NewTarget is undefined, throw a TypeError exception. +---*/ + +assert.throws(TypeError, function() { + Uint32Array(); +}, "Uint32Array()"); + +assert.throws(TypeError, function() { + Uint32Array(0); +}, "Uint32Array(0)"); + +assert.throws(TypeError, function() { + Uint32Array(new Uint32Array(1)); +}, "Uint32Array(uint32Array)"); + +assert.throws(TypeError, function() { + Uint32Array([]); +}, "Uint32Array(array)"); + +assert.throws(TypeError, function() { + Uint32Array(new ArrayBuffer(8)); +}, "Uint32Array(arrayBuffer)"); diff --git a/test/built-ins/TypedArrays/Uint8Array/BYTES_PER_ELEMENT.js b/test/built-ins/TypedArrays/Uint8Array/BYTES_PER_ELEMENT.js new file mode 100755 index 0000000000000000000000000000000000000000..1a7185d46a89832613340dcf8de1b5e265a9f879 --- /dev/null +++ b/test/built-ins/TypedArrays/Uint8Array/BYTES_PER_ELEMENT.js @@ -0,0 +1,20 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5.1 +description: > + The initial value of Uint8Array.BYTES_PER_ELEMENT is 1. +info: > + The value of TypedArray.BYTES_PER_ELEMENT is the Number value of the + Element Size value specified in Table 49 for TypedArray. + + This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Uint8Array.BYTES_PER_ELEMENT, 1); + +verifyNotEnumerable(Uint8Array, "BYTES_PER_ELEMENT"); +verifyNotWritable(Uint8Array, "BYTES_PER_ELEMENT"); +verifyNotConfigurable(Uint8Array, "BYTES_PER_ELEMENT"); diff --git a/test/built-ins/TypedArrays/Uint8Array/constructor.js b/test/built-ins/TypedArrays/Uint8Array/constructor.js new file mode 100755 index 0000000000000000000000000000000000000000..a54b74aba3a0d39788e17a7b212c6bbec74d559e --- /dev/null +++ b/test/built-ins/TypedArrays/Uint8Array/constructor.js @@ -0,0 +1,10 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.4 +description: > + Uint8Array is a constructor function. +---*/ + +assert.sameValue(typeof Uint8Array, 'function', 'typeof Uint8Array is "function"'); diff --git a/test/built-ins/TypedArrays/Uint8Array/length.js b/test/built-ins/TypedArrays/Uint8Array/length.js new file mode 100755 index 0000000000000000000000000000000000000000..78ef6305d5d1f5a607e9a1ed762d25b59d9f836e --- /dev/null +++ b/test/built-ins/TypedArrays/Uint8Array/length.js @@ -0,0 +1,29 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5 +description: > + Uint8Array.length is 3. +info: > + Besides a length property (whose value is 3), [...]. + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, has a length + property whose value is an integer. Unless otherwise specified, this + value is equal to the largest number of named arguments shown in the + subclause headings for the function description, including optional + parameters. However, rest parameters shown using the form “...name†+ are not included in the default argument count. + + Unless otherwise specified, the length property of a built-in Function + object has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Uint8Array.length, 3); + +verifyNotEnumerable(Uint8Array, "length"); +verifyNotWritable(Uint8Array, "length"); +verifyConfigurable(Uint8Array, "length"); diff --git a/test/built-ins/TypedArrays/Uint8Array/name.js b/test/built-ins/TypedArrays/Uint8Array/name.js new file mode 100755 index 0000000000000000000000000000000000000000..f1e3f03a8c4ba6769003241e05621cd69703da40 --- /dev/null +++ b/test/built-ins/TypedArrays/Uint8Array/name.js @@ -0,0 +1,27 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5 +description: > + Uint8Array.name is "Uint8Array". +info: > + Each TypedArray constructor has a name property whose value is the + String value of the constructor name specified for it in Table 49. + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, that is not + identified as an anonymous function has a name property whose value + is a String. + + 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] +---*/ + +assert.sameValue(Uint8Array.name, "Uint8Array"); + +verifyNotEnumerable(Uint8Array, "name"); +verifyNotWritable(Uint8Array, "name"); +verifyConfigurable(Uint8Array, "name"); diff --git a/test/built-ins/TypedArrays/Uint8Array/proto.js b/test/built-ins/TypedArrays/Uint8Array/proto.js new file mode 100755 index 0000000000000000000000000000000000000000..49698bd0ae116655f7443d1821fce5860cc5f440 --- /dev/null +++ b/test/built-ins/TypedArrays/Uint8Array/proto.js @@ -0,0 +1,13 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5 +description: > + The prototype of Uint8Array is %TypedArray%. +info: > + The value of the [[Prototype]] internal slot of each TypedArray constructor is the %TypedArray% intrinsic object (22.2.1). +includes: [testTypedArray.js] +---*/ + +assert.sameValue(Object.getPrototypeOf(Uint8Array), TypedArray); diff --git a/test/built-ins/TypedArrays/Uint8Array/prototype.js b/test/built-ins/TypedArrays/Uint8Array/prototype.js new file mode 100755 index 0000000000000000000000000000000000000000..99fdf36a205aa1785c63fcc4efaffb11a874144c --- /dev/null +++ b/test/built-ins/TypedArrays/Uint8Array/prototype.js @@ -0,0 +1,19 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5.2 +description: > + The initial value of Uint8Array.prototype is the Uint8Array prototype object. +info: > + The initial value of TypedArray.prototype is the corresponding TypedArray prototype intrinsic object (22.2.6). + + This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Uint8Array.prototype, Object.getPrototypeOf(new Uint8Array(0))); + +verifyNotEnumerable(Uint8Array, "prototype"); +verifyNotWritable(Uint8Array, "prototype"); +verifyNotConfigurable(Uint8Array, "prototype"); diff --git a/test/built-ins/TypedArrays/Uint8Array/prototype/BYTES_PER_ELEMENT.js b/test/built-ins/TypedArrays/Uint8Array/prototype/BYTES_PER_ELEMENT.js new file mode 100755 index 0000000000000000000000000000000000000000..74058dde320529b0937caddc1d3cd22f61e8315f --- /dev/null +++ b/test/built-ins/TypedArrays/Uint8Array/prototype/BYTES_PER_ELEMENT.js @@ -0,0 +1,20 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.6.1 +description: > + The initial value of Uint8Array.prototype.BYTES_PER_ELEMENT is 1. +info: > + The value of TypedArray.prototype.BYTES_PER_ELEMENT is the Number value + of the Element Size value specified in Table 49 for TypedArray. + + This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Uint8Array.prototype.BYTES_PER_ELEMENT, 1); + +verifyNotEnumerable(Uint8Array.prototype, "BYTES_PER_ELEMENT"); +verifyNotWritable(Uint8Array.prototype, "BYTES_PER_ELEMENT"); +verifyNotConfigurable(Uint8Array.prototype, "BYTES_PER_ELEMENT"); diff --git a/test/built-ins/TypedArrays/Uint8Array/prototype/constructor.js b/test/built-ins/TypedArrays/Uint8Array/prototype/constructor.js new file mode 100755 index 0000000000000000000000000000000000000000..bd90f145b266dace6fdd0056fa47eb6adde1301b --- /dev/null +++ b/test/built-ins/TypedArrays/Uint8Array/prototype/constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.6.2 +description: > + The initial value of Uint8Array.prototype.constructor is the Uint8Array object. +info: > + The initial value of Uint8Array.prototype.constructor is the intrinsic + object %Uint8Array%. + + 17 ECMAScript Standard Built-in Objects: + 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] +---*/ + +assert.sameValue(Uint8Array.prototype.constructor, Uint8Array); + +verifyNotEnumerable(Uint8Array.prototype, "constructor"); +verifyWritable(Uint8Array.prototype, "constructor"); +verifyConfigurable(Uint8Array.prototype, "constructor"); diff --git a/test/built-ins/TypedArrays/Uint8Array/prototype/not-typedarray-object.js b/test/built-ins/TypedArrays/Uint8Array/prototype/not-typedarray-object.js new file mode 100755 index 0000000000000000000000000000000000000000..55b25be853d5fa4d47ac55089729f3ee17b47c58 --- /dev/null +++ b/test/built-ins/TypedArrays/Uint8Array/prototype/not-typedarray-object.js @@ -0,0 +1,16 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.6 +description: > + Uint8Array.prototype is not a TypedArray instance object. +info: > + A TypedArray prototype object is an ordinary object. It does not have + a [[ViewedArrayBuffer]] or any other of the internal slots that are + specific to TypedArray instance objects. +---*/ + +assert.throws(TypeError, function() { + Uint8Array.prototype.buffer; +}); diff --git a/test/built-ins/TypedArrays/Uint8Array/prototype/proto.js b/test/built-ins/TypedArrays/Uint8Array/prototype/proto.js new file mode 100755 index 0000000000000000000000000000000000000000..c214a7cf59b9a9e23b549d5b889ec1d014b242b9 --- /dev/null +++ b/test/built-ins/TypedArrays/Uint8Array/prototype/proto.js @@ -0,0 +1,14 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.6 +description: > + The prototype of Uint8Array.prototype is %TypedArrayPrototype%. +info: > + The value of the [[Prototype]] internal slot of a TypedArray prototype + object is the intrinsic object %TypedArrayPrototype% (22.2.3). +includes: [testTypedArray.js] +---*/ + +assert.sameValue(Object.getPrototypeOf(Uint8Array.prototype), TypedArray.prototype); diff --git a/test/built-ins/TypedArrays/Uint8Array/undefined-newtarget.js b/test/built-ins/TypedArrays/Uint8Array/undefined-newtarget.js new file mode 100755 index 0000000000000000000000000000000000000000..d592176d6fa1cbbc58bc839bd08bf16a402ce90a --- /dev/null +++ b/test/built-ins/TypedArrays/Uint8Array/undefined-newtarget.js @@ -0,0 +1,32 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.4.1 +description: > + Throws a TypeError if NewTarget is undefined. +info: > + TypedArray( ... argumentsList) + + 1. If NewTarget is undefined, throw a TypeError exception. +---*/ + +assert.throws(TypeError, function() { + Uint8Array(); +}, "Uint8Array()"); + +assert.throws(TypeError, function() { + Uint8Array(0); +}, "Uint8Array(0)"); + +assert.throws(TypeError, function() { + Uint8Array(new Uint8Array(1)); +}, "Uint8Array(uint8Array)"); + +assert.throws(TypeError, function() { + Uint8Array([]); +}, "Uint8Array(array)"); + +assert.throws(TypeError, function() { + Uint8Array(new ArrayBuffer(8)); +}, "Uint8Array(arrayBuffer)"); diff --git a/test/built-ins/TypedArrays/Uint8ClampedArray/BYTES_PER_ELEMENT.js b/test/built-ins/TypedArrays/Uint8ClampedArray/BYTES_PER_ELEMENT.js new file mode 100755 index 0000000000000000000000000000000000000000..49998f40acf4e83024596c4b331d725895850fa4 --- /dev/null +++ b/test/built-ins/TypedArrays/Uint8ClampedArray/BYTES_PER_ELEMENT.js @@ -0,0 +1,20 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5.1 +description: > + The initial value of Uint8ClampedArray.BYTES_PER_ELEMENT is 1. +info: > + The value of TypedArray.BYTES_PER_ELEMENT is the Number value of the + Element Size value specified in Table 49 for TypedArray. + + This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Uint8ClampedArray.BYTES_PER_ELEMENT, 1); + +verifyNotEnumerable(Uint8ClampedArray, "BYTES_PER_ELEMENT"); +verifyNotWritable(Uint8ClampedArray, "BYTES_PER_ELEMENT"); +verifyNotConfigurable(Uint8ClampedArray, "BYTES_PER_ELEMENT"); diff --git a/test/built-ins/TypedArrays/Uint8ClampedArray/constructor.js b/test/built-ins/TypedArrays/Uint8ClampedArray/constructor.js new file mode 100755 index 0000000000000000000000000000000000000000..82c630381f8dc6d2dc2512af3709ef137591ec8b --- /dev/null +++ b/test/built-ins/TypedArrays/Uint8ClampedArray/constructor.js @@ -0,0 +1,10 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.4 +description: > + Uint8ClampedArray is a constructor function. +---*/ + +assert.sameValue(typeof Uint8ClampedArray, 'function', 'typeof Uint8ClampedArray is "function"'); diff --git a/test/built-ins/TypedArrays/Uint8ClampedArray/length.js b/test/built-ins/TypedArrays/Uint8ClampedArray/length.js new file mode 100755 index 0000000000000000000000000000000000000000..a08ca73700fa47bef9fbde831ecd462fb9bb0bbb --- /dev/null +++ b/test/built-ins/TypedArrays/Uint8ClampedArray/length.js @@ -0,0 +1,29 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5 +description: > + Uint8ClampedArray.length is 3. +info: > + Besides a length property (whose value is 3), [...]. + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, has a length + property whose value is an integer. Unless otherwise specified, this + value is equal to the largest number of named arguments shown in the + subclause headings for the function description, including optional + parameters. However, rest parameters shown using the form “...name†+ are not included in the default argument count. + + Unless otherwise specified, the length property of a built-in Function + object has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Uint8ClampedArray.length, 3); + +verifyNotEnumerable(Uint8ClampedArray, "length"); +verifyNotWritable(Uint8ClampedArray, "length"); +verifyConfigurable(Uint8ClampedArray, "length"); diff --git a/test/built-ins/TypedArrays/Uint8ClampedArray/name.js b/test/built-ins/TypedArrays/Uint8ClampedArray/name.js new file mode 100755 index 0000000000000000000000000000000000000000..a3105a2b1e60da4f32c7f118d8c23092df03e9a4 --- /dev/null +++ b/test/built-ins/TypedArrays/Uint8ClampedArray/name.js @@ -0,0 +1,27 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5 +description: > + Uint8ClampedArray.name is "Uint8ClampedArray". +info: > + Each TypedArray constructor has a name property whose value is the + String value of the constructor name specified for it in Table 49. + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, that is not + identified as an anonymous function has a name property whose value + is a String. + + 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] +---*/ + +assert.sameValue(Uint8ClampedArray.name, "Uint8ClampedArray"); + +verifyNotEnumerable(Uint8ClampedArray, "name"); +verifyNotWritable(Uint8ClampedArray, "name"); +verifyConfigurable(Uint8ClampedArray, "name"); diff --git a/test/built-ins/TypedArrays/Uint8ClampedArray/proto.js b/test/built-ins/TypedArrays/Uint8ClampedArray/proto.js new file mode 100755 index 0000000000000000000000000000000000000000..c94c0c8deb687ccdd734fc7b9fc9347be0612acd --- /dev/null +++ b/test/built-ins/TypedArrays/Uint8ClampedArray/proto.js @@ -0,0 +1,13 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5 +description: > + The prototype of Uint8ClampedArray is %TypedArray%. +info: > + The value of the [[Prototype]] internal slot of each TypedArray constructor is the %TypedArray% intrinsic object (22.2.1). +includes: [testTypedArray.js] +---*/ + +assert.sameValue(Object.getPrototypeOf(Uint8ClampedArray), TypedArray); diff --git a/test/built-ins/TypedArrays/Uint8ClampedArray/prototype.js b/test/built-ins/TypedArrays/Uint8ClampedArray/prototype.js new file mode 100755 index 0000000000000000000000000000000000000000..2a3a7e1117517a82b80737bb4eb92db7a877c550 --- /dev/null +++ b/test/built-ins/TypedArrays/Uint8ClampedArray/prototype.js @@ -0,0 +1,19 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.5.2 +description: > + The initial value of Uint8ClampedArray.prototype is the Uint8ClampedArray prototype object. +info: > + The initial value of TypedArray.prototype is the corresponding TypedArray prototype intrinsic object (22.2.6). + + This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Uint8ClampedArray.prototype, Object.getPrototypeOf(new Uint8ClampedArray(0))); + +verifyNotEnumerable(Uint8ClampedArray, "prototype"); +verifyNotWritable(Uint8ClampedArray, "prototype"); +verifyNotConfigurable(Uint8ClampedArray, "prototype"); diff --git a/test/built-ins/TypedArrays/Uint8ClampedArray/prototype/BYTES_PER_ELEMENT.js b/test/built-ins/TypedArrays/Uint8ClampedArray/prototype/BYTES_PER_ELEMENT.js new file mode 100755 index 0000000000000000000000000000000000000000..554aae55a4da62e4881576b94d747ff4013f6f6a --- /dev/null +++ b/test/built-ins/TypedArrays/Uint8ClampedArray/prototype/BYTES_PER_ELEMENT.js @@ -0,0 +1,20 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.6.1 +description: > + The initial value of Uint8ClampedArray.prototype.BYTES_PER_ELEMENT is 1. +info: > + The value of TypedArray.prototype.BYTES_PER_ELEMENT is the Number value + of the Element Size value specified in Table 49 for TypedArray. + + This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Uint8ClampedArray.prototype.BYTES_PER_ELEMENT, 1); + +verifyNotEnumerable(Uint8ClampedArray.prototype, "BYTES_PER_ELEMENT"); +verifyNotWritable(Uint8ClampedArray.prototype, "BYTES_PER_ELEMENT"); +verifyNotConfigurable(Uint8ClampedArray.prototype, "BYTES_PER_ELEMENT"); diff --git a/test/built-ins/TypedArrays/Uint8ClampedArray/prototype/constructor.js b/test/built-ins/TypedArrays/Uint8ClampedArray/prototype/constructor.js new file mode 100755 index 0000000000000000000000000000000000000000..8d153d33df57dc0150189c1a7cec0eb44e438160 --- /dev/null +++ b/test/built-ins/TypedArrays/Uint8ClampedArray/prototype/constructor.js @@ -0,0 +1,23 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.6.2 +description: > + The initial value of Uint8ClampedArray.prototype.constructor is the Uint8ClampedArray object. +info: > + The initial value of Uint8ClampedArray.prototype.constructor is the intrinsic + object %Uint8ClampedArray%. + + 17 ECMAScript Standard Built-in Objects: + 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] +---*/ + +assert.sameValue(Uint8ClampedArray.prototype.constructor, Uint8ClampedArray); + +verifyNotEnumerable(Uint8ClampedArray.prototype, "constructor"); +verifyWritable(Uint8ClampedArray.prototype, "constructor"); +verifyConfigurable(Uint8ClampedArray.prototype, "constructor"); diff --git a/test/built-ins/TypedArrays/Uint8ClampedArray/prototype/not-typedarray-object.js b/test/built-ins/TypedArrays/Uint8ClampedArray/prototype/not-typedarray-object.js new file mode 100755 index 0000000000000000000000000000000000000000..71a29c0d6402263ea6d836e849fa893132693408 --- /dev/null +++ b/test/built-ins/TypedArrays/Uint8ClampedArray/prototype/not-typedarray-object.js @@ -0,0 +1,16 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.6 +description: > + Uint8ClampedArray.prototype is not a TypedArray instance object. +info: > + A TypedArray prototype object is an ordinary object. It does not have + a [[ViewedArrayBuffer]] or any other of the internal slots that are + specific to TypedArray instance objects. +---*/ + +assert.throws(TypeError, function() { + Uint8ClampedArray.prototype.buffer; +}); diff --git a/test/built-ins/TypedArrays/Uint8ClampedArray/prototype/proto.js b/test/built-ins/TypedArrays/Uint8ClampedArray/prototype/proto.js new file mode 100755 index 0000000000000000000000000000000000000000..72a5c008e0c31ab212efc05dcf53b050fd581de4 --- /dev/null +++ b/test/built-ins/TypedArrays/Uint8ClampedArray/prototype/proto.js @@ -0,0 +1,14 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.6 +description: > + The prototype of Uint8ClampedArray.prototype is %TypedArrayPrototype%. +info: > + The value of the [[Prototype]] internal slot of a TypedArray prototype + object is the intrinsic object %TypedArrayPrototype% (22.2.3). +includes: [testTypedArray.js] +---*/ + +assert.sameValue(Object.getPrototypeOf(Uint8ClampedArray.prototype), TypedArray.prototype); diff --git a/test/built-ins/TypedArrays/Uint8ClampedArray/undefined-newtarget.js b/test/built-ins/TypedArrays/Uint8ClampedArray/undefined-newtarget.js new file mode 100755 index 0000000000000000000000000000000000000000..63c1dbd767ac29e1aba02ede49808ca6fe1a2f6d --- /dev/null +++ b/test/built-ins/TypedArrays/Uint8ClampedArray/undefined-newtarget.js @@ -0,0 +1,32 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 22.2.4.1 +description: > + Throws a TypeError if NewTarget is undefined. +info: > + TypedArray( ... argumentsList) + + 1. If NewTarget is undefined, throw a TypeError exception. +---*/ + +assert.throws(TypeError, function() { + Uint8ClampedArray(); +}, "Uint8ClampedArray()"); + +assert.throws(TypeError, function() { + Uint8ClampedArray(0); +}, "Uint8ClampedArray(0)"); + +assert.throws(TypeError, function() { + Uint8ClampedArray(new Uint8ClampedArray(1)); +}, "Uint8ClampedArray(uint8clampedArray)"); + +assert.throws(TypeError, function() { + Uint8ClampedArray([]); +}, "Uint8ClampedArray(array)"); + +assert.throws(TypeError, function() { + Uint8ClampedArray(new ArrayBuffer(8)); +}, "Uint8ClampedArray(arrayBuffer)");