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

Unified Diff: src/objects.h

Issue 2350963004: [builtins] Move StringIndexOf to a C++ builtin. (Closed)
Patch Set: Fix formatting errors Created 4 years, 2 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/js/string.js ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 552e96f18fab6259c0c2661098c552c44b7fdca5..d086845c8b2cb1135f7abdfd017ad76419e5ebb5 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -9404,10 +9404,14 @@ class String: public Name {
MUST_USE_RESULT static ComparisonResult Compare(Handle<String> x,
Handle<String> y);
+ // Perform ES6 21.1.3.8, including checking arguments.
+ static Object* IndexOf(Isolate* isolate, Handle<Object> receiver,
+ Handle<Object> search, Handle<Object> position);
// Perform string match of pattern on subject, starting at start index.
- // Caller must ensure that 0 <= start_index <= sub->length().
- static int IndexOf(Isolate* isolate, Handle<String> sub, Handle<String> pat,
- int start_index);
+ // Caller must ensure that 0 <= start_index <= sub->length(), as this does not
+ // check any arguments.
+ static int IndexOf(Isolate* isolate, Handle<String> receiver,
+ Handle<String> search, int start_index);
static Object* LastIndexOf(Isolate* isolate, Handle<Object> receiver,
Handle<Object> search, Handle<Object> position);
« no previous file with comments | « src/js/string.js ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698