diff options
author | Ben Murdoch <benm@google.com> | 2010-07-22 15:37:06 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-07-27 10:20:25 +0100 |
commit | 967717af5423377c967781471ee106e2bb4e11c8 (patch) | |
tree | 1e701dc0a12f7f07cce1df4a7681717de77a211b /JavaScriptCore/qt/api/qscriptengine_p.cpp | |
parent | dcc30a9fca45f634b1d3a12b276d3a0ccce99fc3 (diff) | |
download | external_webkit-967717af5423377c967781471ee106e2bb4e11c8.zip external_webkit-967717af5423377c967781471ee106e2bb4e11c8.tar.gz external_webkit-967717af5423377c967781471ee106e2bb4e11c8.tar.bz2 |
Merge WebKit at r63859 : Initial merge by git.
Change-Id: Ie8096c63ec7c991c9a9cba8bdd9c3b74a3b8ed62
Diffstat (limited to 'JavaScriptCore/qt/api/qscriptengine_p.cpp')
-rw-r--r-- | JavaScriptCore/qt/api/qscriptengine_p.cpp | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/JavaScriptCore/qt/api/qscriptengine_p.cpp b/JavaScriptCore/qt/api/qscriptengine_p.cpp index 360de29..e3311ed 100644 --- a/JavaScriptCore/qt/api/qscriptengine_p.cpp +++ b/JavaScriptCore/qt/api/qscriptengine_p.cpp @@ -32,32 +32,12 @@ QScriptEnginePrivate::QScriptEnginePrivate(const QScriptEngine* engine) : q_ptr(const_cast<QScriptEngine*>(engine)) , m_context(JSGlobalContextCreate(0)) , m_exception(0) - , m_arrayConstructor(0) - , m_arrayPrototype(0) + , m_originalGlobalObject(m_context) { - JSObjectRef globalObject = JSContextGetGlobalObject(m_context); - - // Save references to the Array constructor and prototype. - JSRetainPtr<JSStringRef> arrayName(Adopt, JSStringCreateWithUTF8CString("Array")); - JSValueRef arrayConstructor = JSObjectGetProperty(m_context, globalObject, arrayName.get(), /* exception */ 0); - Q_ASSERT(JSValueIsObject(m_context, arrayConstructor)); - m_arrayConstructor = JSValueToObject(m_context, arrayConstructor, /* exception */ 0); - JSValueProtect(m_context, m_arrayConstructor); - - // Note that this is not the [[Prototype]] internal property (which we could - // get via JSObjectGetPrototype), but the Array.prototype, that will be set - // as [[Prototype]] of Array instances. - JSRetainPtr<JSStringRef> prototypeName(Adopt, JSStringCreateWithUTF8CString("prototype")); - JSValueRef arrayPrototype = JSObjectGetProperty(m_context, m_arrayConstructor, prototypeName.get(), /* exception */ 0); - Q_ASSERT(JSValueIsObject(m_context, arrayPrototype)); - m_arrayPrototype = arrayPrototype; - JSValueProtect(m_context, m_arrayPrototype); } QScriptEnginePrivate::~QScriptEnginePrivate() { - JSValueUnprotect(m_context, m_arrayConstructor); - JSValueUnprotect(m_context, m_arrayPrototype); if (m_exception) JSValueUnprotect(m_context, m_exception); JSGlobalContextRelease(m_context); |