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

Unified Diff: src/string.js

Issue 9355005: Fix String.prototype.split for undefined separator. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 10 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 | « no previous file | test/test262/test262.status » ('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 2d6896120e5c7c2633fd550a085b1624eb62ada6..3576ccd626dce27512085aec26324a328a74429e 100644
--- a/src/string.js
+++ b/src/string.js
@@ -588,11 +588,8 @@ function StringSplit(separator, limit) {
limit = (IS_UNDEFINED(limit)) ? 0xffffffff : TO_UINT32(limit);
// ECMA-262 says that if separator is undefined, the result should
- // be an array of size 1 containing the entire string. SpiderMonkey
- // and KJS have this behavior only when no separator is given. If
- // undefined is explicitly given, they convert it to a string and
- // use that. We do as SpiderMonkey and KJS.
- if (%_ArgumentsLength() === 0) {
+ // be an array of size 1 containing the entire string.
+ if (IS_UNDEFINED(separator)) {
return [subject];
}
« no previous file with comments | « no previous file | test/test262/test262.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698