Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
1104663f
Commit
1104663f
authored
Jul 24, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 24, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Use prototype for builtin String properties.
parent
1dfb75d9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletion
+21
-1
string.c
dlls/jscript/string.c
+14
-1
api.js
dlls/jscript/tests/api.js
+7
-0
No files found.
dlls/jscript/string.c
View file @
1104663f
...
...
@@ -1536,6 +1536,19 @@ static const builtin_info_t String_info = {
NULL
};
static
const
builtin_prop_t
StringInst_props
[]
=
{
{
lengthW
,
String_length
,
0
}
};
static
const
builtin_info_t
StringInst_info
=
{
JSCLASS_STRING
,
{
NULL
,
String_value
,
0
},
sizeof
(
StringInst_props
)
/
sizeof
(
*
StringInst_props
),
StringInst_props
,
String_destructor
,
NULL
};
/* ECMA-262 3rd Edition 15.5.3.2 */
static
HRESULT
StringConstr_fromCharCode
(
script_ctx_t
*
ctx
,
vdisp_t
*
jsthis
,
WORD
flags
,
unsigned
argc
,
VARIANT
*
argv
,
VARIANT
*
retv
,
jsexcept_t
*
ei
)
...
...
@@ -1635,7 +1648,7 @@ static HRESULT string_alloc(script_ctx_t *ctx, jsdisp_t *object_prototype, Strin
if
(
object_prototype
)
hres
=
init_dispex
(
&
string
->
dispex
,
ctx
,
&
String_info
,
object_prototype
);
else
hres
=
init_dispex_from_constr
(
&
string
->
dispex
,
ctx
,
&
String_info
,
ctx
->
string_constr
);
hres
=
init_dispex_from_constr
(
&
string
->
dispex
,
ctx
,
&
String
Inst
_info
,
ctx
->
string_constr
);
if
(
FAILED
(
hres
))
{
heap_free
(
string
);
return
hres
;
...
...
dlls/jscript/tests/api.js
View file @
1104663f
...
...
@@ -239,6 +239,13 @@ ok(!RegExp.hasOwnProperty('exec'), "RegExp.hasOwnProperty('exec') is true");
ok
(
!
RegExp
.
hasOwnProperty
(
'source'
),
"RegExp.hasOwnProperty('source') is true"
);
ok
(
RegExp
.
prototype
.
hasOwnProperty
(
'source'
),
"RegExp.prototype.hasOwnProperty('source') is false"
);
obj
=
new
String
();
ok
(
!
obj
.
hasOwnProperty
(
'charAt'
),
"obj.hasOwnProperty('charAt') is true"
);
ok
(
obj
.
hasOwnProperty
(
'length'
),
"obj.hasOwnProperty('length') is false"
);
ok
(
!
String
.
hasOwnProperty
(
'charAt'
),
"String.hasOwnProperty('charAt') is true"
);
ok
(
String
.
prototype
.
hasOwnProperty
(
'charAt'
),
"String.prototype.hasOwnProperty('charAt') is false"
);
ok
(
String
.
prototype
.
hasOwnProperty
(
'length'
),
"String.prototype.hasOwnProperty('length') is false"
);
tmp
=
""
+
new
Object
();
ok
(
tmp
===
"[object Object]"
,
"'' + new Object() = "
+
tmp
);
(
tmp
=
new
Array
).
f
=
Object
.
prototype
.
toString
;
...
...
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