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

Unified Diff: src/string.js

Issue 1143993003: Use shared container to manage imports/exports. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fixed test for no-snap 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/runtime.js ('k') | src/string-iterator.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/string.js
diff --git a/src/string.js b/src/string.js
index 0ecb29e55823b741265ae05dc1a407fbbd77813f..e4683b9abff1796c24bf1d33951bc96674747a44 100644
--- a/src/string.js
+++ b/src/string.js
@@ -2,11 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-var $stringCharAt;
-var $stringIndexOf;
-var $stringSubstring;
-
-(function(global, shared, exports) {
+(function(global, utils) {
%CheckIsBootstrapping();
@@ -15,8 +11,16 @@ var $stringSubstring;
var GlobalRegExp = global.RegExp;
var GlobalString = global.String;
-var InternalArray = shared.InternalArray;
-var InternalPackedArray = shared.InternalPackedArray;
+var InternalArray = utils.InternalArray;
+var InternalPackedArray = utils.InternalPackedArray;
+
+var MathMax;
+var MathMin;
+
+utils.Import(function(from) {
+ MathMax = from.MathMax;
+ MathMin = from.MathMin;
+});
//-------------------------------------------------------------------
@@ -968,7 +972,7 @@ function StringStartsWith(searchString /* position */) { // length == 1
}
var s_len = s.length;
- var start = $min($max(pos, 0), s_len);
+ var start = MathMin(MathMax(pos, 0), s_len);
var ss_len = ss.length;
if (ss_len + start > s_len) {
return false;
@@ -998,7 +1002,7 @@ function StringEndsWith(searchString /* position */) { // length == 1
}
}
- var end = $min($max(pos, 0), s_len);
+ var end = MathMin(MathMax(pos, 0), s_len);
var ss_len = ss.length;
var start = end - ss_len;
if (start < 0) {
@@ -1027,7 +1031,7 @@ function StringIncludes(searchString /* position */) { // length == 1
}
var s_len = s.length;
- var start = $min($max(pos, 0), s_len);
+ var start = MathMin(MathMax(pos, 0), s_len);
var ss_len = ss.length;
if (ss_len + start > s_len) {
return false;
@@ -1172,8 +1176,13 @@ $installFunctions(GlobalString.prototype, DONT_ENUM, [
"sup", StringSup
]);
-$stringCharAt = StringCharAtJS;
-$stringIndexOf = StringIndexOfJS;
-$stringSubstring = StringSubstring;
+// -------------------------------------------------------------------
+// Exports
+
+utils.Export(function(to) {
+ to.StringCharAt = StringCharAtJS;
+ to.StringIndexOf = StringIndexOfJS;
+ to.StringSubstring = StringSubstring;
+});
})
« no previous file with comments | « src/runtime.js ('k') | src/string-iterator.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698