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
466fae64
Commit
466fae64
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 disp_delete_name helper and use it in interp_delete.
parent
e6fc8d9b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
20 deletions
+45
-20
dispex.c
dlls/jscript/dispex.c
+43
-0
engine.c
dlls/jscript/engine.c
+1
-20
jscript.h
dlls/jscript/jscript.h
+1
-0
No files found.
dlls/jscript/dispex.c
View file @
466fae64
...
@@ -1498,6 +1498,49 @@ HRESULT disp_delete(IDispatch *disp, DISPID id, BOOL *ret)
...
@@ -1498,6 +1498,49 @@ HRESULT disp_delete(IDispatch *disp, DISPID id, BOOL *ret)
return
S_OK
;
return
S_OK
;
}
}
HRESULT
disp_delete_name
(
script_ctx_t
*
ctx
,
IDispatch
*
disp
,
jsstr_t
*
name
,
BOOL
*
ret
)
{
IDispatchEx
*
dispex
;
jsdisp_t
*
jsdisp
;
HRESULT
hres
;
jsdisp
=
iface_to_jsdisp
((
IUnknown
*
)
disp
);
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
);
else
hres
=
DISP_E_MEMBERNOTFOUND
;
jsdisp_release
(
jsdisp
);
return
hres
;
}
hres
=
IDispatch_QueryInterface
(
disp
,
&
IID_IDispatchEx
,
(
void
**
)
&
dispex
);
if
(
SUCCEEDED
(
hres
))
{
BSTR
bstr
;
bstr
=
SysAllocStringLen
(
name
->
str
,
jsstr_length
(
name
));
if
(
bstr
)
{
hres
=
IDispatchEx_DeleteMemberByName
(
dispex
,
bstr
,
make_grfdex
(
ctx
,
fdexNameCaseSensitive
));
SysFreeString
(
bstr
);
*
ret
=
TRUE
;
}
else
{
hres
=
E_OUTOFMEMORY
;
}
IDispatchEx_Release
(
dispex
);
}
else
{
hres
=
S_OK
;
ret
=
FALSE
;
}
return
hres
;
}
HRESULT
jsdisp_is_own_prop
(
jsdisp_t
*
obj
,
const
WCHAR
*
name
,
BOOL
*
ret
)
HRESULT
jsdisp_is_own_prop
(
jsdisp_t
*
obj
,
const
WCHAR
*
name
,
BOOL
*
ret
)
{
{
dispex_prop_t
*
prop
;
dispex_prop_t
*
prop
;
...
...
dlls/jscript/engine.c
View file @
466fae64
...
@@ -1592,7 +1592,6 @@ static HRESULT interp_mod(exec_ctx_t *ctx)
...
@@ -1592,7 +1592,6 @@ static HRESULT interp_mod(exec_ctx_t *ctx)
static
HRESULT
interp_delete
(
exec_ctx_t
*
ctx
)
static
HRESULT
interp_delete
(
exec_ctx_t
*
ctx
)
{
{
jsval_t
objv
,
namev
;
jsval_t
objv
,
namev
;
IDispatchEx
*
dispex
;
IDispatch
*
obj
;
IDispatch
*
obj
;
jsstr_t
*
name
;
jsstr_t
*
name
;
BOOL
ret
;
BOOL
ret
;
...
@@ -1617,25 +1616,7 @@ static HRESULT interp_delete(exec_ctx_t *ctx)
...
@@ -1617,25 +1616,7 @@ static HRESULT interp_delete(exec_ctx_t *ctx)
return
hres
;
return
hres
;
}
}
hres
=
IDispatch_QueryInterface
(
obj
,
&
IID_IDispatchEx
,
(
void
**
)
&
dispex
);
hres
=
disp_delete_name
(
ctx
->
script
,
obj
,
name
,
&
ret
);
if
(
SUCCEEDED
(
hres
))
{
BSTR
bstr
;
bstr
=
SysAllocStringLen
(
name
->
str
,
jsstr_length
(
name
));
if
(
bstr
)
{
hres
=
IDispatchEx_DeleteMemberByName
(
dispex
,
bstr
,
make_grfdex
(
ctx
->
script
,
fdexNameCaseSensitive
));
SysFreeString
(
bstr
);
ret
=
TRUE
;
}
else
{
hres
=
E_OUTOFMEMORY
;
}
IDispatchEx_Release
(
dispex
);
}
else
{
hres
=
S_OK
;
ret
=
FALSE
;
}
IDispatch_Release
(
obj
);
IDispatch_Release
(
obj
);
jsstr_release
(
name
);
jsstr_release
(
name
);
if
(
FAILED
(
hres
))
if
(
FAILED
(
hres
))
...
...
dlls/jscript/jscript.h
View file @
466fae64
...
@@ -276,6 +276,7 @@ HRESULT jsdisp_propget_name(jsdisp_t*,LPCWSTR,jsval_t*) DECLSPEC_HIDDEN;
...
@@ -276,6 +276,7 @@ HRESULT jsdisp_propget_name(jsdisp_t*,LPCWSTR,jsval_t*) DECLSPEC_HIDDEN;
HRESULT
jsdisp_get_idx
(
jsdisp_t
*
,
DWORD
,
jsval_t
*
)
DECLSPEC_HIDDEN
;
HRESULT
jsdisp_get_idx
(
jsdisp_t
*
,
DWORD
,
jsval_t
*
)
DECLSPEC_HIDDEN
;
HRESULT
jsdisp_get_id
(
jsdisp_t
*
,
const
WCHAR
*
,
DWORD
,
DISPID
*
)
DECLSPEC_HIDDEN
;
HRESULT
jsdisp_get_id
(
jsdisp_t
*
,
const
WCHAR
*
,
DWORD
,
DISPID
*
)
DECLSPEC_HIDDEN
;
HRESULT
disp_delete
(
IDispatch
*
,
DISPID
,
BOOL
*
)
DECLSPEC_HIDDEN
;
HRESULT
disp_delete
(
IDispatch
*
,
DISPID
,
BOOL
*
)
DECLSPEC_HIDDEN
;
HRESULT
disp_delete_name
(
script_ctx_t
*
,
IDispatch
*
,
jsstr_t
*
,
BOOL
*
);
HRESULT
jsdisp_delete_idx
(
jsdisp_t
*
,
DWORD
)
DECLSPEC_HIDDEN
;
HRESULT
jsdisp_delete_idx
(
jsdisp_t
*
,
DWORD
)
DECLSPEC_HIDDEN
;
HRESULT
jsdisp_is_own_prop
(
jsdisp_t
*
,
const
WCHAR
*
,
BOOL
*
)
DECLSPEC_HIDDEN
;
HRESULT
jsdisp_is_own_prop
(
jsdisp_t
*
,
const
WCHAR
*
,
BOOL
*
)
DECLSPEC_HIDDEN
;
HRESULT
jsdisp_is_enumerable
(
jsdisp_t
*
,
const
WCHAR
*
,
BOOL
*
)
DECLSPEC_HIDDEN
;
HRESULT
jsdisp_is_enumerable
(
jsdisp_t
*
,
const
WCHAR
*
,
BOOL
*
)
DECLSPEC_HIDDEN
;
...
...
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