Commit 1b51a43a authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Added SCRIPTITEM_ISVISIBLE flag implementation.

parent 73658a8b
......@@ -458,6 +458,16 @@ static HRESULT identifier_eval(exec_ctx_t *ctx, BSTR identifier, DWORD flags, ex
}
for(item = ctx->parser->script->named_items; item; item = item->next) {
if((item->flags & SCRIPTITEM_ISVISIBLE) && !strcmpW(item->name, identifier)) {
ret->type = EXPRVAL_VARIANT;
V_VT(&ret->u.var) = VT_DISPATCH;
V_DISPATCH(&ret->u.var) = item->disp;
IDispatch_AddRef(item->disp);
return S_OK;
}
}
for(item = ctx->parser->script->named_items; item; item = item->next) {
hres = disp_get_id(item->disp, identifier, 0, &id);
if(SUCCEEDED(hres))
break;
......
......@@ -326,6 +326,7 @@ static HRESULT WINAPI JScript_Close(IActiveScript *iface)
iter2 = iter->next;
IDispatch_Release(iter->disp);
heap_free(iter->name);
heap_free(iter);
iter = iter2;
}
......@@ -390,6 +391,13 @@ static HRESULT WINAPI JScript_AddNamedItem(IActiveScript *iface,
item->disp = disp;
item->flags = dwFlags;
item->name = heap_strdupW(pstrName);
if(!item->name) {
IDispatch_Release(disp);
heap_free(item);
return E_OUTOFMEMORY;
}
item->next = This->ctx->named_items;
This->ctx->named_items = item;
......
......@@ -154,6 +154,7 @@ HRESULT to_object(exec_ctx_t*,VARIANT*,IDispatch**);
typedef struct named_item_t {
IDispatch *disp;
DWORD flags;
LPWSTR name;
struct named_item_t *next;
} named_item_t;
......
......@@ -702,6 +702,8 @@ static void run_tests(void)
parse_script_a("delete testObj.deleteTest;");
CHECK_CALLED(testobj_delete);
parse_script_a("ok(typeof(test) === 'object', \"typeof(test) != 'object'\");");
run_from_res("lang.js");
run_from_res("api.js");
run_from_res("regexp.js");
......
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