Signed-off-by: Paul Gofman pgofman@codeweavers.com --- dlls/jscript/engine.c | 4 ++++ dlls/mshtml/tests/es5.js | 29 +++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+)
diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index cb9ea5cd9ac..47b4e56e8e4 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -573,6 +573,7 @@ HRESULT jsval_strict_equal(jsval_t lval, jsval_t rval, BOOL *ret)
static HRESULT detach_scope(script_ctx_t *ctx, call_frame_t *frame, scope_chain_t *scope) { + function_code_t *func = frame->function; unsigned int i, index; HRESULT hres;
@@ -591,6 +592,9 @@ static HRESULT detach_scope(script_ctx_t *ctx, call_frame_t *frame, scope_chain_ scope->obj = to_disp(scope->jsobj); }
+ if (scope == frame->base_scope && func->name && ctx->version >= SCRIPTLANGUAGEVERSION_ES5) + jsdisp_propput_name(scope->jsobj, func->name, jsval_obj(jsdisp_addref(frame->function_instance))); + index = scope->scope_index; for(i = 0; i < frame->function->local_scopes[index].locals_cnt; i++) { diff --git a/dlls/mshtml/tests/es5.js b/dlls/mshtml/tests/es5.js index e57aed5ca35..81c06a4145e 100644 --- a/dlls/mshtml/tests/es5.js +++ b/dlls/mshtml/tests/es5.js @@ -1447,6 +1447,35 @@ sync_test("functions scope", function() { val = with_function(); ok(val == 8, "val != 8"); ok(w == 9, "w != 9"); + + var func, func_outer, ret; + var o = new Object(); + + func_outer = function e() + { + function func_inner() + { + ok(typeof e == "function", "typeof e == " + typeof e); + ret = e + } + func = func_inner + } + func_outer(); + func(); + ok(ret === func_outer, "ret != func_outer"); + + func_outer = function f(f) + { + function func_inner() + { + ok(typeof f == "object", "typeof f == " + typeof f); + ret = f + } + func = func_inner + } + func_outer(o); + func(); + ok(ret === o, "ret != o"); });
sync_test("console", function() {
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=95323
Your paranoid android.
=== w8adm (32 bit report) ===
mshtml: events.c:1089: Test failed: unexpected call img_onerror events: Timeout
=== w1064_tsign (32 bit report) ===
mshtml: script.c:2838: Test failed: ReportResult failed: 80ef0001