Index: src/runtime.cc |
diff --git a/src/runtime.cc b/src/runtime.cc |
index b6c4525bae5e1b3bc86f92c92b199ebd51d55ab5..d7b52ce8f75ea2922a8ba2a821ea558db209df7b 100644 |
--- a/src/runtime.cc |
+++ b/src/runtime.cc |
@@ -2050,6 +2050,28 @@ RUNTIME_FUNCTION(Runtime_PreventExtensions) { |
} |
+RUNTIME_FUNCTION(Runtime_ToMethod) { |
+ HandleScope scope(isolate); |
+ DCHECK(args.length() == 2); |
+ CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0); |
+ CONVERT_ARG_HANDLE_CHECKED(JSObject, home_object, 1); |
+ Handle<JSFunction> clone = JSFunction::Copy(fun); |
arv (Not doing code reviews)
2014/08/20 15:35:53
This is going to copy the properties which is not
|
+ Handle<Symbol> home_object_symbol(isolate->heap()->home_object_symbol()); |
+ JSObject::SetOwnPropertyIgnoreAttributes( |
+ clone, |
+ home_object_symbol, |
+ home_object, |
+ DONT_SHOW).Assert(); |
Toon Verwaest
2014/08/20 07:43:11
DONT_ENUM.
The other flags are just there for fil
|
+ return *clone; |
+} |
+ |
+ |
+RUNTIME_FUNCTION(Runtime_HomeObjectSymbol) { |
+ DCHECK(args.length() == 0); |
+ return isolate->heap()->home_object_symbol(); |
+} |
+ |
+ |
RUNTIME_FUNCTION(Runtime_IsExtensible) { |
SealHandleScope shs(isolate); |
DCHECK(args.length() == 1); |