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

Unified Diff: src/string.js

Issue 1144163002: Revert of Use shared container to manage imports/exports. (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/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 e4683b9abff1796c24bf1d33951bc96674747a44..0ecb29e55823b741265ae05dc1a407fbbd77813f 100644
--- a/src/string.js
+++ b/src/string.js
@@ -2,7 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-(function(global, utils) {
+var $stringCharAt;
+var $stringIndexOf;
+var $stringSubstring;
+
+(function(global, shared, exports) {
%CheckIsBootstrapping();
@@ -11,16 +15,8 @@
var GlobalRegExp = global.RegExp;
var GlobalString = global.String;
-var InternalArray = utils.InternalArray;
-var InternalPackedArray = utils.InternalPackedArray;
-
-var MathMax;
-var MathMin;
-
-utils.Import(function(from) {
- MathMax = from.MathMax;
- MathMin = from.MathMin;
-});
+var InternalArray = shared.InternalArray;
+var InternalPackedArray = shared.InternalPackedArray;
//-------------------------------------------------------------------
@@ -972,7 +968,7 @@
}
var s_len = s.length;
- var start = MathMin(MathMax(pos, 0), s_len);
+ var start = $min($max(pos, 0), s_len);
var ss_len = ss.length;
if (ss_len + start > s_len) {
return false;
@@ -1002,7 +998,7 @@
}
}
- var end = MathMin(MathMax(pos, 0), s_len);
+ var end = $min($max(pos, 0), s_len);
var ss_len = ss.length;
var start = end - ss_len;
if (start < 0) {
@@ -1031,7 +1027,7 @@
}
var s_len = s.length;
- var start = MathMin(MathMax(pos, 0), s_len);
+ var start = $min($max(pos, 0), s_len);
var ss_len = ss.length;
if (ss_len + start > s_len) {
return false;
@@ -1176,13 +1172,8 @@
"sup", StringSup
]);
-// -------------------------------------------------------------------
-// Exports
-
-utils.Export(function(to) {
- to.StringCharAt = StringCharAtJS;
- to.StringIndexOf = StringIndexOfJS;
- to.StringSubstring = StringSubstring;
-});
+$stringCharAt = StringCharAtJS;
+$stringIndexOf = StringIndexOfJS;
+$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