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
5cd11ade
Commit
5cd11ade
authored
Aug 14, 2023
by
Yuxuan Shui
Committed by
Alexandre Julliard
Aug 15, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Fix Array.prototype.splice with omitted deleteCount in ES5+ mode.
parent
20afe438
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
2 deletions
+11
-2
array.c
dlls/jscript/array.c
+2
-0
api.js
dlls/jscript/tests/api.js
+2
-2
es5.js
dlls/mshtml/tests/es5.js
+7
-0
No files found.
dlls/jscript/array.c
View file @
5cd11ade
...
...
@@ -870,6 +870,8 @@ static HRESULT Array_splice(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsign
}
add_args
=
argc
-
2
;
}
else
if
(
argc
&&
ctx
->
version
>=
SCRIPTLANGUAGEVERSION_ES5
)
{
delete_cnt
=
length
-
start
;
}
if
(
r
)
{
...
...
dlls/jscript/tests/api.js
View file @
5cd11ade
...
...
@@ -1310,8 +1310,8 @@ ok(arr.toString() == "1,2,3,4,5", "arr.splice(2,-1) is " + arr.toString());
arr
=
[
1
,
2
,
3
,
4
,
5
];
tmp
=
arr
.
splice
(
2
);
ok
(
tmp
.
toString
()
==
""
,
"arr.splice(2
,-1
) returned "
+
tmp
.
toString
());
ok
(
arr
.
toString
()
==
"1,2,3,4,5"
,
"arr.splice(2
,-1
) is "
+
arr
.
toString
());
ok
(
tmp
.
toString
()
==
""
,
"arr.splice(2) returned "
+
tmp
.
toString
());
ok
(
arr
.
toString
()
==
"1,2,3,4,5"
,
"arr.splice(2) is "
+
arr
.
toString
());
arr
=
[
1
,
2
,
3
,
4
,
5
];
tmp
=
arr
.
splice
();
...
...
dlls/mshtml/tests/es5.js
View file @
5cd11ade
...
...
@@ -374,6 +374,13 @@ sync_test("isArray", function() {
expect_array
(
new
C
(),
false
);
});
sync_test
(
"array_splice"
,
function
()
{
var
arr
=
[
1
,
2
,
3
,
4
,
5
]
var
tmp
=
arr
.
splice
(
2
);
ok
(
arr
.
toString
()
===
"1,2"
,
"arr = "
+
arr
);
ok
(
tmp
.
toString
()
===
"3,4,5"
,
"tmp = "
+
tmp
);
});
sync_test
(
"array_map"
,
function
()
{
var
calls
,
m
,
arr
,
ctx
;
...
...
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