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

Unified Diff: src/string.js

Issue 9694033: Experimental Profiler: tweak type info threshold. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 9 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 | « src/flag-definitions.h ('k') | no next file » | 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 02f5c98cd3aee7eefe5965953c6420feb1237442..3caaff43df91563faac196fd2d1a83bdb6fd200d 100644
--- a/src/string.js
+++ b/src/string.js
@@ -554,14 +554,14 @@ function StringSlice(start, end) {
}
} else {
if (start_i > s_len) {
- start_i = s_len;
+ return '';
}
}
if (end_i < 0) {
end_i += s_len;
if (end_i < 0) {
- end_i = 0;
+ return '';
}
} else {
if (end_i > s_len) {
@@ -569,12 +569,11 @@ function StringSlice(start, end) {
}
}
- var num_c = end_i - start_i;
- if (num_c < 0) {
- num_c = 0;
+ if (end_i <= start_i) {
+ return '';
}
- return SubString(s, start_i, start_i + num_c);
+ return SubString(s, start_i, end_i);
}
« no previous file with comments | « src/flag-definitions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698