Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 02b6be4d3b7a4622a423d2232b9620796177afa7..49239b41ec0108f59b18284349902c77ea6d0fcc 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -4305,6 +4305,20 @@ int Function::ScriptId() const { |
} |
+Local<v8::Value> Function::GetBoundFunction() const { |
+ i::Handle<i::JSFunction> func = Utils::OpenHandle(this); |
+ if (!func->shared()->bound()) { |
+ return v8::Undefined(reinterpret_cast<v8::Isolate*>(func->GetIsolate())); |
+ } |
+ i::Handle<i::FixedArray> bound_args = i::Handle<i::FixedArray>( |
+ i::FixedArray::cast(func->function_bindings())); |
+ i::Handle<i::Object> original( |
+ i::JSReceiver::cast(bound_args->get(i::JSFunction::kBoundFunctionIndex)), |
yurys
2013/12/18 10:10:14
Why do you need to cast to i::JSReceiver here?
Alexandra Mikhaylova
2013/12/18 14:16:07
Thanks, I think we can make it without i::JSReceiv
|
+ func->GetIsolate()); |
+ return Utils::ToLocal(i::Handle<i::JSFunction>::cast(original)); |
+} |
+ |
+ |
int String::Length() const { |
i::Handle<i::String> str = Utils::OpenHandle(this); |
return str->length(); |