Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
0d335089
Commit
0d335089
authored
Sep 10, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 11, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Set parameters on function call.
parent
dd9f8f7d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
0 deletions
+34
-0
function.c
dlls/jscript/function.c
+30
-0
lang.js
dlls/jscript/tests/lang.js
+4
-0
No files found.
dlls/jscript/function.c
View file @
0d335089
...
...
@@ -64,6 +64,30 @@ static IDispatch *get_this(DISPPARAMS *dp)
return
NULL
;
}
static
HRESULT
init_parameters
(
DispatchEx
*
var_disp
,
FunctionInstance
*
function
,
LCID
lcid
,
DISPPARAMS
*
dp
,
jsexcept_t
*
ei
,
IServiceProvider
*
caller
)
{
parameter_t
*
param
;
VARIANT
var_empty
;
DWORD
cargs
,
i
=
0
;
HRESULT
hres
;
V_VT
(
&
var_empty
)
=
VT_EMPTY
;
cargs
=
dp
->
cArgs
-
dp
->
cNamedArgs
;
for
(
param
=
function
->
parameters
;
param
;
param
=
param
->
next
)
{
hres
=
jsdisp_propput_name
(
var_disp
,
param
->
identifier
,
lcid
,
i
<
cargs
?
dp
->
rgvarg
+
dp
->
cArgs
-
1
-
i
:
&
var_empty
,
ei
,
caller
);
if
(
FAILED
(
hres
))
return
hres
;
i
++
;
}
return
S_OK
;
}
static
HRESULT
create_var_disp
(
FunctionInstance
*
function
,
LCID
lcid
,
DISPPARAMS
*
dp
,
jsexcept_t
*
ei
,
IServiceProvider
*
caller
,
DispatchEx
**
ret
)
{
...
...
@@ -74,6 +98,12 @@ static HRESULT create_var_disp(FunctionInstance *function, LCID lcid, DISPPARAMS
if
(
FAILED
(
hres
))
return
hres
;
hres
=
init_parameters
(
var_disp
,
function
,
lcid
,
dp
,
ei
,
caller
);
if
(
FAILED
(
hres
))
{
jsdisp_release
(
var_disp
);
return
hres
;
}
*
ret
=
var_disp
;
return
S_OK
;
}
...
...
dlls/jscript/tests/lang.js
View file @
0d335089
...
...
@@ -41,6 +41,10 @@ ok(trueVar, "trueVar is not true");
ok
(
ScriptEngine
.
length
===
0
,
"ScriptEngine.length is not 0"
);
function
testFunc1
(
x
,
y
)
{
ok
(
this
!==
undefined
,
"this is undefined"
);
ok
(
x
===
true
,
"x is not 1"
);
ok
(
y
===
"test"
,
"y is not
\"
test
\"
"
);
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