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
f824a165
Commit
f824a165
authored
Aug 02, 2010
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 02, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Use generic properties for NaN and Infinity implementation.
parent
9ca80347
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
43 deletions
+22
-43
global.c
dlls/jscript/global.c
+13
-43
lang.js
dlls/jscript/tests/lang.js
+9
-0
No files found.
dlls/jscript/global.c
View file @
f824a165
...
...
@@ -118,42 +118,6 @@ static HRESULT constructor_call(DispatchEx *constr, WORD flags, DISPPARAMS *dp,
return
S_OK
;
}
static
HRESULT
JSGlobal_NaN
(
script_ctx_t
*
ctx
,
vdisp_t
*
jsthis
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
sp
)
{
TRACE
(
"
\n
"
);
switch
(
flags
)
{
case
DISPATCH_PROPERTYGET
:
num_set_nan
(
retv
);
break
;
default:
FIXME
(
"unimplemented flags %x
\n
"
,
flags
);
return
E_NOTIMPL
;
}
return
S_OK
;
}
static
HRESULT
JSGlobal_Infinity
(
script_ctx_t
*
ctx
,
vdisp_t
*
jsthis
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
sp
)
{
TRACE
(
"
\n
"
);
switch
(
flags
)
{
case
DISPATCH_PROPERTYGET
:
num_set_inf
(
retv
,
TRUE
);
break
;
default:
FIXME
(
"unimplemented flags %x
\n
"
,
flags
);
return
E_NOTIMPL
;
}
return
S_OK
;
}
static
HRESULT
JSGlobal_Array
(
script_ctx_t
*
ctx
,
vdisp_t
*
jsthis
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
sp
)
{
...
...
@@ -1063,9 +1027,6 @@ static const builtin_prop_t JSGlobal_props[] = {
{
EvalErrorW
,
JSGlobal_EvalError
,
PROPF_CONSTR
|
1
},
{
FunctionW
,
JSGlobal_Function
,
PROPF_CONSTR
|
1
},
{
_GetObjectW
,
JSGlobal_GetObject
,
PROPF_METHOD
|
2
},
{
InfinityW
,
JSGlobal_Infinity
,
0
},
/* {MathW, JSGlobal_Math, 0}, */
{
NaNW
,
JSGlobal_NaN
,
0
},
{
NumberW
,
JSGlobal_Number
,
PROPF_CONSTR
|
1
},
{
ObjectW
,
JSGlobal_Object
,
PROPF_CONSTR
|
1
},
{
RangeErrorW
,
JSGlobal_RangeError
,
PROPF_CONSTR
|
1
},
...
...
@@ -1175,15 +1136,24 @@ HRESULT init_global(script_ctx_t *ctx)
if
(
FAILED
(
hres
))
return
hres
;
V_VT
(
&
var
)
=
VT_DISPATCH
;
V_DISPATCH
(
&
var
)
=
(
IDispatch
*
)
_IDispatchEx_
(
math
);
hres
=
jsdisp_propput_name
(
ctx
->
global
,
MathW
,
&
var
,
NULL
/*FIXME*/
,
NULL
/*FIXME*/
);
jsdisp_release
(
math
);
if
(
FAILED
(
hres
))
return
hres
;
V_VT
(
&
var
)
=
VT_EMPTY
;
hres
=
jsdisp_propput_name
(
ctx
->
global
,
undefinedW
,
&
var
,
NULL
/*FIXME*/
,
NULL
/*FIXME*/
);
if
(
FAILED
(
hres
))
return
hres
;
V_VT
(
&
var
)
=
VT_DISPATCH
;
V_DISPATCH
(
&
var
)
=
(
IDispatch
*
)
_IDispatchEx_
(
math
);
hres
=
jsdisp_propput_name
(
ctx
->
global
,
MathW
,
&
var
,
NULL
/*FIXME*/
,
NULL
/*FIXME*/
);
jsdisp_release
(
math
)
;
num_set_nan
(
&
var
)
;
hres
=
jsdisp_propput_name
(
ctx
->
global
,
NaNW
,
&
var
,
NULL
/*FIXME*/
,
NULL
/*FIXME*/
);
if
(
FAILED
(
hres
))
return
hres
;
num_set_inf
(
&
var
,
TRUE
);
hres
=
jsdisp_propput_name
(
ctx
->
global
,
InfinityW
,
&
var
,
NULL
/*FIXME*/
,
NULL
/*FIXME*/
);
return
hres
;
}
dlls/jscript/tests/lang.js
View file @
f824a165
...
...
@@ -1044,4 +1044,13 @@ obj = {undefined: 3};
undefined
=
6
;
ok
(
undefined
===
6
,
"undefined = "
+
undefined
);
NaN
=
6
;
ok
(
NaN
===
6
,
"NaN !== 6"
);
Infinity
=
6
;
ok
(
Infinity
===
6
,
"Infinity !== 6"
);
Math
=
6
;
ok
(
Math
===
6
,
"NaN !== 6"
);
reportSuccess
();
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