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
02615bb4
Commit
02615bb4
authored
Sep 20, 2009
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 22, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Added arguments.callee implementation.
parent
86ad4c97
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
function.c
dlls/jscript/function.c
+11
-2
lang.js
dlls/jscript/tests/lang.js
+3
-0
No files found.
dlls/jscript/function.c
View file @
02615bb4
...
...
@@ -100,7 +100,7 @@ static const builtin_info_t Arguments_info = {
NULL
};
static
HRESULT
create_arguments
(
script_ctx_t
*
ctx
,
LCID
lcid
,
DISPPARAMS
*
dp
,
static
HRESULT
create_arguments
(
script_ctx_t
*
ctx
,
IDispatch
*
calee
,
LCID
lcid
,
DISPPARAMS
*
dp
,
jsexcept_t
*
ei
,
IServiceProvider
*
caller
,
DispatchEx
**
ret
)
{
DispatchEx
*
args
;
...
...
@@ -108,6 +108,8 @@ static HRESULT create_arguments(script_ctx_t *ctx, LCID lcid, DISPPARAMS *dp,
DWORD
i
;
HRESULT
hres
;
static
const
WCHAR
caleeW
[]
=
{
'c'
,
'a'
,
'l'
,
'l'
,
'e'
,
'e'
,
0
};
args
=
heap_alloc_zero
(
sizeof
(
DispatchEx
));
if
(
!
args
)
return
E_OUTOFMEMORY
;
...
...
@@ -128,6 +130,12 @@ static HRESULT create_arguments(script_ctx_t *ctx, LCID lcid, DISPPARAMS *dp,
V_VT
(
&
var
)
=
VT_I4
;
V_I4
(
&
var
)
=
arg_cnt
(
dp
);
hres
=
jsdisp_propput_name
(
args
,
lengthW
,
lcid
,
&
var
,
ei
,
caller
);
if
(
SUCCEEDED
(
hres
))
{
V_VT
(
&
var
)
=
VT_DISPATCH
;
V_DISPATCH
(
&
var
)
=
calee
;
hres
=
jsdisp_propput_name
(
args
,
caleeW
,
lcid
,
&
var
,
ei
,
caller
);
}
}
if
(
FAILED
(
hres
))
{
...
...
@@ -151,7 +159,8 @@ static HRESULT create_var_disp(FunctionInstance *function, LCID lcid, DISPPARAMS
if
(
FAILED
(
hres
))
return
hres
;
hres
=
create_arguments
(
function
->
dispex
.
ctx
,
lcid
,
dp
,
ei
,
caller
,
&
arg_disp
);
hres
=
create_arguments
(
function
->
dispex
.
ctx
,
(
IDispatch
*
)
_IDispatchEx_
(
&
function
->
dispex
),
lcid
,
dp
,
ei
,
caller
,
&
arg_disp
);
if
(
SUCCEEDED
(
hres
))
{
VARIANT
var
;
...
...
dlls/jscript/tests/lang.js
View file @
02615bb4
...
...
@@ -68,6 +68,7 @@ function testFunc1(x, y) {
ok
(
arguments
.
length
===
2
,
"arguments.length is not 2"
);
ok
(
arguments
[
"0"
]
===
true
,
"arguments[0] is not true"
);
ok
(
arguments
[
"1"
]
===
"test"
,
"arguments[1] is not
\"
test
\"
"
);
ok
(
arguments
.
callee
===
testFunc1
,
"arguments.calee !== testFunc1"
);
return
true
;
}
...
...
@@ -116,6 +117,7 @@ obj1.func = function () {
ok
(
this
.
test
===
true
,
"this.test is not true"
);
ok
(
arguments
.
length
===
1
,
"arguments.length is not 1"
);
ok
(
arguments
[
"0"
]
===
true
,
"arguments[0] is not true"
);
ok
(
typeof
(
arguments
.
callee
)
===
"function"
,
"typeof(arguments.calee) = "
+
typeof
(
arguments
.
calee
));
return
"test"
;
};
...
...
@@ -128,6 +130,7 @@ function testConstr1() {
ok
(
this
!==
undefined
,
"this is undefined"
);
ok
(
arguments
.
length
===
1
,
"arguments.length is not 1"
);
ok
(
arguments
[
"0"
]
===
true
,
"arguments[0] is not 1"
);
ok
(
arguments
.
callee
===
testConstr1
,
"arguments.calee !== testConstr1"
);
return
false
;
}
...
...
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