summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/ArrayBuffer/Symbol.species
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/ArrayBuffer/Symbol.species')
-rw-r--r--js/src/tests/test262/built-ins/ArrayBuffer/Symbol.species/browser.js0
-rw-r--r--js/src/tests/test262/built-ins/ArrayBuffer/Symbol.species/length.js34
-rw-r--r--js/src/tests/test262/built-ins/ArrayBuffer/Symbol.species/return-value.js16
-rw-r--r--js/src/tests/test262/built-ins/ArrayBuffer/Symbol.species/shell.js0
-rw-r--r--js/src/tests/test262/built-ins/ArrayBuffer/Symbol.species/symbol-species-name.js27
-rw-r--r--js/src/tests/test262/built-ins/ArrayBuffer/Symbol.species/symbol-species.js23
6 files changed, 100 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/ArrayBuffer/Symbol.species/browser.js b/js/src/tests/test262/built-ins/ArrayBuffer/Symbol.species/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/built-ins/ArrayBuffer/Symbol.species/browser.js
diff --git a/js/src/tests/test262/built-ins/ArrayBuffer/Symbol.species/length.js b/js/src/tests/test262/built-ins/ArrayBuffer/Symbol.species/length.js
new file mode 100644
index 0000000000..3d44fa0cae
--- /dev/null
+++ b/js/src/tests/test262/built-ins/ArrayBuffer/Symbol.species/length.js
@@ -0,0 +1,34 @@
+// Copyright (C) 2015 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-get-arraybuffer-@@species
+description: >
+ get ArrayBuffer [ @@species ].length is 0.
+info: |
+ get ArrayBuffer [ @@species ]
+
+ 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]
+features: [Symbol.species]
+---*/
+
+var desc = Object.getOwnPropertyDescriptor(ArrayBuffer, Symbol.species);
+
+assert.sameValue(desc.get.length, 0);
+
+verifyNotEnumerable(desc.get, "length");
+verifyNotWritable(desc.get, "length");
+verifyConfigurable(desc.get, "length");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/ArrayBuffer/Symbol.species/return-value.js b/js/src/tests/test262/built-ins/ArrayBuffer/Symbol.species/return-value.js
new file mode 100644
index 0000000000..607473f7b2
--- /dev/null
+++ b/js/src/tests/test262/built-ins/ArrayBuffer/Symbol.species/return-value.js
@@ -0,0 +1,16 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-get-arraybuffer-@@species
+description: Return value of @@species accessor method
+info: |
+ 1. Return the this value.
+features: [Symbol.species]
+---*/
+
+var thisVal = {};
+var accessor = Object.getOwnPropertyDescriptor(ArrayBuffer, Symbol.species).get;
+
+assert.sameValue(accessor.call(thisVal), thisVal);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/ArrayBuffer/Symbol.species/shell.js b/js/src/tests/test262/built-ins/ArrayBuffer/Symbol.species/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/built-ins/ArrayBuffer/Symbol.species/shell.js
diff --git a/js/src/tests/test262/built-ins/ArrayBuffer/Symbol.species/symbol-species-name.js b/js/src/tests/test262/built-ins/ArrayBuffer/Symbol.species/symbol-species-name.js
new file mode 100644
index 0000000000..2d9d0eb3e8
--- /dev/null
+++ b/js/src/tests/test262/built-ins/ArrayBuffer/Symbol.species/symbol-species-name.js
@@ -0,0 +1,27 @@
+// Copyright (C) 2015 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-get-arraybuffer-@@species
+description: >
+ ArrayBuffer[Symbol.species] accessor property get name
+info: |
+ 24.1.3.3 get ArrayBuffer [ @@species ]
+
+ ...
+ The value of the name property of this function is "get [Symbol.species]".
+features: [Symbol.species]
+includes: [propertyHelper.js]
+---*/
+
+var descriptor = Object.getOwnPropertyDescriptor(ArrayBuffer, Symbol.species);
+
+assert.sameValue(
+ descriptor.get.name,
+ 'get [Symbol.species]'
+);
+
+verifyNotEnumerable(descriptor.get, 'name');
+verifyNotWritable(descriptor.get, 'name');
+verifyConfigurable(descriptor.get, 'name');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/ArrayBuffer/Symbol.species/symbol-species.js b/js/src/tests/test262/built-ins/ArrayBuffer/Symbol.species/symbol-species.js
new file mode 100644
index 0000000000..8c01389acb
--- /dev/null
+++ b/js/src/tests/test262/built-ins/ArrayBuffer/Symbol.species/symbol-species.js
@@ -0,0 +1,23 @@
+// Copyright 2015 Cubane Canada, Inc. All rights reserved.
+// See LICENSE for details.
+
+/*---
+info: |
+ ArrayBuffer has a property at `Symbol.species`
+esid: sec-get-arraybuffer-@@species
+author: Sam Mikes
+description: ArrayBuffer[Symbol.species] exists per spec
+features: [ArrayBuffer, Symbol.species]
+includes: [propertyHelper.js]
+---*/
+
+var desc = Object.getOwnPropertyDescriptor(ArrayBuffer, Symbol.species);
+
+assert.sameValue(desc.set, undefined);
+assert.sameValue(typeof desc.get, 'function');
+
+verifyNotWritable(ArrayBuffer, Symbol.species, Symbol.species);
+verifyNotEnumerable(ArrayBuffer, Symbol.species);
+verifyConfigurable(ArrayBuffer, Symbol.species);
+
+reportCompare(0, 0);