Esempio n. 1
0
void IBAction::Create()
{
	// create action variable
	for (uint i = 0; i < m_pDef->GetVarNames().size(); ++i)
		m_aVariables.insert(VarPair(m_pDef->GetVarNames()[i], IBObject()));

	ResolveVariableFromPostCond(m_aPostCond.back());

	m_pDef->CreateOwnedVariables(this);

	m_eState = (IsResolved() ? IBA_State::IBA_Resolved : IBA_State::IBA_Unresolved);

	if (m_eState == IBA_State::IBA_Resolved)
	{
		m_eState = IBA_State::IBA_Ready;
		FinalizeCreation();
	}
	else if (m_eState == IBA_State::IBA_Unresolved)
	{
		for (VarMap::iterator it = m_aVariables.begin(); it != m_aVariables.end(); ++it)
		{
			const IBObject& Obj = it->second;
			if (Obj.GetUserData() == nullptr)
				m_aPotentialVariables.insert(PotentialVarPair(it->first, vector<IBObject>()));
		}

		m_pDef->CompleteVariables(this);
	}
}
Esempio n. 2
0
JSBool
XPCNativeMember::NewFunctionObject(XPCCallContext& ccx,
                                   XPCNativeInterface* iface, JSObject *parent,
                                   jsval* pval)
{
    NS_ASSERTION(!IsConstant(),
                 "Only call this if you're sure this is not a constant!");
    if(!IsResolved() && !Resolve(ccx, iface))
        return JS_FALSE;

    AUTO_MARK_JSVAL(ccx, &mVal);
    JSObject* funobj =
        xpc_CloneJSFunction(ccx, JSVAL_TO_OBJECT(mVal), parent);
    if(!funobj)
        return JS_FALSE;

    *pval = OBJECT_TO_JSVAL(funobj);

    return JS_TRUE;
}