Commit 20c040dc authored by yangguo@chromium.org's avatar yangguo@chromium.org

Split up String.split to deal with normal separator and regexp separator separately.

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/9694041

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11030 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent cd819760
// Copyright 2006-2009 the V8 project authors. All rights reserved.
// Copyright 2012 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
......@@ -610,6 +610,12 @@ function StringSplit(separator, limit) {
if (limit === 0) return [];
// Separator is a regular expression.
return StringSplitOnRegExp(subject, separator, limit, length);
}
function StringSplitOnRegExp(subject, separator, limit, length) {
%_Log('regexp', 'regexp-split,%0S,%1r', [subject, separator]);
if (length === 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment