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
6010e6b8
Commit
6010e6b8
authored
Jun 07, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 07, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Correctly handle deleted entries in iterate_map.
Based on patch by Gabriel Ivăncescu. Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
parent
bae77953
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
3 deletions
+33
-3
set.c
dlls/jscript/set.c
+9
-3
documentmode.js
dlls/mshtml/tests/documentmode.js
+24
-0
No files found.
dlls/jscript/set.c
View file @
6010e6b8
...
...
@@ -183,7 +183,7 @@ static HRESULT set_map_entry(MapInstance *map, jsval_t key, jsval_t value, jsval
static
HRESULT
iterate_map
(
MapInstance
*
map
,
script_ctx_t
*
ctx
,
unsigned
argc
,
jsval_t
*
argv
,
jsval_t
*
r
)
{
struct
jsval_map_entry
*
entry
;
struct
list
*
iter
=
list_head
(
&
map
->
entries
)
;
IDispatch
*
context_obj
=
NULL
;
HRESULT
hres
;
...
...
@@ -200,16 +200,22 @@ static HRESULT iterate_map(MapInstance *map, script_ctx_t *ctx, unsigned argc, j
context_obj
=
get_object
(
argv
[
1
]);
}
LIST_FOR_EACH_ENTRY
(
entry
,
&
map
->
entries
,
struct
jsval_map_entry
,
list_entry
)
{
while
(
iter
)
{
struct
jsval_map_entry
*
entry
=
LIST_ENTRY
(
iter
,
struct
jsval_map_entry
,
list_entry
);
jsval_t
args
[
3
],
v
;
if
(
entry
->
deleted
)
if
(
entry
->
deleted
)
{
iter
=
list_next
(
&
map
->
entries
,
iter
);
continue
;
}
args
[
0
]
=
entry
->
value
;
args
[
1
]
=
entry
->
key
;
args
[
2
]
=
jsval_obj
(
&
map
->
dispex
);
grab_map_entry
(
entry
);
hres
=
disp_call_value
(
ctx
,
get_object
(
argv
[
0
]),
context_obj
,
DISPATCH_METHOD
,
ARRAY_SIZE
(
args
),
args
,
&
v
);
iter
=
list_next
(
&
map
->
entries
,
iter
);
release_map_entry
(
entry
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
dlls/mshtml/tests/documentmode.js
View file @
6010e6b8
...
...
@@ -1019,6 +1019,18 @@ sync_test("set_obj", function() {
s
=
new
Set
([
1
,
2
,
3
]);
ok
(
s
.
size
===
0
,
"size = "
+
s
.
size
);
s
=
new
Set
();
s
.
add
(
1
);
s
.
add
(
2
);
s
.
add
(
3
);
r
=
0
;
s
.
forEach
(
function
(
value
,
key
,
obj
)
{
r
++
;
s
.
clear
();
ok
(
s
.
size
===
0
,
"size = "
+
s
.
size
);
});
ok
(
r
===
1
,
"r = "
+
r
);
});
sync_test
(
"map_obj"
,
function
()
{
...
...
@@ -1161,6 +1173,18 @@ sync_test("map_obj", function() {
}
catch
(
e
)
{
ok
(
e
.
number
===
0xa13fc
-
0x80000000
,
"e.number = "
+
e
.
number
);
}
s
=
new
Map
();
s
.
set
(
1
,
10
);
s
.
set
(
2
,
20
);
s
.
set
(
3
,
30
);
r
=
0
;
s
.
forEach
(
function
(
value
,
key
)
{
r
++
;
s
.
clear
();
ok
(
s
.
size
===
0
,
"size = "
+
s
.
size
);
});
ok
(
r
===
1
,
"r = "
+
r
);
});
sync_test
(
"elem_attr"
,
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