Commit 9dd50eae authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Allow 0x strings with explicit radix 16 in parseInt.

parent 58dd9c2b
......@@ -336,6 +336,8 @@ static HRESULT JSGlobal_parseInt(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
}else {
radix = 10;
}
}else if(radix == 16 && *ptr == '0' && (ptr[1] == 'x' || ptr[1] == 'X')) {
ptr += 2;
}
i = char_to_int(*ptr++);
......
......@@ -156,6 +156,12 @@ i = parseInt("1", 37);
ok(isNaN(i), "parseInt('1', 37) = " + i);
i = parseInt("1", 36);
ok(i === 1, "parseInt('1', 36) = " + i);
i = parseInt("0x1f", 16);
ok(i === 31, "parseInt('0xf', 16) = " + i);
i = parseInt("0x", 16);
ok(isNaN(i), "parseInt('0x', 16) = " + i);
i = parseInt("0x1f", 17);
ok(i === 0, "parseInt('0xf', 16) = " + i);
tmp = encodeURI("abc");
ok(tmp === "abc", "encodeURI('abc') = " + tmp);
......
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