Chromium Code Reviews| 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); |
|
Yang
2016/03/22 12:49:38
Let's omit this optimization. I'm not convinced we
Dan Ehrenberg
2016/03/22 18:26:31
This isn't an optimization--apparently you can't c
|
| + %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; |