diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-08-12 13:39:55 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-08-12 13:39:55 (GMT) |
commit | bbadec8c68d930a4cb9f45835aa7d1659620cdc3 (patch) | |
tree | 9bd835b4264624037dab12dcf4d298e44ef5c2a1 /src/script/bridge/qscriptclassobject.cpp | |
parent | 30d5f14e1062df9d0f4d47e308982460e8f850d3 (diff) | |
download | Qt-bbadec8c68d930a4cb9f45835aa7d1659620cdc3.zip Qt-bbadec8c68d930a4cb9f45835aa7d1659620cdc3.tar.gz Qt-bbadec8c68d930a4cb9f45835aa7d1659620cdc3.tar.bz2 |
Cantralize the place when we construct the default 'this' object that JSC doesn't construct.
Removes code duplication.
This also indirrectly fixes the QMetaObjectWrapperObject where this was missing
Diffstat (limited to 'src/script/bridge/qscriptclassobject.cpp')
-rw-r--r-- | src/script/bridge/qscriptclassobject.cpp | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/script/bridge/qscriptclassobject.cpp b/src/script/bridge/qscriptclassobject.cpp index 3a41dae..9b9af9e 100644 --- a/src/script/bridge/qscriptclassobject.cpp +++ b/src/script/bridge/qscriptclassobject.cpp @@ -243,17 +243,9 @@ JSC::JSObject* ClassObjectDelegate::construct(JSC::ExecState *exec, JSC::JSObjec QScriptObjectDelegate *delegate = obj->delegate(); QScriptClass *scriptClass = static_cast<ClassObjectDelegate*>(delegate)->scriptClass(); - JSC::Structure* structure; - JSC::JSValue prototype = JSC::asObject(callee)->get(exec, exec->propertyNames().prototype); - if (prototype.isObject()) - structure = JSC::asObject(prototype)->inheritorID(); - else - structure = exec->lexicalGlobalObject()->emptyObjectStructure(); - JSC::JSObject* thisObject = new (exec) QScriptObject(structure); - QScriptEnginePrivate *eng_p = scriptEngineFromExec(exec); JSC::ExecState *oldFrame = eng_p->currentFrame; - eng_p->pushContext(exec, thisObject, args, callee, true); + eng_p->pushContext(exec, JSC::JSValue(), args, callee, true); QScriptContext *ctx = eng_p->contextForFrame(eng_p->currentFrame); QScriptValue defaultObject = ctx->thisObject(); |