jscript: Added RegExp.global getter implementation.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2016-05-25 14:08:03 +02:00 committed by Alexandre Julliard
parent 81cb13af7a
commit b1773131ac
2 changed files with 9 additions and 2 deletions

View File

@ -264,8 +264,10 @@ static HRESULT RegExp_set_source(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t va
static HRESULT RegExp_get_global(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r) static HRESULT RegExp_get_global(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r)
{ {
FIXME("\n"); TRACE("\n");
return E_NOTIMPL;
*r = jsval_bool(!!(regexp_from_jsdisp(jsthis)->jsregexp->flags & REG_GLOB));
return S_OK;
} }
static HRESULT RegExp_set_global(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t value) static HRESULT RegExp_set_global(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t value)

View File

@ -663,13 +663,18 @@ ok(/abc/.toString(1, false, "3") === "/abc/", "/abc/.toString(1, false, \"3\") =
re = /x/; re = /x/;
ok(re.ignoreCase === false, "re.ignoreCase = " + re.ignoreCase); ok(re.ignoreCase === false, "re.ignoreCase = " + re.ignoreCase);
ok(re.multiline === false, "re.multiline = " + re.multiline); ok(re.multiline === false, "re.multiline = " + re.multiline);
ok(re.global === false, "re.global = " + re.global);
re = /x/i; re = /x/i;
ok(re.ignoreCase === true, "re.ignoreCase = " + re.ignoreCase); ok(re.ignoreCase === true, "re.ignoreCase = " + re.ignoreCase);
ok(re.multiline === false, "re.multiline = " + re.multiline); ok(re.multiline === false, "re.multiline = " + re.multiline);
ok(re.global === false, "re.global = " + re.global);
re = new RegExp("xxx", "gi"); re = new RegExp("xxx", "gi");
ok(re.ignoreCase === true, "re.ignoreCase = " + re.ignoreCase); ok(re.ignoreCase === true, "re.ignoreCase = " + re.ignoreCase);
ok(re.multiline === false, "re.multiline = " + re.multiline); ok(re.multiline === false, "re.multiline = " + re.multiline);
ok(re.global === true, "re.global = " + re.global);
re = /x/mg; re = /x/mg;
ok(re.ignoreCase === false, "re.ignoreCase = " + re.ignoreCase);
ok(re.multiline === true, "re.multiline = " + re.multiline); ok(re.multiline === true, "re.multiline = " + re.multiline);
ok(re.global === true, "re.global = " + re.global);
reportSuccess(); reportSuccess();