summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/v8/src/api.cc
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2011-10-14 17:03:06 +1000
committerQt by Nokia <qt-info@nokia.com>2012-04-26 08:56:27 +0200
commitcb81e0bca99bbd90a3f22277727ff31b38152805 (patch)
tree0b0d14dbcfddc78c412d91cb66706dc50ad6d6cf /src/3rdparty/v8/src/api.cc
parent83b51177e547a9e012a17294c8cefb05836ab00a (diff)
[V8] Allow access to the calling script data
Change-Id: I6efcd64530357a5ca789cd6cccd5426f370b64eb Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Diffstat (limited to 'src/3rdparty/v8/src/api.cc')
-rw-r--r--src/3rdparty/v8/src/api.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/3rdparty/v8/src/api.cc b/src/3rdparty/v8/src/api.cc
index aff02f9..d11b98e 100644
--- a/src/3rdparty/v8/src/api.cc
+++ b/src/3rdparty/v8/src/api.cc
@@ -4608,6 +4608,18 @@ v8::Local<v8::Object> Context::GetCallingQmlGlobal() {
}
}
+v8::Local<v8::Value> Context::GetCallingScriptData()
+{
+ i::Isolate* isolate = i::Isolate::Current();
+ if (IsDeadCheck(isolate, "v8::Context::GetCallingScriptData()")) {
+ return Local<Object>();
+ }
+
+ i::JavaScriptFrameIterator it;
+ if (it.done()) return Local<Object>();
+ i::Handle<i::Script> script(i::Script::cast(i::JSFunction::cast(it.frame()->function())->shared()->script()));
+ return Utils::ToLocal(i::Handle<i::Object>(script->data()));
+}
v8::Local<v8::Object> Context::Global() {
if (IsDeadCheck(i::Isolate::Current(), "v8::Context::Global()")) {