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
7bb41e75
Commit
7bb41e75
authored
Mar 27, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 27, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Store value as double in NumberInstance object.
parent
0bf61fb6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
21 deletions
+16
-21
jscript.h
dlls/jscript/jscript.h
+1
-1
jsutils.c
dlls/jscript/jsutils.c
+1
-1
number.c
dlls/jscript/number.c
+14
-19
No files found.
dlls/jscript/jscript.h
View file @
7bb41e75
...
...
@@ -242,7 +242,7 @@ HRESULT create_regexp(script_ctx_t*,const WCHAR *,int,DWORD,jsdisp_t**) DECLSPEC
HRESULT
create_regexp_var
(
script_ctx_t
*
,
VARIANT
*
,
VARIANT
*
,
jsdisp_t
**
)
DECLSPEC_HIDDEN
;
HRESULT
create_string
(
script_ctx_t
*
,
const
WCHAR
*
,
DWORD
,
jsdisp_t
**
)
DECLSPEC_HIDDEN
;
HRESULT
create_bool
(
script_ctx_t
*
,
VARIANT_BOOL
,
jsdisp_t
**
)
DECLSPEC_HIDDEN
;
HRESULT
create_number
(
script_ctx_t
*
,
VARIANT
*
,
jsdisp_t
**
)
DECLSPEC_HIDDEN
;
HRESULT
create_number
(
script_ctx_t
*
,
double
,
jsdisp_t
**
)
DECLSPEC_HIDDEN
;
HRESULT
create_vbarray
(
script_ctx_t
*
,
SAFEARRAY
*
,
jsdisp_t
**
)
DECLSPEC_HIDDEN
;
typedef
enum
{
...
...
dlls/jscript/jsutils.c
View file @
7bb41e75
...
...
@@ -623,7 +623,7 @@ HRESULT to_object(script_ctx_t *ctx, VARIANT *v, IDispatch **disp)
break
;
case
VT_I4
:
case
VT_R8
:
hres
=
create_number
(
ctx
,
v
,
&
dispex
);
hres
=
create_number
(
ctx
,
num_val
(
v
)
,
&
dispex
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
dlls/jscript/number.c
View file @
7bb41e75
...
...
@@ -30,7 +30,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(jscript);
typedef
struct
{
jsdisp_t
dispex
;
VARIANT
num
;
double
value
;
}
NumberInstance
;
static
const
WCHAR
toStringW
[]
=
{
't'
,
'o'
,
'S'
,
't'
,
'r'
,
'i'
,
'n'
,
'g'
,
0
};
...
...
@@ -76,17 +76,16 @@ static HRESULT Number_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, D
return
throw_type_error
(
ctx
,
ei
,
JS_E_INVALIDARG
,
NULL
);
}
if
(
V_VT
(
&
number
->
num
)
==
VT_I4
)
val
=
V_I4
(
&
number
->
num
);
else
val
=
V_R8
(
&
number
->
num
);
val
=
number
->
value
;
if
(
radix
==
10
||
isnan
(
val
)
||
isinf
(
val
))
{
hres
=
to_string
(
ctx
,
&
number
->
num
,
ei
,
&
str
);
VARIANT
v
;
num_set_val
(
&
v
,
val
);
hres
=
to_string
(
ctx
,
&
v
,
ei
,
&
str
);
if
(
FAILED
(
hres
))
return
hres
;
}
else
{
}
else
{
INT
idx
=
0
;
DOUBLE
integ
,
frac
,
log_radix
=
0
;
WCHAR
buf
[
NUMBER_TOSTRING_BUF_SIZE
+
16
];
...
...
@@ -218,7 +217,7 @@ static HRESULT Number_valueOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DI
return
throw_type_error
(
ctx
,
ei
,
JS_E_NUMBER_EXPECTED
,
NULL
);
if
(
retv
)
*
retv
=
number
->
num
;
num_set_val
(
retv
,
number
->
value
)
;
return
S_OK
;
}
...
...
@@ -231,7 +230,7 @@ static HRESULT Number_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISP
case
INVOKE_FUNC
:
return
throw_type_error
(
ctx
,
ei
,
JS_E_FUNCTION_EXPECTED
,
NULL
);
case
DISPATCH_PROPERTYGET
:
*
retv
=
number
->
num
;
num_set_val
(
retv
,
number
->
value
)
;
break
;
default:
...
...
@@ -288,20 +287,16 @@ static HRESULT NumberConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags
case
DISPATCH_CONSTRUCT
:
{
jsdisp_t
*
obj
;
VARIANT
v
;
if
(
arg_cnt
(
dp
))
{
hres
=
to_number
(
ctx
,
get_arg
(
dp
,
0
),
ei
,
&
n
);
if
(
FAILED
(
hres
))
return
hres
;
num_set_val
(
&
v
,
n
);
}
else
{
V_VT
(
&
v
)
=
VT_I4
;
V_I4
(
&
v
)
=
0
;
n
=
0
;
}
hres
=
create_number
(
ctx
,
&
v
,
&
obj
);
hres
=
create_number
(
ctx
,
n
,
&
obj
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -347,7 +342,7 @@ HRESULT create_number_constr(script_ctx_t *ctx, jsdisp_t *object_prototype, jsdi
if
(
FAILED
(
hres
))
return
hres
;
V_VT
(
&
number
->
num
)
=
VT_I4
;
number
->
value
=
0
;
hres
=
create_builtin_function
(
ctx
,
NumberConstr_value
,
NumberW
,
NULL
,
PROPF_CONSTR
|
1
,
&
number
->
dispex
,
ret
);
...
...
@@ -355,7 +350,7 @@ HRESULT create_number_constr(script_ctx_t *ctx, jsdisp_t *object_prototype, jsdi
return
hres
;
}
HRESULT
create_number
(
script_ctx_t
*
ctx
,
VARIANT
*
num
,
jsdisp_t
**
ret
)
HRESULT
create_number
(
script_ctx_t
*
ctx
,
double
value
,
jsdisp_t
**
ret
)
{
NumberInstance
*
number
;
HRESULT
hres
;
...
...
@@ -364,7 +359,7 @@ HRESULT create_number(script_ctx_t *ctx, VARIANT *num, jsdisp_t **ret)
if
(
FAILED
(
hres
))
return
hres
;
number
->
num
=
*
num
;
number
->
value
=
value
;
*
ret
=
&
number
->
dispex
;
return
S_OK
;
...
...
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