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
68dddd8d
Commit
68dddd8d
authored
Jun 20, 2016
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 21, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Properly handle arguments in Object constructor.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
cbca4b3f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
3 deletions
+18
-3
object.c
dlls/jscript/object.c
+3
-3
api.js
dlls/jscript/tests/api.js
+15
-0
No files found.
dlls/jscript/object.c
View file @
68dddd8d
...
...
@@ -261,6 +261,9 @@ static HRESULT ObjectConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags
switch
(
flags
)
{
case
DISPATCH_METHOD
:
case
DISPATCH_CONSTRUCT
:
{
jsdisp_t
*
obj
;
if
(
argc
)
{
if
(
!
is_undefined
(
argv
[
0
])
&&
!
is_null
(
argv
[
0
])
&&
(
!
is_object_instance
(
argv
[
0
])
||
get_object
(
argv
[
0
])))
{
IDispatch
*
disp
;
...
...
@@ -276,9 +279,6 @@ static HRESULT ObjectConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags
return
S_OK
;
}
}
/* fall through */
case
DISPATCH_CONSTRUCT
:
{
jsdisp_t
*
obj
;
hres
=
create_object
(
ctx
,
NULL
,
&
obj
);
if
(
FAILED
(
hres
))
...
...
dlls/jscript/tests/api.js
View file @
68dddd8d
...
...
@@ -350,12 +350,27 @@ ok(Object(1) instanceof Number, "Object(1) is not instance of Number");
ok
(
Object
(
""
)
instanceof
String
,
"Object('') is not instance of String"
);
ok
(
Object
(
false
)
instanceof
Boolean
,
"Object(false) is not instance of Boolean"
);
ok
(
new
Object
(
1
)
instanceof
Number
,
"Object(1) is not instance of Number"
);
ok
(
new
Object
(
""
)
instanceof
String
,
"Object('') is not instance of String"
);
ok
(
new
Object
(
false
)
instanceof
Boolean
,
"Object(false) is not instance of Boolean"
);
obj
=
new
Object
();
ok
(
Object
(
obj
)
===
obj
,
"Object(obj) !== obj"
);
ok
(
typeof
(
Object
())
===
"object"
,
"typeof(Object()) !== 'object'"
);
ok
(
typeof
(
Object
(
undefined
))
===
"object"
,
"typeof(Object(undefined)) !== 'object'"
);
ok
(
typeof
(
Object
(
null
))
===
"object"
,
"typeof(Object(null)) !== 'object'"
);
ok
(
typeof
(
Object
(
nullDisp
))
===
"object"
,
"typeof(Object(nullDisp)) !== 'object'"
);
ok
(
Object
(
nullDisp
)
!=
nullDisp
,
"Object(nullDisp) == nullDisp"
);
ok
(
new
Object
(
nullDisp
)
!=
nullDisp
,
"new Object(nullDisp) == nullDisp"
);
ok
(
Object
(
testObj
)
===
testObj
,
"Object(testObj) != testObj
\
n"
);
ok
(
new
Object
(
testObj
)
===
testObj
,
"new Object(testObj) != testObj
\
n"
);
tmp
=
new
Object
();
ok
(
Object
(
tmp
)
===
tmp
,
"Object(tmp) != tmp"
);
ok
(
new
Object
(
tmp
)
===
tmp
,
"new Object(tmp) != tmp"
);
var
obj
=
new
Object
();
obj
.
toString
=
function
(
x
)
{
...
...
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