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
4a78b991
Commit
4a78b991
authored
Jun 22, 2023
by
Gabriel Ivăncescu
Committed by
Alexandre Julliard
Jun 23, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Don't use detached arguments buffer in html mode.
Signed-off-by:
Gabriel Ivăncescu
<
gabrielopcode@gmail.com
>
parent
963be08b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
1 deletion
+51
-1
function.c
dlls/jscript/function.c
+1
-1
documentmode.js
dlls/mshtml/tests/documentmode.js
+50
-0
No files found.
dlls/jscript/function.c
View file @
4a78b991
...
...
@@ -242,7 +242,7 @@ void detach_arguments_object(call_frame_t *frame)
jsdisp_propput_name
(
jsobj
,
L"arguments"
,
jsval_undefined
());
/* Don't bother coppying arguments if call frame holds the last reference. */
if
(
arguments
->
jsdisp
.
ref
>
1
)
{
if
(
arguments
->
jsdisp
.
ref
>
1
&&
!
arguments
->
jsdisp
.
ctx
->
html_mode
)
{
arguments
->
buf
=
malloc
(
arguments
->
argc
*
sizeof
(
*
arguments
->
buf
));
if
(
arguments
->
buf
)
{
const
jsval_t
*
args
=
on_stack
?
arguments
->
jsdisp
.
ctx
->
stack
+
frame
->
arguments_off
:
scope
->
detached_vars
->
var
;
...
...
dlls/mshtml/tests/documentmode.js
View file @
4a78b991
...
...
@@ -1228,6 +1228,56 @@ sync_test("delete_prop", function() {
ok
(
!
(
"globalprop4"
in
obj
),
"globalprop4 is still in obj"
);
});
sync_test
(
"detached arguments"
,
function
()
{
var
args
,
get_a
,
set_a
,
get_x
,
set_x
;
function
test_args
()
{
ok
(
args
[
0
]
===
1
,
"args[0] = "
+
args
[
0
]);
set_x
(
2
);
ok
(
args
[
0
]
===
2
,
"args[0] = "
+
args
[
0
]);
args
[
0
]
=
3
;
ok
(
get_x
()
===
3
,
"get_x() = "
+
get_x
());
ok
(
args
[
0
]
===
3
,
"args[0] = "
+
args
[
0
]);
}
(
function
(
x
)
{
args
=
arguments
;
get_x
=
function
()
{
return
x
;
};
set_x
=
function
(
v
)
{
x
=
v
;
};
test_args
();
x
=
1
;
})(
1
);
test_args
();
(
function
(
a
,
a
,
b
,
c
)
{
get_a
=
function
()
{
return
a
;
}
set_a
=
function
(
v
)
{
a
=
v
;
}
ok
(
get_a
()
===
2
,
"get_a() = "
+
get_a
());
ok
(
a
===
2
,
"a = "
+
a
);
ok
(
b
===
3
,
"b = "
+
b
);
ok
(
c
===
4
,
"c = "
+
c
);
a
=
42
;
ok
(
arguments
[
0
]
===
1
,
"arguments[0] = "
+
arguments
[
0
]);
ok
(
arguments
[
1
]
===
42
,
"arguments[1] = "
+
arguments
[
1
]);
ok
(
get_a
()
===
42
,
"get_a() after assign = "
+
get_a
());
args
=
arguments
;
})(
1
,
2
,
3
,
4
);
ok
(
get_a
()
===
42
,
"get_a() after detach = "
+
get_a
());
set_a
(
100
);
ok
(
get_a
()
===
100
,
"get_a() after set_a() = "
+
get_a
());
ok
(
args
[
0
]
===
1
,
"detached args[0] = "
+
args
[
0
]);
ok
(
args
[
1
]
===
100
,
"detached args[1] = "
+
args
[
1
]);
(
function
(
a
,
a
)
{
eval
(
"var a = 7;"
);
ok
(
a
===
7
,
"function(a, a) a = "
+
a
);
ok
(
arguments
[
0
]
===
5
,
"function(a, a) arguments[0] = "
+
arguments
[
0
]);
ok
(
arguments
[
1
]
===
7
,
"function(a, a) arguments[1] = "
+
arguments
[
1
]);
})(
5
,
6
);
});
var
func_scope_val
=
1
;
var
func_scope_val2
=
2
;
...
...
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