diff options
author | Kristian Monsen <kristianm@google.com> | 2010-09-30 15:42:16 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-10-07 10:59:29 +0100 |
commit | bec39347bb3bb5bf1187ccaf471d26247f28b585 (patch) | |
tree | 56bdc4c2978fbfd3d79d0d36d5d6c640ecc09cc8 /JavaScriptCore/qt/api/qscriptoriginalglobalobject_p.h | |
parent | 90b7966e7815b262cd19ac25f03aaad9b21fdc06 (diff) | |
download | external_webkit-bec39347bb3bb5bf1187ccaf471d26247f28b585.zip external_webkit-bec39347bb3bb5bf1187ccaf471d26247f28b585.tar.gz external_webkit-bec39347bb3bb5bf1187ccaf471d26247f28b585.tar.bz2 |
Merge WebKit at r68651 : Initial merge by git.
Change-Id: I3d6bff59f17eedd6722723354f386fec9be8ad12
Diffstat (limited to 'JavaScriptCore/qt/api/qscriptoriginalglobalobject_p.h')
-rw-r--r-- | JavaScriptCore/qt/api/qscriptoriginalglobalobject_p.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/JavaScriptCore/qt/api/qscriptoriginalglobalobject_p.h b/JavaScriptCore/qt/api/qscriptoriginalglobalobject_p.h index 31e94f7..2bd945f 100644 --- a/JavaScriptCore/qt/api/qscriptoriginalglobalobject_p.h +++ b/JavaScriptCore/qt/api/qscriptoriginalglobalobject_p.h @@ -43,6 +43,7 @@ public: inline bool objectHasOwnProperty(JSObjectRef object, JSStringRef property) const; inline QVector<JSStringRef> objectGetOwnPropertyNames(JSObjectRef object) const; + inline bool isDate(JSValueRef value) const; inline bool isArray(JSValueRef value) const; inline bool isError(JSValueRef value) const; @@ -61,6 +62,8 @@ private: JSValueRef m_errorPrototype; JSObjectRef m_functionConstructor; JSValueRef m_functionPrototype; + JSObjectRef m_dateConstructor; + JSValueRef m_datePrototype; // Reference to standard JS functions that are not exposed by JSC C API. JSObjectRef m_hasOwnPropertyFunction; @@ -78,6 +81,7 @@ QScriptOriginalGlobalObject::QScriptOriginalGlobalObject(JSGlobalContextRef cont 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); + initializeMember(globalObject, propertyName.get(), "Date", m_dateConstructor, m_datePrototype); propertyName.adopt(JSStringCreateWithUTF8CString("hasOwnProperty")); m_hasOwnPropertyFunction = const_cast<JSObjectRef>(JSObjectGetProperty(m_context, globalObject, propertyName.get(), &exception)); @@ -126,6 +130,8 @@ QScriptOriginalGlobalObject::~QScriptOriginalGlobalObject() JSValueUnprotect(m_context, m_errorPrototype); JSValueUnprotect(m_context, m_functionConstructor); JSValueUnprotect(m_context, m_functionPrototype); + JSValueUnprotect(m_context, m_dateConstructor); + JSValueUnprotect(m_context, m_datePrototype); JSValueUnprotect(m_context, m_hasOwnPropertyFunction); JSValueUnprotect(m_context, m_getOwnPropertyNamesFunction); JSGlobalContextRelease(m_context); @@ -170,6 +176,11 @@ inline QVector<JSStringRef> QScriptOriginalGlobalObject::objectGetOwnPropertyNam return names; } +inline bool QScriptOriginalGlobalObject::isDate(JSValueRef value) const +{ + return isType(value, m_dateConstructor, m_datePrototype); +} + inline bool QScriptOriginalGlobalObject::isArray(JSValueRef value) const { return isType(value, m_arrayConstructor, m_arrayPrototype); |