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
17ff7829
Commit
17ff7829
authored
Jun 21, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 21, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Make Function object invocation a special case in IDispatchEx implementation.
parent
4a335142
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
4 deletions
+32
-4
dispex.c
dlls/jscript/dispex.c
+10
-4
function.c
dlls/jscript/function.c
+21
-0
jscript.h
dlls/jscript/jscript.h
+1
-0
No files found.
dlls/jscript/dispex.c
View file @
17ff7829
...
...
@@ -391,7 +391,6 @@ static HRESULT invoke_prop_func(jsdisp_t *This, jsdisp_t *jsthis, dispex_prop_t
case
PROP_BUILTIN
:
{
DISPPARAMS
params
;
VARIANT
buf
[
6
];
vdisp_t
vthis
;
if
(
flags
==
DISPATCH_CONSTRUCT
&&
(
prop
->
flags
&
PROPF_METHOD
))
{
WARN
(
"%s is not a constructor
\n
"
,
debugstr_w
(
prop
->
name
));
...
...
@@ -402,9 +401,16 @@ static HRESULT invoke_prop_func(jsdisp_t *This, jsdisp_t *jsthis, dispex_prop_t
if
(
FAILED
(
hres
))
return
hres
;
set_jsdisp
(
&
vthis
,
jsthis
);
hres
=
prop
->
u
.
p
->
invoke
(
This
->
ctx
,
&
vthis
,
flags
,
&
params
,
retv
,
ei
);
vdisp_release
(
&
vthis
);
if
(
prop
->
name
||
jsthis
->
builtin_info
->
class
!=
JSCLASS_FUNCTION
)
{
vdisp_t
vthis
;
set_jsdisp
(
&
vthis
,
jsthis
);
hres
=
prop
->
u
.
p
->
invoke
(
This
->
ctx
,
&
vthis
,
flags
,
&
params
,
retv
,
ei
);
vdisp_release
(
&
vthis
);
}
else
{
/* Function object calls are special case */
hres
=
Function_invoke
(
This
,
flags
,
&
params
,
retv
,
ei
);
}
if
(
params
.
rgvarg
!=
buf
&&
params
.
rgvarg
!=
dp
->
rgvarg
)
heap_free
(
params
.
rgvarg
);
return
hres
;
...
...
dlls/jscript/function.c
View file @
17ff7829
...
...
@@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <assert.h>
#include "jscript.h"
#include "engine.h"
...
...
@@ -305,6 +307,25 @@ static HRESULT function_to_string(FunctionInstance *function, BSTR *ret)
return
S_OK
;
}
HRESULT
Function_invoke
(
jsdisp_t
*
func_this
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
)
{
FunctionInstance
*
function
;
TRACE
(
"
\n
"
);
assert
(
is_class
(
func_this
,
JSCLASS_FUNCTION
));
function
=
(
FunctionInstance
*
)
func_this
;
if
(
function
->
value_proc
)
return
invoke_value_proc
(
function
->
dispex
.
ctx
,
function
,
get_this
(
dp
),
flags
,
dp
,
retv
,
ei
);
if
(
flags
==
DISPATCH_CONSTRUCT
)
return
invoke_constructor
(
function
->
dispex
.
ctx
,
function
,
dp
,
retv
,
ei
);
assert
(
flags
==
DISPATCH_METHOD
);
return
invoke_source
(
function
->
dispex
.
ctx
,
function
,
get_this
(
dp
),
dp
,
retv
,
ei
);
}
static
HRESULT
Function_length
(
script_ctx_t
*
ctx
,
vdisp_t
*
jsthis
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
)
{
...
...
dlls/jscript/jscript.h
View file @
17ff7829
...
...
@@ -225,6 +225,7 @@ VARIANT_BOOL jsdisp_is_own_prop(jsdisp_t *obj, BSTR name) DECLSPEC_HIDDEN;
HRESULT
create_builtin_function
(
script_ctx_t
*
,
builtin_invoke_t
,
const
WCHAR
*
,
const
builtin_info_t
*
,
DWORD
,
jsdisp_t
*
,
jsdisp_t
**
)
DECLSPEC_HIDDEN
;
HRESULT
Function_value
(
script_ctx_t
*
,
vdisp_t
*
,
WORD
,
DISPPARAMS
*
,
VARIANT
*
,
jsexcept_t
*
)
DECLSPEC_HIDDEN
;
HRESULT
Function_invoke
(
jsdisp_t
*
,
WORD
,
DISPPARAMS
*
,
VARIANT
*
,
jsexcept_t
*
);
HRESULT
throw_eval_error
(
script_ctx_t
*
,
jsexcept_t
*
,
HRESULT
,
const
WCHAR
*
)
DECLSPEC_HIDDEN
;
HRESULT
throw_generic_error
(
script_ctx_t
*
,
jsexcept_t
*
,
HRESULT
,
const
WCHAR
*
)
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