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

Unified Diff: src/object-observe.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/object-observe.js
diff --git a/src/object-observe.js b/src/object-observe.js
index 0f1f6d37fbadab8acd1b12968fed89e70a93f62c..aba4e1024358e51b707846601fbff20ed004289f 100644
--- a/src/object-observe.js
+++ b/src/object-observe.js
@@ -693,11 +693,10 @@ $observeArrayMethods = [
// TODO(adamk): Figure out why this prototype removal has to
// happen as part of initial snapshotting.
-var removePrototypeFn = function(f, i) {
- if (i % 2 === 1) %FunctionRemovePrototype(f);
-};
-$observeObjectMethods.forEach(removePrototypeFn);
-$observeArrayMethods.forEach(removePrototypeFn);
+for (var i = 0; i < $observeObjectMethods.length; i++)
Camillo Bruni 2015/09/08 07:10:34 I presume these are accidental changes?
aperez 2015/09/09 12:48:43 Same here, now with the macro is possible to avoid
+ if (i % 2 === 1) %FunctionRemovePrototype($observeObjectMethods[i]);
+for (var i = 0; i < $observeArrayMethods.length; i++)
+ if (i % 2 === 1) %FunctionRemovePrototype($observeArrayMethods[i]);
$observeEnqueueSpliceRecord = EnqueueSpliceRecord;
$observeBeginPerformSplice = BeginPerformSplice;

Powered by Google App Engine
This is Rietveld 408576698