Exemplo n.º 1
0
void ScriptCallArgumentHandler::appendArgument(const ScriptObject& argument)
{
    if (argument.scriptState() != m_exec) {
        ASSERT_NOT_REACHED();
        return;
    }
    m_arguments.append(argument.jsObject());
}
Exemplo n.º 2
0
bool ScriptObject::set(const char* name, const ScriptObject& value)
{
    if (value.scriptState() != m_scriptState) {
        ASSERT_NOT_REACHED();
        return false;
    }
    JSLock lock(SilenceAssertionsOnly);
    PutPropertySlot slot;
    jsObject()->put(m_scriptState, Identifier(m_scriptState, name), value.jsObject(), slot);
    return handleException(m_scriptState);
}
InjectedScript InjectedScriptHost::injectedScriptFor(ScriptState* scriptState)
{
    JSLock lock(SilenceAssertionsOnly);
    JSDOMGlobalObject* globalObject = static_cast<JSDOMGlobalObject*>(scriptState->lexicalGlobalObject());
    JSObject* injectedScript = globalObject->injectedScript();
    if (injectedScript)
        return InjectedScript(ScriptObject(scriptState, injectedScript));

    ASSERT(!m_injectedScriptSource.isEmpty());
    ScriptObject injectedScriptObject = createInjectedScript(m_injectedScriptSource, this, scriptState, m_nextInjectedScriptId);
    globalObject->setInjectedScript(injectedScriptObject.jsObject());
    InjectedScript result(injectedScriptObject);
    m_idToInjectedScript.set(m_nextInjectedScriptId, result);
    m_nextInjectedScriptId++;
    return result;
}
Exemplo n.º 4
0
bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, const ScriptObject& value)
{
    JSLock lock(SilenceAssertionsOnly);
    scriptState->lexicalGlobalObject()->putDirect(scriptState->globalData(), Identifier(scriptState, name), value.jsObject());
    return handleException(scriptState);
}
Exemplo n.º 5
0
bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, const ScriptObject& value)
{
    JSLockHolder lock(scriptState);
    scriptState->lexicalGlobalObject()->putDirect(scriptState->vm(), Identifier(scriptState, name), value.jsObject());
    return handleException(scriptState);
}