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

Unified Diff: src/bootstrapper.cc

Issue 2394713003: [regexp] Port test, match, and search (Closed)
Patch Set: Rebaseline bytecode expectations 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 | « no previous file | src/builtins/builtins.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index 24e4966009202655988f4601d1d88564a7ad55f4..065b5dd70df308ec990e44ec51ee5c86296cd83f 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -1702,8 +1702,12 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
JSObject::AddProperty(prototype, factory->constructor_string(),
regexp_fun, DONT_ENUM);
- SimpleInstallFunction(prototype, "exec", Builtins::kRegExpPrototypeExec,
- 1, true, DONT_ENUM);
+ {
+ Handle<JSFunction> fun = SimpleInstallFunction(
+ prototype, "exec", Builtins::kRegExpPrototypeExec, 1, true,
+ DONT_ENUM);
+ native_context()->set_regexp_exec_function(*fun);
+ }
SimpleInstallGetter(prototype, factory->flags_string(),
Builtins::kRegExpPrototypeFlagsGetter, true);
@@ -1726,6 +1730,22 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
SimpleInstallFunction(prototype, factory->toString_string(),
Builtins::kRegExpPrototypeToString, 0, false,
DONT_ENUM);
+ SimpleInstallFunction(prototype, "test", Builtins::kRegExpPrototypeTest,
+ 1, false, DONT_ENUM);
+
+ {
+ Handle<JSFunction> fun = SimpleCreateFunction(
+ isolate, factory->InternalizeUtf8String("[Symbol.match]"),
+ Builtins::kRegExpPrototypeMatch, 1, false);
+ InstallFunction(prototype, fun, factory->match_symbol(), DONT_ENUM);
+ }
+
+ {
+ Handle<JSFunction> fun = SimpleCreateFunction(
+ isolate, factory->InternalizeUtf8String("[Symbol.search]"),
+ Builtins::kRegExpPrototypeSearch, 1, false);
+ InstallFunction(prototype, fun, factory->search_symbol(), DONT_ENUM);
+ }
}
{
@@ -1812,7 +1832,7 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
// ECMA-262, section 15.10.7.5.
PropertyAttributes writable =
static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE);
- DataDescriptor field(factory->last_index_string(),
+ DataDescriptor field(factory->lastIndex_string(),
JSRegExp::kLastIndexFieldIndex, writable,
Representation::Tagged());
initial_map->AppendDescriptor(&field);
« no previous file with comments | « no previous file | src/builtins/builtins.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698