jscript: Support undefined context value in Array.prototype.map.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
6d69c6db51
commit
8be931623a
|
@ -1074,11 +1074,12 @@ static HRESULT Array_map(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned
|
|||
callback = get_object(argv[0]);
|
||||
|
||||
if(argc > 1) {
|
||||
if(!is_object_instance(argv[1]) || !get_object(argv[1])) {
|
||||
if(is_object_instance(argv[1]) && get_object(argv[1])) {
|
||||
context_this = get_object(argv[1]);
|
||||
}else if(!is_undefined(argv[1])) {
|
||||
FIXME("Unsupported context this %s\n", debugstr_jsval(argv[1]));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
context_this = get_object(argv[1]);
|
||||
}
|
||||
|
||||
hres = create_array(ctx, length, &array);
|
||||
|
|
|
@ -178,6 +178,13 @@ function test_array_map() {
|
|||
ok(calls === "0:1,1:3,2:5,", "calls = " + calls);
|
||||
ok(m.join() === "0,2,4", "m = " + m);
|
||||
|
||||
[1,2].map(function() {
|
||||
ok(this === window, "this != window");
|
||||
});
|
||||
[1,2].map(function() {
|
||||
ok(this === window, "this != window");
|
||||
}, undefined);
|
||||
|
||||
next_test();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue