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

Unified Diff: src/string.js

Issue 16537: Runtime logging (Closed)
Patch Set: Created 11 years, 11 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
Index: src/string.js
diff --git a/src/string.js b/src/string.js
index 78606a60e97dd17c31edb45a2f167ac0cccb2fb3..614d541c57225697eb560c0209676d9299459c70 100644
--- a/src/string.js
+++ b/src/string.js
@@ -152,6 +152,7 @@ function StringMatch(regexp) {
var subject = ToString(this);
if (!regexp.global) return regexp.exec(subject);
+ %_Log('regexp', 'regexp-match,%0S,%1r', [subject, regexp]);
var matches = DoRegExpExecGlobal(regexp, subject);
// If the regexp did not match, return null.
@@ -185,6 +186,7 @@ function StringReplace(search, replace) {
// Delegate to one of the regular expression variants if necessary.
if (IS_REGEXP(search)) {
+ %_Log('regexp', 'regexp-replace,%0r,%1S', [search, subject]);
if (IS_FUNCTION(replace)) {
return StringReplaceRegExpWithFunction(subject, search, replace);
} else {
@@ -513,7 +515,13 @@ function StringSplit(separator, limit) {
var currentIndex = 0;
var startIndex = 0;
- var sep = IS_REGEXP(separator) ? separator : ToString(separator);
+ var sep;
+ if (IS_REGEXP(separator)) {
+ sep = separator;
+ %_Log('regexp', 'regexp-split,%0S,%1r', [subject, sep]);
+ } else {
+ sep = ToString(separator);
+ }
if (length === 0) {
if (splitMatch(sep, subject, 0, 0) != null) return result;
« src/codegen-ia32.cc ('K') | « src/runtime.cc ('k') | test/mjsunit/fuzz-natives.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698