Commit 5e4a1681 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Added support for SCRIPTTEXT_ISEXPRESSION.

parent b568d888
......@@ -766,10 +766,34 @@ static HRESULT WINAPI JScriptParse_ParseScriptText(IActiveScriptParse *iface,
if(This->thread_id != GetCurrentThreadId() || This->ctx->state == SCRIPTSTATE_CLOSED)
return E_UNEXPECTED;
hres = compile_script(This->ctx, pstrCode, NULL, pstrDelimiter, FALSE, This->is_encode, &code);
hres = compile_script(This->ctx, pstrCode, NULL, pstrDelimiter, (dwFlags & SCRIPTTEXT_ISEXPRESSION) != 0,
This->is_encode, &code);
if(FAILED(hres))
return hres;
if(dwFlags & SCRIPTTEXT_ISEXPRESSION) {
exec_ctx_t *exec_ctx;
hres = create_exec_ctx(This->ctx, NULL, This->ctx->global, NULL, TRUE, &exec_ctx);
if(SUCCEEDED(hres)) {
jsval_t r;
IActiveScriptSite_OnEnterScript(This->site);
clear_ei(This->ctx);
hres = exec_source(exec_ctx, code, &code->global_code, TRUE, &r);
if(SUCCEEDED(hres)) {
hres = jsval_to_variant(r, pvarResult);
jsval_release(r);
}
exec_release(exec_ctx);
IActiveScriptSite_OnLeaveScript(This->site);
}
return hres;
}
if(!is_started(This->ctx)) {
if(This->queue_tail)
This->queue_tail = This->queue_tail->next = code;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment