Revision: 11030
Author: [email protected]
Date: Tue Mar 13 08:44:19 2012
Log: Split up String.split to deal with normal separator and regexp
separator separately.
BUG=
TEST=
Review URL: https://chromiumcodereview.appspot.com/9694041
http://code.google.com/p/v8/source/detail?r=11030
Modified:
/branches/bleeding_edge/src/string.js
=======================================
--- /branches/bleeding_edge/src/string.js Tue Mar 13 04:38:37 2012
+++ /branches/bleeding_edge/src/string.js Tue Mar 13 08:44:19 2012
@@ -1,4 +1,4 @@
-// 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 @@
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) {
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev