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

Unified Diff: src/string.js

Issue 1321853006: [es6] Use SubString in String{Starts,Ends}With (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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 | 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 1bbc8a69ce1259515bb950d2b259c5269056435a..1db65bb0bad25b677c7fa38144976c6a39f4ca18 100644
--- a/src/string.js
+++ b/src/string.js
@@ -997,7 +997,7 @@ function StringStartsWith(searchString /* position */) { // length == 1
return false;
}
- return %StringIndexOf(s, ss, start) === start;
+ return %_SubString(s, start, start + ss_len) === ss;
}
@@ -1028,7 +1028,7 @@ function StringEndsWith(searchString /* position */) { // length == 1
return false;
}
- return %StringLastIndexOf(s, ss, start) === start;
+ return %_SubString(s, start, start + ss_len) === ss;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698