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
68d4f489
Commit
68d4f489
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 arguments object on function call.
parent
0d335089
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
3 deletions
+49
-3
dispex.c
dlls/jscript/dispex.c
+10
-0
function.c
dlls/jscript/function.c
+37
-2
jscript.h
dlls/jscript/jscript.h
+1
-1
lang.js
dlls/jscript/tests/lang.js
+1
-0
No files found.
dlls/jscript/dispex.c
View file @
68d4f489
...
...
@@ -883,6 +883,16 @@ HRESULT jsdisp_propput_name(DispatchEx *obj, const WCHAR *name, LCID lcid, VARIA
return
prop_put
(
obj
,
prop
,
lcid
,
&
dp
,
ei
,
caller
);
}
HRESULT
jsdisp_propput_idx
(
DispatchEx
*
obj
,
DWORD
idx
,
LCID
lcid
,
VARIANT
*
val
,
jsexcept_t
*
ei
,
IServiceProvider
*
caller
)
{
WCHAR
buf
[
12
];
static
const
WCHAR
formatW
[]
=
{
'%'
,
'd'
,
0
};
sprintfW
(
buf
,
formatW
,
idx
);
return
jsdisp_propput_name
(
obj
,
buf
,
lcid
,
val
,
ei
,
caller
);
}
HRESULT
disp_propput
(
IDispatch
*
disp
,
DISPID
id
,
LCID
lcid
,
VARIANT
*
val
,
jsexcept_t
*
ei
,
IServiceProvider
*
caller
)
{
DISPID
dispid
=
DISPID_PROPERTYPUT
;
...
...
dlls/jscript/function.c
View file @
68d4f489
...
...
@@ -88,17 +88,52 @@ static HRESULT init_parameters(DispatchEx *var_disp, FunctionInstance *function,
return
S_OK
;
}
static
HRESULT
init_arguments
(
DispatchEx
*
arg_disp
,
FunctionInstance
*
function
,
LCID
lcid
,
DISPPARAMS
*
dp
,
jsexcept_t
*
ei
,
IServiceProvider
*
caller
)
{
VARIANT
var
;
DWORD
i
;
HRESULT
hres
;
for
(
i
=
0
;
i
<
dp
->
cArgs
-
dp
->
cNamedArgs
;
i
++
)
{
hres
=
jsdisp_propput_idx
(
arg_disp
,
i
,
lcid
,
dp
->
rgvarg
+
dp
->
cArgs
-
1
-
i
,
ei
,
caller
);
if
(
FAILED
(
hres
))
return
hres
;
}
V_VT
(
&
var
)
=
VT_I4
;
V_I4
(
&
var
)
=
dp
->
cArgs
-
dp
->
cNamedArgs
;
return
jsdisp_propput_name
(
arg_disp
,
lengthW
,
lcid
,
&
var
,
ei
,
caller
);
}
static
HRESULT
create_var_disp
(
FunctionInstance
*
function
,
LCID
lcid
,
DISPPARAMS
*
dp
,
jsexcept_t
*
ei
,
IServiceProvider
*
caller
,
DispatchEx
**
ret
)
{
DispatchEx
*
var_disp
;
DispatchEx
*
var_disp
,
*
arg_disp
;
HRESULT
hres
;
static
const
WCHAR
argumentsW
[]
=
{
'a'
,
'r'
,
'g'
,
'u'
,
'm'
,
'e'
,
'n'
,
't'
,
's'
,
0
};
hres
=
create_dispex
(
function
->
dispex
.
ctx
,
NULL
,
NULL
,
&
var_disp
);
if
(
FAILED
(
hres
))
return
hres
;
hres
=
init_parameters
(
var_disp
,
function
,
lcid
,
dp
,
ei
,
caller
);
hres
=
create_dispex
(
function
->
dispex
.
ctx
,
NULL
,
NULL
,
&
arg_disp
);
if
(
SUCCEEDED
(
hres
))
{
hres
=
init_arguments
(
arg_disp
,
function
,
lcid
,
dp
,
ei
,
caller
);
if
(
SUCCEEDED
(
hres
))
{
VARIANT
var
;
V_VT
(
&
var
)
=
VT_DISPATCH
;
V_DISPATCH
(
&
var
)
=
(
IDispatch
*
)
_IDispatchEx_
(
arg_disp
);
hres
=
jsdisp_propput_name
(
var_disp
,
argumentsW
,
lcid
,
&
var
,
ei
,
caller
);
}
jsdisp_release
(
arg_disp
);
}
if
(
SUCCEEDED
(
hres
))
hres
=
init_parameters
(
var_disp
,
function
,
lcid
,
dp
,
ei
,
caller
);
if
(
FAILED
(
hres
))
{
jsdisp_release
(
var_disp
);
return
hres
;
...
...
dlls/jscript/jscript.h
View file @
68d4f489
...
...
@@ -109,7 +109,7 @@ HRESULT jsdisp_call_value(DispatchEx*,LCID,WORD,DISPPARAMS*,VARIANT*,jsexcept_t*
HRESULT
disp_propget
(
IDispatch
*
,
DISPID
,
LCID
,
VARIANT
*
,
jsexcept_t
*
,
IServiceProvider
*
);
HRESULT
disp_propput
(
IDispatch
*
,
DISPID
,
LCID
,
VARIANT
*
,
jsexcept_t
*
,
IServiceProvider
*
);
HRESULT
jsdisp_propput_name
(
DispatchEx
*
,
const
WCHAR
*
,
LCID
,
VARIANT
*
,
jsexcept_t
*
,
IServiceProvider
*
);
HRESULT
jsdisp_
set_prototype
(
DispatchEx
*
,
DispatchEx
*
);
HRESULT
jsdisp_
propput_idx
(
DispatchEx
*
,
DWORD
,
LCID
,
VARIANT
*
,
jsexcept_t
*
,
IServiceProvider
*
);
HRESULT
create_builtin_function
(
script_ctx_t
*
,
builtin_invoke_t
,
DWORD
,
DispatchEx
*
,
DispatchEx
**
);
...
...
dlls/jscript/tests/lang.js
View file @
68d4f489
...
...
@@ -44,6 +44,7 @@ function testFunc1(x, y) {
ok
(
this
!==
undefined
,
"this is undefined"
);
ok
(
x
===
true
,
"x is not 1"
);
ok
(
y
===
"test"
,
"y is not
\"
test
\"
"
);
ok
(
arguments
.
length
===
2
,
"arguments.length is not 2"
);
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