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
1a97632a
Commit
1a97632a
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(number) implementation.
parent
7fa373e3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
0 deletions
+30
-0
jscript.h
dlls/jscript/jscript.h
+1
-0
jsutils.c
dlls/jscript/jsutils.c
+8
-0
number.c
dlls/jscript/number.c
+17
-0
lang.js
dlls/jscript/tests/lang.js
+4
-0
No files found.
dlls/jscript/jscript.h
View file @
1a97632a
...
...
@@ -135,6 +135,7 @@ 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
create_number
(
script_ctx_t
*
,
VARIANT
*
,
DispatchEx
**
);
HRESULT
to_primitive
(
script_ctx_t
*
,
VARIANT
*
,
jsexcept_t
*
,
VARIANT
*
);
HRESULT
to_boolean
(
VARIANT
*
,
VARIANT_BOOL
*
);
...
...
dlls/jscript/jsutils.c
View file @
1a97632a
...
...
@@ -260,6 +260,14 @@ HRESULT to_object(exec_ctx_t *ctx, VARIANT *v, IDispatch **disp)
*
disp
=
(
IDispatch
*
)
_IDispatchEx_
(
dispex
);
break
;
case
VT_I4
:
case
VT_R8
:
hres
=
create_number
(
ctx
->
parser
->
script
,
v
,
&
dispex
);
if
(
FAILED
(
hres
))
return
hres
;
*
disp
=
(
IDispatch
*
)
_IDispatchEx_
(
dispex
);
break
;
case
VT_DISPATCH
:
IDispatch_AddRef
(
V_DISPATCH
(
v
));
*
disp
=
V_DISPATCH
(
v
);
...
...
dlls/jscript/number.c
View file @
1a97632a
...
...
@@ -24,6 +24,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(jscript);
typedef
struct
{
DispatchEx
dispex
;
VARIANT
num
;
}
NumberInstance
;
static
const
WCHAR
toStringW
[]
=
{
't'
,
'o'
,
'S'
,
't'
,
'r'
,
'i'
,
'n'
,
'g'
,
0
};
...
...
@@ -165,3 +167,18 @@ HRESULT create_number_constr(script_ctx_t *ctx, DispatchEx **ret)
jsdisp_release
(
&
number
->
dispex
);
return
hres
;
}
HRESULT
create_number
(
script_ctx_t
*
ctx
,
VARIANT
*
num
,
DispatchEx
**
ret
)
{
NumberInstance
*
number
;
HRESULT
hres
;
hres
=
alloc_number
(
ctx
,
TRUE
,
&
number
);
if
(
FAILED
(
hres
))
return
hres
;
number
->
num
=
*
num
;
*
ret
=
&
number
->
dispex
;
return
S_OK
;
}
dlls/jscript/tests/lang.js
View file @
1a97632a
...
...
@@ -239,6 +239,10 @@ ok("".test === true, "\"\".test is not true");
Boolean
.
prototype
.
test
=
true
;
ok
(
true
.
test
===
true
,
"true.test is not true"
);
Number
.
prototype
.
test
=
true
;
ok
((
0
).
test
===
true
,
"(0).test is not true"
);
ok
((
0.5
).
test
===
true
,
"(0.5).test is not true"
);
var
state
=
""
;
try
{
ok
(
state
===
""
,
"try: state = "
+
state
);
...
...
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