Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
96cbc45a
Commit
96cbc45a
authored
Oct 19, 2009
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 20, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Return array length in Array.unshift for invoke version >= 2.
parent
a1ac9d66
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
25 deletions
+30
-25
array.c
dlls/jscript/array.c
+30
-25
No files found.
dlls/jscript/array.c
View file @
96cbc45a
...
...
@@ -967,29 +967,25 @@ static HRESULT Array_unshift(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, DISP
return
hres
;
argc
=
arg_cnt
(
dp
);
if
(
!
argc
)
{
if
(
retv
)
V_VT
(
retv
)
=
VT_EMPTY
;
return
S_OK
;
}
buf_end
=
buf
+
sizeof
(
buf
)
/
sizeof
(
WCHAR
)
-
1
;
*
buf_end
--
=
0
;
i
=
length
;
if
(
argc
)
{
buf_end
=
buf
+
sizeof
(
buf
)
/
sizeof
(
WCHAR
)
-
1
;
*
buf_end
--
=
0
;
i
=
length
;
while
(
i
--
)
{
str
=
idx_to_str
(
i
,
buf_end
);
while
(
i
--
)
{
str
=
idx_to_str
(
i
,
buf_end
);
hres
=
jsdisp_get_id
(
jsthis
,
str
,
0
,
&
id
);
if
(
SUCCEEDED
(
hres
))
{
hres
=
jsdisp_propget
(
jsthis
,
id
,
&
var
,
ei
,
caller
);
if
(
FAILED
(
hres
))
return
hres
;
hres
=
jsdisp_get_id
(
jsthis
,
str
,
0
,
&
id
);
if
(
SUCCEEDED
(
hres
))
{
hres
=
jsdisp_propget
(
jsthis
,
id
,
&
var
,
ei
,
caller
);
if
(
FAILED
(
hres
))
return
hres
;
hres
=
jsdisp_propput_idx
(
jsthis
,
i
+
argc
,
&
var
,
ei
,
caller
);
VariantClear
(
&
var
);
}
else
if
(
hres
==
DISP_E_UNKNOWNNAME
)
{
hres
=
IDispatchEx_DeleteMemberByDispID
(
vthis
->
u
.
dispex
,
id
);
hres
=
jsdisp_propput_idx
(
jsthis
,
i
+
argc
,
&
var
,
ei
,
caller
);
VariantClear
(
&
var
);
}
else
if
(
hres
==
DISP_E_UNKNOWNNAME
)
{
hres
=
IDispatchEx_DeleteMemberByDispID
(
vthis
->
u
.
dispex
,
id
);
}
}
if
(
FAILED
(
hres
))
...
...
@@ -1002,12 +998,21 @@ static HRESULT Array_unshift(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, DISP
return
hres
;
}
hres
=
set_length
(
jsthis
,
ei
,
length
+
argc
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
argc
)
{
length
+=
argc
;
hres
=
set_length
(
jsthis
,
ei
,
length
);
if
(
FAILED
(
hres
))
return
hres
;
}
if
(
retv
)
V_VT
(
retv
)
=
VT_EMPTY
;
if
(
retv
)
{
if
(
ctx
->
version
<
2
)
{
V_VT
(
retv
)
=
VT_EMPTY
;
}
else
{
V_VT
(
retv
)
=
VT_I4
;
V_I4
(
retv
)
=
length
;
}
}
return
S_OK
;
}
...
...
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