Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
d9d8c8b7
Commit
d9d8c8b7
authored
Nov 30, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 30, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Added support for DontDelete attribute and use it for arguments object.
parent
466fae64
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
24 deletions
+36
-24
dispex.c
dlls/jscript/dispex.c
+24
-18
function.c
dlls/jscript/function.c
+1
-1
jscript.h
dlls/jscript/jscript.h
+7
-5
lang.js
dlls/jscript/tests/lang.js
+4
-0
No files found.
dlls/jscript/dispex.c
View file @
d9d8c8b7
...
...
@@ -740,8 +740,15 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc
return
hres
;
}
static
HRESULT
delete_prop
(
dispex_prop_t
*
prop
)
static
HRESULT
delete_prop
(
dispex_prop_t
*
prop
,
BOOL
*
ret
)
{
if
(
prop
->
flags
&
PROPF_DONTDELETE
)
{
*
ret
=
FALSE
;
return
S_OK
;
}
*
ret
=
TRUE
;
/* FIXME: not exactly right */
if
(
prop
->
type
==
PROP_JSVAL
)
{
jsval_release
(
prop
->
u
.
val
);
prop
->
type
=
PROP_DELETED
;
...
...
@@ -753,6 +760,7 @@ static HRESULT WINAPI DispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bst
{
jsdisp_t
*
This
=
impl_from_IDispatchEx
(
iface
);
dispex_prop_t
*
prop
;
BOOL
b
;
HRESULT
hres
;
TRACE
(
"(%p)->(%s %x)
\n
"
,
This
,
debugstr_w
(
bstrName
),
grfdex
);
...
...
@@ -768,13 +776,14 @@ static HRESULT WINAPI DispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bst
return
S_OK
;
}
return
delete_prop
(
prop
);
return
delete_prop
(
prop
,
&
b
);
}
static
HRESULT
WINAPI
DispatchEx_DeleteMemberByDispID
(
IDispatchEx
*
iface
,
DISPID
id
)
{
jsdisp_t
*
This
=
impl_from_IDispatchEx
(
iface
);
dispex_prop_t
*
prop
;
BOOL
b
;
TRACE
(
"(%p)->(%x)
\n
"
,
This
,
id
);
...
...
@@ -784,7 +793,7 @@ static HRESULT WINAPI DispatchEx_DeleteMemberByDispID(IDispatchEx *iface, DISPID
return
DISP_E_MEMBERNOTFOUND
;
}
return
delete_prop
(
prop
);
return
delete_prop
(
prop
,
&
b
);
}
static
HRESULT
WINAPI
DispatchEx_GetMemberProperties
(
IDispatchEx
*
iface
,
DISPID
id
,
DWORD
grfdexFetch
,
DWORD
*
pgrfdex
)
...
...
@@ -1266,18 +1275,23 @@ HRESULT disp_call_value(script_ctx_t *ctx, IDispatch *disp, IDispatch *jsthis, W
return
hres
;
}
HRESULT
jsdisp_propput
_name
(
jsdisp_t
*
obj
,
const
WCHAR
*
name
,
jsval_t
val
)
HRESULT
jsdisp_propput
(
jsdisp_t
*
obj
,
const
WCHAR
*
name
,
DWORD
flags
,
jsval_t
val
)
{
dispex_prop_t
*
prop
;
HRESULT
hres
;
hres
=
ensure_prop_name
(
obj
,
name
,
FALSE
,
PROPF_ENUM
,
&
prop
);
hres
=
ensure_prop_name
(
obj
,
name
,
FALSE
,
flags
,
&
prop
);
if
(
FAILED
(
hres
))
return
hres
;
return
prop_put
(
obj
,
prop
,
val
,
NULL
);
}
HRESULT
jsdisp_propput_name
(
jsdisp_t
*
obj
,
const
WCHAR
*
name
,
jsval_t
val
)
{
return
jsdisp_propput
(
obj
,
name
,
PROPF_ENUM
,
val
);
}
HRESULT
jsdisp_propput_const
(
jsdisp_t
*
obj
,
const
WCHAR
*
name
,
jsval_t
val
)
{
dispex_prop_t
*
prop
;
...
...
@@ -1292,14 +1306,7 @@ HRESULT jsdisp_propput_const(jsdisp_t *obj, const WCHAR *name, jsval_t val)
HRESULT
jsdisp_propput_dontenum
(
jsdisp_t
*
obj
,
const
WCHAR
*
name
,
jsval_t
val
)
{
dispex_prop_t
*
prop
;
HRESULT
hres
;
hres
=
ensure_prop_name
(
obj
,
name
,
FALSE
,
0
,
&
prop
);
if
(
FAILED
(
hres
))
return
hres
;
return
prop_put
(
obj
,
prop
,
val
,
NULL
);
return
jsdisp_propput
(
obj
,
name
,
0
,
val
);
}
HRESULT
jsdisp_propput_idx
(
jsdisp_t
*
obj
,
DWORD
idx
,
jsval_t
val
)
...
...
@@ -1451,6 +1458,7 @@ HRESULT jsdisp_delete_idx(jsdisp_t *obj, DWORD idx)
static
const
WCHAR
formatW
[]
=
{
'%'
,
'd'
,
0
};
WCHAR
buf
[
12
];
dispex_prop_t
*
prop
;
BOOL
b
;
HRESULT
hres
;
sprintfW
(
buf
,
formatW
,
idx
);
...
...
@@ -1459,7 +1467,7 @@ HRESULT jsdisp_delete_idx(jsdisp_t *obj, DWORD idx)
if
(
FAILED
(
hres
)
||
!
prop
)
return
hres
;
return
delete_prop
(
prop
);
return
delete_prop
(
prop
,
&
b
);
}
HRESULT
disp_delete
(
IDispatch
*
disp
,
DISPID
id
,
BOOL
*
ret
)
...
...
@@ -1472,10 +1480,9 @@ HRESULT disp_delete(IDispatch *disp, DISPID id, BOOL *ret)
if
(
jsdisp
)
{
dispex_prop_t
*
prop
;
*
ret
=
TRUE
;
prop
=
get_prop
(
jsdisp
,
id
);
if
(
prop
)
hres
=
delete_prop
(
prop
);
hres
=
delete_prop
(
prop
,
ret
);
else
hres
=
DISP_E_MEMBERNOTFOUND
;
...
...
@@ -1508,10 +1515,9 @@ HRESULT disp_delete_name(script_ctx_t *ctx, IDispatch *disp, jsstr_t *name, BOOL
if
(
jsdisp
)
{
dispex_prop_t
*
prop
;
*
ret
=
TRUE
;
hres
=
find_prop_name
(
jsdisp
,
string_hash
(
name
->
str
),
name
->
str
,
&
prop
);
if
(
prop
)
hres
=
delete_prop
(
prop
);
hres
=
delete_prop
(
prop
,
ret
);
else
hres
=
DISP_E_MEMBERNOTFOUND
;
...
...
dlls/jscript/function.c
View file @
d9d8c8b7
...
...
@@ -220,7 +220,7 @@ static HRESULT invoke_source(script_ctx_t *ctx, FunctionInstance *function, IDis
return
hres
;
}
hres
=
jsdisp_propput
_name
(
var_disp
,
argumentsW
,
jsval_obj
(
arg_disp
));
hres
=
jsdisp_propput
(
var_disp
,
argumentsW
,
PROPF_DONTDELETE
,
jsval_obj
(
arg_disp
));
if
(
SUCCEEDED
(
hres
))
{
hres
=
scope_push
(
function
->
scope_chain
,
var_disp
,
to_disp
(
var_disp
),
&
scope
);
if
(
SUCCEEDED
(
hres
))
{
...
...
dlls/jscript/jscript.h
View file @
d9d8c8b7
...
...
@@ -95,11 +95,12 @@ typedef struct jsdisp_t jsdisp_t;
extern
HINSTANCE
jscript_hinstance
DECLSPEC_HIDDEN
;
#define PROPF_ARGMASK 0x00ff
#define PROPF_METHOD 0x0100
#define PROPF_ENUM 0x0200
#define PROPF_CONSTR 0x0400
#define PROPF_CONST 0x0800
#define PROPF_ARGMASK 0x00ff
#define PROPF_METHOD 0x0100
#define PROPF_ENUM 0x0200
#define PROPF_CONSTR 0x0400
#define PROPF_CONST 0x0800
#define PROPF_DONTDELETE 0x1000
/* NOTE: Keep in sync with names in Object.toString implementation */
typedef
enum
{
...
...
@@ -268,6 +269,7 @@ HRESULT jsdisp_call_name(jsdisp_t*,const WCHAR*,WORD,unsigned,jsval_t*,jsval_t*)
HRESULT
disp_propget
(
script_ctx_t
*
,
IDispatch
*
,
DISPID
,
jsval_t
*
)
DECLSPEC_HIDDEN
;
HRESULT
disp_propput
(
script_ctx_t
*
,
IDispatch
*
,
DISPID
,
jsval_t
)
DECLSPEC_HIDDEN
;
HRESULT
jsdisp_propget
(
jsdisp_t
*
,
DISPID
,
jsval_t
*
)
DECLSPEC_HIDDEN
;
HRESULT
jsdisp_propput
(
jsdisp_t
*
,
const
WCHAR
*
,
DWORD
,
jsval_t
)
DECLSPEC_HIDDEN
;
HRESULT
jsdisp_propput_name
(
jsdisp_t
*
,
const
WCHAR
*
,
jsval_t
)
DECLSPEC_HIDDEN
;
HRESULT
jsdisp_propput_const
(
jsdisp_t
*
,
const
WCHAR
*
,
jsval_t
)
DECLSPEC_HIDDEN
;
HRESULT
jsdisp_propput_dontenum
(
jsdisp_t
*
,
const
WCHAR
*
,
jsval_t
)
DECLSPEC_HIDDEN
;
...
...
dlls/jscript/tests/lang.js
View file @
d9d8c8b7
...
...
@@ -86,6 +86,10 @@ function testFunc1(x, y) {
ok
(
this
===
test
,
"this !== test"
);
eval
(
'ok(this === test, "this !== test");'
);
tmp
=
delete
arguments
;
ok
(
tmp
===
false
,
"arguments deleted"
);
ok
(
typeof
(
arguments
)
===
"object"
,
"typeof(arguments) = "
+
typeof
(
arguments
));
return
true
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment