diff options
Diffstat (limited to 'js/src')
-rw-r--r-- | js/src/jsarray.cpp | 2 | ||||
-rw-r--r-- | js/src/tests/ecma_6/Array/values.js | 20 |
2 files changed, 13 insertions, 9 deletions
diff --git a/js/src/jsarray.cpp b/js/src/jsarray.cpp index 7a67c0095..9cbeff6a2 100644 --- a/js/src/jsarray.cpp +++ b/js/src/jsarray.cpp @@ -3165,7 +3165,9 @@ static const JSFunctionSpec array_methods[] = { JS_SELF_HOSTED_SYM_FN(iterator, "ArrayValues", 0,0), JS_SELF_HOSTED_FN("entries", "ArrayEntries", 0,0), JS_SELF_HOSTED_FN("keys", "ArrayKeys", 0,0), +#ifdef NIGHTLY_BUILD JS_SELF_HOSTED_FN("values", "ArrayValues", 0,0), +#endif /* ES7 additions */ JS_SELF_HOSTED_FN("includes", "ArrayIncludes", 2,0), diff --git a/js/src/tests/ecma_6/Array/values.js b/js/src/tests/ecma_6/Array/values.js index 52a0b63c6..902a66812 100644 --- a/js/src/tests/ecma_6/Array/values.js +++ b/js/src/tests/ecma_6/Array/values.js @@ -1,18 +1,20 @@ /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/licenses/publicdomain/ */ -assertEq(Array.prototype.values, Array.prototype[Symbol.iterator]); -assertEq(Array.prototype.values.name, "values"); -assertEq(Array.prototype.values.length, 0); +if (Array.prototype.values) { + assertEq(Array.prototype.values, Array.prototype[Symbol.iterator]); + assertEq(Array.prototype.values.name, "values"); + assertEq(Array.prototype.values.length, 0); -function valuesUnscopeable() { - var values = "foo"; - with ([1, 2, 3]) { - assertEq(indexOf, Array.prototype.indexOf); - assertEq(values, "foo"); + function valuesUnscopeable() { + var values = "foo"; + with ([1, 2, 3]) { + assertEq(indexOf, Array.prototype.indexOf); + assertEq(values, "foo"); + } } + valuesUnscopeable(); } -valuesUnscopeable(); if (typeof reportCompare === 'function') reportCompare(0, 0); |