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

Unified Diff: src/runtime.js

Issue 1151503002: [destructuring] Implement spread binding patterns. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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 ab79a4bbde0853ee3f39b68c2cf8518fb8f8f975..fa6689df0cedc244cc666cea43135bc4eeb56d04 100644
--- a/src/runtime.js
+++ b/src/runtime.js
@@ -730,7 +730,6 @@ STACK_OVERFLOW = function STACK_OVERFLOW(length) {
throw %MakeRangeError(kStackOverflow);
}
arv (Not doing code reviews) 2015/05/20 13:34:14 undo this line removal... (it was probably from wh
Dmitry Lomov (no reviews) 2015/05/20 14:22:03 Done.
-
// Convert the receiver to an object - forward to ToObject.
TO_OBJECT = function TO_OBJECT() {
return %$toObject(this);
@@ -930,6 +929,14 @@ function SameValueZero(x, y) {
return x === y;
}
+function SpreadIntoArray(target, iterable) {
rossberg 2015/05/20 12:57:35 Nit: ConcatIterableToArray
arv (Not doing code reviews) 2015/05/20 13:34:14 It is not to array... it adds it to an existing ar
arv (Not doing code reviews) 2015/05/20 13:39:45 There is also $spreadIterable which almost does th
rossberg 2015/05/20 13:49:39 Hence Concat...ToArray ;)
Dmitry Lomov (no reviews) 2015/05/20 14:22:03 Done.
+ var index = target.length;
+ for (var element of iterable) {
+ %AddElement(target, index++, element, NONE);
+ }
+ return target;
+}
+
/* ---------------------------------
- - - U t i l i t i e s - - -
@@ -1015,6 +1022,7 @@ $nonNumberToNumber = NonNumberToNumber;
$nonStringToString = NonStringToString;
$sameValue = SameValue;
$sameValueZero = SameValueZero;
+$spreadIntoArray = SpreadIntoArray;
$toBoolean = ToBoolean;
$toInt32 = ToInt32;
$toInteger = ToInteger;
« src/preparser.h ('K') | « src/preparser.h ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698