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
6e4f74f7
Commit
6e4f74f7
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 Array properties.
parent
3a724d58
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletion
+20
-1
array.c
dlls/jscript/array.c
+14
-1
api.js
dlls/jscript/tests/api.js
+6
-0
No files found.
dlls/jscript/array.c
View file @
6e4f74f7
...
...
@@ -1100,6 +1100,19 @@ static const builtin_info_t Array_info = {
Array_on_put
};
static
const
builtin_prop_t
ArrayInst_props
[]
=
{
{
lengthW
,
Array_length
,
0
}
};
static
const
builtin_info_t
ArrayInst_info
=
{
JSCLASS_ARRAY
,
{
NULL
,
Array_value
,
0
},
sizeof
(
ArrayInst_props
)
/
sizeof
(
*
ArrayInst_props
),
ArrayInst_props
,
Array_destructor
,
Array_on_put
};
static
HRESULT
ArrayConstr_value
(
script_ctx_t
*
ctx
,
vdisp_t
*
vthis
,
WORD
flags
,
unsigned
argc
,
VARIANT
*
argv
,
VARIANT
*
retv
,
jsexcept_t
*
ei
)
{
...
...
@@ -1161,7 +1174,7 @@ static HRESULT alloc_array(script_ctx_t *ctx, jsdisp_t *object_prototype, ArrayI
if
(
object_prototype
)
hres
=
init_dispex
(
&
array
->
dispex
,
ctx
,
&
Array_info
,
object_prototype
);
else
hres
=
init_dispex_from_constr
(
&
array
->
dispex
,
ctx
,
&
Array_info
,
ctx
->
array_constr
);
hres
=
init_dispex_from_constr
(
&
array
->
dispex
,
ctx
,
&
Array
Inst
_info
,
ctx
->
array_constr
);
if
(
FAILED
(
hres
))
{
heap_free
(
array
);
...
...
dlls/jscript/tests/api.js
View file @
6e4f74f7
...
...
@@ -211,6 +211,12 @@ ok(!Object.hasOwnProperty('isPrototypeOf'), "Object.hasOwnProperty('isPrototypeO
ok
(
!
parseFloat
.
hasOwnProperty
(
'call'
),
"parseFloat.hasOwnProperty('call') is true"
);
ok
(
!
Function
.
hasOwnProperty
(
'call'
),
"Function.hasOwnProperty('call') is true"
);
obj
=
new
Array
();
ok
(
Array
.
prototype
.
hasOwnProperty
(
'sort'
),
"Array.prototype.hasOwnProperty('sort') is false"
);
ok
(
Array
.
prototype
.
hasOwnProperty
(
'length'
),
"Array.prototype.hasOwnProperty('length') is false"
);
ok
(
!
obj
.
hasOwnProperty
(
'sort'
),
"obj.hasOwnProperty('sort') is true"
);
ok
(
obj
.
hasOwnProperty
(
'length'
),
"obj.hasOwnProperty('length') is true"
);
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