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
6d69c6db
Commit
6d69c6db
authored
Mar 20, 2019
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 20, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Support undefined context value in Array.prototype.forEach.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ec8a3a78
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
6 deletions
+18
-6
array.c
dlls/jscript/array.c
+11
-6
es5.js
dlls/mshtml/tests/es5.js
+7
-0
No files found.
dlls/jscript/array.c
View file @
6d69c6db
...
...
@@ -959,16 +959,21 @@ static HRESULT Array_forEach(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsi
TRACE
(
"
\n
"
);
/* FIXME: Check IsCallable */
if
(
argc
!=
1
||
!
is_object_instance
(
argv
[
0
]))
{
FIXME
(
"Unsupported arguments
\n
"
);
return
E_NOTIMPL
;
}
hres
=
get_length
(
ctx
,
vthis
,
&
jsthis
,
&
length
);
if
(
FAILED
(
hres
))
return
hres
;
/* Fixme check IsCallable */
if
(
!
argc
||
!
is_object_instance
(
argv
[
0
])
||
!
get_object
(
argv
[
0
]))
{
FIXME
(
"Invalid arg %s
\n
"
,
debugstr_jsval
(
argc
?
argv
[
0
]
:
jsval_undefined
()));
return
E_INVALIDARG
;
}
if
(
argc
>
1
&&
!
is_undefined
(
argv
[
1
]))
{
FIXME
(
"Unsupported context this %s
\n
"
,
debugstr_jsval
(
argv
[
1
]));
return
E_NOTIMPL
;
}
for
(
i
=
0
;
i
<
length
;
i
++
)
{
hres
=
jsdisp_get_idx
(
jsthis
,
i
,
&
value
);
if
(
hres
==
DISP_E_UNKNOWNNAME
)
...
...
dlls/mshtml/tests/es5.js
View file @
6d69c6db
...
...
@@ -109,6 +109,13 @@ function test_array_forEach() {
test
(
new
String
(
"abc"
),
[[
0
,
"a"
],[
1
,
"b"
],[
2
,
"c"
]]);
test
([],
[]);
[
1
,
2
].
forEach
(
function
()
{
ok
(
this
===
window
,
"this != window"
);
});
[
1
,
2
].
forEach
(
function
()
{
ok
(
this
===
window
,
"this != window"
);
},
undefined
);
next_test
();
}
...
...
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