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
9f0969fb
Commit
9f0969fb
authored
Aug 12, 2009
by
Piotr Caban
Committed by
Alexandre Julliard
Aug 12, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Inherit some Number functions from Object.
parent
5d412056
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
37 deletions
+10
-37
global.c
dlls/jscript/global.c
+1
-1
jscript.h
dlls/jscript/jscript.h
+1
-1
number.c
dlls/jscript/number.c
+7
-35
api.js
dlls/jscript/tests/api.js
+1
-0
No files found.
dlls/jscript/global.c
View file @
9f0969fb
...
...
@@ -770,7 +770,7 @@ static HRESULT init_constructors(script_ctx_t *ctx, DispatchEx *object_prototype
if
(
FAILED
(
hres
))
return
hres
;
hres
=
create_number_constr
(
ctx
,
&
ctx
->
number_constr
);
hres
=
create_number_constr
(
ctx
,
object_prototype
,
&
ctx
->
number_constr
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
dlls/jscript/jscript.h
View file @
9f0969fb
...
...
@@ -229,7 +229,7 @@ HRESULT create_array_constr(script_ctx_t*,DispatchEx**);
HRESULT
create_bool_constr
(
script_ctx_t
*
,
DispatchEx
**
);
HRESULT
create_date_constr
(
script_ctx_t
*
,
DispatchEx
**
);
HRESULT
init_error_constr
(
script_ctx_t
*
);
HRESULT
create_number_constr
(
script_ctx_t
*
,
DispatchEx
**
);
HRESULT
create_number_constr
(
script_ctx_t
*
,
DispatchEx
*
,
DispatchEx
*
*
);
HRESULT
create_object_constr
(
script_ctx_t
*
,
DispatchEx
*
,
DispatchEx
**
);
HRESULT
create_regexp_constr
(
script_ctx_t
*
,
DispatchEx
*
,
DispatchEx
**
);
HRESULT
create_string_constr
(
script_ctx_t
*
,
DispatchEx
*
,
DispatchEx
**
);
...
...
dlls/jscript/number.c
View file @
9f0969fb
...
...
@@ -36,10 +36,6 @@ static const WCHAR toFixedW[] = {'t','o','F','i','x','e','d',0};
static
const
WCHAR
toExponentialW
[]
=
{
't'
,
'o'
,
'E'
,
'x'
,
'p'
,
'o'
,
'n'
,
'e'
,
'n'
,
't'
,
'i'
,
'a'
,
'l'
,
0
};
static
const
WCHAR
toPrecisionW
[]
=
{
't'
,
'o'
,
'P'
,
'r'
,
'e'
,
'c'
,
'i'
,
's'
,
'i'
,
'o'
,
'n'
,
0
};
static
const
WCHAR
valueOfW
[]
=
{
'v'
,
'a'
,
'l'
,
'u'
,
'e'
,
'O'
,
'f'
,
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
};
#define NUMBER_TOSTRING_BUF_SIZE 64
/* ECMA-262 3rd Edition 15.7.4.2 */
...
...
@@ -214,27 +210,6 @@ static HRESULT Number_valueOf(DispatchEx *dispex, LCID lcid, WORD flags, DISPPAR
return
S_OK
;
}
static
HRESULT
Number_hasOwnProperty
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
sp
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
Number_propertyIsEnumerable
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
sp
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
Number_isPrototypeOf
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
sp
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
Number_value
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
sp
)
{
...
...
@@ -256,9 +231,6 @@ static HRESULT Number_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAM
}
static
const
builtin_prop_t
Number_props
[]
=
{
{
hasOwnPropertyW
,
Number_hasOwnProperty
,
PROPF_METHOD
},
{
isPrototypeOfW
,
Number_isPrototypeOf
,
PROPF_METHOD
},
{
propertyIsEnumerableW
,
Number_propertyIsEnumerable
,
PROPF_METHOD
},
{
toExponentialW
,
Number_toExponential
,
PROPF_METHOD
},
{
toFixedW
,
Number_toFixed
,
PROPF_METHOD
},
{
toLocaleStringW
,
Number_toLocaleString
,
PROPF_METHOD
},
...
...
@@ -330,7 +302,7 @@ static HRESULT NumberConstr_value(DispatchEx *dispex, LCID lcid, WORD flags, DIS
return
S_OK
;
}
static
HRESULT
alloc_number
(
script_ctx_t
*
ctx
,
BOOL
use_constr
,
NumberInstance
**
ret
)
static
HRESULT
alloc_number
(
script_ctx_t
*
ctx
,
DispatchEx
*
object_prototype
,
NumberInstance
**
ret
)
{
NumberInstance
*
number
;
HRESULT
hres
;
...
...
@@ -339,10 +311,10 @@ static HRESULT alloc_number(script_ctx_t *ctx, BOOL use_constr, NumberInstance *
if
(
!
number
)
return
E_OUTOFMEMORY
;
if
(
use_constr
)
hres
=
init_dispex
_from_constr
(
&
number
->
dispex
,
ctx
,
&
Number_info
,
ctx
->
number_constr
);
if
(
object_prototype
)
hres
=
init_dispex
(
&
number
->
dispex
,
ctx
,
&
Number_info
,
object_prototype
);
else
hres
=
init_dispex
(
&
number
->
dispex
,
ctx
,
&
Number_info
,
NULL
);
hres
=
init_dispex
_from_constr
(
&
number
->
dispex
,
ctx
,
&
Number_info
,
ctx
->
number_constr
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -350,12 +322,12 @@ static HRESULT alloc_number(script_ctx_t *ctx, BOOL use_constr, NumberInstance *
return
S_OK
;
}
HRESULT
create_number_constr
(
script_ctx_t
*
ctx
,
DispatchEx
**
ret
)
HRESULT
create_number_constr
(
script_ctx_t
*
ctx
,
DispatchEx
*
object_prototype
,
DispatchEx
*
*
ret
)
{
NumberInstance
*
number
;
HRESULT
hres
;
hres
=
alloc_number
(
ctx
,
FALSE
,
&
number
);
hres
=
alloc_number
(
ctx
,
object_prototype
,
&
number
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -371,7 +343,7 @@ HRESULT create_number(script_ctx_t *ctx, VARIANT *num, DispatchEx **ret)
NumberInstance
*
number
;
HRESULT
hres
;
hres
=
alloc_number
(
ctx
,
TRUE
,
&
number
);
hres
=
alloc_number
(
ctx
,
NULL
,
&
number
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
dlls/jscript/tests/api.js
View file @
9f0969fb
...
...
@@ -1380,5 +1380,6 @@ function testObjectInherit(obj, ts, tls, vo) {
Object
.
prototype
.
_test
=
"test"
;
testObjectInherit
(
new
String
(
"test"
),
false
,
true
,
false
);
testObjectInherit
(
/test/g
,
false
,
true
,
true
);
testObjectInherit
(
new
Number
(
1
),
false
,
false
,
false
);
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