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
db137cc9
Commit
db137cc9
authored
Jan 15, 2010
by
Piotr Caban
Committed by
Alexandre Julliard
Jan 18, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Make Array.join generic.
parent
6f618936
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
9 deletions
+18
-9
array.c
dlls/jscript/array.c
+7
-9
api.js
dlls/jscript/tests/api.js
+11
-0
No files found.
dlls/jscript/array.c
View file @
db137cc9
...
...
@@ -342,20 +342,18 @@ static HRESULT array_join(script_ctx_t *ctx, DispatchEx *array, DWORD length, co
}
/* ECMA-262 3rd Edition 15.4.4.5 */
static
HRESULT
Array_join
(
script_ctx_t
*
ctx
,
vdisp_t
*
js
this
,
WORD
flags
,
DISPPARAMS
*
dp
,
static
HRESULT
Array_join
(
script_ctx_t
*
ctx
,
vdisp_t
*
v
this
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
caller
)
{
DispatchEx
*
jsthis
;
DWORD
length
;
HRESULT
hres
;
TRACE
(
"
\n
"
);
if
(
is_vclass
(
jsthis
,
JSCLASS_ARRAY
))
{
length
=
array_from_vdisp
(
jsthis
)
->
length
;
}
else
{
FIXME
(
"dispid is not Array
\n
"
);
return
E_NOTIMPL
;
}
hres
=
get_length
(
ctx
,
vthis
,
ei
,
&
jsthis
,
&
length
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
arg_cnt
(
dp
))
{
BSTR
sep
;
...
...
@@ -364,11 +362,11 @@ static HRESULT Array_join(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPA
if
(
FAILED
(
hres
))
return
hres
;
hres
=
array_join
(
ctx
,
jsthis
->
u
.
jsdisp
,
length
,
sep
,
retv
,
ei
,
caller
);
hres
=
array_join
(
ctx
,
jsthis
,
length
,
sep
,
retv
,
ei
,
caller
);
SysFreeString
(
sep
);
}
else
{
hres
=
array_join
(
ctx
,
jsthis
->
u
.
jsdisp
,
length
,
default_separatorW
,
retv
,
ei
,
caller
);
hres
=
array_join
(
ctx
,
jsthis
,
length
,
default_separatorW
,
retv
,
ei
,
caller
);
}
return
hres
;
...
...
dlls/jscript/tests/api.js
View file @
db137cc9
...
...
@@ -654,6 +654,16 @@ ok(tmp === "1,2,,false,,,a", "arr.toString() = " + tmp);
tmp
=
arr
.
toString
(
"test"
);
ok
(
tmp
===
"1,2,,false,,,a"
,
"arr.toString() = "
+
tmp
);
arr
=
new
Object
();
arr
.
length
=
3
;
arr
[
0
]
=
"aa"
;
arr
[
2
]
=
2
;
arr
[
7
]
=
3
;
arr
.
join
=
Array
.
prototype
.
join
;
tmp
=
arr
.
join
(
","
);
ok
(
arr
.
length
===
3
,
"arr.length = "
+
arr
.
length
);
ok
(
tmp
===
"aa,,2"
,
"tmp = "
+
tmp
);
arr
=
[
5
,
true
,
2
,
-
1
,
3
,
false
,
"2.5"
];
tmp
=
arr
.
sort
(
function
(
x
,
y
)
{
return
y
-
x
;
});
ok
(
tmp
===
arr
,
"tmp !== arr"
);
...
...
@@ -1880,6 +1890,7 @@ testArrayHostThis("slice");
testArrayHostThis
(
"splice"
);
testArrayHostThis
(
"unshift"
);
testArrayHostThis
(
"reverse"
);
testArrayHostThis
(
"join"
);
function
testObjectInherit
(
obj
,
constr
,
ts
,
tls
,
vo
)
{
ok
(
obj
instanceof
Object
,
"obj is not instance of Object"
);
...
...
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