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
136f7933
Commit
136f7933
authored
Sep 25, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 25, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Added object to number conversion implementation.
parent
5b3630ec
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
jsutils.c
dlls/jscript/jsutils.c
+12
-0
lang.js
dlls/jscript/tests/lang.js
+5
-0
No files found.
dlls/jscript/jsutils.c
View file @
136f7933
...
...
@@ -335,6 +335,18 @@ HRESULT to_number(script_ctx_t *ctx, VARIANT *v, jsexcept_t *ei, VARIANT *ret)
break
;
case
VT_BSTR
:
return
str_to_number
(
V_BSTR
(
v
),
ret
);
case
VT_DISPATCH
:
{
VARIANT
prim
;
HRESULT
hres
;
hres
=
to_primitive
(
ctx
,
v
,
ei
,
&
prim
);
if
(
FAILED
(
hres
))
return
hres
;
hres
=
to_number
(
ctx
,
&
prim
,
ei
,
ret
);
VariantClear
(
&
prim
);
return
hres
;
}
case
VT_BOOL
:
V_VT
(
ret
)
=
VT_I4
;
V_I4
(
ret
)
=
V_BOOL
(
v
)
?
1
:
0
;
...
...
dlls/jscript/tests/lang.js
View file @
136f7933
...
...
@@ -359,6 +359,11 @@ ok(+"-3" === -3, "+'-3' !== -3");
ok
(
+
"0xff"
===
255
,
"+'0xff' !== 255"
);
ok
(
+
"3e3"
===
3000
,
"+'3e3' !== 3000"
);
tmp
=
new
Number
(
1
);
ok
(
+
tmp
===
1
,
"ToNumber(new Number(1)) = "
+
(
+
tmp
));
tmp
=
new
String
(
"1"
);
ok
(
+
tmp
===
1
,
"ToNumber(new String('1')) = "
+
(
+
tmp
));
ok
(
""
+
0
===
"0"
,
"
\"\"
+ 0 !==
\"
0
\"
"
);
ok
(
""
+
123
===
"123"
,
"
\"\"
+ 123 !==
\"
123
\"
"
);
ok
(
""
+
(
-
5
)
===
"-5"
,
"
\"\"
+ (-5) !==
\"
-5
\"
"
);
...
...
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