diff --git a/test/built-ins/TypedArray/prototype/Symbol.toStringTag/return-typedarrayname.js b/test/built-ins/TypedArray/prototype/Symbol.toStringTag/return-typedarrayname.js new file mode 100644 index 0000000000000000000000000000000000000000..72127f90d212bbfd36ae2017ad525c8f20fd3d91 --- /dev/null +++ b/test/built-ins/TypedArray/prototype/Symbol.toStringTag/return-typedarrayname.js @@ -0,0 +1,21 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-get-%typedarray%.prototype-@@tostringtag +description: | + Return value from the [[TypedArrayName]] internal slot +info: > + 22.2.3.32 get %TypedArray%.prototype [ @@toStringTag ] + + ... + 4. Let name be the value of O's [[TypedArrayName]] internal slot. + 5. Assert: name is a String value. + 6. Return name. +includes: [testTypedArray.js] +features: [Symbol.toStringTag] +---*/ + +testWithTypedArrayConstructors(function(TA) { + var ta = new TA(); + assert.sameValue(ta[Symbol.toStringTag], TA.name, "property value"); +}); diff --git a/test/built-ins/TypedArray/prototype/Symbol.toStringTag/this-has-no-typedarrayname-internal.js b/test/built-ins/TypedArray/prototype/Symbol.toStringTag/this-has-no-typedarrayname-internal.js new file mode 100644 index 0000000000000000000000000000000000000000..6c6567b824498c7f9cd5aa815a8ccb17e227f9b5 --- /dev/null +++ b/test/built-ins/TypedArray/prototype/Symbol.toStringTag/this-has-no-typedarrayname-internal.js @@ -0,0 +1,29 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-get-%typedarray%.prototype-@@tostringtag +description: > + Return undefined when `this` does not have a [[TypedArrayName]] internal slot +info: > + 22.2.3.32 get %TypedArray%.prototype [ @@toStringTag ] + + 1. Let O be the this value. + ... + 3. If O does not have a [[TypedArrayName]] internal slot, return undefined. + ... +includes: [testTypedArray.js] +features: [Symbol.toStringTag, DataView] +---*/ + +var TypedArrayPrototype = TypedArray.prototype; +var getter = Object.getOwnPropertyDescriptor( + TypedArrayPrototype, Symbol.toStringTag +).get; + +assert.sameValue(getter.call({}), undefined); +assert.sameValue(getter.call([]), undefined); +assert.sameValue(getter.call(new ArrayBuffer(8)), undefined); + +var ab = new ArrayBuffer(8); +var dv = new DataView(ab, 0, 1); +assert.sameValue(getter.call(dv), undefined); diff --git a/test/built-ins/TypedArray/prototype/Symbol.toStringTag/this-is-not-object.js b/test/built-ins/TypedArray/prototype/Symbol.toStringTag/this-is-not-object.js new file mode 100644 index 0000000000000000000000000000000000000000..99a95d608b6a8138a7e8cd3ad36dcf410705be75 --- /dev/null +++ b/test/built-ins/TypedArray/prototype/Symbol.toStringTag/this-is-not-object.js @@ -0,0 +1,27 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-get-%typedarray%.prototype-@@tostringtag +description: Return undefined when `this` is not Object +info: > + 22.2.3.32 get %TypedArray%.prototype [ @@toStringTag ] + + 1. Let O be the this value. + 2. If Type(O) is not Object, return undefined. + ... +includes: [testTypedArray.js] +features: [Symbol, Symbol.toStringTag] +---*/ + +var TypedArrayPrototype = TypedArray.prototype; +var getter = Object.getOwnPropertyDescriptor( + TypedArrayPrototype, Symbol.toStringTag +).get; + +assert.sameValue(getter.call(undefined), undefined, "this is undefined"); +assert.sameValue(getter.call(42), undefined, "this is 42"); +assert.sameValue(getter.call("foo"), undefined, "this is a string"); +assert.sameValue(getter.call(true), undefined, "this is true"); +assert.sameValue(getter.call(false), undefined, "this is false"); +assert.sameValue(getter.call(Symbol("s")), undefined, "this is a Symbol"); +assert.sameValue(getter.call(null), undefined, "this is null"); diff --git a/test/built-ins/TypedArray/prototype/buffer/prop-desc.js b/test/built-ins/TypedArray/prototype/buffer/prop-desc.js index a413419495062a460d8f167443b18be38331f1dd..f026c0668ef4a5aceb7bf1f31830d4b45da31433 100644 --- a/test/built-ins/TypedArray/prototype/buffer/prop-desc.js +++ b/test/built-ins/TypedArray/prototype/buffer/prop-desc.js @@ -7,11 +7,17 @@ description: > info: > %TypedArray%.prototype.buffer is an accessor property whose set accessor function is undefined. -includes: [testTypedArray.js] + + Section 17: Every accessor property described in clauses 18 through 26 and in + Annex B.2 has the attributes {[[Enumerable]]: false, [[Configurable]]: true } +includes: [propertyHelper.js, testTypedArray.js] ---*/ var TypedArrayPrototype = TypedArray.prototype; -var desc = Object.getOwnPropertyDescriptor(TypedArrayPrototype, 'buffer'); +var desc = Object.getOwnPropertyDescriptor(TypedArrayPrototype, "buffer"); assert.sameValue(desc.set, undefined); -assert.sameValue(typeof desc.get, 'function'); +assert.sameValue(typeof desc.get, "function"); + +verifyNotEnumerable(TypedArrayPrototype, "buffer"); +verifyConfigurable(TypedArrayPrototype, "buffer"); diff --git a/test/built-ins/TypedArray/prototype/buffer/return-buffer.js b/test/built-ins/TypedArray/prototype/buffer/return-buffer.js new file mode 100644 index 0000000000000000000000000000000000000000..63e3b071394c9d91188d02558a8d020c260bcc25 --- /dev/null +++ b/test/built-ins/TypedArray/prototype/buffer/return-buffer.js @@ -0,0 +1,21 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +es6id: 22.2.3.1 +description: | + Return buffer from [[ViewedArrayBuffer]] internal slot +info: > + 22.2.3.1 get %TypedArray%.prototype.buffer + + ... + 4. Let buffer be the value of O's [[ViewedArrayBuffer]] internal slot. + 5. Return buffer. +includes: [testTypedArray.js] +---*/ + +testWithTypedArrayConstructors(function(TA) { + var buffer = new ArrayBuffer(TA.BYTES_PER_ELEMENT); + var ta = new TA(buffer); + + assert.sameValue(ta.buffer, buffer); +}); diff --git a/test/built-ins/TypedArray/prototype/buffer/return-dataview-buffer.js b/test/built-ins/TypedArray/prototype/buffer/return-dataview-buffer.js new file mode 100644 index 0000000000000000000000000000000000000000..05992e520efa85a6406043fcfafcc7b9c03bfb8b --- /dev/null +++ b/test/built-ins/TypedArray/prototype/buffer/return-dataview-buffer.js @@ -0,0 +1,24 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +es6id: 22.2.3.1 +description: | + Return buffer from DataView's instance [[ViewedArrayBuffer]] internal slot +info: > + 22.2.3.1 get %TypedArray%.prototype.buffer + + ... + 4. Let buffer be the value of O's [[ViewedArrayBuffer]] internal slot. + 5. Return buffer. +includes: [testTypedArray.js] +features: [DataView] +---*/ + +var getter = Object.getOwnPropertyDescriptor( + TypedArray.prototype, "buffer" +).get; + +var buffer = new ArrayBuffer(8); +var dv = new DataView(buffer, 0); + +assert.sameValue(getter.call(dv), buffer); diff --git a/test/built-ins/TypedArray/prototype/buffer/this-has-no-viewedarraybuffer-internal.js b/test/built-ins/TypedArray/prototype/buffer/this-has-no-viewedarraybuffer-internal.js new file mode 100644 index 0000000000000000000000000000000000000000..8939cad810b2db2260f90fdf20853814a7ab0017 --- /dev/null +++ b/test/built-ins/TypedArray/prototype/buffer/this-has-no-viewedarraybuffer-internal.js @@ -0,0 +1,35 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +es6id: 22.2.3.1 +description: | + Throws a TypeError exception when `this` does not have a [[ViewedArrayBuffer]] + internal slot +info: > + 22.2.3.1 get %TypedArray%.prototype.buffer + + 1. Let O be the this value. + 2. If Type(O) is not Object, throw a TypeError exception. + 3. If O does not have a [[ViewedArrayBuffer]] internal slot, throw a TypeError + exception. + ... +includes: [testTypedArray.js] +---*/ + +var TypedArrayPrototype = TypedArray.prototype; +var getter = Object.getOwnPropertyDescriptor( + TypedArrayPrototype, "buffer" +).get; + +assert.throws(TypeError, function() { + getter.call({}); +}); + +assert.throws(TypeError, function() { + getter.call([]); +}); + +var ab = new ArrayBuffer(8); +assert.throws(TypeError, function() { + getter.call(ab); +}); diff --git a/test/built-ins/TypedArray/prototype/buffer/this-is-not-object.js b/test/built-ins/TypedArray/prototype/buffer/this-is-not-object.js new file mode 100644 index 0000000000000000000000000000000000000000..b0cdaf828aa0d4704bba6e1624466b84f8abd7ce --- /dev/null +++ b/test/built-ins/TypedArray/prototype/buffer/this-is-not-object.js @@ -0,0 +1,48 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +es6id: 22.2.3.1 +description: Throws a TypeError exception when `this` is not Object +info: > + 22.2.3.1 get %TypedArray%.prototype.buffer + + 1. Let O be the this value. + 2. If Type(O) is not Object, throw a TypeError exception. + ... +includes: [testTypedArray.js] +features: [Symbol] +---*/ + +var TypedArrayPrototype = TypedArray.prototype; +var getter = Object.getOwnPropertyDescriptor( + TypedArrayPrototype, "buffer" +).get; + +assert.throws(TypeError, function() { + getter.call(undefined); +}, "this is undefined"); + +assert.throws(TypeError, function() { + getter.call(null); +}, "this is null"); + +assert.throws(TypeError, function() { + getter.call(42); +}, "this is 42"); + +assert.throws(TypeError, function() { + getter.call("1"); +}, "this is a string"); + +assert.throws(TypeError, function() { + getter.call(true); +}, "this is true"); + +assert.throws(TypeError, function() { + getter.call(false); +}, "this is false"); + +var s = Symbol("s"); +assert.throws(TypeError, function() { + getter.call(s); +}, "this is a Symbol"); diff --git a/test/built-ins/TypedArray/prototype/byteLength/prop-desc.js b/test/built-ins/TypedArray/prototype/byteLength/prop-desc.js index 8ceec382530b9bf5b80d451a863e43832ddf8440..3f227ee448b4b58f0b7ad7eae36483d0c150d695 100644 --- a/test/built-ins/TypedArray/prototype/byteLength/prop-desc.js +++ b/test/built-ins/TypedArray/prototype/byteLength/prop-desc.js @@ -7,11 +7,17 @@ description: > info: > %TypedArray%.prototype.byteLength is an accessor property whose set accessor function is undefined. -includes: [testTypedArray.js] + + Section 17: Every accessor property described in clauses 18 through 26 and in + Annex B.2 has the attributes {[[Enumerable]]: false, [[Configurable]]: true } +includes: [propertyHelper.js, testTypedArray.js] ---*/ var TypedArrayPrototype = TypedArray.prototype; -var desc = Object.getOwnPropertyDescriptor(TypedArrayPrototype, 'byteLength'); +var desc = Object.getOwnPropertyDescriptor(TypedArrayPrototype, "byteLength"); assert.sameValue(desc.set, undefined); -assert.sameValue(typeof desc.get, 'function'); +assert.sameValue(typeof desc.get, "function"); + +verifyNotEnumerable(TypedArrayPrototype, "byteLength"); +verifyConfigurable(TypedArrayPrototype, "byteLength"); diff --git a/test/built-ins/TypedArray/prototype/byteLength/return-bytelength.js b/test/built-ins/TypedArray/prototype/byteLength/return-bytelength.js new file mode 100644 index 0000000000000000000000000000000000000000..45ac33ac41ccfe14f14fd4bfd03a9ba96334f0f1 --- /dev/null +++ b/test/built-ins/TypedArray/prototype/byteLength/return-bytelength.js @@ -0,0 +1,23 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +es6id: 22.2.3.2 +description: | + Return value from [[ByteLength]] internal slot +info: > + 22.2.3.2 get %TypedArray%.prototype.byteLength + + ... + 6. Let size be the value of O's [[ByteLength]] internal slot. + 7. Return size. +includes: [testTypedArray.js] +---*/ + +testWithTypedArrayConstructors(function(TA) { + var bytesPerElement = TA.BYTES_PER_ELEMENT; + var ta1 = new TA(); + assert.sameValue(ta1.byteLength, 0); + + var ta2 = new TA(42); + assert.sameValue(ta2.byteLength, 42 * bytesPerElement); +}); diff --git a/test/built-ins/TypedArray/prototype/byteLength/return-dataview-bytelength.js b/test/built-ins/TypedArray/prototype/byteLength/return-dataview-bytelength.js new file mode 100644 index 0000000000000000000000000000000000000000..8f1930d0d005dcbf9b170b06281ad9c49aad0d0a --- /dev/null +++ b/test/built-ins/TypedArray/prototype/byteLength/return-dataview-bytelength.js @@ -0,0 +1,24 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +es6id: 22.2.3.2 +description: | + Return buffer from DataView's instance [[ViewedArrayBuffer]] internal slot +info: > + 22.2.3.2 get %TypedArray%.prototype.byteLength + + ... + 6. Let size be the value of O's [[ByteLength]] internal slot. + 7. Return size. +includes: [testTypedArray.js] +features: [DataView] +---*/ + +var getter = Object.getOwnPropertyDescriptor( + TypedArray.prototype, "byteLength" +).get; + +var buffer = new ArrayBuffer(64); +var dv = new DataView(buffer, 0); + +assert.sameValue(getter.call(dv), 64); diff --git a/test/built-ins/TypedArray/prototype/byteLength/this-has-no-viewedarraybuffer-internal.js b/test/built-ins/TypedArray/prototype/byteLength/this-has-no-viewedarraybuffer-internal.js new file mode 100644 index 0000000000000000000000000000000000000000..935c86c03d540790fc6baa3a8ee61efc7b443cad --- /dev/null +++ b/test/built-ins/TypedArray/prototype/byteLength/this-has-no-viewedarraybuffer-internal.js @@ -0,0 +1,35 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +es6id: 22.2.3.2 +description: | + Throws a TypeError exception when `this` does not have a [[ViewedArrayBuffer]] + internal slot +info: > + 22.2.3.2 get %TypedArray%.prototype.byteLength + + 1. Let O be the this value. + 2. If Type(O) is not Object, throw a TypeError exception. + 3. If O does not have a [[ViewedArrayBuffer]] internal slot, throw a TypeError + exception. + ... +includes: [testTypedArray.js] +---*/ + +var TypedArrayPrototype = TypedArray.prototype; +var getter = Object.getOwnPropertyDescriptor( + TypedArrayPrototype, "byteLength" +).get; + +assert.throws(TypeError, function() { + getter.call({}); +}); + +assert.throws(TypeError, function() { + getter.call([]); +}); + +var ab = new ArrayBuffer(8); +assert.throws(TypeError, function() { + getter.call(ab); +}); diff --git a/test/built-ins/TypedArray/prototype/byteLength/this-is-not-object.js b/test/built-ins/TypedArray/prototype/byteLength/this-is-not-object.js new file mode 100644 index 0000000000000000000000000000000000000000..8dd7a61798bcd644b73fb5ec5773dbf699975767 --- /dev/null +++ b/test/built-ins/TypedArray/prototype/byteLength/this-is-not-object.js @@ -0,0 +1,48 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +es6id: 22.2.3.2 +description: Throws a TypeError exception when `this` is not Object +info: > + 22.2.3.2 get %TypedArray%.prototype.byteLength + + 1. Let O be the this value. + 2. If Type(O) is not Object, throw a TypeError exception. + ... +includes: [testTypedArray.js] +features: [Symbol] +---*/ + +var TypedArrayPrototype = TypedArray.prototype; +var getter = Object.getOwnPropertyDescriptor( + TypedArrayPrototype, "byteLength" +).get; + +assert.throws(TypeError, function() { + getter.call(undefined); +}, "this is undefined"); + +assert.throws(TypeError, function() { + getter.call(null); +}, "this is null"); + +assert.throws(TypeError, function() { + getter.call(42); +}, "this is 42"); + +assert.throws(TypeError, function() { + getter.call("1"); +}, "this is a string"); + +assert.throws(TypeError, function() { + getter.call(true); +}, "this is true"); + +assert.throws(TypeError, function() { + getter.call(false); +}, "this is false"); + +var s = Symbol("s"); +assert.throws(TypeError, function() { + getter.call(s); +}, "this is a Symbol"); diff --git a/test/built-ins/TypedArray/prototype/byteOffset/prop-desc.js b/test/built-ins/TypedArray/prototype/byteOffset/prop-desc.js index 7b180db704eb011873a6c4d62a0df1b6993bab12..f03c4963d61b8ad88529463e2c3cf5e82beb191c 100644 --- a/test/built-ins/TypedArray/prototype/byteOffset/prop-desc.js +++ b/test/built-ins/TypedArray/prototype/byteOffset/prop-desc.js @@ -7,11 +7,17 @@ description: > info: > %TypedArray%.prototype.byteOffset is an accessor property whose set accessor function is undefined. -includes: [testTypedArray.js] + + Section 17: Every accessor property described in clauses 18 through 26 and in + Annex B.2 has the attributes {[[Enumerable]]: false, [[Configurable]]: true } +includes: [propertyHelper.js, testTypedArray.js] ---*/ var TypedArrayPrototype = TypedArray.prototype; -var desc = Object.getOwnPropertyDescriptor(TypedArrayPrototype, 'byteOffset'); +var desc = Object.getOwnPropertyDescriptor(TypedArrayPrototype, "byteOffset"); assert.sameValue(desc.set, undefined); -assert.sameValue(typeof desc.get, 'function'); +assert.sameValue(typeof desc.get, "function"); + +verifyNotEnumerable(TypedArrayPrototype, "byteOffset"); +verifyConfigurable(TypedArrayPrototype, "byteOffset"); diff --git a/test/built-ins/TypedArray/prototype/byteOffset/return-byteoffset.js b/test/built-ins/TypedArray/prototype/byteOffset/return-byteoffset.js new file mode 100644 index 0000000000000000000000000000000000000000..51570aa23a08cda1960ee348860a2e89403e987b --- /dev/null +++ b/test/built-ins/TypedArray/prototype/byteOffset/return-byteoffset.js @@ -0,0 +1,30 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +es6id: 22.2.3.3 +description: | + Return value from [[ByteOffset]] internal slot +info: > + 22.2.3.3 get %TypedArray%.prototype.byteOffset + + ... + 6. Let offset be the value of O's [[ByteOffset]] internal slot. + 7. Return size. +includes: [testTypedArray.js] +---*/ + +testWithTypedArrayConstructors(function(TA) { + var ta1 = new TA(); + assert.sameValue(ta1.byteOffset, 0, "Regular typedArray"); + + var offset = 4 * TA.BYTES_PER_ELEMENT; + + var buffer1 = new ArrayBuffer(8 * TA.BYTES_PER_ELEMENT); + var ta2 = new TA(buffer1, offset); + assert.sameValue(ta2.byteOffset, offset, "TA(buffer, offset)"); + + var buffer2 = new ArrayBuffer(8 * TA.BYTES_PER_ELEMENT); + var sample = new TA(buffer2, offset) + var ta3 = new TA(sample); + assert.sameValue(ta3.byteOffset, 0, "TA(typedArray)"); +}); diff --git a/test/built-ins/TypedArray/prototype/byteOffset/return-dataview-byteoffset.js b/test/built-ins/TypedArray/prototype/byteOffset/return-dataview-byteoffset.js new file mode 100644 index 0000000000000000000000000000000000000000..916514a5c5a4763032f67f5c9dda408fe3f6ff3a --- /dev/null +++ b/test/built-ins/TypedArray/prototype/byteOffset/return-dataview-byteoffset.js @@ -0,0 +1,27 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +es6id: 22.2.3.2 +description: | + Return buffer from DataView's instance [[ViewedArrayBuffer]] internal slot +info: > + 22.2.3.2 get %TypedArray%.prototype.byteOffset + + ... + 6. Let offset be the value of O's [[ByteOffset]] internal slot. + 7. Return size. +includes: [testTypedArray.js] +features: [DataView] +---*/ + +var getter = Object.getOwnPropertyDescriptor( + TypedArray.prototype, "byteOffset" +).get; + +var buffer = new ArrayBuffer(64); + +var dv1 = new DataView(buffer, 0); +assert.sameValue(getter.call(dv1), 0); + +var dv2 = new DataView(buffer, 32); +assert.sameValue(getter.call(dv2), 32); diff --git a/test/built-ins/TypedArray/prototype/byteOffset/this-has-no-viewedarraybuffer-internal.js b/test/built-ins/TypedArray/prototype/byteOffset/this-has-no-viewedarraybuffer-internal.js new file mode 100644 index 0000000000000000000000000000000000000000..a444fdbf147ccdf8811c50bff1266bb5b77f9e81 --- /dev/null +++ b/test/built-ins/TypedArray/prototype/byteOffset/this-has-no-viewedarraybuffer-internal.js @@ -0,0 +1,35 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +es6id: 22.2.3.3 +description: | + Throws a TypeError exception when `this` does not have a [[ViewedArrayBuffer]] + internal slot +info: > + 22.2.3.3 get %TypedArray%.prototype.byteOffset + + 1. Let O be the this value. + 2. If Type(O) is not Object, throw a TypeError exception. + 3. If O does not have a [[ViewedArrayBuffer]] internal slot, throw a TypeError + exception. + ... +includes: [testTypedArray.js] +---*/ + +var TypedArrayPrototype = TypedArray.prototype; +var getter = Object.getOwnPropertyDescriptor( + TypedArrayPrototype, "byteOffset" +).get; + +assert.throws(TypeError, function() { + getter.call({}); +}); + +assert.throws(TypeError, function() { + getter.call([]); +}); + +var ab = new ArrayBuffer(8); +assert.throws(TypeError, function() { + getter.call(ab); +}); diff --git a/test/built-ins/TypedArray/prototype/byteOffset/this-is-not-object.js b/test/built-ins/TypedArray/prototype/byteOffset/this-is-not-object.js new file mode 100644 index 0000000000000000000000000000000000000000..244072f9faf63e757eab197d718594d56e72e3b8 --- /dev/null +++ b/test/built-ins/TypedArray/prototype/byteOffset/this-is-not-object.js @@ -0,0 +1,48 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +es6id: 22.2.3.3 +description: Throws a TypeError exception when `this` is not Object +info: > + 22.2.3.3 get %TypedArray%.prototype.byteOffset + + 1. Let O be the this value. + 2. If Type(O) is not Object, throw a TypeError exception. + ... +includes: [testTypedArray.js] +features: [Symbol] +---*/ + +var TypedArrayPrototype = TypedArray.prototype; +var getter = Object.getOwnPropertyDescriptor( + TypedArrayPrototype, "byteOffset" +).get; + +assert.throws(TypeError, function() { + getter.call(undefined); +}, "this is undefined"); + +assert.throws(TypeError, function() { + getter.call(null); +}, "this is null"); + +assert.throws(TypeError, function() { + getter.call(42); +}, "this is 42"); + +assert.throws(TypeError, function() { + getter.call("1"); +}, "this is a string"); + +assert.throws(TypeError, function() { + getter.call(true); +}, "this is true"); + +assert.throws(TypeError, function() { + getter.call(false); +}, "this is false"); + +var s = Symbol("s"); +assert.throws(TypeError, function() { + getter.call(s); +}, "this is a Symbol"); diff --git a/test/built-ins/TypedArray/prototype/length/prop-desc.js b/test/built-ins/TypedArray/prototype/length/prop-desc.js index 3f40eae8936c750cfce3177aa7801ea971929b60..ff2718060b3198801598207fcaed20b8959a4ba1 100644 --- a/test/built-ins/TypedArray/prototype/length/prop-desc.js +++ b/test/built-ins/TypedArray/prototype/length/prop-desc.js @@ -7,11 +7,17 @@ description: > info: > %TypedArray%.prototype.length is an accessor property whose set accessor function is undefined. -includes: [testTypedArray.js] + + Section 17: Every accessor property described in clauses 18 through 26 and in + Annex B.2 has the attributes {[[Enumerable]]: false, [[Configurable]]: true } +includes: [propertyHelper.js, testTypedArray.js] ---*/ var TypedArrayPrototype = TypedArray.prototype; -var desc = Object.getOwnPropertyDescriptor(TypedArrayPrototype, 'length'); +var desc = Object.getOwnPropertyDescriptor(TypedArrayPrototype, "length"); assert.sameValue(desc.set, undefined); -assert.sameValue(typeof desc.get, 'function'); +assert.sameValue(typeof desc.get, "function"); + +verifyNotEnumerable(TypedArrayPrototype, "length"); +verifyConfigurable(TypedArrayPrototype, "length"); diff --git a/test/built-ins/TypedArray/prototype/length/return-length.js b/test/built-ins/TypedArray/prototype/length/return-length.js new file mode 100644 index 0000000000000000000000000000000000000000..61e3f9dfcbd6969a8865f4701b0750f956496f9e --- /dev/null +++ b/test/built-ins/TypedArray/prototype/length/return-length.js @@ -0,0 +1,27 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-get-%typedarray%.prototype.length +description: | + Return value from the [[ArrayLength]] internal slot +info: > + 22.2.3.18 get %TypedArray%.prototype.length + + ... + 6. Let length be the value of O's [[ArrayLength]] internal slot. + 7. Return length. + + --- + + The current tests on `prop-desc.js` and `length.js` already assert `length` is + not a dynamic property as in regular arrays. +includes: [testTypedArray.js] +---*/ + +testWithTypedArrayConstructors(function(TA) { + var ta1 = new TA(); + assert.sameValue(ta1.length, 0); + + var ta2 = new TA(42); + assert.sameValue(ta2.length, 42); +}); diff --git a/test/built-ins/TypedArray/prototype/length/this-has-no-typedarrayname-internal.js b/test/built-ins/TypedArray/prototype/length/this-has-no-typedarrayname-internal.js new file mode 100644 index 0000000000000000000000000000000000000000..94db7aa5791dd21bf262e5dd976744937e06ba24 --- /dev/null +++ b/test/built-ins/TypedArray/prototype/length/this-has-no-typedarrayname-internal.js @@ -0,0 +1,41 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-get-%typedarray%.prototype.length +description: | + Throws a TypeError exception when `this` does not have a [[TypedArrayName]] + internal slot +info: > + 22.2.3.18 get %TypedArray%.prototype.length + + 1. Let O be the this value. + 2. If Type(O) is not Object, throw a TypeError exception. + 3. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError + exception. + ... +includes: [testTypedArray.js] +features: [DataView] +---*/ + +var TypedArrayPrototype = TypedArray.prototype; +var getter = Object.getOwnPropertyDescriptor( + TypedArrayPrototype, "length" +).get; + +assert.throws(TypeError, function() { + getter.call({}); +}); + +assert.throws(TypeError, function() { + getter.call([]); +}); + +var ab = new ArrayBuffer(8); +assert.throws(TypeError, function() { + getter.call(ab); +}); + +var dv = new DataView(new ArrayBuffer(8), 0); +assert.throws(TypeError, function() { + getter.call(dv); +}); diff --git a/test/built-ins/TypedArray/prototype/length/this-is-not-object-strict-mode.js b/test/built-ins/TypedArray/prototype/length/this-is-not-object-strict-mode.js new file mode 100644 index 0000000000000000000000000000000000000000..d22f4d5ad70a56505227e19d64a265b905845dff --- /dev/null +++ b/test/built-ins/TypedArray/prototype/length/this-is-not-object-strict-mode.js @@ -0,0 +1,27 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-get-%typedarray%.prototype.length +description: Throws a TypeError exception when `this` is null or undefined +info: > + 22.2.3.18 get %TypedArray%.prototype.length + + 1. Let O be the this value. + 2. If Type(O) is not Object, throw a TypeError exception. + ... +includes: [testTypedArray.js] +flags: [onlyStrict] +---*/ + +var TypedArrayPrototype = TypedArray.prototype; +var getter = Object.getOwnPropertyDescriptor( + TypedArrayPrototype, "length" +).get; + +assert.throws(TypeError, function() { + getter.call(undefined); +}); + +assert.throws(TypeError, function() { + getter.call(null); +}); diff --git a/test/built-ins/TypedArray/prototype/length/this-is-not-object.js b/test/built-ins/TypedArray/prototype/length/this-is-not-object.js new file mode 100644 index 0000000000000000000000000000000000000000..77685b43a1e712638553ec9c4d8b6227b5e2c679 --- /dev/null +++ b/test/built-ins/TypedArray/prototype/length/this-is-not-object.js @@ -0,0 +1,40 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-get-%typedarray%.prototype.length +description: Throws a TypeError exception when `this` is not Object +info: > + 22.2.3.18 get %TypedArray%.prototype.length + + 1. Let O be the this value. + 2. If Type(O) is not Object, throw a TypeError exception. + ... +includes: [testTypedArray.js] +features: [Symbol] +---*/ + +var TypedArrayPrototype = TypedArray.prototype; +var getter = Object.getOwnPropertyDescriptor( + TypedArrayPrototype, "length" +).get; + +assert.throws(TypeError, function() { + getter.call(42); +}); + +assert.throws(TypeError, function() { + getter.call("1"); +}); + +assert.throws(TypeError, function() { + getter.call(true); +}); + +assert.throws(TypeError, function() { + getter.call(false); +}); + +var s = Symbol("s"); +assert.throws(TypeError, function() { + getter.call(s); +}); diff --git a/test/built-ins/TypedArray/prototype/toString/prop-desc.js b/test/built-ins/TypedArray/prototype/toString/prop-desc.js new file mode 100644 index 0000000000000000000000000000000000000000..c5277b14777f7966d2966e5f197c994d2ff355c1 --- /dev/null +++ b/test/built-ins/TypedArray/prototype/toString/prop-desc.js @@ -0,0 +1,19 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +es6id: 22.2.3.28 +esid: sec-%typedarray%.prototype.tostring +description: > + "String" property of TypedArrayPrototype +info: > + ES6 section 17: Every other data property described in clauses 18 through + 26 and in Annex B.2 has the attributes { [[Writable]]: true, + [[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js, testTypedArray.js] +---*/ + +var TypedArrayPrototype = TypedArray.prototype; + +verifyNotEnumerable(TypedArrayPrototype, "toString"); +verifyWritable(TypedArrayPrototype, "toString"); +verifyConfigurable(TypedArrayPrototype, "toString"); diff --git a/test/built-ins/TypedArrays/prototype/Symbol.iterator.js b/test/built-ins/TypedArrays/prototype/Symbol.iterator.js new file mode 100755 index 0000000000000000000000000000000000000000..cfb4a24244be8056b8bbd732c119680306f77453 --- /dev/null +++ b/test/built-ins/TypedArrays/prototype/Symbol.iterator.js @@ -0,0 +1,13 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-%typedarray%.prototype-@@iterator +description: > + _TypedArray_.prototype has no own property @@iterator +includes: [testTypedArray.js] +features: [Symbol.iterator] +---*/ + +testWithTypedArrayConstructors(function(TA) { + assert.sameValue(TA.prototype.hasOwnProperty(Symbol.iterator), false); +}); diff --git a/test/built-ins/TypedArrays/prototype/Symbol.toStringTag/inherited.js b/test/built-ins/TypedArrays/prototype/Symbol.toStringTag/inherited.js new file mode 100644 index 0000000000000000000000000000000000000000..1e5cc0e2bb89e24b8baba7e871904452be45334b --- /dev/null +++ b/test/built-ins/TypedArrays/prototype/Symbol.toStringTag/inherited.js @@ -0,0 +1,14 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-get-%typedarray%.prototype-@@tostringtag +description: > + _TypedArray_.prototype[@@toStringTag] is inherited from %TypedArray% + _TypedArray_.prototype has no own property @@toStringTag +includes: [testTypedArray.js] +features: [Symbol.toStringTag] +---*/ + +testWithTypedArrayConstructors(function(TA) { + assert.sameValue(TA.prototype.hasOwnProperty(Symbol.toStringTag), false); +}); diff --git a/test/built-ins/TypedArrays/prototype/buffer/inherited.js b/test/built-ins/TypedArrays/prototype/buffer/inherited.js new file mode 100644 index 0000000000000000000000000000000000000000..0d68c60fdcc347269a64a2c2bd9aa3ea01262619 --- /dev/null +++ b/test/built-ins/TypedArrays/prototype/buffer/inherited.js @@ -0,0 +1,12 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-get-%typedarray%.prototype.buffer +description: > + _TypedArray_.prototype has no own property "buffer" +includes: [testTypedArray.js] +---*/ + +testWithTypedArrayConstructors(function(TA) { + assert.sameValue(TA.prototype.hasOwnProperty("buffer"), false); +}); diff --git a/test/built-ins/TypedArrays/prototype/byteLength/inherited.js b/test/built-ins/TypedArrays/prototype/byteLength/inherited.js new file mode 100644 index 0000000000000000000000000000000000000000..55646f37ef2aa06f26a168e83abbe59566fa98c5 --- /dev/null +++ b/test/built-ins/TypedArrays/prototype/byteLength/inherited.js @@ -0,0 +1,12 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-get-%typedarray%.prototype.bytelength +description: > + _TypedArray_.prototype has no own property "byteLength" +includes: [testTypedArray.js] +---*/ + +testWithTypedArrayConstructors(function(TA) { + assert.sameValue(TA.prototype.hasOwnProperty("byteLength"), false); +}); diff --git a/test/built-ins/TypedArrays/prototype/byteOffset/inherited.js b/test/built-ins/TypedArrays/prototype/byteOffset/inherited.js new file mode 100644 index 0000000000000000000000000000000000000000..eb098d6267394b547e48734ab77adc9e95680bb7 --- /dev/null +++ b/test/built-ins/TypedArrays/prototype/byteOffset/inherited.js @@ -0,0 +1,12 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-get-%typedarray%.prototype.byteoffset +description: > + _TypedArray_.prototype has no own property "byteOffset" +includes: [testTypedArray.js] +---*/ + +testWithTypedArrayConstructors(function(TA) { + assert.sameValue(TA.prototype.hasOwnProperty("byteOffset"), false); +}); diff --git a/test/built-ins/TypedArrays/prototype/copyWithin/inherited.js b/test/built-ins/TypedArrays/prototype/copyWithin/inherited.js new file mode 100644 index 0000000000000000000000000000000000000000..9c2e52ac32799dba508d1930eaf9ee310bbf8b30 --- /dev/null +++ b/test/built-ins/TypedArrays/prototype/copyWithin/inherited.js @@ -0,0 +1,12 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-%typedarray%.prototype.copywithin +description: > + _TypedArray_.prototype has no own property "copyWithin" +includes: [testTypedArray.js] +---*/ + +testWithTypedArrayConstructors(function(TA) { + assert.sameValue(TA.prototype.hasOwnProperty("copyWithin"), false); +}); diff --git a/test/built-ins/TypedArrays/prototype/entries/inherited.js b/test/built-ins/TypedArrays/prototype/entries/inherited.js new file mode 100644 index 0000000000000000000000000000000000000000..e4b080c5596d70b637fea6ee480a1ab0071725d0 --- /dev/null +++ b/test/built-ins/TypedArrays/prototype/entries/inherited.js @@ -0,0 +1,12 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-%typedarray%.prototype.entries +description: > + _TypedArray_.prototype has no own property "entries" +includes: [testTypedArray.js] +---*/ + +testWithTypedArrayConstructors(function(TA) { + assert.sameValue(TA.prototype.hasOwnProperty("entries"), false); +}); diff --git a/test/built-ins/TypedArrays/prototype/every/inherited.js b/test/built-ins/TypedArrays/prototype/every/inherited.js new file mode 100644 index 0000000000000000000000000000000000000000..fcf42763effa248fb2e48f25aba65ca1a9ba4fe0 --- /dev/null +++ b/test/built-ins/TypedArrays/prototype/every/inherited.js @@ -0,0 +1,12 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-%typedarray%.prototype.every +description: > + _TypedArray_.prototype has no own property "every" +includes: [testTypedArray.js] +---*/ + +testWithTypedArrayConstructors(function(TA) { + assert.sameValue(TA.prototype.hasOwnProperty("every"), false); +}); diff --git a/test/built-ins/TypedArrays/prototype/fill/inherited.js b/test/built-ins/TypedArrays/prototype/fill/inherited.js new file mode 100644 index 0000000000000000000000000000000000000000..050de1b053135d7428d5f50e99171edfe38d4620 --- /dev/null +++ b/test/built-ins/TypedArrays/prototype/fill/inherited.js @@ -0,0 +1,12 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-%typedarray%.prototype.fill +description: > + _TypedArray_.prototype has no own property "fill" +includes: [testTypedArray.js] +---*/ + +testWithTypedArrayConstructors(function(TA) { + assert.sameValue(TA.prototype.hasOwnProperty("fill"), false); +}); diff --git a/test/built-ins/TypedArrays/prototype/filter/inherited.js b/test/built-ins/TypedArrays/prototype/filter/inherited.js new file mode 100644 index 0000000000000000000000000000000000000000..48bde7b97ae716f4677d85d97e333ccb96cacb48 --- /dev/null +++ b/test/built-ins/TypedArrays/prototype/filter/inherited.js @@ -0,0 +1,12 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-%typedarray%.prototype.filter +description: > + _TypedArray_.prototype has no own property "filter" +includes: [testTypedArray.js] +---*/ + +testWithTypedArrayConstructors(function(TA) { + assert.sameValue(TA.prototype.hasOwnProperty("filter"), false); +}); diff --git a/test/built-ins/TypedArrays/prototype/find/inherited.js b/test/built-ins/TypedArrays/prototype/find/inherited.js new file mode 100644 index 0000000000000000000000000000000000000000..39be0a7c7bcf40bda6634c86079eb428d487daa8 --- /dev/null +++ b/test/built-ins/TypedArrays/prototype/find/inherited.js @@ -0,0 +1,12 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-%typedarray%.prototype.find +description: > + _TypedArray_.prototype has no own property "find" +includes: [testTypedArray.js] +---*/ + +testWithTypedArrayConstructors(function(TA) { + assert.sameValue(TA.prototype.hasOwnProperty("find"), false); +}); diff --git a/test/built-ins/TypedArrays/prototype/findIndex/inherited.js b/test/built-ins/TypedArrays/prototype/findIndex/inherited.js new file mode 100644 index 0000000000000000000000000000000000000000..df3acdd086dbbd46f9262a8cc6686a60cf21b25c --- /dev/null +++ b/test/built-ins/TypedArrays/prototype/findIndex/inherited.js @@ -0,0 +1,12 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-%typedarray%.prototype.findindex +description: > + _TypedArray_.prototype has no own property "findIndex" +includes: [testTypedArray.js] +---*/ + +testWithTypedArrayConstructors(function(TA) { + assert.sameValue(TA.prototype.hasOwnProperty("findIndex"), false); +}); diff --git a/test/built-ins/TypedArrays/prototype/forEach/inherited.js b/test/built-ins/TypedArrays/prototype/forEach/inherited.js new file mode 100644 index 0000000000000000000000000000000000000000..d08b41484b0fbc4a312ee690e9c51af971005420 --- /dev/null +++ b/test/built-ins/TypedArrays/prototype/forEach/inherited.js @@ -0,0 +1,12 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-%typedarray%.prototype.foreach +description: > + _TypedArray_.prototype has no own property "forEach" +includes: [testTypedArray.js] +---*/ + +testWithTypedArrayConstructors(function(TA) { + assert.sameValue(TA.prototype.hasOwnProperty("forEach"), false); +}); diff --git a/test/built-ins/TypedArrays/prototype/indexOf/inherited.js b/test/built-ins/TypedArrays/prototype/indexOf/inherited.js new file mode 100644 index 0000000000000000000000000000000000000000..fdebbaed11e8e3e81655e17b9c136cfb7571116a --- /dev/null +++ b/test/built-ins/TypedArrays/prototype/indexOf/inherited.js @@ -0,0 +1,12 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-%typedarray%.prototype.indexof +description: > + _TypedArray_.prototype has no own property "indexOf" +includes: [testTypedArray.js] +---*/ + +testWithTypedArrayConstructors(function(TA) { + assert.sameValue(TA.prototype.hasOwnProperty("indexOf"), false); +}); diff --git a/test/built-ins/TypedArrays/prototype/join/inherited.js b/test/built-ins/TypedArrays/prototype/join/inherited.js new file mode 100644 index 0000000000000000000000000000000000000000..07db7980aa07c4f9c56703d2470cc1209876c728 --- /dev/null +++ b/test/built-ins/TypedArrays/prototype/join/inherited.js @@ -0,0 +1,12 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-%typedarray%.prototype.join +description: > + _TypedArray_.prototype has no own property "join" +includes: [testTypedArray.js] +---*/ + +testWithTypedArrayConstructors(function(TA) { + assert.sameValue(TA.prototype.hasOwnProperty("join"), false); +}); diff --git a/test/built-ins/TypedArrays/prototype/keys/inherited.js b/test/built-ins/TypedArrays/prototype/keys/inherited.js new file mode 100644 index 0000000000000000000000000000000000000000..c2d85c011f79628d760348455423272fd33443b1 --- /dev/null +++ b/test/built-ins/TypedArrays/prototype/keys/inherited.js @@ -0,0 +1,12 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-%typedarray%.prototype.keys +description: > + _TypedArray_.prototype has no own property "keys" +includes: [testTypedArray.js] +---*/ + +testWithTypedArrayConstructors(function(TA) { + assert.sameValue(TA.prototype.hasOwnProperty("keys"), false); +}); diff --git a/test/built-ins/TypedArrays/prototype/lastIndexOf/inherited.js b/test/built-ins/TypedArrays/prototype/lastIndexOf/inherited.js new file mode 100644 index 0000000000000000000000000000000000000000..3dccc11ab7b3204e6d029e5a3617b4cdeaa5c989 --- /dev/null +++ b/test/built-ins/TypedArrays/prototype/lastIndexOf/inherited.js @@ -0,0 +1,12 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-%typedarray%.prototype.lastindexof +description: > + _TypedArray_.prototype has no own property "lastIndexOf" +includes: [testTypedArray.js] +---*/ + +testWithTypedArrayConstructors(function(TA) { + assert.sameValue(TA.prototype.hasOwnProperty("lastIndexOf"), false); +}); diff --git a/test/built-ins/TypedArrays/prototype/length/inherited.js b/test/built-ins/TypedArrays/prototype/length/inherited.js new file mode 100644 index 0000000000000000000000000000000000000000..fb73a6d5ee87c8196ee78531a2a9f7bbe8c0bcf3 --- /dev/null +++ b/test/built-ins/TypedArrays/prototype/length/inherited.js @@ -0,0 +1,12 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-get-%typedarray%.prototype.length +description: > + _TypedArray_.prototype has no own property "length" +includes: [testTypedArray.js] +---*/ + +testWithTypedArrayConstructors(function(TA) { + assert.sameValue(TA.prototype.hasOwnProperty("length"), false); +}); diff --git a/test/built-ins/TypedArrays/prototype/map/inherited.js b/test/built-ins/TypedArrays/prototype/map/inherited.js new file mode 100644 index 0000000000000000000000000000000000000000..8305e9331aaf83a33d85d865c490c7dd15ee52c9 --- /dev/null +++ b/test/built-ins/TypedArrays/prototype/map/inherited.js @@ -0,0 +1,12 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-%typedarray%.prototype.map +description: > + _TypedArray_.prototype has no own property "map" +includes: [testTypedArray.js] +---*/ + +testWithTypedArrayConstructors(function(TA) { + assert.sameValue(TA.prototype.hasOwnProperty("map"), false); +}); diff --git a/test/built-ins/TypedArrays/prototype/reduce/inherited.js b/test/built-ins/TypedArrays/prototype/reduce/inherited.js new file mode 100644 index 0000000000000000000000000000000000000000..a1327a87a2b2cce457c3020cf707c252d1f6fc52 --- /dev/null +++ b/test/built-ins/TypedArrays/prototype/reduce/inherited.js @@ -0,0 +1,12 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-get-%typedarray%.prototype.reduce +description: > + _TypedArray_.prototype has no own property "reduce" +includes: [testTypedArray.js] +---*/ + +testWithTypedArrayConstructors(function(TA) { + assert.sameValue(TA.prototype.hasOwnProperty("reduce"), false); +}); diff --git a/test/built-ins/TypedArrays/prototype/reduceRight/inherited.js b/test/built-ins/TypedArrays/prototype/reduceRight/inherited.js new file mode 100644 index 0000000000000000000000000000000000000000..0073fd5d28b031fa833c21797342560254b66680 --- /dev/null +++ b/test/built-ins/TypedArrays/prototype/reduceRight/inherited.js @@ -0,0 +1,12 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-%typedarray%.prototype.reduceright +description: > + _TypedArray_.prototype has no own property "reduceRight" +includes: [testTypedArray.js] +---*/ + +testWithTypedArrayConstructors(function(TA) { + assert.sameValue(TA.prototype.hasOwnProperty("reduceRight"), false); +}); diff --git a/test/built-ins/TypedArrays/prototype/reverse/inherited.js b/test/built-ins/TypedArrays/prototype/reverse/inherited.js new file mode 100644 index 0000000000000000000000000000000000000000..54555621f7af05219f30aa71c47e3664a5f378cd --- /dev/null +++ b/test/built-ins/TypedArrays/prototype/reverse/inherited.js @@ -0,0 +1,12 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-%typedarray%.prototype.reverse +description: > + _TypedArray_.prototype has no own property "reverse" +includes: [testTypedArray.js] +---*/ + +testWithTypedArrayConstructors(function(TA) { + assert.sameValue(TA.prototype.hasOwnProperty("reverse"), false); +}); diff --git a/test/built-ins/TypedArrays/prototype/set/inherited.js b/test/built-ins/TypedArrays/prototype/set/inherited.js new file mode 100644 index 0000000000000000000000000000000000000000..2b741bbdc9a86eca4c8dd90127d6db0de515d2d7 --- /dev/null +++ b/test/built-ins/TypedArrays/prototype/set/inherited.js @@ -0,0 +1,12 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-%typedarray%.prototype.set +description: > + _TypedArray_.prototype has no own property "set" +includes: [testTypedArray.js] +---*/ + +testWithTypedArrayConstructors(function(TA) { + assert.sameValue(TA.prototype.hasOwnProperty("set"), false); +}); diff --git a/test/built-ins/TypedArrays/prototype/slice/inherited.js b/test/built-ins/TypedArrays/prototype/slice/inherited.js new file mode 100644 index 0000000000000000000000000000000000000000..1fb88a840543e97b9663420a09f51f466194f471 --- /dev/null +++ b/test/built-ins/TypedArrays/prototype/slice/inherited.js @@ -0,0 +1,12 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-%typedarray%.prototype.slice +description: > + _TypedArray_.prototype has no own property "slice" +includes: [testTypedArray.js] +---*/ + +testWithTypedArrayConstructors(function(TA) { + assert.sameValue(TA.prototype.hasOwnProperty("slice"), false); +}); diff --git a/test/built-ins/TypedArrays/prototype/some/inherited.js b/test/built-ins/TypedArrays/prototype/some/inherited.js new file mode 100644 index 0000000000000000000000000000000000000000..5d3bf013d8ab84abe001b885c7d18bb61fb751e3 --- /dev/null +++ b/test/built-ins/TypedArrays/prototype/some/inherited.js @@ -0,0 +1,12 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-%typedarray%.prototype.some +description: > + _TypedArray_.prototype has no own property "some" +includes: [testTypedArray.js] +---*/ + +testWithTypedArrayConstructors(function(TA) { + assert.sameValue(TA.prototype.hasOwnProperty("some"), false); +}); diff --git a/test/built-ins/TypedArrays/prototype/sort/inherited.js b/test/built-ins/TypedArrays/prototype/sort/inherited.js new file mode 100644 index 0000000000000000000000000000000000000000..b6386611125616f2ba1b7d5712ab6602d91501b8 --- /dev/null +++ b/test/built-ins/TypedArrays/prototype/sort/inherited.js @@ -0,0 +1,12 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-%typedarray%.prototype.sort +description: > + _TypedArray_.prototype has no own property "sort" +includes: [testTypedArray.js] +---*/ + +testWithTypedArrayConstructors(function(TA) { + assert.sameValue(TA.prototype.hasOwnProperty("sort"), false); +}); diff --git a/test/built-ins/TypedArrays/prototype/subarray/inherited.js b/test/built-ins/TypedArrays/prototype/subarray/inherited.js new file mode 100644 index 0000000000000000000000000000000000000000..53bb41efcea1c6fbcc82ee643f8abf1c9add628a --- /dev/null +++ b/test/built-ins/TypedArrays/prototype/subarray/inherited.js @@ -0,0 +1,12 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-%typedarray%.prototype.subarray +description: > + _TypedArray_.prototype has no own property "subarray" +includes: [testTypedArray.js] +---*/ + +testWithTypedArrayConstructors(function(TA) { + assert.sameValue(TA.prototype.hasOwnProperty("subarray"), false); +}); diff --git a/test/built-ins/TypedArrays/prototype/toLocaleString/inherited.js b/test/built-ins/TypedArrays/prototype/toLocaleString/inherited.js new file mode 100644 index 0000000000000000000000000000000000000000..69809cf7db2619815f89fb4dad8c02b802721094 --- /dev/null +++ b/test/built-ins/TypedArrays/prototype/toLocaleString/inherited.js @@ -0,0 +1,12 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-%typedarray%.prototype.tolocalestring +description: > + _TypedArray_.prototype has no own property "toLocaleString" +includes: [testTypedArray.js] +---*/ + +testWithTypedArrayConstructors(function(TA) { + assert.sameValue(TA.prototype.hasOwnProperty("toLocaleString"), false); +}); diff --git a/test/built-ins/TypedArrays/prototype/toString/inherited.js b/test/built-ins/TypedArrays/prototype/toString/inherited.js new file mode 100644 index 0000000000000000000000000000000000000000..44cb7c19bcd3758f5d43f909e27fd29484129509 --- /dev/null +++ b/test/built-ins/TypedArrays/prototype/toString/inherited.js @@ -0,0 +1,12 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-%typedarray%.prototype.tostring +description: > + _TypedArray_.prototype has no own property "toString" +includes: [testTypedArray.js] +---*/ + +testWithTypedArrayConstructors(function(TA) { + assert.sameValue(TA.prototype.hasOwnProperty("toString"), false); +}); diff --git a/test/built-ins/TypedArrays/prototype/values/inherited.js b/test/built-ins/TypedArrays/prototype/values/inherited.js new file mode 100644 index 0000000000000000000000000000000000000000..86570c55a0c3147fb3357743cf4182fa1729aa99 --- /dev/null +++ b/test/built-ins/TypedArrays/prototype/values/inherited.js @@ -0,0 +1,12 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-%typedarray%.prototype.values +description: > + _TypedArray_.prototype has no own property "values" +includes: [testTypedArray.js] +---*/ + +testWithTypedArrayConstructors(function(TA) { + assert.sameValue(TA.prototype.hasOwnProperty("values"), false); +});