Index: src/v8natives.js |
diff --git a/src/v8natives.js b/src/v8natives.js |
index 380c871e040ef47d263fbde0193d2545903359c6..490f39f4b4a2b95a2b9aa227204ad38a1ac0144e 100644 |
--- a/src/v8natives.js |
+++ b/src/v8natives.js |
@@ -32,6 +32,17 @@ function InstallFunctions(object, attributes, functions) { |
} |
+function OverrideFunction(object, name, f) { |
+ ObjectDefineProperty(object, name, { value: f, |
+ writeable: true, |
+ configurable: true, |
+ enumerable: false }); |
+ %FunctionSetName(f, name); |
+ %FunctionRemovePrototype(f); |
+ %SetNativeFlag(f); |
+} |
+ |
+ |
// Helper function to install a getter-only accessor property. |
function InstallGetter(object, name, getter) { |
%FunctionSetName(getter, name); |