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
175c4dda
Commit
175c4dda
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 Date properties.
parent
5058c1d1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
date.c
dlls/jscript/date.c
+9
-1
api.js
dlls/jscript/tests/api.js
+5
-0
No files found.
dlls/jscript/date.c
View file @
175c4dda
...
...
@@ -2110,6 +2110,14 @@ static const builtin_info_t Date_info = {
NULL
};
static
const
builtin_info_t
DateInst_info
=
{
JSCLASS_DATE
,
{
NULL
,
Date_value
,
0
},
0
,
NULL
,
NULL
,
NULL
};
static
HRESULT
create_date
(
script_ctx_t
*
ctx
,
jsdisp_t
*
object_prototype
,
DOUBLE
time
,
jsdisp_t
**
ret
)
{
DateInstance
*
date
;
...
...
@@ -2125,7 +2133,7 @@ static HRESULT create_date(script_ctx_t *ctx, jsdisp_t *object_prototype, DOUBLE
if
(
object_prototype
)
hres
=
init_dispex
(
&
date
->
dispex
,
ctx
,
&
Date_info
,
object_prototype
);
else
hres
=
init_dispex_from_constr
(
&
date
->
dispex
,
ctx
,
&
Date_info
,
ctx
->
date_constr
);
hres
=
init_dispex_from_constr
(
&
date
->
dispex
,
ctx
,
&
Date
Inst
_info
,
ctx
->
date_constr
);
if
(
FAILED
(
hres
))
{
heap_free
(
date
);
return
hres
;
...
...
dlls/jscript/tests/api.js
View file @
175c4dda
...
...
@@ -222,6 +222,11 @@ ok(!obj.hasOwnProperty('toString'), "obj.hasOwnProperty('toString') is true");
ok
(
!
Boolean
.
hasOwnProperty
(
'toString'
),
"Boolean.hasOwnProperty('toString') is true"
);
ok
(
Boolean
.
prototype
.
hasOwnProperty
(
'toString'
),
"Boolean.prototype.hasOwnProperty('toString') is false"
);
obj
=
new
Date
();
ok
(
!
obj
.
hasOwnProperty
(
'getTime'
),
"obj.hasOwnProperty('getTime') is true"
);
ok
(
!
Date
.
hasOwnProperty
(
'getTime'
),
"Date.hasOwnProperty('getTime') is true"
);
ok
(
Date
.
prototype
.
hasOwnProperty
(
'getTime'
),
"Date.prototype.hasOwnProperty('getTime') 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