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
dcaf0669
Commit
dcaf0669
authored
Sep 17, 2009
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 17, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Added Object function invocation implementation.
parent
a94c25f3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
1 deletion
+34
-1
object.c
dlls/jscript/object.c
+22
-1
api.js
dlls/jscript/tests/api.js
+12
-0
No files found.
dlls/jscript/object.c
View file @
dcaf0669
...
...
@@ -163,13 +163,34 @@ static const builtin_info_t Object_info = {
};
static
HRESULT
ObjectConstr_value
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
sp
)
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
caller
)
{
HRESULT
hres
;
TRACE
(
"
\n
"
);
switch
(
flags
)
{
case
DISPATCH_METHOD
:
if
(
arg_cnt
(
dp
))
{
VARIANT
*
arg
=
get_arg
(
dp
,
0
);
if
(
V_VT
(
arg
)
!=
VT_EMPTY
&&
V_VT
(
arg
)
!=
VT_NULL
)
{
IDispatch
*
disp
;
hres
=
to_object
(
dispex
->
ctx
,
arg
,
&
disp
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
retv
)
{
V_VT
(
retv
)
=
VT_DISPATCH
;
V_DISPATCH
(
retv
)
=
disp
;
}
else
{
IDispatch_Release
(
disp
);
}
return
S_OK
;
}
}
/* fall through */
case
DISPATCH_CONSTRUCT
:
{
DispatchEx
*
obj
;
...
...
dlls/jscript/tests/api.js
View file @
dcaf0669
...
...
@@ -88,6 +88,17 @@ ok(tmp.f() === "[object RegExp]", "tmp.f() = " + tmp.f());
(
tmp
=
new
String
).
f
=
Object
.
prototype
.
toString
;
ok
(
tmp
.
f
()
===
"[object String]"
,
"tmp.f() = "
+
tmp
.
f
());
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"
);
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'"
);
var
obj
=
new
Object
();
obj
.
toString
=
function
(
x
)
{
ok
(
arguments
.
length
===
0
,
"arguments.length = "
+
arguments
.
length
);
...
...
@@ -95,6 +106,7 @@ obj.toString = function (x) {
};
ok
((
tmp
=
obj
.
toLocaleString
())
===
"test"
,
"obj.toLocaleString() = "
+
tmp
);
ok
((
tmp
=
obj
.
toLocaleString
(
1
))
===
"test"
,
"obj.toLocaleString(1) = "
+
tmp
);
ok
(
obj
===
obj
.
valueOf
(),
"obj !== obj.valueOf"
);
ok
(
""
.
length
===
0
,
"
\"\"
.length = "
+
""
.
length
);
ok
(
getVT
(
""
.
length
)
==
"VT_I4"
,
"
\"\"
.length = "
+
""
.
length
);
...
...
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