mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-02 08:33:37 +00:00
jscript: Throw proper error when calling Map constructor as method.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
This commit is contained in:
parent
8cb5d74125
commit
84f7f60192
|
@ -417,6 +417,9 @@ static HRESULT Map_constructor(script_ctx_t *ctx, jsval_t vthis, WORD flags, uns
|
|||
*r = jsval_obj(&map->dispex);
|
||||
return S_OK;
|
||||
|
||||
case DISPATCH_METHOD:
|
||||
return throw_error(ctx, JS_E_WRONG_THIS, L"Map");
|
||||
|
||||
default:
|
||||
FIXME("unimplemented flags %x\n", flags);
|
||||
return E_NOTIMPL;
|
||||
|
|
|
@ -1301,6 +1301,13 @@ sync_test("set_obj", function() {
|
|||
sync_test("map_obj", function() {
|
||||
if(!("Map" in window)) return;
|
||||
|
||||
try {
|
||||
var s = Map();
|
||||
ok(false, "expected exception calling constructor as method");
|
||||
}catch(e) {
|
||||
ok(e.number === 0xa13fc - 0x80000000, "calling constructor as method threw " + e.number);
|
||||
}
|
||||
|
||||
var s = new Map, r, i;
|
||||
ok(Object.getPrototypeOf(s) === Map.prototype, "unexpected Map prototype");
|
||||
|
||||
|
|
Loading…
Reference in a new issue