summaryrefslogtreecommitdiffstats
path: root/src/v8/0005-Allow-access-to-the-calling-script-data.patch
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2011-10-11 15:06:25 +1000
committerQt by Nokia <qt-info@nokia.com>2011-10-19 20:48:25 +0200
commit7dc5973bf12919d2d35230844beabe558d4faa00 (patch)
tree88d6128a911d2ec3b9a72d8e45d56fc2b250c714 /src/v8/0005-Allow-access-to-the-calling-script-data.patch
parent4dc25c1f2995a5e02da47f0f6f3522af9eb6f78c (diff)
Update V8
Change-Id: I7a9da7dbb2116a441788407d60ed10155cded941 Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Diffstat (limited to 'src/v8/0005-Allow-access-to-the-calling-script-data.patch')
-rw-r--r--src/v8/0005-Allow-access-to-the-calling-script-data.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/v8/0005-Allow-access-to-the-calling-script-data.patch b/src/v8/0005-Allow-access-to-the-calling-script-data.patch
new file mode 100644
index 0000000000..a8cdc1dd54
--- /dev/null
+++ b/src/v8/0005-Allow-access-to-the-calling-script-data.patch
@@ -0,0 +1,48 @@
+From 2608243d70a8fcb0335f3520d5de1ac3cd854e87 Mon Sep 17 00:00:00 2001
+From: Aaron Kennedy <aaron.kennedy@nokia.com>
+Date: Fri, 14 Oct 2011 17:03:06 +1000
+Subject: [PATCH 05/11] Allow access to the calling script data
+
+---
+ include/v8.h | 1 +
+ src/api.cc | 12 ++++++++++++
+ 2 files changed, 13 insertions(+), 0 deletions(-)
+
+diff --git a/include/v8.h b/include/v8.h
+index 193e2fe..c094d08 100644
+--- a/include/v8.h
++++ b/include/v8.h
+@@ -3517,6 +3517,7 @@ class V8EXPORT Context {
+ */
+ static Local<Context> GetCalling();
+ static Local<Object> GetCallingQmlGlobal();
++ static Local<Value> GetCallingScriptData();
+
+ /**
+ * Sets the security token for the context. To access an object in
+diff --git a/src/api.cc b/src/api.cc
+index fd718c8..526aa02 100644
+--- a/src/api.cc
++++ b/src/api.cc
+@@ -4361,6 +4361,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()")) {
+--
+1.7.4.4
+