Skip to content

Commit f2bef80

Browse files
winesyncMishaProductions
authored andcommitted
[WINESYNC] jscript: Support non-extensible objects in jsdisp_define_property.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 7f1c98cac61609474a188e87c4d66680ad1b1094 by Jacek Caban <jacek@codeweavers.com>
1 parent af9caa0 commit f2bef80

File tree

5 files changed

+7
-1
lines changed

5 files changed

+7
-1
lines changed

dll/win32/jscript/dispex.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2503,6 +2503,9 @@ HRESULT jsdisp_define_property(jsdisp_t *obj, const WCHAR *name, property_desc_t
25032503
if(FAILED(hres))
25042504
return hres;
25052505

2506+
if((!prop || prop->type == PROP_DELETED) && !obj->extensible)
2507+
return throw_error(obj->ctx, JS_E_OBJECT_NONEXTENSIBLE, name);
2508+
25062509
if(!prop && !(prop = alloc_prop(obj, name, PROP_DELETED, 0)))
25072510
return E_OUTOFMEMORY;
25082511

dll/win32/jscript/error.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,7 @@ jsdisp_t *create_builtin_error(script_ctx_t *ctx)
477477
case JS_E_ENUMERATOR_EXPECTED:
478478
case JS_E_REGEXP_EXPECTED:
479479
case JS_E_ARRAY_EXPECTED:
480+
case JS_E_OBJECT_NONEXTENSIBLE:
480481
case JS_E_NONCONFIGURABLE_REDEFINED:
481482
case JS_E_NONWRITABLE_MODIFIED:
482483
case JS_E_PROP_DESC_MISMATCH:

dll/win32/jscript/jscript.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,7 @@ static inline DWORD make_grfdex(script_ctx_t *ctx, DWORD flags)
576576
#define JS_E_PRECISION_OUT_OF_RANGE MAKE_JSERROR(IDS_PRECISION_OUT_OF_RANGE)
577577
#define JS_E_INVALID_LENGTH MAKE_JSERROR(IDS_INVALID_LENGTH)
578578
#define JS_E_ARRAY_EXPECTED MAKE_JSERROR(IDS_ARRAY_EXPECTED)
579+
#define JS_E_OBJECT_NONEXTENSIBLE MAKE_JSERROR(IDS_OBJECT_NONEXTENSIBLE)
579580
#define JS_E_NONCONFIGURABLE_REDEFINED MAKE_JSERROR(IDS_NONCONFIGURABLE_REDEFINED)
580581
#define JS_E_NONWRITABLE_MODIFIED MAKE_JSERROR(IDS_NONWRITABLE_MODIFIED)
581582
#define JS_E_PROP_DESC_MISMATCH MAKE_JSERROR(IDS_PROP_DESC_MISMATCH)

dll/win32/jscript/resource.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
#define IDS_INVALID_LENGTH 0x13A5
7171
#define IDS_ARRAY_EXPECTED 0x13A7
7272
#define IDS_INVALID_WRITABLE_PROP_DESC 0x13AC
73+
#define IDS_OBJECT_NONEXTENSIBLE 0x13D5
7374
#define IDS_NONCONFIGURABLE_REDEFINED 0x13D6
7475
#define IDS_NONWRITABLE_MODIFIED 0x13D7
7576
/* FIXME: This is not compatible with native, but we would

sdk/tools/winesync/jscript.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ directories:
33
dlls/jscript/tests: modules/rostests/winetests/jscript
44
files: null
55
tags:
6-
wine: 7dadcaf81904265ea76055cb12fe7577922e8c36
6+
wine: 7f1c98cac61609474a188e87c4d66680ad1b1094

0 commit comments

Comments
 (0)