From 2538a74c801230941c326f2629ba07962e14fa4b Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Thu, 10 May 2018 19:20:45 +0200 Subject: [PATCH] jscript: Make RegExp object properties non-writable. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/jscript/jsregexp.c | 40 ++++++++-------------------------------- dlls/mshtml/tests/es5.js | 4 ++++ 2 files changed, 12 insertions(+), 32 deletions(-) diff --git a/dlls/jscript/jsregexp.c b/dlls/jscript/jsregexp.c index 5798635cb87..821c0164eb8 100644 --- a/dlls/jscript/jsregexp.c +++ b/dlls/jscript/jsregexp.c @@ -256,12 +256,6 @@ static HRESULT RegExp_get_source(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r return S_OK; } -static HRESULT RegExp_set_source(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t value) -{ - FIXME("\n"); - return E_NOTIMPL; -} - static HRESULT RegExp_get_global(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r) { TRACE("\n"); @@ -270,12 +264,6 @@ static HRESULT RegExp_get_global(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r return S_OK; } -static HRESULT RegExp_set_global(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t value) -{ - FIXME("\n"); - return E_NOTIMPL; -} - static HRESULT RegExp_get_ignoreCase(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r) { TRACE("\n"); @@ -284,12 +272,6 @@ static HRESULT RegExp_get_ignoreCase(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_ return S_OK; } -static HRESULT RegExp_set_ignoreCase(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t value) -{ - FIXME("\n"); - return E_NOTIMPL; -} - static HRESULT RegExp_get_multiline(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r) { TRACE("\n"); @@ -298,12 +280,6 @@ static HRESULT RegExp_get_multiline(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t return S_OK; } -static HRESULT RegExp_set_multiline(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t value) -{ - FIXME("\n"); - return E_NOTIMPL; -} - static INT index_from_val(script_ctx_t *ctx, jsval_t v) { double n; @@ -607,11 +583,11 @@ static void RegExp_destructor(jsdisp_t *dispex) static const builtin_prop_t RegExp_props[] = { {execW, RegExp_exec, PROPF_METHOD|1}, - {globalW, NULL,0, RegExp_get_global, RegExp_set_global}, - {ignoreCaseW, NULL,0, RegExp_get_ignoreCase, RegExp_set_ignoreCase}, + {globalW, NULL,0, RegExp_get_global}, + {ignoreCaseW, NULL,0, RegExp_get_ignoreCase}, {lastIndexW, NULL,0, RegExp_get_lastIndex, RegExp_set_lastIndex}, - {multilineW, NULL,0, RegExp_get_multiline, RegExp_set_multiline}, - {sourceW, NULL,0, RegExp_get_source, RegExp_set_source}, + {multilineW, NULL,0, RegExp_get_multiline}, + {sourceW, NULL,0, RegExp_get_source}, {testW, RegExp_test, PROPF_METHOD|1}, {toStringW, RegExp_toString, PROPF_METHOD} }; @@ -626,11 +602,11 @@ static const builtin_info_t RegExp_info = { }; static const builtin_prop_t RegExpInst_props[] = { - {globalW, NULL,0, RegExp_get_global, RegExp_set_global}, - {ignoreCaseW, NULL,0, RegExp_get_ignoreCase, RegExp_set_ignoreCase}, + {globalW, NULL,0, RegExp_get_global}, + {ignoreCaseW, NULL,0, RegExp_get_ignoreCase}, {lastIndexW, NULL,0, RegExp_get_lastIndex, RegExp_set_lastIndex}, - {multilineW, NULL,0, RegExp_get_multiline, RegExp_set_multiline}, - {sourceW, NULL,0, RegExp_get_source, RegExp_set_source} + {multilineW, NULL,0, RegExp_get_multiline}, + {sourceW, NULL,0, RegExp_get_source} }; static const builtin_info_t RegExpInst_info = { diff --git a/dlls/mshtml/tests/es5.js b/dlls/mshtml/tests/es5.js index 6b84b4084a5..a769a499ff8 100644 --- a/dlls/mshtml/tests/es5.js +++ b/dlls/mshtml/tests/es5.js @@ -179,7 +179,11 @@ function test_getOwnPropertyDescriptor() { test_own_data_prop_desc(obj, "arguments", false, false, false); obj = /test/; + test_own_data_prop_desc(obj, "global", false, false, false); + test_own_data_prop_desc(obj, "ignoreCase", false, false, false); test_own_data_prop_desc(obj, "lastIndex", true, false, false); + test_own_data_prop_desc(obj, "multiline", false, false, false); + test_own_data_prop_desc(obj, "source", false, false, false); next_test(); } -- 2.11.4.GIT