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
7fa373e3
Commit
7fa373e3
authored
Sep 16, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 16, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Added to_object(VT_BOOL) implementation.
parent
e7903ecf
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
1 deletion
+29
-1
bool.c
dlls/jscript/bool.c
+17
-0
jscript.h
dlls/jscript/jscript.h
+1
-0
jsutils.c
dlls/jscript/jsutils.c
+7
-0
lang.js
dlls/jscript/tests/lang.js
+4
-1
No files found.
dlls/jscript/bool.c
View file @
7fa373e3
...
...
@@ -24,6 +24,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(jscript);
typedef
struct
{
DispatchEx
dispex
;
VARIANT_BOOL
val
;
}
BoolInstance
;
static
const
WCHAR
toStringW
[]
=
{
't'
,
'o'
,
'S'
,
't'
,
'r'
,
'i'
,
'n'
,
'g'
,
0
};
...
...
@@ -145,3 +147,18 @@ HRESULT create_bool_constr(script_ctx_t *ctx, DispatchEx **ret)
jsdisp_release
(
&
bool
->
dispex
);
return
hres
;
}
HRESULT
create_bool
(
script_ctx_t
*
ctx
,
VARIANT_BOOL
b
,
DispatchEx
**
ret
)
{
BoolInstance
*
bool
;
HRESULT
hres
;
hres
=
alloc_bool
(
ctx
,
TRUE
,
&
bool
);
if
(
FAILED
(
hres
))
return
hres
;
bool
->
val
=
b
;
*
ret
=
&
bool
->
dispex
;
return
S_OK
;
}
dlls/jscript/jscript.h
View file @
7fa373e3
...
...
@@ -134,6 +134,7 @@ HRESULT create_math(script_ctx_t*,DispatchEx**);
HRESULT
create_array
(
script_ctx_t
*
,
DWORD
,
DispatchEx
**
);
HRESULT
create_regexp_str
(
script_ctx_t
*
,
const
WCHAR
*
,
DWORD
,
const
WCHAR
*
,
DWORD
,
DispatchEx
**
);
HRESULT
create_string
(
script_ctx_t
*
,
const
WCHAR
*
,
DWORD
,
DispatchEx
**
);
HRESULT
create_bool
(
script_ctx_t
*
,
VARIANT_BOOL
,
DispatchEx
**
);
HRESULT
to_primitive
(
script_ctx_t
*
,
VARIANT
*
,
jsexcept_t
*
,
VARIANT
*
);
HRESULT
to_boolean
(
VARIANT
*
,
VARIANT_BOOL
*
);
...
...
dlls/jscript/jsutils.c
View file @
7fa373e3
...
...
@@ -264,6 +264,13 @@ HRESULT to_object(exec_ctx_t *ctx, VARIANT *v, IDispatch **disp)
IDispatch_AddRef
(
V_DISPATCH
(
v
));
*
disp
=
V_DISPATCH
(
v
);
break
;
case
VT_BOOL
:
hres
=
create_bool
(
ctx
->
parser
->
script
,
V_BOOL
(
v
),
&
dispex
);
if
(
FAILED
(
hres
))
return
hres
;
*
disp
=
(
IDispatch
*
)
_IDispatchEx_
(
dispex
);
break
;
default:
FIXME
(
"unsupported vt %d
\n
"
,
V_VT
(
v
));
return
E_NOTIMPL
;
...
...
dlls/jscript/tests/lang.js
View file @
7fa373e3
...
...
@@ -234,7 +234,10 @@ ok(tmp-- === 2, "tmp-- (2) is not 2");
ok
(
tmp
===
1
,
"decremented tmp is not 1"
);
String
.
prototype
.
test
=
true
;
ok
(
""
.
test
===
true
,
"
\"\"
,test is not true"
);
ok
(
""
.
test
===
true
,
"
\"\"
.test is not true"
);
Boolean
.
prototype
.
test
=
true
;
ok
(
true
.
test
===
true
,
"true.test is not true"
);
var
state
=
""
;
try
{
...
...
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