Chromium Code Reviews| Index: src/js/i18n.js |
| diff --git a/src/js/i18n.js b/src/js/i18n.js |
| index dd85a0526495c926bc55ba011769dca720059d3c..e018262ca2b76fedce02c82fc6d8ce9866e8b747 100644 |
| --- a/src/js/i18n.js |
| +++ b/src/js/i18n.js |
| @@ -41,7 +41,6 @@ var resolvedSymbol = utils.ImportNow("intl_resolved_symbol"); |
| var SetFunctionName = utils.SetFunctionName; |
| var StringIndexOf; |
| var StringLastIndexOf; |
| -var StringSplit; |
| var StringSubstr; |
| var StringSubstring; |
| @@ -57,7 +56,6 @@ utils.Import(function(from) { |
| InternalRegExpReplace = from.InternalRegExpReplace; |
| StringIndexOf = from.StringIndexOf; |
| StringLastIndexOf = from.StringLastIndexOf; |
| - StringSplit = from.StringSplit; |
| StringSubstr = from.StringSubstr; |
| StringSubstring = from.StringSubstring; |
| }); |
| @@ -125,6 +123,15 @@ function AddBoundMethod(obj, methodName, implementation, length, type) { |
| %SetNativeFlag(getter); |
| } |
| +// Special StringSplit function for this file; does not work with RegExps |
| +// or access Symbol.split, but per spec, is just for strings. |
| +function StringSplit(separator, limit) { |
| + var subject = TO_STRING(this); |
| + var separator_string = TO_STRING(separator); |
| + limit = (IS_UNDEFINED(limit)) ? kMaxUint32 : TO_UINT32(limit); |
|
Yang
2016/07/07 09:13:01
I don't think StringSplit is used with the optiona
Dan Ehrenberg
2016/07/07 18:35:42
That's true; I don't see a real need to call TO_ST
|
| + return %StringSplit(this, separator, limit); |
| +} |
| + |
| // ------------------------------------------------------------------- |
| var Intl = {}; |