From 51277bb5f996cb8cae82985ffe8b5cb0a5428cc8 Mon Sep 17 00:00:00 2001 From: Qian Hong Date: Fri, 3 Oct 2014 02:30:53 +0800 Subject: [PATCH 3/5] jscript: Ignore BOM mark in parseInt. To: wine-patches Reply-To: wine-devel Cc: Qian Hong --- dlls/jscript/global.c | 2 +- dlls/jscript/tests/run.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/jscript/global.c b/dlls/jscript/global.c index e0300ac..de3fe8b 100644 --- a/dlls/jscript/global.c +++ b/dlls/jscript/global.c @@ -470,7 +470,7 @@ static HRESULT JSGlobal_parseInt(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, if(FAILED(hres)) return hres; - while(isspaceW(*ptr)) + while(is_jsspaceW(*ptr)) ptr++; switch(*ptr) { diff --git a/dlls/jscript/tests/run.c b/dlls/jscript/tests/run.c index 9dd4561..446adf4 100644 --- a/dlls/jscript/tests/run.c +++ b/dlls/jscript/tests/run.c @@ -1997,6 +1997,9 @@ static const struct spaces_test spaces_tests[] = { {"var a = parseFloat(\" 3.14 \");\ ok(a == 3.14, \"returned \"+a);\ reportSuccess();", S_OK}, + {"var a = parseInt(\" 3.14 \");\ + ok(a == 3, \"returned \"+a);\ + reportSuccess();", S_OK}, {{0}} }; -- 1.9.1