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

Unified Diff: src/string-iterator.js

Issue 1149773003: Revert of Revert of Hook up more import/exports in natives. (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
« no previous file with comments | « src/string.js ('k') | src/symbol.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/string-iterator.js
diff --git a/src/string-iterator.js b/src/string-iterator.js
index d6cf95e7d9f2dcc058f808298f7cbf6bee9e837b..536430ee8f6a06ab4d3b54cb7e3c37a42e0ddeb6 100644
--- a/src/string-iterator.js
+++ b/src/string-iterator.js
@@ -8,9 +8,18 @@
%CheckIsBootstrapping();
+// -------------------------------------------------------------------
+// Imports
+
var GlobalString = global.String;
-//-------------------------------------------------------------------
+var ArrayIteratorCreateResultObject;
+
+utils.Import(function(from) {
+ ArrayIteratorCreateResultObject = from.ArrayIteratorCreateResultObject;
+});
+
+// -------------------------------------------------------------------
var stringIteratorIteratedStringSymbol =
GLOBAL_PRIVATE("StringIterator#iteratedString");
@@ -41,7 +50,7 @@
var s = GET_PRIVATE(iterator, stringIteratorIteratedStringSymbol);
if (IS_UNDEFINED(s)) {
- return $iteratorCreateResultObject(UNDEFINED, true);
+ return ArrayIteratorCreateResultObject(UNDEFINED, true);
}
var position = GET_PRIVATE(iterator, stringIteratorNextIndexSymbol);
@@ -50,7 +59,7 @@
if (position >= length) {
SET_PRIVATE(iterator, stringIteratorIteratedStringSymbol,
UNDEFINED);
- return $iteratorCreateResultObject(UNDEFINED, true);
+ return ArrayIteratorCreateResultObject(UNDEFINED, true);
}
var first = %_StringCharCodeAt(s, position);
@@ -67,7 +76,7 @@
SET_PRIVATE(iterator, stringIteratorNextIndexSymbol, position);
- return $iteratorCreateResultObject(resultString, false);
+ return ArrayIteratorCreateResultObject(resultString, false);
}
@@ -81,13 +90,13 @@
%FunctionSetPrototype(StringIterator, {__proto__: $iteratorPrototype});
%FunctionSetInstanceClassName(StringIterator, 'String Iterator');
-$installFunctions(StringIterator.prototype, DONT_ENUM, [
+utils.InstallFunctions(StringIterator.prototype, DONT_ENUM, [
'next', StringIteratorNext
]);
%AddNamedProperty(StringIterator.prototype, symbolToStringTag,
"String Iterator", READ_ONLY | DONT_ENUM);
-$setFunctionName(StringPrototypeIterator, symbolIterator);
+utils.SetFunctionName(StringPrototypeIterator, symbolIterator);
%AddNamedProperty(GlobalString.prototype, symbolIterator,
StringPrototypeIterator, DONT_ENUM);
« no previous file with comments | « src/string.js ('k') | src/symbol.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698