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
17ceb90b
Commit
17ceb90b
authored
Sep 21, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 22, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Added String function implementation.
parent
67516448
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
0 deletions
+30
-0
string.c
dlls/jscript/string.c
+19
-0
api.js
dlls/jscript/tests/api.js
+11
-0
No files found.
dlls/jscript/string.c
View file @
17ceb90b
...
...
@@ -772,7 +772,26 @@ static HRESULT StringConstr_value(DispatchEx *dispex, LCID lcid, WORD flags, DIS
{
HRESULT
hres
;
TRACE
(
"
\n
"
);
switch
(
flags
)
{
case
INVOKE_FUNC
:
{
BSTR
str
;
if
(
arg_cnt
(
dp
))
{
hres
=
to_string
(
dispex
->
ctx
,
get_arg
(
dp
,
0
),
ei
,
&
str
);
if
(
FAILED
(
hres
))
return
hres
;
}
else
{
str
=
SysAllocStringLen
(
NULL
,
0
);
if
(
!
str
)
return
E_OUTOFMEMORY
;
}
V_VT
(
retv
)
=
VT_BSTR
;
V_BSTR
(
retv
)
=
str
;
break
;
}
case
DISPATCH_CONSTRUCT
:
{
DispatchEx
*
ret
;
...
...
dlls/jscript/tests/api.js
View file @
17ceb90b
...
...
@@ -69,6 +69,17 @@ ok(str.toString() === "test", "str.toString() = " + str.toString());
tmp
=
"value "
+
str
;
ok
(
tmp
===
"value test"
,
"'value ' + str = "
+
tmp
);
tmp
=
String
();
ok
(
tmp
===
""
,
"String() = "
+
tmp
);
tmp
=
String
(
false
);
ok
(
tmp
===
"false"
,
"String(false) = "
+
tmp
);
tmp
=
String
(
null
);
ok
(
tmp
===
"null"
,
"String(null) = "
+
tmp
);
tmp
=
String
(
"test"
);
ok
(
tmp
===
"test"
,
"String('test') = "
+
tmp
);
tmp
=
String
(
"test"
,
"abc"
);
ok
(
tmp
===
"test"
,
"String('test','abc') = "
+
tmp
);
tmp
=
"abc"
.
charAt
(
0
);
ok
(
tmp
===
"a"
,
"'abc',charAt(0) = "
+
tmp
);
tmp
=
"abc"
.
charAt
(
1
);
...
...
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