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
40b36d42
Commit
40b36d42
authored
Oct 17, 2023
by
Gabriel Ivăncescu
Committed by
Alexandre Julliard
Oct 17, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Fix Array.map when last element doesn't exist.
Signed-off-by:
Gabriel Ivăncescu
<
gabrielopcode@gmail.com
>
parent
75635053
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
array.c
dlls/jscript/array.c
+4
-2
es5.js
dlls/mshtml/tests/es5.js
+7
-0
No files found.
dlls/jscript/array.c
View file @
40b36d42
...
...
@@ -1354,14 +1354,16 @@ static HRESULT Array_map(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned
if
(
argc
>
1
)
context_this
=
argv
[
1
];
hres
=
create_array
(
ctx
,
length
,
&
array
);
hres
=
create_array
(
ctx
,
0
,
&
array
);
if
(
FAILED
(
hres
))
goto
done
;
for
(
k
=
0
;
k
<
length
;
k
++
)
{
hres
=
jsdisp_get_idx
(
jsthis
,
k
,
&
callback_args
[
0
]);
if
(
hres
==
DISP_E_UNKNOWNNAME
)
if
(
hres
==
DISP_E_UNKNOWNNAME
)
{
hres
=
S_OK
;
continue
;
}
if
(
FAILED
(
hres
))
break
;
...
...
dlls/mshtml/tests/es5.js
View file @
40b36d42
...
...
@@ -431,6 +431,13 @@ sync_test("array_map", function() {
[
1
,
2
].
map
(
function
()
{
ok
(
this
.
valueOf
()
===
137
,
"this.valueOf() = "
+
this
.
valueOf
());
},
137
);
r
=
[
1
,,
2
,].
map
(
function
(
x
)
{
return
""
+
x
;
});
ok
(
r
.
length
===
3
,
"[1,,2,].map length = "
+
r
.
length
);
ok
(
r
[
0
]
===
"1"
,
"[1,,2,].map[0] = "
+
r
[
0
]);
ok
(
r
[
2
]
===
"2"
,
"[1,,2,].map[2] = "
+
r
[
2
]);
ok
(
!
(
"1"
in
r
),
"[1,,2,].map[1] exists"
);
ok
(
!
(
"3"
in
r
),
"[1,,2,].map[3] exists"
);
});
sync_test
(
"array_sort"
,
function
()
{
...
...
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