summaryrefslogtreecommitdiffstats
path: root/JavaScriptCore/qt/api/qscriptoriginalglobalobject_p.h
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2010-07-30 10:46:49 +0100
committerKristian Monsen <kristianm@google.com>2010-08-04 13:01:34 +0100
commit0617145a89917ae7735fe1c9538688ab9a577df5 (patch)
tree56206078694427c37ed7bdf27eb5221398b833c0 /JavaScriptCore/qt/api/qscriptoriginalglobalobject_p.h
parentef1adcdfc805d4d13103f6f15cc5b4d96828a60f (diff)
downloadexternal_webkit-0617145a89917ae7735fe1c9538688ab9a577df5.zip
external_webkit-0617145a89917ae7735fe1c9538688ab9a577df5.tar.gz
external_webkit-0617145a89917ae7735fe1c9538688ab9a577df5.tar.bz2
Merge WebKit at r64264 : Initial merge by git.
Change-Id: Ic42bef02efef8217a0f84c47176a9c617c28d1f1
Diffstat (limited to 'JavaScriptCore/qt/api/qscriptoriginalglobalobject_p.h')
-rw-r--r--JavaScriptCore/qt/api/qscriptoriginalglobalobject_p.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/JavaScriptCore/qt/api/qscriptoriginalglobalobject_p.h b/JavaScriptCore/qt/api/qscriptoriginalglobalobject_p.h
index 8d080fb..31e94f7 100644
--- a/JavaScriptCore/qt/api/qscriptoriginalglobalobject_p.h
+++ b/JavaScriptCore/qt/api/qscriptoriginalglobalobject_p.h
@@ -45,6 +45,8 @@ public:
inline bool isArray(JSValueRef value) const;
inline bool isError(JSValueRef value) const;
+
+ inline JSValueRef functionPrototype() const;
private:
inline bool isType(JSValueRef value, JSObjectRef constructor, JSValueRef prototype) const;
inline void initializeMember(JSObjectRef globalObject, JSStringRef prototypeName, const char* type, JSObjectRef& constructor, JSValueRef& prototype);
@@ -57,6 +59,8 @@ private:
JSValueRef m_arrayPrototype;
JSObjectRef m_errorConstructor;
JSValueRef m_errorPrototype;
+ JSObjectRef m_functionConstructor;
+ JSValueRef m_functionPrototype;
// Reference to standard JS functions that are not exposed by JSC C API.
JSObjectRef m_hasOwnPropertyFunction;
@@ -73,6 +77,7 @@ QScriptOriginalGlobalObject::QScriptOriginalGlobalObject(JSGlobalContextRef cont
propertyName.adopt(JSStringCreateWithUTF8CString("prototype"));
initializeMember(globalObject, propertyName.get(), "Array", m_arrayConstructor, m_arrayPrototype);
initializeMember(globalObject, propertyName.get(), "Error", m_errorConstructor, m_errorPrototype);
+ initializeMember(globalObject, propertyName.get(), "Function", m_functionConstructor, m_functionPrototype);
propertyName.adopt(JSStringCreateWithUTF8CString("hasOwnProperty"));
m_hasOwnPropertyFunction = const_cast<JSObjectRef>(JSObjectGetProperty(m_context, globalObject, propertyName.get(), &exception));
@@ -119,6 +124,8 @@ QScriptOriginalGlobalObject::~QScriptOriginalGlobalObject()
JSValueUnprotect(m_context, m_arrayPrototype);
JSValueUnprotect(m_context, m_errorConstructor);
JSValueUnprotect(m_context, m_errorPrototype);
+ JSValueUnprotect(m_context, m_functionConstructor);
+ JSValueUnprotect(m_context, m_functionPrototype);
JSValueUnprotect(m_context, m_hasOwnPropertyFunction);
JSValueUnprotect(m_context, m_getOwnPropertyNamesFunction);
JSGlobalContextRelease(m_context);
@@ -173,6 +180,11 @@ inline bool QScriptOriginalGlobalObject::isError(JSValueRef value) const
return isType(value, m_errorConstructor, m_errorPrototype);
}
+inline JSValueRef QScriptOriginalGlobalObject::functionPrototype() const
+{
+ return m_functionPrototype;
+}
+
inline bool QScriptOriginalGlobalObject::isType(JSValueRef value, JSObjectRef constructor, JSValueRef prototype) const
{
// JSC API doesn't export the [[Class]] information for the builtins. But we know that a value