Commit ae41d600 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Add Map.prototype.has implementation.

parent 6e9f69d4
...@@ -322,8 +322,17 @@ static HRESULT Map_set(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned ...@@ -322,8 +322,17 @@ static HRESULT Map_set(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned
static HRESULT Map_has(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, static HRESULT Map_has(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv,
jsval_t *r) jsval_t *r)
{ {
FIXME("%p\n", jsthis); jsval_t key = argc >= 1 ? argv[0] : jsval_undefined();
return E_NOTIMPL; struct jsval_map_entry *entry;
MapInstance *map;
if(!(map = get_map_this(jsthis))) return JS_E_MAP_EXPECTED;
TRACE("%p (%s)\n", map, debugstr_jsval(key));
entry = get_map_entry(map, key);
if(r) *r = jsval_bool(!!entry);
return S_OK;
} }
static HRESULT Map_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, static HRESULT Map_value(script_ctx_t *ctx, vdisp_t *jsthis, 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