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

Unified Diff: src/js/prologue.js

Issue 1596483005: Add ES2015 RegExp full subclassing semantics behind a flag (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: camelCase Created 4 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/js/i18n.js ('k') | src/js/regexp.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/prologue.js
diff --git a/src/js/prologue.js b/src/js/prologue.js
index 03a842d6caa669c6b24ffa1c074fd71f879517e3..dfbba6bc14b5ce6b5e8ce695f501b521699bfeb7 100644
--- a/src/js/prologue.js
+++ b/src/js/prologue.js
@@ -126,6 +126,18 @@ function InstallGetterSetter(object, name, getter, setter, attributes) {
}
+function OverrideFunction(object, name, f, afterInitialBootstrap) {
+ %CheckIsBootstrapping();
+ %ObjectDefineProperty(object, name, { value: f,
+ writeable: true,
+ configurable: true,
+ enumerable: false });
+ SetFunctionName(f, name);
+ if (!afterInitialBootstrap) %FunctionRemovePrototype(f);
+ %SetNativeFlag(f);
+}
+
+
// Prevents changes to the prototype of a built-in function.
// The "prototype" property of the function object is made non-configurable,
// and the prototype object is made non-extensible. The latter prevents
@@ -187,6 +199,12 @@ function PostNatives(utils) {
"PromiseChain",
"PromiseDeferred",
"PromiseResolved",
+ "RegExpSubclassExecJS",
+ "RegExpSubclassMatch",
+ "RegExpSubclassReplace",
+ "RegExpSubclassSearch",
+ "RegExpSubclassSplit",
+ "RegExpSubclassTest",
"SetIterator",
"SetIteratorNext",
"SetValues",
@@ -206,6 +224,10 @@ function PostNatives(utils) {
"to_string_tag_symbol",
"object_to_string",
"species_symbol",
+ "match_symbol",
+ "replace_symbol",
+ "search_symbol",
+ "split_symbol",
];
var filtered_exports = {};
@@ -284,6 +306,7 @@ utils.InstallConstants = InstallConstants;
utils.InstallFunctions = InstallFunctions;
utils.InstallGetter = InstallGetter;
utils.InstallGetterSetter = InstallGetterSetter;
+utils.OverrideFunction = OverrideFunction;
utils.SetUpLockedPrototype = SetUpLockedPrototype;
utils.PostNatives = PostNatives;
utils.PostExperimentals = PostExperimentals;
« no previous file with comments | « src/js/i18n.js ('k') | src/js/regexp.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698