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
4791cdb1
Commit
4791cdb1
authored
Aug 14, 2009
by
Piotr Caban
Committed by
Alexandre Julliard
Aug 14, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Inherit some Array functions from Object.
parent
da6398dc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
36 deletions
+9
-36
array.c
dlls/jscript/array.c
+6
-34
global.c
dlls/jscript/global.c
+1
-1
jscript.h
dlls/jscript/jscript.h
+1
-1
api.js
dlls/jscript/tests/api.js
+1
-0
No files found.
dlls/jscript/array.c
View file @
4791cdb1
...
...
@@ -43,10 +43,6 @@ static const WCHAR spliceW[] = {'s','p','l','i','c','e',0};
static
const
WCHAR
toStringW
[]
=
{
't'
,
'o'
,
'S'
,
't'
,
'r'
,
'i'
,
'n'
,
'g'
,
0
};
static
const
WCHAR
toLocaleStringW
[]
=
{
't'
,
'o'
,
'L'
,
'o'
,
'c'
,
'a'
,
'l'
,
'e'
,
'S'
,
't'
,
'r'
,
'i'
,
'n'
,
'g'
,
0
};
static
const
WCHAR
unshiftW
[]
=
{
'u'
,
'n'
,
's'
,
'h'
,
'i'
,
'f'
,
't'
,
0
};
static
const
WCHAR
hasOwnPropertyW
[]
=
{
'h'
,
'a'
,
's'
,
'O'
,
'w'
,
'n'
,
'P'
,
'r'
,
'o'
,
'p'
,
'e'
,
'r'
,
't'
,
'y'
,
0
};
static
const
WCHAR
propertyIsEnumerableW
[]
=
{
'p'
,
'r'
,
'o'
,
'p'
,
'e'
,
'r'
,
't'
,
'y'
,
'I'
,
's'
,
'E'
,
'n'
,
'u'
,
'm'
,
'e'
,
'r'
,
'a'
,
'b'
,
'l'
,
'e'
,
0
};
static
const
WCHAR
isPrototypeOfW
[]
=
{
'i'
,
's'
,
'P'
,
'r'
,
'o'
,
't'
,
'o'
,
't'
,
'y'
,
'p'
,
'e'
,
'O'
,
'f'
,
0
};
static
const
WCHAR
default_separatorW
[]
=
{
','
,
0
};
...
...
@@ -743,27 +739,6 @@ static HRESULT Array_unshift(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARA
return
E_NOTIMPL
;
}
static
HRESULT
Array_hasOwnProperty
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
sp
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
Array_propertyIsEnumerable
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
sp
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
Array_isPrototypeOf
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
sp
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
Array_value
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
sp
)
{
...
...
@@ -810,12 +785,9 @@ static void Array_on_put(DispatchEx *dispex, const WCHAR *name)
static
const
builtin_prop_t
Array_props
[]
=
{
{
concatW
,
Array_concat
,
PROPF_METHOD
},
{
hasOwnPropertyW
,
Array_hasOwnProperty
,
PROPF_METHOD
},
{
isPrototypeOfW
,
Array_isPrototypeOf
,
PROPF_METHOD
},
{
joinW
,
Array_join
,
PROPF_METHOD
},
{
lengthW
,
Array_length
,
0
},
{
popW
,
Array_pop
,
PROPF_METHOD
},
{
propertyIsEnumerableW
,
Array_propertyIsEnumerable
,
PROPF_METHOD
},
{
pushW
,
Array_push
,
PROPF_METHOD
},
{
reverseW
,
Array_reverse
,
PROPF_METHOD
},
{
shiftW
,
Array_shift
,
PROPF_METHOD
},
...
...
@@ -888,7 +860,7 @@ static HRESULT ArrayConstr_value(DispatchEx *dispex, LCID lcid, WORD flags, DISP
return
S_OK
;
}
static
HRESULT
alloc_array
(
script_ctx_t
*
ctx
,
BOOL
use_constr
,
ArrayInstance
**
ret
)
static
HRESULT
alloc_array
(
script_ctx_t
*
ctx
,
DispatchEx
*
object_prototype
,
ArrayInstance
**
ret
)
{
ArrayInstance
*
array
;
HRESULT
hres
;
...
...
@@ -897,8 +869,8 @@ static HRESULT alloc_array(script_ctx_t *ctx, BOOL use_constr, ArrayInstance **r
if
(
!
array
)
return
E_OUTOFMEMORY
;
if
(
use_constr
)
hres
=
init_dispex
_from_constr
(
&
array
->
dispex
,
ctx
,
&
Array_info
,
ctx
->
array_constr
);
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
->
object_constr
);
...
...
@@ -911,12 +883,12 @@ static HRESULT alloc_array(script_ctx_t *ctx, BOOL use_constr, ArrayInstance **r
return
S_OK
;
}
HRESULT
create_array_constr
(
script_ctx_t
*
ctx
,
DispatchEx
**
ret
)
HRESULT
create_array_constr
(
script_ctx_t
*
ctx
,
DispatchEx
*
object_prototype
,
DispatchEx
*
*
ret
)
{
ArrayInstance
*
array
;
HRESULT
hres
;
hres
=
alloc_array
(
ctx
,
FALSE
,
&
array
);
hres
=
alloc_array
(
ctx
,
object_prototype
,
&
array
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -931,7 +903,7 @@ HRESULT create_array(script_ctx_t *ctx, DWORD length, DispatchEx **ret)
ArrayInstance
*
array
;
HRESULT
hres
;
hres
=
alloc_array
(
ctx
,
TRUE
,
&
array
);
hres
=
alloc_array
(
ctx
,
NULL
,
&
array
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
dlls/jscript/global.c
View file @
4791cdb1
...
...
@@ -754,7 +754,7 @@ static HRESULT init_constructors(script_ctx_t *ctx, DispatchEx *object_prototype
if
(
FAILED
(
hres
))
return
hres
;
hres
=
create_array_constr
(
ctx
,
&
ctx
->
array_constr
);
hres
=
create_array_constr
(
ctx
,
object_prototype
,
&
ctx
->
array_constr
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
dlls/jscript/jscript.h
View file @
4791cdb1
...
...
@@ -226,7 +226,7 @@ HRESULT init_global(script_ctx_t*);
HRESULT
init_function_constr
(
script_ctx_t
*
,
DispatchEx
*
);
HRESULT
create_object_prototype
(
script_ctx_t
*
,
DispatchEx
**
);
HRESULT
create_array_constr
(
script_ctx_t
*
,
DispatchEx
**
);
HRESULT
create_array_constr
(
script_ctx_t
*
,
DispatchEx
*
,
DispatchEx
*
*
);
HRESULT
create_bool_constr
(
script_ctx_t
*
,
DispatchEx
*
,
DispatchEx
**
);
HRESULT
create_date_constr
(
script_ctx_t
*
,
DispatchEx
*
,
DispatchEx
**
);
HRESULT
init_error_constr
(
script_ctx_t
*
);
...
...
dlls/jscript/tests/api.js
View file @
4791cdb1
...
...
@@ -1391,5 +1391,6 @@ testObjectInherit(/test/g, false, true, true);
testObjectInherit
(
new
Number
(
1
),
false
,
false
,
false
);
testObjectInherit
(
new
Date
(),
false
,
false
,
false
);
testObjectInherit
(
new
Boolean
(
true
),
false
,
true
,
false
);
testObjectInherit
(
new
Array
(),
false
,
false
,
true
);
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