Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Unified Diff: src/runtime.js

Issue 1309243003: ES6: Array.prototype.slice and friends should use ToLength instead of ToUint32 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/runtime.js
diff --git a/src/runtime.js b/src/runtime.js
index 1503373d4a3fc6c78cc2630b039800f30c338b08..98b21ea3912f78529bad47f157864b2bbe176ffc 100644
--- a/src/runtime.js
+++ b/src/runtime.js
@@ -26,6 +26,8 @@ var $toPositiveInteger;
var $toPrimitive;
var $toString;
+var harmony_tolength = false;
+
(function(global, utils) {
%CheckIsBootstrapping();
@@ -712,6 +714,9 @@ function ToLength(arg) {
: GlobalNumber.MAX_SAFE_INTEGER;
}
+function ToLengthFlagged(arg) {
Camillo Bruni 2015/09/08 07:18:07 I would create a TO_LENGTH macro out of this (see
aperez 2015/09/09 12:48:43 Acknowledged.
+ return (harmony_tolength) ? ToLength(arg) : TO_UINT32(arg);
+}
// ES5, section 9.12
function SameValue(x, y) {
@@ -903,6 +908,7 @@ utils.Export(function(to) {
to.ToNumber = ToNumber;
to.ToPrimitive = ToPrimitive;
to.ToString = ToString;
+ to.ToLengthFlagged = ToLengthFlagged;
});
})

Powered by Google App Engine
This is Rietveld 408576698