Bug 1180290 - Part 4: Add tests for builtin getter name. r=till
authorTooru Fujisawa <arai_a@mac.com>
Tue, 05 Jan 2016 03:21:24 +0900
changeset 278812 a59c19e0b14d38b02ae4c12e5e39659756e2d586
parent 278811 dd562b7c8512ecfacb413bd901b0c1ae89a029b4
child 278813 7bc312c15f1fd17866f6f177dfedb7e2a96880b0
push id29860
push usercbook@mozilla.com
push dateThu, 07 Jan 2016 10:51:20 +0000
treeherdermozilla-central@e0bcd16e1d4b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstill
bugs1180290
milestone46.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1180290 - Part 4: Add tests for builtin getter name. r=till
js/src/tests/ecma_6/Array/getter-name.js
js/src/tests/ecma_6/ArrayBuffer/getter-name.js
js/src/tests/ecma_6/DataView/getter-name.js
js/src/tests/ecma_6/Map/getter-name.js
js/src/tests/ecma_6/Object/getter-name.js
js/src/tests/ecma_6/RegExp/getter-name.js
js/src/tests/ecma_6/Set/getter-name.js
js/src/tests/ecma_6/TypedArray/getter-name.js
new file mode 100644
--- /dev/null
+++ b/js/src/tests/ecma_6/Array/getter-name.js
@@ -0,0 +1,10 @@
+var BUGNUMBER = 1180290;
+var summary = 'Array getters should have get prefix';
+
+print(BUGNUMBER + ": " + summary);
+
+// FIXME: bug 1165052
+// assertEq(Object.getOwnPropertyDescriptor(Array, Symbol.species).get.name, "get [Symbol.species]");
+
+if (typeof reportCompare === 'function')
+  reportCompare(true, true);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/ecma_6/ArrayBuffer/getter-name.js
@@ -0,0 +1,11 @@
+var BUGNUMBER = 1180290;
+var summary = 'ArrayBuffer getters should have get prefix';
+
+print(BUGNUMBER + ": " + summary);
+
+// FIXME: bug 1165053
+// assertEq(Object.getOwnPropertyDescriptor(ArrayBuffer, Symbol.species).get.name, "get [Symbol.species]");
+assertEq(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength").get.name, "get byteLength");
+
+if (typeof reportCompare === 'function')
+  reportCompare(true, true);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/ecma_6/DataView/getter-name.js
@@ -0,0 +1,11 @@
+var BUGNUMBER = 1180290;
+var summary = 'DataView getters should have get prefix';
+
+print(BUGNUMBER + ": " + summary);
+
+assertEq(Object.getOwnPropertyDescriptor(DataView.prototype, "buffer").get.name, "get buffer");
+assertEq(Object.getOwnPropertyDescriptor(DataView.prototype, "byteLength").get.name, "get byteLength");
+assertEq(Object.getOwnPropertyDescriptor(DataView.prototype, "byteOffset").get.name, "get byteOffset");
+
+if (typeof reportCompare === 'function')
+  reportCompare(true, true);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/ecma_6/Map/getter-name.js
@@ -0,0 +1,10 @@
+var BUGNUMBER = 1180290;
+var summary = 'Map getters should have get prefix';
+
+print(BUGNUMBER + ": " + summary);
+
+assertEq(Object.getOwnPropertyDescriptor(Map, Symbol.species).get.name, "get [Symbol.species]");
+assertEq(Object.getOwnPropertyDescriptor(Map.prototype, "size").get.name, "get size");
+
+if (typeof reportCompare === 'function')
+  reportCompare(true, true);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/ecma_6/Object/getter-name.js
@@ -0,0 +1,10 @@
+var BUGNUMBER = 1180290;
+var summary = 'Object accessors should have get prefix';
+
+print(BUGNUMBER + ": " + summary);
+
+assertEq(Object.getOwnPropertyDescriptor(Object.prototype, "__proto__").get.name, "get __proto__");
+assertEq(Object.getOwnPropertyDescriptor(Object.prototype, "__proto__").set.name, "set __proto__");
+
+if (typeof reportCompare === 'function')
+  reportCompare(true, true);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/ecma_6/RegExp/getter-name.js
@@ -0,0 +1,17 @@
+var BUGNUMBER = 1180290;
+var summary = 'RegExp getters should have get prefix';
+
+print(BUGNUMBER + ": " + summary);
+
+// FIXME: bug 887016
+// assertEq(Object.getOwnPropertyDescriptor(RegExp, Symbol.species).get.name, "get [Symbol.species]");
+assertEq(Object.getOwnPropertyDescriptor(RegExp.prototype, "flags").get.name, "get flags");
+assertEq(Object.getOwnPropertyDescriptor(RegExp.prototype, "global").get.name, "get global");
+assertEq(Object.getOwnPropertyDescriptor(RegExp.prototype, "ignoreCase").get.name, "get ignoreCase");
+assertEq(Object.getOwnPropertyDescriptor(RegExp.prototype, "multiline").get.name, "get multiline");
+assertEq(Object.getOwnPropertyDescriptor(RegExp.prototype, "source").get.name, "get source");
+assertEq(Object.getOwnPropertyDescriptor(RegExp.prototype, "sticky").get.name, "get sticky");
+assertEq(Object.getOwnPropertyDescriptor(RegExp.prototype, "unicode").get.name, "get unicode");
+
+if (typeof reportCompare === 'function')
+  reportCompare(true, true);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/ecma_6/Set/getter-name.js
@@ -0,0 +1,10 @@
+var BUGNUMBER = 1180290;
+var summary = 'Set getters should have get prefix';
+
+print(BUGNUMBER + ": " + summary);
+
+assertEq(Object.getOwnPropertyDescriptor(Set, Symbol.species).get.name, "get [Symbol.species]");
+assertEq(Object.getOwnPropertyDescriptor(Set.prototype, "size").get.name, "get size");
+
+if (typeof reportCompare === 'function')
+  reportCompare(true, true);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/ecma_6/TypedArray/getter-name.js
@@ -0,0 +1,18 @@
+var BUGNUMBER = 1180290;
+var summary = 'TypedArray getters should have get prefix';
+
+print(BUGNUMBER + ": " + summary);
+
+let TypedArray = Object.getPrototypeOf(Float32Array.prototype).constructor;
+
+// FIXME: bug 1165053
+// assertEq(Object.getOwnPropertyDescriptor(TypedArray, Symbol.species).get.name, "get [Symbol.species]");
+assertEq(Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer").get.name, "get buffer");
+assertEq(Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength").get.name, "get byteLength");
+assertEq(Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset").get.name, "get byteOffset");
+assertEq(Object.getOwnPropertyDescriptor(TypedArray.prototype, "length").get.name, "get length");
+// FIXME: bug 1114580
+// assertEq(Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag).get.name, "get [Symbol.toStringTag]");
+
+if (typeof reportCompare === 'function')
+  reportCompare(true, true);