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
fbb763a5
Commit
fbb763a5
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: Use the value returned from constructor in 'new' expression if the value if an object.
parent
fded8dc0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
2 deletions
+24
-2
function.c
dlls/jscript/function.c
+9
-2
lang.js
dlls/jscript/tests/lang.js
+15
-0
No files found.
dlls/jscript/function.c
View file @
fbb763a5
...
...
@@ -226,20 +226,27 @@ static HRESULT invoke_constructor(script_ctx_t *ctx, FunctionInstance *function,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
caller
)
{
DispatchEx
*
this_obj
;
VARIANT
var
;
HRESULT
hres
;
hres
=
create_object
(
ctx
,
&
function
->
dispex
,
&
this_obj
);
if
(
FAILED
(
hres
))
return
hres
;
hres
=
invoke_source
(
ctx
,
function
,
(
IDispatch
*
)
_IDispatchEx_
(
this_obj
),
dp
,
retv
,
ei
,
caller
);
hres
=
invoke_source
(
ctx
,
function
,
(
IDispatch
*
)
_IDispatchEx_
(
this_obj
),
dp
,
&
var
,
ei
,
caller
);
if
(
FAILED
(
hres
))
{
jsdisp_release
(
this_obj
);
return
hres
;
}
V_VT
(
retv
)
=
VT_DISPATCH
;
V_DISPATCH
(
retv
)
=
(
IDispatch
*
)
_IDispatchEx_
(
this_obj
);
if
(
V_VT
(
&
var
)
==
VT_DISPATCH
)
{
jsdisp_release
(
this_obj
);
V_DISPATCH
(
retv
)
=
V_DISPATCH
(
&
var
);
}
else
{
VariantClear
(
&
var
);
V_DISPATCH
(
retv
)
=
(
IDispatch
*
)
_IDispatchEx_
(
this_obj
);
}
return
S_OK
;
}
...
...
dlls/jscript/tests/lang.js
View file @
fbb763a5
...
...
@@ -148,6 +148,21 @@ obj2.pvar = 3;
testConstr1
.
prototype
.
pvar
=
1
;
ok
(
obj2
.
pvar
===
3
,
"obj2.pvar is not 3"
);
obj1
=
new
Object
();
function
testConstr3
()
{
return
obj1
;
}
obj2
=
new
testConstr3
();
ok
(
obj1
===
obj2
,
"obj1 != obj2"
);
function
testConstr4
()
{
return
2
;
}
obj2
=
new
testConstr3
();
ok
(
typeof
(
obj2
)
===
"object"
,
"typeof(obj2) = "
+
typeof
(
obj2
));
var
obj3
=
new
Object
;
ok
(
typeof
(
obj3
)
===
"object"
,
"typeof(obj3) is not object"
);
...
...
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