Commit 6a22b304 authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

jscript: Implement WeakMap.clear().

parent 56c74e38
......@@ -669,8 +669,20 @@ void remove_weakmap_entry(struct weakmap_entry *entry)
static HRESULT WeakMap_clear(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r)
{
FIXME("\n");
return E_NOTIMPL;
WeakMapInstance *weakmap;
HRESULT hres;
hres = get_weakmap_this(ctx, vthis, &weakmap);
if(FAILED(hres))
return hres;
TRACE("%p\n", weakmap);
while(weakmap->map.root)
remove_weakmap_entry(RB_ENTRY_VALUE(weakmap->map.root, struct weakmap_entry, entry));
if(r) *r = jsval_undefined();
return S_OK;
}
static HRESULT WeakMap_delete(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv,
......
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