I'm sorry about that. There seem to be some assumptions about builtins being
immutable somewhere in V8, although I couldn't figure out where exactly.
Here is
an easy alternative that works for me:
diff --git a/src/runtime.js b/src/runtime.js
index 4bc377c..f4beadb 100644
--- a/src/runtime.js
+++ b/src/runtime.js
@@ -567,7 +567,10 @@ function ToInteger(x) {
// ES6, draft 08-24-14, section 7.1.15
+// TODO(rossberg): Remove use of flag once --harmony-arrays is gone.
+ToLength.harmony = false;
function ToLength(arg) {
+ if (!ToLength.harmony) return TO_UINT32(x);
arg = ToInteger(arg);
if (arg < 0) return 0;
return arg < $Number.MAX_SAFE_INTEGER ? arg : $Number.MAX_SAFE_INTEGER;
diff --git a/src/harmony-array.js b/src/harmony-array.js
index 06fada7..7121856 100644
--- a/src/harmony-array.js
+++ b/src/harmony-array.js
@@ -145,6 +145,9 @@ function ArrayOf() {
function HarmonyArrayExtendArrayPrototype() {
%CheckIsBootstrapping();
+ // Upgrade index conversion semantics to ES6.
+ ToLength.harmony = true;
+
// Set up non-enumerable functions on the Array object.
InstallFunctions($Array, DONT_ENUM, $Array(
"of", ArrayOf
https://codereview.chromium.org/553623004/
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.