void JSGlobalObject::init(JSObject* thisValue)
{
    ASSERT(JSLock::currentThreadIsHoldingLock());

    structure()->disableSpecificFunctionTracking();

    d()->globalData = Heap::heap(this)->globalData();
    d()->globalScopeChain = ScopeChain(this, d()->globalData.get(), this, thisValue);

    JSGlobalObject::globalExec()->init(0, 0, d()->globalScopeChain.node(), CallFrame::noCaller(), 0, 0);

    if (JSGlobalObject*& headObject = head()) {
        d()->prev = headObject;
        d()->next = headObject->d()->next;
        headObject->d()->next->d()->prev = this;
        headObject->d()->next = this;
    } else
        headObject = d()->next = d()->prev = this;

    d()->debugger = 0;

    d()->profileGroup = 0;

    reset(prototype());
}
Exemplo n.º 2
0
ScopeChain QSFuncRefClass::refScope( const QSObject &ref )
{
    if( ref.isFunction() ) {
	return ( (QSReferenceData*) ref.shVal() )->context;
    }
    qWarning( "QSFuncRefClass::refScope() - not a reference" );
    return ScopeChain();
}