summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2015-05-14 22:32:01 -0400
committerJulien Gilli <julien.gilli@joyent.com>2015-05-22 11:52:06 -0700
commit6157697bd5bdbf58b19b9d3177249a7bbb467f79 (patch)
tree026846779aa3b5e95fbf010cdd562302b1b1faad
parenta294aeef0315817fa230bb4e048564d2aea5cdf7 (diff)
downloadnode-6157697bd5bdbf58b19b9d3177249a7bbb467f79.tar.gz
deps: revert v8 Array.prototype.values() removal
The Node 0.12 line was initially released with a version of v8 that included Array.prototype.values(). In https://github.com/joyent/node/pull/18206, v8 was updated to a version that dropped support for values(). https://codereview.chromium.org/647703003 removed this method because it causes problems with some versions of Outlook Web Access. This commit reverts the removal of Array.prototype.values(). Original commit message: Revert "Version 3.28.71.17 (merged r24706, r24708)" This reverts commit 529541ecb58fd0d6df4dfbe41d01bff9ae21ff06. Conflicts: src/version.cc Reviewed-By: Julien Gilli <julien.gilli@joyent.com> PR-URL: https://github.com/joyent/node/pull/25328
-rw-r--r--deps/v8/src/array-iterator.js2
-rw-r--r--deps/v8/src/array.js1
-rw-r--r--deps/v8/test/mjsunit/es6/array-iterator.js17
-rw-r--r--deps/v8/test/mjsunit/es6/typed-array-iterator.js4
-rw-r--r--deps/v8/test/webkit/fast/js/Object-getOwnPropertyNames-expected.txt2
-rw-r--r--deps/v8/test/webkit/fast/js/Object-getOwnPropertyNames.js2
6 files changed, 16 insertions, 12 deletions
diff --git a/deps/v8/src/array-iterator.js b/deps/v8/src/array-iterator.js
index cd5cd835b..f04d6c974 100644
--- a/deps/v8/src/array-iterator.js
+++ b/deps/v8/src/array-iterator.js
@@ -120,8 +120,8 @@ function ExtendArrayPrototype() {
%CheckIsBootstrapping();
InstallFunctions($Array.prototype, DONT_ENUM, $Array(
- // No 'values' since it breaks webcompat: http://crbug.com/409858
'entries', ArrayEntries,
+ 'values', ArrayValues,
'keys', ArrayKeys
));
diff --git a/deps/v8/src/array.js b/deps/v8/src/array.js
index 337e14002..cf99aceb6 100644
--- a/deps/v8/src/array.js
+++ b/deps/v8/src/array.js
@@ -1480,6 +1480,7 @@ function SetUpArray() {
find: true,
findIndex: true,
keys: true,
+ values: true,
};
%AddNamedProperty($Array.prototype, symbolUnscopables, unscopables,
DONT_ENUM | READ_ONLY);
diff --git a/deps/v8/test/mjsunit/es6/array-iterator.js b/deps/v8/test/mjsunit/es6/array-iterator.js
index 099c94d6a..63a7415b9 100644
--- a/deps/v8/test/mjsunit/es6/array-iterator.js
+++ b/deps/v8/test/mjsunit/es6/array-iterator.js
@@ -45,8 +45,11 @@ function assertHasOwnProperty(object, name, attrs) {
function TestArrayPrototype() {
assertHasOwnProperty(Array.prototype, 'entries', DONT_ENUM);
+ assertHasOwnProperty(Array.prototype, 'values', DONT_ENUM);
assertHasOwnProperty(Array.prototype, 'keys', DONT_ENUM);
assertHasOwnProperty(Array.prototype, Symbol.iterator, DONT_ENUM);
+
+ assertEquals(Array.prototype.values, Array.prototype[Symbol.iterator]);
}
TestArrayPrototype();
@@ -58,7 +61,7 @@ function assertIteratorResult(value, done, result) {
function TestValues() {
var array = ['a', 'b', 'c'];
- var iterator = array[Symbol.iterator]();
+ var iterator = array.values();
assertIteratorResult('a', false, iterator.next());
assertIteratorResult('b', false, iterator.next());
assertIteratorResult('c', false, iterator.next());
@@ -72,7 +75,7 @@ TestValues();
function TestValuesMutate() {
var array = ['a', 'b', 'c'];
- var iterator = array[Symbol.iterator]();
+ var iterator = array.values();
assertIteratorResult('a', false, iterator.next());
assertIteratorResult('b', false, iterator.next());
assertIteratorResult('c', false, iterator.next());
@@ -139,17 +142,17 @@ TestEntriesMutate();
function TestArrayIteratorPrototype() {
var array = [];
- var iterator = array.keys();
+ var iterator = array.values();
var ArrayIteratorPrototype = iterator.__proto__;
- assertEquals(ArrayIteratorPrototype, array[Symbol.iterator]().__proto__);
+ assertEquals(ArrayIteratorPrototype, array.values().__proto__);
assertEquals(ArrayIteratorPrototype, array.keys().__proto__);
assertEquals(ArrayIteratorPrototype, array.entries().__proto__);
assertEquals(Object.prototype, ArrayIteratorPrototype.__proto__);
- assertEquals('Array Iterator', %_ClassOf(array[Symbol.iterator]()));
+ assertEquals('Array Iterator', %_ClassOf(array.values()));
assertEquals('Array Iterator', %_ClassOf(array.keys()));
assertEquals('Array Iterator', %_ClassOf(array.entries()));
@@ -166,7 +169,7 @@ function TestForArrayValues() {
var buffer = [];
var array = [0, 'a', true, false, null, /* hole */, undefined, NaN];
var i = 0;
- for (var value of array[Symbol.iterator]()) {
+ for (var value of array.values()) {
buffer[i++] = value;
}
@@ -239,7 +242,7 @@ TestForArrayValues();
function TestNonOwnSlots() {
var array = [0];
- var iterator = array[Symbol.iterator]();
+ var iterator = array.values();
var object = {__proto__: iterator};
assertThrows(function() {
diff --git a/deps/v8/test/mjsunit/es6/typed-array-iterator.js b/deps/v8/test/mjsunit/es6/typed-array-iterator.js
index 9903b0aba..a2e4906c1 100644
--- a/deps/v8/test/mjsunit/es6/typed-array-iterator.js
+++ b/deps/v8/test/mjsunit/es6/typed-array-iterator.js
@@ -21,9 +21,9 @@ function TestTypedArrayPrototype(constructor) {
assertFalse(constructor.prototype.propertyIsEnumerable(Symbol.iterator));
assertEquals(Array.prototype.entries, constructor.prototype.entries);
- assertEquals(Array.prototype[Symbol.iterator], constructor.prototype.values);
+ assertEquals(Array.prototype.values, constructor.prototype.values);
assertEquals(Array.prototype.keys, constructor.prototype.keys);
- assertEquals(Array.prototype[Symbol.iterator], constructor.prototype[Symbol.iterator]);
+ assertEquals(Array.prototype.values, constructor.prototype[Symbol.iterator]);
}
constructors.forEach(TestTypedArrayPrototype);
diff --git a/deps/v8/test/webkit/fast/js/Object-getOwnPropertyNames-expected.txt b/deps/v8/test/webkit/fast/js/Object-getOwnPropertyNames-expected.txt
index 2ac5a39c9..4b8eb1477 100644
--- a/deps/v8/test/webkit/fast/js/Object-getOwnPropertyNames-expected.txt
+++ b/deps/v8/test/webkit/fast/js/Object-getOwnPropertyNames-expected.txt
@@ -68,7 +68,7 @@ PASS getSortedOwnPropertyNames(Object.prototype) is ['__defineGetter__', '__defi
PASS getSortedOwnPropertyNames(Function) is ['arguments', 'caller', 'length', 'name', 'prototype']
PASS getSortedOwnPropertyNames(Function.prototype) is ['apply', 'arguments', 'bind', 'call', 'caller', 'constructor', 'length', 'name', 'toString']
PASS getSortedOwnPropertyNames(Array) is ['arguments', 'caller', 'isArray', 'length', 'name', 'observe', 'prototype', 'unobserve']
-PASS getSortedOwnPropertyNames(Array.prototype) is ['concat', 'constructor', 'entries', 'every', 'filter', 'forEach', 'indexOf', 'join', 'keys', 'lastIndexOf', 'length', 'map', 'pop', 'push', 'reduce', 'reduceRight', 'reverse', 'shift', 'slice', 'some', 'sort', 'splice', 'toLocaleString', 'toString', 'unshift']
+PASS getSortedOwnPropertyNames(Array.prototype) is ['concat', 'constructor', 'entries', 'every', 'filter', 'forEach', 'indexOf', 'join', 'keys', 'lastIndexOf', 'length', 'map', 'pop', 'push', 'reduce', 'reduceRight', 'reverse', 'shift', 'slice', 'some', 'sort', 'splice', 'toLocaleString', 'toString', 'unshift', 'values']
PASS getSortedOwnPropertyNames(String) is ['arguments', 'caller', 'fromCharCode', 'length', 'name', 'prototype']
PASS getSortedOwnPropertyNames(String.prototype) is ['anchor', 'big', 'blink', 'bold', 'charAt', 'charCodeAt', 'concat', 'constructor', 'fixed', 'fontcolor', 'fontsize', 'indexOf', 'italics', 'lastIndexOf', 'length', 'link', 'localeCompare', 'match', 'normalize', 'replace', 'search', 'slice', 'small', 'split', 'strike', 'sub', 'substr', 'substring', 'sup', 'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toString', 'toUpperCase', 'trim', 'trimLeft', 'trimRight', 'valueOf']
PASS getSortedOwnPropertyNames(Boolean) is ['arguments', 'caller', 'length', 'name', 'prototype']
diff --git a/deps/v8/test/webkit/fast/js/Object-getOwnPropertyNames.js b/deps/v8/test/webkit/fast/js/Object-getOwnPropertyNames.js
index caa0111fe..c168c37b0 100644
--- a/deps/v8/test/webkit/fast/js/Object-getOwnPropertyNames.js
+++ b/deps/v8/test/webkit/fast/js/Object-getOwnPropertyNames.js
@@ -76,7 +76,7 @@ var expectedPropertyNamesSet = {
"Function": "['arguments', 'caller', 'length', 'name', 'prototype']",
"Function.prototype": "['apply', 'arguments', 'bind', 'call', 'caller', 'constructor', 'length', 'name', 'toString']",
"Array": "['arguments', 'caller', 'isArray', 'length', 'name', 'observe', 'prototype', 'unobserve']",
- "Array.prototype": "['concat', 'constructor', 'entries', 'every', 'filter', 'forEach', 'indexOf', 'join', 'keys', 'lastIndexOf', 'length', 'map', 'pop', 'push', 'reduce', 'reduceRight', 'reverse', 'shift', 'slice', 'some', 'sort', 'splice', 'toLocaleString', 'toString', 'unshift']",
+ "Array.prototype": "['concat', 'constructor', 'entries', 'every', 'filter', 'forEach', 'indexOf', 'join', 'keys', 'lastIndexOf', 'length', 'map', 'pop', 'push', 'reduce', 'reduceRight', 'reverse', 'shift', 'slice', 'some', 'sort', 'splice', 'toLocaleString', 'toString', 'unshift', 'values']",
"String": "['arguments', 'caller', 'fromCharCode', 'length', 'name', 'prototype']",
"String.prototype": "['anchor', 'big', 'blink', 'bold', 'charAt', 'charCodeAt', 'concat', 'constructor', 'fixed', 'fontcolor', 'fontsize', 'indexOf', 'italics', 'lastIndexOf', 'length', 'link', 'localeCompare', 'match', 'normalize', 'replace', 'search', 'slice', 'small', 'split', 'strike', 'sub', 'substr', 'substring', 'sup', 'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toString', 'toUpperCase', 'trim', 'trimLeft', 'trimRight', 'valueOf']",
"Boolean": "['arguments', 'caller', 'length', 'name', 'prototype']",