Compare commits

..

339 Commits

Author SHA1 Message Date
(no author)
c5d6b83e4c This commit was manufactured by cvs2svn to create branch 'CVS'.
git-svn-id: svn://10.0.0.236/branches/CVS@50735 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:53:00 +00:00
shaver%netscape.com
f3548d4772 case correction, scriptability and deprecative comment for nsIEnumerator (r=waterson,brendan)
git-svn-id: svn://10.0.0.236/trunk@50734 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:52:59 +00:00
mjudge%netscape.com
8633625794 oops. for got to check this in last time. bug number is 14795
git-svn-id: svn://10.0.0.236/trunk@50733 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:52:42 +00:00
norris%netscape.com
9323b18962 Fix a Unix warning by removing an unused local variable
git-svn-id: svn://10.0.0.236/trunk@50732 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:49:36 +00:00
norris%netscape.com
d8ebef8633 correct a comment.
git-svn-id: svn://10.0.0.236/trunk@50731 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:49:05 +00:00
kmcclusk%netscape.com
d8ff43782f Set vertical-align:baseline for input[type=image] to make it compatible with Nav 4.x
bug #16370; r=rods@netscape.com


git-svn-id: svn://10.0.0.236/trunk@50730 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:48:02 +00:00
pollmann%netscape.com
806e3f40cd Bugs 16450, 11979, 16576: Add back a CRLF I took out of the form post headers; r=harishd
git-svn-id: svn://10.0.0.236/trunk@50729 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:47:08 +00:00
davidm%netscape.com
b8febcc271 14974 apprunner fails to start up on B&W G3 8.6
Add file to generate logs on the mac
r sdagley


git-svn-id: svn://10.0.0.236/trunk@50728 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:46:27 +00:00
norris%netscape.com
814809437c Fix bug 16303. r=alecf@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50727 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:45:40 +00:00
davidm%netscape.com
4d52510e79 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@50726 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:45:20 +00:00
kmcclusk%netscape.com
440593ffd1 When submitting a form using a "get" method only add the ? if the href does not end in a ?.
bug #16137 r=rods@netscape.com


git-svn-id: svn://10.0.0.236/trunk@50725 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:45:02 +00:00
kmcclusk%netscape.com
9827b1d455 Return the value of the option element value attribute if it is present otherwise return
the content of the option. bug #16158. r=rods@netscape.com


git-svn-id: svn://10.0.0.236/trunk@50724 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:41:40 +00:00
morse%netscape.com
19b5a1e558 fix bug 16357, memory leak, r=neeti
git-svn-id: svn://10.0.0.236/trunk@50723 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:37:35 +00:00
harishd%netscape.com
1cd0327569 Bug fix 2749 - Tweaked comment handling in quirks mode.
Bug fix 15992 - Line breaks within script and style were not getting counted
Related to bug 15423 - Rectified a glitch in Nav. DTD code where a doctype tag
                                         was opening up a body.
Userdefined tags are now treated as containers.
Added Kipp's Leaky Tool

r=pollmann.


git-svn-id: svn://10.0.0.236/trunk@50722 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:37:21 +00:00
morse%netscape.com
75a2c4fce1 fix bug 16348, memory leak, r=neeti
git-svn-id: svn://10.0.0.236/trunk@50721 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:36:50 +00:00
sdagley%netscape.com
6f9ff35120 Enforce _MD_DEFAULT_STACK_SIZE as the minimum stack size on Mac. r=beard
git-svn-id: svn://10.0.0.236/trunk@50720 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:33:13 +00:00
pepper%netscape.com
7f58cc3a0b Changed friend declaration to make HP compilers happy.
aCC requires a decl of friend class ClassName instead of friend ClassName.
r=peterl@netscape.com,mgleeson@netscape.com


git-svn-id: svn://10.0.0.236/trunk@50719 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:31:07 +00:00
ssu%netscape.com
6277f3a3b3 fixes bug #16246, #16312, #16344, #16308. r=dbragg@netscape.com. fixes crash bug if the install file operation fails. no longer crashes.
git-svn-id: svn://10.0.0.236/trunk@50718 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:30:56 +00:00
kipp%netscape.com
a4a3169649 r=dougt; fixed a warning
git-svn-id: svn://10.0.0.236/trunk@50717 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:30:39 +00:00
sdagley%netscape.com
072fc1a666 Marking all Mac threads as GCable for leak detector work. Bug #15906. r=beard
git-svn-id: svn://10.0.0.236/trunk@50716 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:29:34 +00:00
pepper%netscape.com
0c627abfcd Added missing newline at end of file to make the HP compilers happy.
r=mgleeson@netscape.com


git-svn-id: svn://10.0.0.236/trunk@50715 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:28:17 +00:00
alecf%netscape.com
3185d0a81d add boehm to apprunner
(flag not active in build yet)


git-svn-id: svn://10.0.0.236/trunk@50714 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:27:45 +00:00
alecf%netscape.com
4d423eecaf add boehm leak detector support to xpcom on linux
(these flags not active in the build yet)


git-svn-id: svn://10.0.0.236/trunk@50713 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:26:41 +00:00
wtc%netscape.com
0317a9ec8d Bugsplat bug #365543: removed the PRIntn typecast in the definition of
PR_TRUE and PR_FALSE.


git-svn-id: svn://10.0.0.236/trunk@50712 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:25:01 +00:00
alecf%netscape.com
c8460fa4ce tweaks to make generic_threads work on linux
not part of build


git-svn-id: svn://10.0.0.236/trunk@50711 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:24:34 +00:00
alecf%netscape.com
2fce42c8be more tweaks to make beard's generic_threads stuff work on linux
linux already has some of these routines implemented with pthread-specifics
not part of build = no reviewer/bug


git-svn-id: svn://10.0.0.236/trunk@50710 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:22:17 +00:00
mgleeson1%netscape.com
34c5281c43 r=pepper HPUX specific change - enable 64-bit int for js
git-svn-id: svn://10.0.0.236/trunk@50709 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:20:27 +00:00
wtc%netscape.com
463f69ae27 Bugzilla bug #14126: quote $(OS_RELEASE) in the shell command.
Thanks to Greg Noel <GregNoel@san.rr.com> for the bug report
and the fix.  Reviewed by Greg Noel and tested on several flavors
of Linux (x86, sparc, alpha, and ppc) and FreeBSD.


git-svn-id: svn://10.0.0.236/trunk@50708 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:17:38 +00:00
mcafee%netscape.com
8ebe80d3dc Better warning messages. r=pavlov.
git-svn-id: svn://10.0.0.236/trunk@50707 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:13:39 +00:00
kipp%netscape.com
37a76d8a25 r=Tomi.Leppikangas@oulu.fi; landed his patch for solaris build issues
git-svn-id: svn://10.0.0.236/trunk@50706 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:11:44 +00:00
kipp%netscape.com
63bce01588 Fixed edge case where line bounds wasn't quite accurate which causes the combined rect to not match which now wastes memory; only affects right aligned lines
git-svn-id: svn://10.0.0.236/trunk@50705 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:10:59 +00:00
kipp%netscape.com
18e9b9d2f5 r=troy; Reworked nsLineBox api to allow for reduced storage overhead; fixed bug 16252 while keeping bug 12709 fixed
git-svn-id: svn://10.0.0.236/trunk@50704 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:10:03 +00:00
jband%netscape.com
b3711cec39 Fixing leaks found by beard...
- Fixed leaked nsID ptr. bug 16373. This alsothrows a JS
exception when JS callers call createInstance or getService
using an (optional) param that is not an iid. This had been a
'XXX' in the code.
- Moved a release call out of just the error condition block in
setting up a ServiceReleaser. I should have caught this one, but
few of my tests use services :(  I have hopes that the whole
ServiceReleaser will become unnecessary as the ServiceManager
system changes and simply calling NS_RELEASE on a service becomes
sufficient.
- Cleaned up an addref/release pair in a setter (need to move to
nsComPtrs!) r=beard


git-svn-id: svn://10.0.0.236/trunk@50703 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:08:59 +00:00
kipp%netscape.com
dde9a9185e r=troy; Use a custom frame type so that bullets show up properly in the frame sizing data
git-svn-id: svn://10.0.0.236/trunk@50702 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:08:58 +00:00
kipp%netscape.com
3f737c9dc4 r=troy; Added some more atoms so that Dframe sizing data is more particular for line boxes
git-svn-id: svn://10.0.0.236/trunk@50701 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:08:31 +00:00
kipp%netscape.com
873c0b8d47 r=troy; Added a #define to prevent future code crashes
git-svn-id: svn://10.0.0.236/trunk@50700 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:08:04 +00:00
ftang%netscape.com
2a3924d2e0 fix Shift+a does not produce A in editor problem. We need to clean up isShift before we send. r=pavlov
git-svn-id: svn://10.0.0.236/trunk@50699 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 23:04:57 +00:00
kipp%netscape.com
a542382c77 Added a new table regression test
git-svn-id: svn://10.0.0.236/trunk@50698 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 22:58:41 +00:00
terry%mozilla.org
909afc64d2 Patch by holger@holger.om.org (Holger Schurig) -- was not correctly fixing up the 'when' column in the bugs_activity table.
git-svn-id: svn://10.0.0.236/trunk@50697 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 22:35:12 +00:00
terry%mozilla.org
270c5df832 Patch by holger@holger.om.org (Holger Schurig) -- get the permissions right on the shadow directory.
git-svn-id: svn://10.0.0.236/trunk@50696 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 22:32:44 +00:00
ftang%netscape.com
da9f453e91 fix problem with url bar trancation. Do not send extra key press for non A-Z0-9
git-svn-id: svn://10.0.0.236/trunk@50695 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 21:49:49 +00:00
brade%netscape.com
6bc5327b10 add nspr shlb to optimized too (to fix probably future mac bustage); remove bad path (r=sfraser@netscape.com)
git-svn-id: svn://10.0.0.236/trunk@50694 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 20:34:38 +00:00
ssu%netscape.com
0acd8acee3 fixing bug #16242. approved by leaf. r=leaf. removes jre122 from the mozilla installer. not part of tinderbox. would only affect windows.
git-svn-id: svn://10.0.0.236/trunk@50693 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 20:23:22 +00:00
brade%netscape.com
9c363797fa add nspr shlb to debug to fix mac build bustage
git-svn-id: svn://10.0.0.236/trunk@50692 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 20:18:30 +00:00
dmose%mozilla.org
f0ad8b22a7 fix to cope with checkins.when column name change to checkins.ci_when
git-svn-id: svn://10.0.0.236/trunk@50691 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 20:10:30 +00:00
ftang%netscape.com
0abb41fb24 fix the problem taht PageUp/PageDown/Up/Down/Left/Right/Home/End does not work after we land the keyevent branch. add missing isMeta code there
git-svn-id: svn://10.0.0.236/trunk@50690 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 20:03:00 +00:00
ftang%netscape.com
2d2a382150 landing keyEvent_19991004_BRANCH
bugs # see the log of the check in into branch
author/reviewer:
mozilla/layout/base/src/nsRangeList.cpp brade/mjudge
mozilla/layout/html/forms/src/nsGfxTextControlFrame.cpp brade/ftang
mozilla/layout/events/src/nsDOMEvent.cpp brade/joki
mozilla/layout/events/src/nsEventStateManager.cpp brade/joki
mozilla/widget/public/nsGUIEvent.h akkana/ftang
mozilla/widget/src/windows/nsWindow.cpp ftang/mjudge
mozilla/widget/src/windows/nsWindow.h ftang/mjudge
mozilla/widget/src/mac/nsTextAreaWidget.cpp brade/ftang
mozilla/widget/src/mac/nsMacEventHandler.cpp brade/simon
mozilla/widget/src/xpwidgets/nsKeyBindMgr.cpp brade/ftang
mozilla/widget/src/gtk/nsGtkEventHandler.cpp akkana/?
mozilla/widget/src/gtk/nsWidget.cpp erik/ftang
mozilla/layout/xul/base/src/nsTreeCellFrame.cpp brade/ftang
mozilla/editor/base/nsEditorEventListeners.cpp brade/akkana
mozilla/editor/base/nsHTMLEditor.cpp brade/akkana
mozilla/rdf/content/src/nsXULKeyListener.cpp ftang/saari
fix the master bug- 15693
fix at least, but not limited to, the following bugs
10158,11956,6053,9333,10901,14348,6449,11845,13016,14410,15657,15307,15842,13856


git-svn-id: svn://10.0.0.236/trunk@50688 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 18:27:01 +00:00
alecf%netscape.com
74f7c311eb fix back/forward buttons, #16415
a=leaf


git-svn-id: svn://10.0.0.236/trunk@50687 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 18:26:13 +00:00
terry%mozilla.org
210deb53ba Fix invalid SQL introduced by last patch.
git-svn-id: svn://10.0.0.236/trunk@50686 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 17:34:00 +00:00
terry%mozilla.org
e121b35d4c Allow sorting of status whiteboard column.
git-svn-id: svn://10.0.0.236/trunk@50685 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 17:21:43 +00:00
srinivas%netscape.com
3b846f9edf Add autoconf for NSPR. Check in for cls@seawood.org. Buzill 11893
git-svn-id: svn://10.0.0.236/trunk@50684 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 15:09:11 +00:00
rods%netscape.com
f2b4462a33 This corrects an erroneous checkin made on monday, fixes bug #16362 r=dcone
git-svn-id: svn://10.0.0.236/trunk@50683 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 14:55:08 +00:00
srinivas%netscape.com
e68238933b Autconf for NSPR. Checkin for cls@seawood.org. Bugzill #11893.
git-svn-id: svn://10.0.0.236/trunk@50682 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 14:50:38 +00:00
kipp%netscape.com
49f795c9c9 Make necko work with the viewer again
git-svn-id: svn://10.0.0.236/trunk@50681 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 14:43:59 +00:00
brade%netscape.com
bbc03d38ad remove dbl-click message (per joki); dblclick message is causing bug #14990; r=sfraser@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50680 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 14:22:22 +00:00
brade%netscape.com
eb9061c0ef add nsXULControllers.cpp for hyatt (fix mac bustage)
git-svn-id: svn://10.0.0.236/trunk@50679 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 14:14:55 +00:00
brade%netscape.com
093237bea8 add nsIControllers.idl for hyatt (fix mac build bustage)
git-svn-id: svn://10.0.0.236/trunk@50678 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 13:56:34 +00:00
morse%netscape.com
9cbd053f44 fix bug 10434, memory leak detection, r=kin
git-svn-id: svn://10.0.0.236/trunk@50677 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 13:50:36 +00:00
morse%netscape.com
789e4a6e68 fix bug 10434, memory leak detection, r=valeski
git-svn-id: svn://10.0.0.236/trunk@50676 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 13:36:33 +00:00
hyatt%netscape.com
b895b64505 Fixing warnings. r=travis
git-svn-id: svn://10.0.0.236/trunk@50675 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 12:02:32 +00:00
hyatt%netscape.com
3e56d44211 Fixing linux bustage. Typo in makefile.
git-svn-id: svn://10.0.0.236/trunk@50674 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 11:18:03 +00:00
tbogard%aol.net
226a10c27a Changed the content area of navigator to use the new browser tag rather than html:iframe. r=hyatt.
git-svn-id: svn://10.0.0.236/trunk@50673 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 11:00:21 +00:00
hyatt%netscape.com
9259952dca Landing re-architected command dispatcher. r=hangas(XUL/JS), saari(C++)
git-svn-id: svn://10.0.0.236/trunk@50672 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 10:58:25 +00:00
tbogard%aol.net
d548e091c7 Fixed a number of incorrect assumptions of the attribute retrieval so it would now work with the of new XUL content nodes (iframe, browser, editor). r=hyatt.
git-svn-id: svn://10.0.0.236/trunk@50671 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 10:58:04 +00:00
tbogard%aol.net
e623d0cd2b Adding construction for new XUL tags "iframe", "editor", and "browser". r=hyatt.
git-svn-id: svn://10.0.0.236/trunk@50670 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 10:55:24 +00:00
tbogard%aol.net
645b1aba54 Adding new XUL tags, "iframe", "browser", "editor". r=hyatt.
git-svn-id: svn://10.0.0.236/trunk@50669 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 10:54:32 +00:00
tbogard%aol.net
9cb4c25b8a Added rules for the new browser, editor and iframe types. r=hyatt
git-svn-id: svn://10.0.0.236/trunk@50668 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 10:50:10 +00:00
sgehani%netscape.com
04a7745986 *** NOT PART OF BUILD ***
Fixed bug 11216: Cascading dependencies feature
   
Fixed bug 14320: Parser and action support for the LAUNCHAPP atribute
   
Fixed bug 14322: Mouse over displays component description
   
Fixed bug 16224: Mac Install Wizard crashing when installing custom components


git-svn-id: svn://10.0.0.236/trunk@50667 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 08:30:29 +00:00
sgehani%netscape.com
e33d697bbd Divide by 1024 rather than 1000 when calculating component install sizes. [r=ssu]
git-svn-id: svn://10.0.0.236/trunk@50666 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 08:15:35 +00:00
locka%iol.ie
3e4a7413ef Seperated webshell initialisation/termination out into their own methods. Added support to run Mozilla control from any directory with calls to the new NS_InitXPCOM and some new registry keys.
git-svn-id: svn://10.0.0.236/trunk@50665 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 07:46:55 +00:00
locka%iol.ie
e08fc8df48 Added context popup menu resources
git-svn-id: svn://10.0.0.236/trunk@50664 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 07:44:40 +00:00
locka%iol.ie
9d3f958db2 Added simple working implementation of drag and drop. Control now accepts a URL dragged and dropped from the IE address bar.
git-svn-id: svn://10.0.0.236/trunk@50663 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 07:43:50 +00:00
alecf%netscape.com
4cb578fb28 fix for #16303 - work around DOM security by specifying absolute chrome URLs
patch from norris, r=alecf


git-svn-id: svn://10.0.0.236/trunk@50662 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 07:07:43 +00:00
alecf%netscape.com
067e9e08c7 more tweaks to actually make this do useful things with linux - override malloc with GC_malloc
git-svn-id: svn://10.0.0.236/trunk@50659 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 05:34:21 +00:00
alecf%netscape.com
b7e4e49c84 make this link on rh60 - the pthreads that comes with rh60 doesn't allow direct access to __pthread_initial_thread_box, which was only used as a test anyway
git-svn-id: svn://10.0.0.236/trunk@50658 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 05:33:46 +00:00
troy%netscape.com
3007f63368 b=15388,15408 r=peterl@netscape.com
Made it so that for absolutely positioned frames we pass in the containing
block width/height to the HTML reflow state, rather than have it compute it.
This means we get a bottom up size rather than a top down size. That fixes
a problem where for containing blocks with a specified 'height' of 'auto' we
weren't correctly calculating the containing block height


git-svn-id: svn://10.0.0.236/trunk@50657 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 04:56:50 +00:00
troy%netscape.com
bc13612958 b=16238. Fix discussed with evaughan@netscape. One line change to make sure
the default area frame flag of NS_BLOCK_SPACE_MGR is used for scrolled
elements


git-svn-id: svn://10.0.0.236/trunk@50656 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 04:47:18 +00:00
warren%netscape.com
18d4872487 Reordered columns as per macafee's suggestion.
git-svn-id: svn://10.0.0.236/trunk@50655 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 04:37:13 +00:00
troy%netscape.com
50fb78a575 Space reductions for nsTableFrame. r=karnaze@netscape.com and changes Cc'd to
Hyatt. Tested extensively in apprunner (now mozilla). Change was to reduce from
10 to 5 the default size of the mColumnWidths array (note that the array is
dynamically grown if necessary). This reduces by 20 bytes the minimum table
frame size


git-svn-id: svn://10.0.0.236/trunk@50654 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 04:27:01 +00:00
karnaze%netscape.com
43efe84083 bug 15247 - ComputeAvailableTableWidth accounts for margins
git-svn-id: svn://10.0.0.236/trunk@50653 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 04:03:20 +00:00
karnaze%netscape.com
14d9729d57 cells with width=0 become auto, added comments
git-svn-id: svn://10.0.0.236/trunk@50652 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 04:01:26 +00:00
karnaze%netscape.com
1c91cf67ee new regression tests
git-svn-id: svn://10.0.0.236/trunk@50651 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 03:59:42 +00:00
ssu%netscape.com
661f8f1993 fixing bug #16064. checking in for dveditz@netscape.com. r=ssu@netscape.com. This fixes the crash under win98 when running from the windows installer.
git-svn-id: svn://10.0.0.236/trunk@50650 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 03:26:22 +00:00
srinivas%netscape.com
33f38025b2 Enable specification of minimum stack size.
git-svn-id: svn://10.0.0.236/trunk@50649 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 02:33:14 +00:00
jefft%netscape.com
f59d48eecf enable message move/copy {File Here} menu item; bug 13880, r= hangas
git-svn-id: svn://10.0.0.236/trunk@50648 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 02:20:02 +00:00
rhp%netscape.com
36d221edd9 Fix for attachment count - bug #16076 - reviewer: jefft
git-svn-id: svn://10.0.0.236/trunk@50647 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 02:05:20 +00:00
alecf%netscape.com
e39c37dd58 one down, one to go
git-svn-id: svn://10.0.0.236/trunk@50646 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 02:01:40 +00:00
beard%netscape.com
2975241aaf added support for "about:bloat?leaks". bug=15906,r=warren
git-svn-id: svn://10.0.0.236/trunk@50645 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 01:56:49 +00:00
varada%netscape.com
60280cb48a fix for bug #6348 -new field called Title is to be added in each ini file for the show example
git-svn-id: svn://10.0.0.236/trunk@50644 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 01:56:43 +00:00
evaughan%netscape.com
c89e48e233 Fixed gfx scrollbars style rule. Reviewed by Hyatt
git-svn-id: svn://10.0.0.236/trunk@50642 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 01:55:41 +00:00
alecf%netscape.com
af6d54dbdd convert to nsIModule
r=sspitzer
no bug


git-svn-id: svn://10.0.0.236/trunk@50640 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 01:40:27 +00:00
mcafee%netscape.com
ea6a04a363 Backing out quotes change for (14663), r=matt
git-svn-id: svn://10.0.0.236/trunk@50639 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 01:38:22 +00:00
varada%netscape.com
9acc778e9e bug #10361 config in title
git-svn-id: svn://10.0.0.236/trunk@50637 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 01:23:02 +00:00
varada%netscape.com
9b7d72b4f3 fix for bug #10361 - make neccessary changes in ini files in the title
git-svn-id: svn://10.0.0.236/trunk@50636 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 01:21:01 +00:00
bienvenu%netscape.com
48263cb73e real fix for build bustage
git-svn-id: svn://10.0.0.236/trunk@50635 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 01:02:23 +00:00
peterl%netscape.com
946d493f92 moved style rule cascading logic into a stand-alone rule processor
the rule processor can now cascade rules from multiple style sheets
fix for bug 12401 & 12106
r=pierre


git-svn-id: svn://10.0.0.236/trunk@50634 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 00:59:21 +00:00
peterl%netscape.com
c7896988cd factored out parsing of style attribute
deferred parsing of style attribute until content
is connected to a document
Fix for bug 14986
r=vidur


git-svn-id: svn://10.0.0.236/trunk@50633 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 00:57:37 +00:00
peterl%netscape.com
866322d95e added an assertion to help track down Bug 14238
r=troy


git-svn-id: svn://10.0.0.236/trunk@50632 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 00:56:30 +00:00
cyeh%netscape.com
8ba9c7c1f8 move megahal initialization so that if there is a nick collision and we
die, we at least don't leave a forked process behind.


git-svn-id: svn://10.0.0.236/trunk@50631 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 00:44:37 +00:00
don%netscape.com
7491373c1e Fixed build bustage.
git-svn-id: svn://10.0.0.236/trunk@50630 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 00:39:45 +00:00
varada%netscape.com
0a71d36864 rewriting verifyval to compare values
git-svn-id: svn://10.0.0.236/trunk@50629 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 00:39:31 +00:00
Jerry.Kirk%Nexwarecorp.com
5f745cfd66 These changes fix a draw problem when a top-level window was Move'd
Bug=16325 r=Michael.Kedl@Nexwarecorp.com


git-svn-id: svn://10.0.0.236/trunk@50628 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 00:33:49 +00:00
cmanske%netscape.com
1347e8f244 Fixed bugs 16204, 16118, 15831,15448,14342(partial) r=mjudge
git-svn-id: svn://10.0.0.236/trunk@50627 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 00:13:27 +00:00
cmanske%netscape.com
376ee7ffc4 Fixed bug 16118, part of fix for 14342. Reduced size of ender input widget. r=hyatt,hangas
git-svn-id: svn://10.0.0.236/trunk@50626 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-14 00:13:21 +00:00
beard%netscape.com
c49f31fb70 fixing a memory leak, just use an nsAutoString. bug=15380, r=harishd
git-svn-id: svn://10.0.0.236/trunk@50625 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 23:59:27 +00:00
alecf%netscape.com
064759d0a6 make this compile with -pedantic on Linux 2.2
git-svn-id: svn://10.0.0.236/trunk@50624 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 23:58:25 +00:00
alecf%netscape.com
4cc8b798cc add new makefile for our build system
git-svn-id: svn://10.0.0.236/trunk@50623 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 23:58:09 +00:00
alecf%netscape.com
e8c68e85db move old Boehm makefile to Makefile.unix
(not part of build)


git-svn-id: svn://10.0.0.236/trunk@50622 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 23:57:38 +00:00
bienvenu%netscape.com
2d2078838d add close method to datasources, r=mscott, no bug, but fixes some shutdown memory leaks
git-svn-id: svn://10.0.0.236/trunk@50621 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 23:55:57 +00:00
beard%netscape.com
06ca9ef5c4 make stack crawl instructions addresses reflect call site, not return address. bug=15906, r=rjc
git-svn-id: svn://10.0.0.236/trunk@50620 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 23:45:40 +00:00
beard%netscape.com
a0aa1b960a Rewrote using Mac file I/O, since MSL can only manage 35 FILEs. bug=15906, r=rjc
git-svn-id: svn://10.0.0.236/trunk@50619 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 23:45:03 +00:00
beard%netscape.com
34cb9deb75 for now, let leak detector reclaim block. bug=15906, r=rjc
git-svn-id: svn://10.0.0.236/trunk@50618 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 23:44:55 +00:00
beard%netscape.com
6dfda342cc html-ized the report, added -blame option.
git-svn-id: svn://10.0.0.236/trunk@50617 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 23:42:49 +00:00
alecf%netscape.com
416447022b fix typo (gif not dif)
talked to cmanske about this, no review necessary


git-svn-id: svn://10.0.0.236/trunk@50616 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 23:39:52 +00:00
dveditz%netscape.com
c5129bc74b added directory recursion feature to makecopy.exe, r=dougt
git-svn-id: svn://10.0.0.236/trunk@50615 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 23:37:24 +00:00
varada%netscape.com
59aaafb7d0 fix for bug #6569
git-svn-id: svn://10.0.0.236/trunk@50614 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 21:30:51 +00:00
terry%mozilla.org
10a148d16b Removing the last vote on a bug was causing an SQL error.
git-svn-id: svn://10.0.0.236/trunk@50611 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 20:17:01 +00:00
selmer%netscape.com
9c33ecf2b8 fix 15325 - don't allow dupl config
git-svn-id: svn://10.0.0.236/trunk@50607 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 19:55:13 +00:00
selmer%netscape.com
73b2bf9d78 Can't have commands after a Reload
git-svn-id: svn://10.0.0.236/trunk@50606 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 19:24:41 +00:00
wtc%netscape.com
78e2d8b9b1 Fixed an error of incorrect return value type in _MD_DeleteSharedMemory.
git-svn-id: svn://10.0.0.236/trunk@50603 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 19:17:05 +00:00
larryh%netscape.com
c2335df585 NSPR 3.5 landing
git-svn-id: svn://10.0.0.236/trunk@50602 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 18:32:42 +00:00
rbs%maths.uq.edu.au
28de62d660 [MathML] Fix to get the scriptlevel style context back, and minor cleanups.
git-svn-id: svn://10.0.0.236/trunk@50600 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 15:10:14 +00:00
karnaze%netscape.com
d0d34df829 bug 11026 - AllocateUnconstrained was off by 1 twip in some cases. bug 14159 - cell is not fixed width if an auto cell in the same col has a larger desired size for backward compatibilty.
git-svn-id: svn://10.0.0.236/trunk@50599 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 14:44:22 +00:00
kipp%netscape.com
9c0c764b13 Removed an unsupported argument (-f)
git-svn-id: svn://10.0.0.236/trunk@50598 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 14:43:04 +00:00
karnaze%netscape.com
12a011a2e9 removed handling of 0 width cells in ComputeAvailableTableWidth since it is done in nsHTMLTableElement. review=kmcclusk
git-svn-id: svn://10.0.0.236/trunk@50597 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 14:39:33 +00:00
karnaze%netscape.com
b893071648 added comments
git-svn-id: svn://10.0.0.236/trunk@50596 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 14:36:28 +00:00
gagan%netscape.com
6d496c35bf Argh... fix my last fix.
git-svn-id: svn://10.0.0.236/trunk@50595 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 12:16:08 +00:00
gagan%netscape.com
14334bc5ea Fix build bustage on windows.
git-svn-id: svn://10.0.0.236/trunk@50594 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 11:50:14 +00:00
gagan%netscape.com
22f1039803 Fix the windows build bustage. Bad checkin on my part!
git-svn-id: svn://10.0.0.236/trunk@50593 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 11:09:37 +00:00
gagan%netscape.com
a4426a97a5 Removing an #if 0 block that got checked in accidently with my last checkins.
git-svn-id: svn://10.0.0.236/trunk@50592 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 10:31:16 +00:00
gagan%netscape.com
8d5737519d Removed an unneccesary include statement. No bug number.
git-svn-id: svn://10.0.0.236/trunk@50591 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 10:28:10 +00:00
gagan%netscape.com
b3785299ff Fix for bug # 10333. Made webshell a progress event sink as well so that now it redirects all progress messages from necko land to the appropriate docloader observer. The hack to delete strings which are being received in the status messages is a work around the current limitation of the proxy event code. When bug # 16273 is fixed that delete wont be necessary. In fixing this I also noticed that the nsFileTransport wasn't using the proxy events and was incorrectly firing status messages directly onto the UI thread. Fixed that as well. r=rpotts,warren
git-svn-id: svn://10.0.0.236/trunk@50588 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 10:24:12 +00:00
waterson%netscape.com
821cb4f5b2 Factor out dirtying of tree, fixed bug with dynamic column creation due to row addition. r=hyatt
git-svn-id: svn://10.0.0.236/trunk@50587 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 08:53:57 +00:00
waterson%netscape.com
250dbce4cf Add check-for-null-pointer to FireOnSelectHandler() to avoid crashing in the case where a select handler fires on an 'orphaned' node with no document. This can happen if a document is being destroyed and random scripts and events are still filtering through the system.
git-svn-id: svn://10.0.0.236/trunk@50585 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 08:02:02 +00:00
pinkerton%netscape.com
3cadc697e1 correctly update cellmap when scrolling in a tree with no column headers (r=hyatt, partial fix for bug#15771)
git-svn-id: svn://10.0.0.236/trunk@50584 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 08:01:43 +00:00
waterson%netscape.com
eecbd2d60c Add PR_LOG() calls to aid debugging.
git-svn-id: svn://10.0.0.236/trunk@50583 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 08:00:45 +00:00
waterson%netscape.com
d69c3be183 Add PR_LOG() calls to aid with debugging.
git-svn-id: svn://10.0.0.236/trunk@50582 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 08:00:14 +00:00
sfraser%netscape.com
6aa6a226a0 Add jsurl IDL manifest and project for dougt.
git-svn-id: svn://10.0.0.236/trunk@50579 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 07:19:40 +00:00
dougt%netscape.com
683eda7a2e 1) Now evaluting the script during channel creation rather than read() to
avoid a deadlock between the UI/JS thread and the FileTransport thread.

2) Isolating the proxy of the eval to a single interface

3) Change makefiles for windows and unix.

Brendan asked me to look at this.  I am not sure if there is a bug number.

reviewer=brendan@meer.net


git-svn-id: svn://10.0.0.236/trunk@50578 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 07:17:36 +00:00
sfraser%netscape.com
057541d810 Part of dougt jsurl changes. Fixing the project to use the _debug prefix file when building debug. r=dougt
git-svn-id: svn://10.0.0.236/trunk@50577 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 07:16:12 +00:00
sfraser%netscape.com
1359dee773 First Checked In.
git-svn-id: svn://10.0.0.236/trunk@50576 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 07:14:12 +00:00
alecf%netscape.com
fb48c801ad fix windows bustage (sorry, I thought I checked this line in from my windows box, must have missed it)
git-svn-id: svn://10.0.0.236/trunk@50575 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 07:00:42 +00:00
alecf%netscape.com
252994d3f4 update status
git-svn-id: svn://10.0.0.236/trunk@50574 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 06:14:58 +00:00
alecf%netscape.com
579a822e8a convert XPFE components over the nsIModules
git-svn-id: svn://10.0.0.236/trunk@50573 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 06:12:15 +00:00
despotdaemon%netscape.com
17726547ac Pseudo-automatic update of changes made by risto@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@50572 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 06:07:34 +00:00
alecf%netscape.com
aae40a4d2d nsIModule-ize addressbook
r=sspizer
no bug


git-svn-id: svn://10.0.0.236/trunk@50571 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 05:55:06 +00:00
alecf%netscape.com
53caf671cb DTDs contain image names too
git-svn-id: svn://10.0.0.236/trunk@50570 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 05:53:10 +00:00
pavlov%netscape.com
2aaf45465d take 2 static CID's out of two different functions and combine them into 1 r=alecf fixes bug #15776
git-svn-id: svn://10.0.0.236/trunk@50569 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 05:42:05 +00:00
karnaze%netscape.com
36a43a236d new regression tests, file images for others. Does not affect the build.
git-svn-id: svn://10.0.0.236/trunk@50568 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 05:40:53 +00:00
alecf%netscape.com
309ba432a9 fix makefiles to correct outdent.dif/outdent.gif typo
git-svn-id: svn://10.0.0.236/trunk@50567 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 05:35:57 +00:00
alecf%netscape.com
7f72e574c1 add another missing file
git-svn-id: svn://10.0.0.236/trunk@50566 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 05:34:24 +00:00
sspitzer%netscape.com
e3f84eb9e4 add more comments about what's left to do, and why this is a little scary.
git-svn-id: svn://10.0.0.236/trunk@50565 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 05:33:26 +00:00
mscott%netscape.com
619a993e2c make sure the user name goes into outgoing imap urls that we make
Bug #16263 --> implement NewURI so we can view embedded images!
r=sspitzer


git-svn-id: svn://10.0.0.236/trunk@50564 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 05:21:08 +00:00
mscott%netscape.com
d272bf5abd Bug #16263 --> CreateListOfMessageIDStrings should look for '?' as the delimiter used by
mime for each message part instead of '&'.
r=sspitzer


git-svn-id: svn://10.0.0.236/trunk@50563 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 05:20:14 +00:00
mscott%netscape.com
fab3227026 Bug #16263 --> make nsGetImapServer public
r=sspitzer


git-svn-id: svn://10.0.0.236/trunk@50562 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 05:19:27 +00:00
sspitzer%netscape.com
1caffddc3f whoops, forgot this wee bit of JS.
git-svn-id: svn://10.0.0.236/trunk@50561 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 05:14:16 +00:00
alecf%netscape.com
dad4df6919 remove file that's making CVS complain
git-svn-id: svn://10.0.0.236/trunk@50560 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 05:10:14 +00:00
sspitzer%netscape.com
332b7443db fix for #16264, r=mscott. migrate prefs (if we need to) when compose is opened.
also, if we have no identities, launch the account wizard so the user can create
 one.  also, cache the nsIMsgMailSession, we don't need to go through Components
[] and do a getService each time.


git-svn-id: svn://10.0.0.236/trunk@50559 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 05:09:14 +00:00
alecf%netscape.com
f347f08869 oops, missed this file because of a misspelling
fixes mac and possibly windows breakage


git-svn-id: svn://10.0.0.236/trunk@50558 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 04:41:11 +00:00
alecf%netscape.com
9083887386 update new image names in all XUL, JS, and CSS
git-svn-id: svn://10.0.0.236/trunk@50556 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 04:26:01 +00:00
sspitzer%netscape.com
7516584ad9 fix for #16262, r=mscott. now we have "Mozilla Profile Wizard" (a.k.a. -ProfileWizard) for the mac.
git-svn-id: svn://10.0.0.236/trunk@50555 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 04:21:18 +00:00
vidur%netscape.com
b1974e5540 Fix for bug 15772. Check that a content node is part of the document tree before dispatching a blur event to it. R=joki
git-svn-id: svn://10.0.0.236/trunk@50554 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 04:19:26 +00:00
alecf%netscape.com
d807cd69da get rid of old poorly cased gif file
git-svn-id: svn://10.0.0.236/trunk@50553 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 04:18:00 +00:00
alecf%netscape.com
b5cd4ed681 oops, missed this mac file
git-svn-id: svn://10.0.0.236/trunk@50552 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 04:17:04 +00:00
sspitzer%netscape.com
cb1644bdd6 fix for bug #14591, r=mscott.
handle the case where we migrate from 4.x and our sent folder is on the imap server.
but, since we haven't logged into the imap server yet, our folders are undiscovered.

other related fixes:
1) make it so on failure to fcc, save to draft, save to template, send later the message shows up.
2) clean up the error message strings
3) fix how we determine if an URI points to a local folder. (all we need to do is look at the scheme and see if it is "mailbox:"
4) remove a stale comment.


git-svn-id: svn://10.0.0.236/trunk@50551 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 04:12:06 +00:00
alecf%netscape.com
e7a07c934b export new gifs on Mac
git-svn-id: svn://10.0.0.236/trunk@50550 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 04:10:49 +00:00
alecf%netscape.com
4353d33c01 export new images on windows
r=mscott
no bug


git-svn-id: svn://10.0.0.236/trunk@50549 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 04:09:25 +00:00
alecf%netscape.com
4b07a41a74 export new gifs on unix
r=sspitzer


git-svn-id: svn://10.0.0.236/trunk@50548 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 04:08:15 +00:00
alecf%netscape.com
2475291b21 checkin new image file names
not part of build
no reviewer 'cause you can't review images :)
no bug #, just maintenance for skins a la German
all files added with -kb


git-svn-id: svn://10.0.0.236/trunk@50547 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 03:57:13 +00:00
mscott%netscape.com
928088a46d we appeared to be leaking an rdf resource. I fixed this leak by using a nsCOMPtr.
r=sspitzer


git-svn-id: svn://10.0.0.236/trunk@50546 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 03:18:32 +00:00
pollmann%netscape.com
5c5ba7aa15 Bug 16126: Check for a cached state when reading value or submitting Gfx text frame (before initialize); r=joki
git-svn-id: svn://10.0.0.236/trunk@50545 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 02:49:42 +00:00
mscott%netscape.com
2b381da127 Bug #16115 --> addref the web shell window inside it's Close method to keep the web shell window from getting
deleted out from under us. This could happen because in closing the window, we are destroying a webshell which
could have the last outstanding reference to the webshell window.
r=dp


git-svn-id: svn://10.0.0.236/trunk@50544 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 02:47:56 +00:00
cathleen%netscape.com
b0844bfd3a update windows packaging file list, bug 16144, r=ssu
git-svn-id: svn://10.0.0.236/trunk@50543 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 02:20:16 +00:00
pollmann%netscape.com
489f3fc875 Bug 15423: Check for a base href when forming the URL for an image map; r=harishd
git-svn-id: svn://10.0.0.236/trunk@50541 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 01:37:30 +00:00
valeski%netscape.com
e96f49b91f 16250. r=warren. IOService method name case changed. reflecting the new method names in the directory javascript
git-svn-id: svn://10.0.0.236/trunk@50540 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 01:36:57 +00:00
davidm%netscape.com
989168e646 8010 [FEATURE] Task Menu | Tools sub-menu items do not work
remove bogus rules
r = hangas


git-svn-id: svn://10.0.0.236/trunk@50539 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 01:25:39 +00:00
varada%netscape.com
caca355dec correcting temp node problem
git-svn-id: svn://10.0.0.236/trunk@50538 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 01:19:23 +00:00
mjudge%netscape.com
01e83014a6 bugs 15547,15645,13665,13277,5761, r=akkana,kin,hyatt. fixing selection bugs, keyboard navigation, triple clicking and drag scrolling. get position not a valid call anymore to nsIFrame.h
git-svn-id: svn://10.0.0.236/trunk@50537 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 01:16:09 +00:00
mjudge%netscape.com
dcd63f4da3 bugs 15547,15645,13665,13277,5761, r=akkana,kin,hyatt. fixing selection bugs, keyboard navigation, triple clicking and drag scrolling.
git-svn-id: svn://10.0.0.236/trunk@50536 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 01:15:26 +00:00
troy%netscape.com
5132f68d26 b=15509, r=peterl@netscape.com
If the frame has visible content that extends outside its content area,
then the view needs to be marked as having transparent content


git-svn-id: svn://10.0.0.236/trunk@50535 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 01:02:53 +00:00
pinkerton%netscape.com
9101132f9e removed some visibility/display rules that were already in xul.css. added a workaround for bug #15722 to not change the icons of the scrollbar buttons on rollover, which caused the trees that contained said scrollbars to fully reflow. (r=hyatt).
git-svn-id: svn://10.0.0.236/trunk@50534 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 01:00:05 +00:00
pollmann%netscape.com
c41e517028 Bug 15180: Don't add a Referer line to the HTTP post data, as Necko already adds one. r=harishd
git-svn-id: svn://10.0.0.236/trunk@50533 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 00:54:47 +00:00
mgleeson1%netscape.com
fc95d0c6a1 r=dougt need eol for port boxes
git-svn-id: svn://10.0.0.236/trunk@50532 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 00:50:31 +00:00
rbs%maths.uq.edu.au
6c0a9f5fc0 [MathML] Hooks to allow --enable-mathml
git-svn-id: svn://10.0.0.236/trunk@50531 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 00:46:09 +00:00
waterson%netscape.com
34e280d8c3 Fix up commentary to reflect reality; remove some confusing stylistic changes. r=bienvenu
git-svn-id: svn://10.0.0.236/trunk@50530 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 00:45:57 +00:00
briano%netscape.com
971976b8c4 Automated update
git-svn-id: svn://10.0.0.236/trunk@50529 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 00:45:14 +00:00
pinkerton%netscape.com
93aed372f7 pulled mac-specific patches to the tip in order to allow typing in the url bar in navigator to work w/out firing cmd-keybindings. (r=saari, no explicit bug number).
git-svn-id: svn://10.0.0.236/trunk@50528 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 00:44:43 +00:00
waterson%netscape.com
aa390e05d8 Fix 'commandupdater' nodes; make sure that they are hooked up correctly from the XUL content sink; factor code to appropriately deal with being called from two places. r=hyatt.
git-svn-id: svn://10.0.0.236/trunk@50527 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 00:43:46 +00:00
beard%netscape.com
1a22e3ed7e fixing image decoder leak. bug=15380, r=pnunn
git-svn-id: svn://10.0.0.236/trunk@50526 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 00:41:43 +00:00
rbs%maths.uq.edu.au
1896cfefef [MathML] Assigning @MOZ_MATHML@ to MOZ_MATHML
git-svn-id: svn://10.0.0.236/trunk@50525 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 00:39:36 +00:00
rbs%maths.uq.edu.au
410ce267d5 [MathML] Update MathML hooks
git-svn-id: svn://10.0.0.236/trunk@50524 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 00:33:17 +00:00
varada%netscape.com
fcb9e9bf51 fixes for bug #15782 to save caches
git-svn-id: svn://10.0.0.236/trunk@50523 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 00:28:59 +00:00
varada%netscape.com
37e2169b4e fix for bug #15782 to save cache file in the respective directories and also to save after each page and to save the last used config name in the default che
git-svn-id: svn://10.0.0.236/trunk@50522 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 00:28:10 +00:00
selmer%netscape.com
2e8166fd64 Added checking to ensure DLL & procedure get loaded successfully
git-svn-id: svn://10.0.0.236/trunk@50521 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 00:19:03 +00:00
selmer%netscape.com
3f42f06246 Fixed up releasing DLLs in destructor
git-svn-id: svn://10.0.0.236/trunk@50519 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 00:12:27 +00:00
cbegle%netscape.com
7519f0fc4c * removed stuff from the idl file that caused warnings
* fixed a typo that caused a warning (nsIsupports)
* fixed values of constants that caused warnings
* use a macro instead of assinging a long long value directly

r=jband


git-svn-id: svn://10.0.0.236/trunk@50518 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 00:11:21 +00:00
pinkerton%netscape.com
7062dc3e8b take a first stab at native system colors. obviously more work needs to be done to use appearance, but this will get us started. (r=sfraser, bug# 1021).
git-svn-id: svn://10.0.0.236/trunk@50517 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 00:08:17 +00:00
pinkerton%netscape.com
8c90b18f03 correctly trigger the sending of mouse_exit events when the mouse moves into the growBox. fixes a bug with gfx scrollbars in bookmarks when the window was resized. (r=sfraser, no explicit bug number).
git-svn-id: svn://10.0.0.236/trunk@50516 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 00:06:00 +00:00
selmer%netscape.com
51c5a4e65e Implemented basis for DLL functions in interpreter; fixed Reload to exit if anything follows it
git-svn-id: svn://10.0.0.236/trunk@50515 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-13 00:01:10 +00:00
norris%netscape.com
169ef88ab4 Fix following problem:
Subject:
        another getClassLoader exception
   Date:
        Tue, 12 Oct 1999 10:39:26 -0400
   From:
        Andrew Wason <aw@softcom.com>
     To:
        norris@netscape.com (Norris Boyd)
    CC:
        Howard Lin <howard@softcom.com>




Norris,

It looks like the classes the optimizer generates call
ScriptRuntime.defineFunction which calls getClassLoader.  This throws a
SecurityException.

java.security.AccessControlException: access denied
(java.lang.RuntimePermission getClassLoader )
at
java.security.AccessControlContext.checkPermission(AccessControlContext.java
, Compiled Code)
at java.security.AccessController.checkPermission(AccessController.java,
Compiled Code)
at java.lang.SecurityManager.checkPermission(SecurityManager.java, Compiled
Code)
at java.lang.Class.getClassLoader(Class.java, Compiled Code)
at
org.mozilla.javascript.ScriptRuntime.defineFunction(ScriptRuntime.java:2045)
at org.mozilla.javascript.gen.c5.initScript(order.js)
at org.mozilla.javascript.gen.c5.exec(order.js)
at org.mozilla.javascript.Context.evaluateReader(Context.java:728)
[...]



Andrew
--
Andrew Wason
SoftCom, Inc.
aw@softcom.com


git-svn-id: svn://10.0.0.236/trunk@50514 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 23:54:03 +00:00
despotdaemon%netscape.com
e0c55754d5 Pseudo-automatic update of changes made by dmose@mozilla.org.
git-svn-id: svn://10.0.0.236/trunk@50513 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 23:30:12 +00:00
kipp%netscape.com
b7194daf71 r=kin,troy; Fixed reflow bug with optimization logic to avoid measuring text (no bug #)
git-svn-id: svn://10.0.0.236/trunk@50512 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 23:29:01 +00:00
kipp%netscape.com
01e298fd41 Fixed bugs with combined-area continuing to include trimmed whitespace (wip for 12297); Added support for tracking trim for 16176)
git-svn-id: svn://10.0.0.236/trunk@50511 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 23:27:32 +00:00
kipp%netscape.com
091955e9a0 New API for bug 16176
git-svn-id: svn://10.0.0.236/trunk@50510 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 23:26:41 +00:00
kipp%netscape.com
76b98f20a7 Factored common code into a single method (UseComputedHeight)
git-svn-id: svn://10.0.0.236/trunk@50509 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 23:25:49 +00:00
kipp%netscape.com
51d691cc02 Port to new nsILineIterator api
git-svn-id: svn://10.0.0.236/trunk@50508 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 23:25:19 +00:00
kipp%netscape.com
45e857d860 Fixed bug with bounds of line-box including side margins when it shouldn't (part of 12297)
git-svn-id: svn://10.0.0.236/trunk@50507 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 23:24:51 +00:00
kipp%netscape.com
28bd74e177 r=troy; Cleaned up line-box API (prep work for bug #12297; more coming); Support new line iterator API change (#16176)
git-svn-id: svn://10.0.0.236/trunk@50505 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 23:24:22 +00:00
kipp%netscape.com
eb73055cf6 Removed silly NS_IMETHOD decls
git-svn-id: svn://10.0.0.236/trunk@50504 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 23:22:53 +00:00
kipp%netscape.com
2c17cc458b Added two new atoms to help meter large vs. small line boxes
git-svn-id: svn://10.0.0.236/trunk@50503 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 23:22:34 +00:00
kipp%netscape.com
d10b7ecd53 Removed two warnings
git-svn-id: svn://10.0.0.236/trunk@50502 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 23:21:40 +00:00
kipp%netscape.com
028e053c7f new
git-svn-id: svn://10.0.0.236/trunk@50501 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 23:20:40 +00:00
rjc%netscape.com
252f4090ad Fix VC5 build bustage.
git-svn-id: svn://10.0.0.236/trunk@50500 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 23:09:09 +00:00
idk%eng.sun.com
9599670719 Fix 16230
Call AddRef for newly created PlugletInsance
r = akhil.arora@sun.com


git-svn-id: svn://10.0.0.236/trunk@50499 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 23:01:44 +00:00
terry%mozilla.org
100e540599 Patch by Holger Schurig <holger@holger.om.org> -- rewriting and enhancing the
ability to edit components, products, and versions.  Yay!


git-svn-id: svn://10.0.0.236/trunk@50498 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 23:00:35 +00:00
mgleeson1%netscape.com
b383080e9b r=evaughan friend declaration needs to declare object is function or class (HPUX)
git-svn-id: svn://10.0.0.236/trunk@50497 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 22:58:04 +00:00
norris%netscape.com
f40460044c Fix 7254 Implement DOM security
Reviewed by mstoltz@netscape.com


git-svn-id: svn://10.0.0.236/trunk@50496 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 22:55:25 +00:00
pavlov%netscape.com
967990a454 build nsScriptableRegion.cpp on windows and linux r=pinkerton ********* WORK TO FIX BUG 12465 *********
git-svn-id: svn://10.0.0.236/trunk@50495 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 22:53:41 +00:00
norris%netscape.com
120ec26f3b Work on 15824 bad refcounting in nsCodebasePrincipal
Attempt to discover problem with additional assertions
reviewed by mstoltz@netscape.com


git-svn-id: svn://10.0.0.236/trunk@50494 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 22:52:49 +00:00
norris%netscape.com
f686bba5d8 Fix part of 5403 Services improperly released: Use NS_WITH_SERVICE
reviewed by mstoltz@netscape.com


git-svn-id: svn://10.0.0.236/trunk@50493 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 22:51:54 +00:00
norris%netscape.com
1d1cd2baaf Fix unix build warning.
Reviewed by rogerl@netscape.com.


git-svn-id: svn://10.0.0.236/trunk@50492 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 22:48:17 +00:00
dougt%netscape.com
b6030ceac7 adding default constructor (mac compiler blues)
git-svn-id: svn://10.0.0.236/trunk@50491 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 22:47:50 +00:00
norris%netscape.com
258a2a6d4a Needed for 7254: Implement DOM security
reviewed by Ben Goodger <rgoodger@ihug.co.nz> and Seth Spitzer <sspitzer@netscape.com>

Scripts running from chrome are considered super privileged and can perform operations that
scripts from the web cannot. I differentiate chrome scripts from web
scripts by considering all scripts loaded from chrome: URIs to be
privileged.

The problem I'm running into is that the loading of relative urls in
this code ends up going to the file: protocol (which is what the chrome
protocol is converted to internally). This change makes sure we load
from the chrome protocol so that the scripts are privileged and don't
get access errors. It's probably a good idea to load from the chrome
protocol anyway since it may one day be resolved to extracting from a
JAR file rather than accessing a discrete file.


git-svn-id: svn://10.0.0.236/trunk@50490 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 22:47:36 +00:00
dougt%netscape.com
2f38d972f2 adding default constructor (mac compilers blues)
git-svn-id: svn://10.0.0.236/trunk@50489 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 22:46:49 +00:00
kmcclusk%netscape.com
afe30290c8 Set state of checkbox and Radio button on MouseUp instead of MouseDown so JavaScript onclick
event handlers can retreive the correct state of the form element. bug 15366; r=rods@netscape.com

Submit the form when a text field is clicked on only if the JavaScript event handler
has not consumed the event. bug 15949; r=rods@netscape.com


git-svn-id: svn://10.0.0.236/trunk@50488 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 22:44:23 +00:00
wtc%netscape.com
19cd8f1747 Backed out previous revision, which was checked in during code freeze.
git-svn-id: svn://10.0.0.236/trunk@50486 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 22:37:13 +00:00
cyeh%netscape.com
3ee2fa81c3 add support for megahal conversation ai, fix syntax error for sending
stock reports to the original requestor.


git-svn-id: svn://10.0.0.236/trunk@50485 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 22:34:49 +00:00
dougt%netscape.com
2ebb109791 changing the entrypoint to call another constructor. I need this since I have
removed an unneeded constructor.  related bug 13724. r=brendan@meer.net


git-svn-id: svn://10.0.0.236/trunk@50484 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 22:32:10 +00:00
dougt%netscape.com
8344cba9ee Added a nested event loop instead of blocking during sync calls. Partial fix
for bug 13724.  (I still must remove ifdef's for the autoproxy code.)
r=brendan@meer.net.


git-svn-id: svn://10.0.0.236/trunk@50483 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 22:29:43 +00:00
rjc%netscape.com
7c82b0b5f1 [performance] When profile manager is being used, don't read in bookmarks twice... by deferring hiddenwindow.xul loading until after profile manager is done. Review: danm and sspitzer
git-svn-id: svn://10.0.0.236/trunk@50482 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 22:20:28 +00:00
kmcclusk%netscape.com
1f838ed9cc Backing out change made while tree was closed
git-svn-id: svn://10.0.0.236/trunk@50481 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 22:07:24 +00:00
kmcclusk%netscape.com
288ad892dc Backing out changes made while tree was closed.
git-svn-id: svn://10.0.0.236/trunk@50480 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 22:01:49 +00:00
norris%netscape.com
0067ebd9f5 Remove redundant import.
git-svn-id: svn://10.0.0.236/trunk@50479 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 21:46:50 +00:00
kmcclusk%netscape.com
3ed94d5f1f Set state of checkbox and Radio button on MouseUp instead of MouseDown so JavaScript onclick
event handlers can retreive the correct state of the form element. bug 15366; r=rods@netscape.com

Submit the form when a text field is clicked on only if the JavaScript event handler
has not consumed the event. bug 15949; r=rods@netscape.com


git-svn-id: svn://10.0.0.236/trunk@50478 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 21:42:31 +00:00
evaughan%netscape.com
74de522d21 Fixed mail/news regression. Code review Saari, Hyatt
git-svn-id: svn://10.0.0.236/trunk@50476 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 20:50:01 +00:00
selmer%netscape.com
318689d640 Top level makefile
git-svn-id: svn://10.0.0.236/trunk@50474 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 20:36:42 +00:00
terry%mozilla.org
06a85f06f3 Patch by Holger Schurig <holger@holger.om.org> -- If there is no exactly ONE
user in the profiles table, then this user will be promoted into all groups.


git-svn-id: svn://10.0.0.236/trunk@50473 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 20:28:41 +00:00
beard%netscape.com
fa0386eb21 printing stack crawls with LXR URLs.
git-svn-id: svn://10.0.0.236/trunk@50472 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 18:59:52 +00:00
dmose%mozilla.org
980b8b883b not used on the trunk; the space in the file name is causing script problems. r=smfr@netscape.com, a=leaf@mozilla.org
git-svn-id: svn://10.0.0.236/trunk@50471 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 18:32:04 +00:00
selmer%netscape.com
b237b4f45e Split interpret into its own class
git-svn-id: svn://10.0.0.236/trunk@50470 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 18:31:05 +00:00
terry%mozilla.org
e5bf02a97b newer alphas of MySQL won't let use "when" as a column name, so let's change
our usage while it's still easy to do so.


git-svn-id: svn://10.0.0.236/trunk@50469 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 18:05:42 +00:00
slamm%netscape.com
ffbff9e7c8 Forgot a semicolon and that caused the creation of bogus files. a=leaf. Thanks to jim_nance@yahoo.com for pointing out the problem.
git-svn-id: svn://10.0.0.236/trunk@50468 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 17:05:05 +00:00
terry%mozilla.org
f07d66246d Patch by Holger Schurig <holgerschurig@nikocity.de> -- replace all the
yicky old make*.sh files and the CHANGES file with a new, nifty
checksetup.pl file that knows how to create a setup from scratch as
well as upgrade an older setup to a new one.  Very cool stuff!


git-svn-id: svn://10.0.0.236/trunk@50467 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 16:58:11 +00:00
terry%mozilla.org
6c6ce1b3d7 Patch by tom@platte.com (Tom Schutter) -- wasn't working if no groups
had isbuggroup set.


git-svn-id: svn://10.0.0.236/trunk@50466 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 16:52:25 +00:00
norris%netscape.com
c813db9f21 Fix release date, add contributor.
git-svn-id: svn://10.0.0.236/trunk@50465 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 16:52:13 +00:00
karnaze%netscape.com
eb1e3503ae new regression test.
git-svn-id: svn://10.0.0.236/trunk@50464 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 14:50:38 +00:00
Jerry.Kirk%Nexwarecorp.com
f62900eb59 Fixed syntax error which caused invalidation not to work when logging
was turned off.
Bug# 16169 r=Dale.Stansberry@Nexwarecorp.com


git-svn-id: svn://10.0.0.236/trunk@50463 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 14:39:32 +00:00
neeti%netscape.com
0e926140f9 updating status
git-svn-id: svn://10.0.0.236/trunk@50462 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 13:38:23 +00:00
neeti%netscape.com
639989c1df Converted to nsIModule to prepare for memory leaks fixing. Bug# 14034. r=waterson
git-svn-id: svn://10.0.0.236/trunk@50461 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 13:33:42 +00:00
dcone%netscape.com
78accf0d1a fixed the CreateRenderingContext call in nsDeviceContext to get rid of warnings. CR by KMcclusk.
git-svn-id: svn://10.0.0.236/trunk@50460 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 13:32:34 +00:00
briano%netscape.com
d7505330dd Automated update
git-svn-id: svn://10.0.0.236/trunk@50459 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 12:52:20 +00:00
cls%seawood.org
b166fe020d Converting patches applied for bug 15241 into a build option, --enable-implicit-archive, that is off by default.
r=syd


git-svn-id: svn://10.0.0.236/trunk@50458 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 12:36:07 +00:00
briano%netscape.com
55f10b405f Automated update
git-svn-id: svn://10.0.0.236/trunk@50457 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 11:52:18 +00:00
ramiro%netscape.com
8bcbaf642c Fix for bug 16163. Usage of -liberty to demangle symbols breaks on loser
linux distributions.  I changed configure.in to detect this lib before using
it.  You can stop whinning now thank you.  r=syd@netscape.com.


git-svn-id: svn://10.0.0.236/trunk@50456 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 11:42:56 +00:00
warren%netscape.com
a5420e53d5 Fixed nsnull problem!
git-svn-id: svn://10.0.0.236/trunk@50455 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 11:21:26 +00:00
terry%mozilla.org
611923e583 Updating the vote cache should not update the date-last-changed field
in the bug.


git-svn-id: svn://10.0.0.236/trunk@50454 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 11:18:29 +00:00
warren%netscape.com
4e84b82b51 Fixed return value for non-debug builds.
git-svn-id: svn://10.0.0.236/trunk@50453 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 10:27:40 +00:00
warren%netscape.com
865a79a1b5 Added Bloat statistics under QA menu.
git-svn-id: svn://10.0.0.236/trunk@50452 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 09:37:37 +00:00
warren%netscape.com
5e7fed7a2f Added about:bloat
git-svn-id: svn://10.0.0.236/trunk@50451 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 09:35:22 +00:00
warren%netscape.com
ed816f5fa6 added files: mozilla/netwerk/protocol/about/src/nsAboutBloat.cpp
git-svn-id: svn://10.0.0.236/trunk@50450 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 09:32:18 +00:00
warren%netscape.com
da470df1ca Added nsTraceRefcnt logging.
git-svn-id: svn://10.0.0.236/trunk@50449 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 09:30:16 +00:00
warren%netscape.com
4ff5cdca2a Made nsTraceRefcnt output write to streams.
git-svn-id: svn://10.0.0.236/trunk@50448 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 09:30:12 +00:00
warren%netscape.com
991d518e3e removed files: mozilla/netwerk/protocol/about/src/nsAboutBloat.cpp
git-svn-id: svn://10.0.0.236/trunk@50447 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 09:26:38 +00:00
warren%netscape.com
d8984b315e added files: mozilla/netwerk/protocol/about/src/nsAboutBloat.cpp
git-svn-id: svn://10.0.0.236/trunk@50446 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 09:25:14 +00:00
warren%netscape.com
c5fccc649e Added about:bloat handler.
git-svn-id: svn://10.0.0.236/trunk@50445 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 09:20:25 +00:00
pollmann%netscape.com
419cb327c4 Bug 15841: Don't default to selecting item 0 of a listbox
Bug 15769: Default select item 0 when adding or removing opt to combo
r=harishd


git-svn-id: svn://10.0.0.236/trunk@50444 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 08:47:29 +00:00
pollmann%netscape.com
7860787b10 Bug 15769: Default select item 0 when adding or removing opt to combo
r=harishd


git-svn-id: svn://10.0.0.236/trunk@50443 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 08:47:22 +00:00
mscott%netscape.com
ccf37b21ec Remove this file from the repository to fix the Mac buids.
The mac projects were looking in this folder and always finding the
stale nsISessionHistory.h file instead of using the idl generated
header file
r=davidm


git-svn-id: svn://10.0.0.236/trunk@50442 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 07:50:17 +00:00
mcafee%netscape.com
0ba95a928f Applying patch from buhr@stat.wisc.edu. Fixes destination widget confusion (14759). Unix-only, a=mscott
git-svn-id: svn://10.0.0.236/trunk@50441 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 07:26:47 +00:00
radha%netscape.com
569c87328e Build bustage in solaris
git-svn-id: svn://10.0.0.236/trunk@50440 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 05:57:03 +00:00
mscott%netscape.com
941d2435ba nsISessionHistory.idl needs to be in this project.
i think this should fix Radha' build breakage for the mac.


git-svn-id: svn://10.0.0.236/trunk@50439 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 05:45:10 +00:00
mcafee%netscape.com
68944c6b5c Adding debug Pref UI for evaughan's gfx scrollbars. r=waterson
git-svn-id: svn://10.0.0.236/trunk@50438 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 05:40:15 +00:00
sfraser%netscape.com
1122546a7f Fix for bug 16151; make the file transport working thread stack size 64k, instead of 8k. Fixes crashes on startup on Mac. r=beard
git-svn-id: svn://10.0.0.236/trunk@50437 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 05:39:18 +00:00
jefft%netscape.com
b77b7f8e29 removed files: mozilla/mailnews/compose/src/nsMsgI18N.cpp
git-svn-id: svn://10.0.0.236/trunk@50436 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 05:24:48 +00:00
jefft%netscape.com
1eb33cb46e added files: mozilla/mailnews/base/util/nsMsgI18N.cpp
git-svn-id: svn://10.0.0.236/trunk@50435 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 05:21:21 +00:00
jefft%netscape.com
c0fbb70022 fixed bug 15676 - Display problem in Subject header with non-ascii when Forwarding; decode the subject string based on character prior setting it to nsMsgComposeFields; move nsMsgI18N.h, nsMsgI18N.cpp from compose/src to base/util; r=rhp, nhotta
git-svn-id: svn://10.0.0.236/trunk@50434 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 05:18:27 +00:00
mscott%netscape.com
ec97378850 Bug #15655 --> don't build old nsMimeFactory. Build nsMimeModule instead.
r=rhp


git-svn-id: svn://10.0.0.236/trunk@50433 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 05:05:17 +00:00
mscott%netscape.com
df2bf72c59 Bug #15655 -> build nsMimeModule.cp
r=rhp


git-svn-id: svn://10.0.0.236/trunk@50432 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 05:04:41 +00:00
mscott%netscape.com
7527b7b206 bug #15655 --> no longer build nsMimeFactory.cpp...we build
nsMimeModule instead.
r=rhp


git-svn-id: svn://10.0.0.236/trunk@50431 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 05:04:25 +00:00
mscott%netscape.com
a252dee761 include nsMsgMimeCID.h to get the CID. (moved CID out of interface)
r=rhp


git-svn-id: svn://10.0.0.236/trunk@50430 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 05:03:49 +00:00
mscott%netscape.com
05ab0a848d Bug #15655 module for mime. (replaces nsMimeFactory.cpp)
remove NS_New** factory method. minor cleanup
r=rhp


git-svn-id: svn://10.0.0.236/trunk@50429 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 05:03:25 +00:00
mscott%netscape.com
d0cd134272 Bug #15655 module for mime. (replaces nsMimeFactory.cpp)
r=rhp


git-svn-id: svn://10.0.0.236/trunk@50428 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 05:03:05 +00:00
mscott%netscape.com
e89f59cad5 Bug #15655 new file. module for mime. (replaces nsMimeFactory.cpp)
r=rhp


git-svn-id: svn://10.0.0.236/trunk@50427 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 05:02:23 +00:00
rbs%maths.uq.edu.au
dd050726f8 [MathML] Updates and initial landing of the example mixing.xml to illustrate how to mix MathML with other markups
git-svn-id: svn://10.0.0.236/trunk@50426 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 05:00:32 +00:00
rbs%maths.uq.edu.au
02f74ae132 [MathML] Removing unecessary #include of header files
git-svn-id: svn://10.0.0.236/trunk@50425 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 04:53:41 +00:00
rbs%maths.uq.edu.au
a017529e6b [MathML] Additional missing hooks
git-svn-id: svn://10.0.0.236/trunk@50424 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 04:47:55 +00:00
rbs%maths.uq.edu.au
7083308cff [MathML] Removing unecessary #include of header files
git-svn-id: svn://10.0.0.236/trunk@50423 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 04:42:15 +00:00
waterson%netscape.com
6430228b19 Add nsScrollPortView.cpp to the build to get around undefined symbols at startup: looks like it got missed on Unix.
git-svn-id: svn://10.0.0.236/trunk@50422 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 04:41:07 +00:00
radha%netscape.com
7ba4c213b3 XPIDLising session history. bug # 15437. r=law
git-svn-id: svn://10.0.0.236/trunk@50421 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 04:40:59 +00:00
rbs%maths.uq.edu.au
84470b2c93 [MathML] Portability: adding explicit get() on pointers coming from nsCOMPtr
git-svn-id: svn://10.0.0.236/trunk@50420 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 04:38:21 +00:00
radha%netscape.com
270ce881b4 XPIDised session history. Corresponding changes to users of nsISessionHistory.
Bug # 15437. r=law


git-svn-id: svn://10.0.0.236/trunk@50419 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 04:37:43 +00:00
cls%seawood.org
173cc583c1 Temp fix for the dependency problem caused by the use of implicit shared libs. a=leaf
git-svn-id: svn://10.0.0.236/trunk@50418 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 03:42:02 +00:00
idk%eng.sun.com
651e1ddd8a Bug <a href=http://bugzilla.mozilla.org/show_bug.cgi?id=15892> 15892 </a>
increment pointer to  mime description string before calling strchr


git-svn-id: svn://10.0.0.236/trunk@50417 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 03:29:27 +00:00
waterson%netscape.com
30e53d03e9 Bug 16105. (Bugsplat 366256.) Ensure that nsISupports::Release() calls dtor only once by 'stabilizing' refcnt to a non-zero value before invoking the dtor. See also news://news.mozilla.org/37FD0F3C.3078AE5C%40netscape.com. r=scc,fur
git-svn-id: svn://10.0.0.236/trunk@50416 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 03:05:10 +00:00
warren%netscape.com
0a71bb415f Fixed missed GetFileSpec
git-svn-id: svn://10.0.0.236/trunk@50415 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 02:35:00 +00:00
rbs%maths.uq.edu.au
daf51ae193 Revamp of the architecture for stretchy symbols so that nsMathMLChar only deals with the atomic stretchy task.
git-svn-id: svn://10.0.0.236/trunk@50414 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 02:12:36 +00:00
waterson%netscape.com
e20da712ec Bug 16105. (Bugsplat 366256.) Ensure that nsISupports::Release() calls dtor only once by 'stabilizing' refcnt to a non-zero value before invoking the dtor. See also news://news.mozilla.org/37FD0F3C.3078AE5C%40netscape.com. r=scc,fur
git-svn-id: svn://10.0.0.236/trunk@50413 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 02:10:08 +00:00
alecf%netscape.com
a4d81273ff upating status
git-svn-id: svn://10.0.0.236/trunk@50412 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 02:07:13 +00:00
rbs%maths.uq.edu.au
931605d622 Removing a duplicate reference to a src file
git-svn-id: svn://10.0.0.236/trunk@50411 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 02:06:05 +00:00
rbs%maths.uq.edu.au
ba241132ea Removing a typedef and adding a new NS_MATHML_OPERATOR_MUTABLE flag
git-svn-id: svn://10.0.0.236/trunk@50409 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 01:58:27 +00:00
selmer%netscape.com
36bb330940 Created new Interpret.cpp & CInterpret class
git-svn-id: svn://10.0.0.236/trunk@50408 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 01:54:00 +00:00
rbs%maths.uq.edu.au
328d62f08f [MathML] removing registration hooks. They are now handled by nsLayoutModule.
git-svn-id: svn://10.0.0.236/trunk@50407 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 01:48:05 +00:00
warren%netscape.com
6a952509ef Lowercased idl method names for scriptability. Cleaned up nsIURL interface.
git-svn-id: svn://10.0.0.236/trunk@50406 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 01:39:37 +00:00
peterl%netscape.com
3295631735 store system colors as int rather than enums
return proper result code when setting system color
r=rods


git-svn-id: svn://10.0.0.236/trunk@50405 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 01:31:33 +00:00
slamm%netscape.com
f12855c796 Remove extra 'mozilla/' in cvsblame'd source link.
git-svn-id: svn://10.0.0.236/trunk@50404 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 01:25:47 +00:00
rbs%maths.uq.edu.au
121acfa205 [MathML] Setting a bolean to PR_TRUE to allow generated pseudo content (e.g., :before, :after) in MathML.
git-svn-id: svn://10.0.0.236/trunk@50403 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 01:19:34 +00:00
cathleen%netscape.com
01eb918031 fix mac packager list, bug 16141, r=ssu
git-svn-id: svn://10.0.0.236/trunk@50402 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 01:11:42 +00:00
selmer%netscape.com
63d606d58f Fix up inclusions of headers
git-svn-id: svn://10.0.0.236/trunk@50401 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:56:51 +00:00
pavlov%netscape.com
8f331211d9 fix cursor blinking on linux r=ramiro
git-svn-id: svn://10.0.0.236/trunk@50400 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:44:07 +00:00
alecf%netscape.com
e2e17b4ff5 finish landing nsIModule for compose
this and my last checkin r=sspizter
no bug, porkjockey work


git-svn-id: svn://10.0.0.236/trunk@50399 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:37:39 +00:00
alecf%netscape.com
d5785373e3 land nsIModule for mail compose
git-svn-id: svn://10.0.0.236/trunk@50398 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:34:06 +00:00
peterl%netscape.com
1299fd6c0b better result code testing in recreate frames for content
part of fix for 14134
r=pierre


git-svn-id: svn://10.0.0.236/trunk@50397 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:32:13 +00:00
peterl%netscape.com
7021f197de added ignore value to user-focus
r=hyatt


git-svn-id: svn://10.0.0.236/trunk@50396 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:30:54 +00:00
peterl%netscape.com
df37832d89 added 'ignore' keyword
r=hyatt


git-svn-id: svn://10.0.0.236/trunk@50395 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:30:19 +00:00
warren%netscape.com
6d83d361f0 Fixed bloat snapshotting capabilities. r=kipp
git-svn-id: svn://10.0.0.236/trunk@50394 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:29:54 +00:00
warren%netscape.com
93c11dbc7d Added NS_LOG_RELEASE for bloat stats. r=kmcclusk
git-svn-id: svn://10.0.0.236/trunk@50393 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:28:14 +00:00
ssu%netscape.com
6a84236160 fixing bug #16095. apprunner.exe got renamed to mozilla.exe. This fix updates the installer to create the proper windows shortcut. Not part of tinderbox. r=dbragg@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50392 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:23:37 +00:00
peterl%netscape.com
8b985c46d4 fix return type for append reflow command (was returning PRBool for nsresult)
part of fix for 14134
r=pierre


git-svn-id: svn://10.0.0.236/trunk@50391 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:23:10 +00:00
peterl%netscape.com
bd0a1b5cb4 dont strip multiple changes with nsnull frames
part of fix for 14134
r=pierre


git-svn-id: svn://10.0.0.236/trunk@50390 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:22:18 +00:00
peterl%netscape.com
b765a3d4c4 add 'ignore' to user focus
r=hyatt


git-svn-id: svn://10.0.0.236/trunk@50389 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:21:06 +00:00
dougt%netscape.com
06ac17fb62 fixes bug 15709. r=dveditz.
git-svn-id: svn://10.0.0.236/trunk@50388 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:20:23 +00:00
evaughan%netscape.com
4dbf02b9bd added files: mozilla/view/src/nsScrollPortView.cpp
git-svn-id: svn://10.0.0.236/trunk@50387 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:16:34 +00:00
sspitzer%netscape.com
da4d6e495b fix for #16098, r=mscott. Now we have "Mozilla Profile Manager" for the mac, which is the same as -ProfileManager on the other platforms
git-svn-id: svn://10.0.0.236/trunk@50386 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:16:31 +00:00
evaughan%netscape.com
b6c93b5c5c Integrated Gfx scrollbars.
git-svn-id: svn://10.0.0.236/trunk@50385 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:16:06 +00:00
mscott%netscape.com
6d6b3023f8 support nsIStreamObserver to get rid of an assert in necko.
r=sspitzer


git-svn-id: svn://10.0.0.236/trunk@50384 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:13:45 +00:00
cbegle%netscape.com
d31b3296a7 new files.
new tests for xpconnect.  r=jband.


git-svn-id: svn://10.0.0.236/trunk@50383 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:12:43 +00:00
varada%netscape.com
bb0622beb7 changing minlen and maxlen in edit fields
git-svn-id: svn://10.0.0.236/trunk@50382 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:12:10 +00:00
alecf%netscape.com
342865f5fe was not setting the "type" attribute during CreateIncomingServer
fixes #16075
r=sspitzer


git-svn-id: svn://10.0.0.236/trunk@50381 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:07:14 +00:00
varada%netscape.com
e6f4dfa6bc bug #5958 validating entering of characters in the newconfigdialog edit fields
git-svn-id: svn://10.0.0.236/trunk@50380 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:05:38 +00:00
kmcclusk%netscape.com
f52acaed14 Implemented nsRenderingContextWin::CopyClipRegion. bug 13913; r=rods@netscape.com
git-svn-id: svn://10.0.0.236/trunk@50379 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:05:04 +00:00
ducarroz%netscape.com
888a71ee23 Fix for bug 15235 & 14785. I checkin this for jefft. Messages need to be save using platform specific line break. R=ducarroz
git-svn-id: svn://10.0.0.236/trunk@50378 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-12 00:03:17 +00:00
kmcclusk%netscape.com
90932ba7f3 Changed WIN32 windows style from WS_EX_CLIENTEDGEto WS_EX_WINDOWEDGE to
stop drawing client windows sunken. bug=15151; r=rods@netscape.com


git-svn-id: svn://10.0.0.236/trunk@50377 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 23:56:55 +00:00
rods%netscape.com
b845870367 changed fonts for select and optgroup to match r=kmcclusk b=12230
git-svn-id: svn://10.0.0.236/trunk@50376 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 23:48:41 +00:00
varada%netscape.com
c3b9e376e5 fix to bug #15339- added SetForegroundWindowin the OnSetActive code in the wizardui.cpp
git-svn-id: svn://10.0.0.236/trunk@50375 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 23:47:49 +00:00
nhotta%netscape.com
59ee43f7fc Adding a new interface which does a charset conversion plus NE and NCR for fallback. Part of bug fix #8865, r=ftang.
git-svn-id: svn://10.0.0.236/trunk@50374 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 23:47:27 +00:00
rods%netscape.com
a30fed502d removed css system color references (not implemented on Mac yet)
changed all checkbox borders to 2 pixels r=kmcclusk b=13854


git-svn-id: svn://10.0.0.236/trunk@50373 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 23:44:36 +00:00
nisheeth%netscape.com
d65bc1efa0 We now use the new RAPTOR_STOPWATCH_DEBUGTRACE macro to annotate all manipulations of the timers.
git-svn-id: svn://10.0.0.236/trunk@50372 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 23:42:56 +00:00
nisheeth%netscape.com
932343b896 Changes not part of build. We now use the new RAPTOR_STOPWATCH_DEBUGTRACE macro to annotate all manipulations of the timers.
git-svn-id: svn://10.0.0.236/trunk@50371 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 23:33:14 +00:00
nisheeth%netscape.com
4443e74058 Changes not part of build. Added a debug trace macro that outputs to the console only when DEBUG_STOPWATCH is defined.
git-svn-id: svn://10.0.0.236/trunk@50370 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-11 23:30:45 +00:00
1380 changed files with 54442 additions and 133490 deletions

View File

@@ -0,0 +1,617 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsAVLTree.h"
enum eLean {eLeft,eNeutral,eRight};
struct NS_COM nsAVLNode {
public:
nsAVLNode(void* aValue) {
mLeft=0;
mRight=0;
mSkew=eNeutral;
mValue=aValue;
}
nsAVLNode* mLeft;
nsAVLNode* mRight;
eLean mSkew;
void* mValue;
};
/************************************************************
Now begin the tree class. Don't forget that the comparison
between nodes must occur via the comparitor function,
otherwise all you're testing is pointer addresses.
************************************************************/
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
nsAVLTree::nsAVLTree(nsAVLNodeComparitor& aComparitor,
nsAVLNodeFunctor* aDeallocator) :
mComparitor(aComparitor), mDeallocator(aDeallocator) {
mRoot=0;
mCount=0;
}
static void
avlDeleteTree(nsAVLNode* aNode){
if (aNode) {
avlDeleteTree(aNode->mLeft);
avlDeleteTree(aNode->mRight);
delete aNode;
}
}
/**
*
* @update gess12/27/98
* @param
* @return
*/
nsAVLTree::~nsAVLTree(){
if (mDeallocator) {
ForEachDepthFirst(*mDeallocator);
}
avlDeleteTree(mRoot);
}
class CDoesntExist: public nsAVLNodeFunctor {
public:
CDoesntExist(const nsAVLTree& anotherTree) : mOtherTree(anotherTree) {
}
virtual void* operator()(void* anItem) {
void* result=mOtherTree.FindItem(anItem);
if(result)
return nsnull;
return anItem;
}
protected:
const nsAVLTree& mOtherTree;
};
/**
* This method compares two trees (members by identity).
* @update gess12/27/98
* @param tree to compare against
* @return true if they are identical (contain same stuff).
*/
PRBool nsAVLTree::operator==(const nsAVLTree& aCopy) const{
CDoesntExist functor(aCopy);
void* theItem=FirstThat(functor);
PRBool result=PRBool(!theItem);
return result;
}
/**
*
* @update gess12/27/98
* @param
* @return
*/
static void
avlRotateRight(nsAVLNode*& aRootNode){
nsAVLNode* ptr2;
nsAVLNode* ptr3;
ptr2=aRootNode->mRight;
if(ptr2->mSkew==eRight) {
aRootNode->mRight=ptr2->mLeft;
ptr2->mLeft=aRootNode;
aRootNode->mSkew=eNeutral;
aRootNode=ptr2;
}
else {
ptr3=ptr2->mLeft;
ptr2->mLeft=ptr3->mRight;
ptr3->mRight=ptr2;
aRootNode->mRight=ptr3->mLeft;
ptr3->mLeft=aRootNode;
if(ptr3->mSkew==eLeft)
ptr2->mSkew=eRight;
else ptr2->mSkew=eNeutral;
if(ptr3->mSkew==eRight)
aRootNode->mSkew=eLeft;
else aRootNode->mSkew=eNeutral;
aRootNode=ptr3;
}
aRootNode->mSkew=eNeutral;
return;
}
/**
*
* @update gess12/27/98
* @param
* @return
*/
static void
avlRotateLeft(nsAVLNode*& aRootNode){
nsAVLNode* ptr2;
nsAVLNode* ptr3;
ptr2=aRootNode->mLeft;
if(ptr2->mSkew==eLeft) {
aRootNode->mLeft=ptr2->mRight;
ptr2->mRight=aRootNode;
aRootNode->mSkew=eNeutral;
aRootNode=ptr2;
}
else {
ptr3=ptr2->mRight;
ptr2->mRight=ptr3->mLeft;
ptr3->mLeft=ptr2;
aRootNode->mLeft=ptr3->mRight;
ptr3->mRight=aRootNode;
if(ptr3->mSkew==eRight)
ptr2->mSkew=eLeft;
else ptr2->mSkew=eNeutral;
if(ptr3->mSkew==eLeft)
aRootNode->mSkew=eRight;
else aRootNode->mSkew=eNeutral;
aRootNode=ptr3;
}
aRootNode->mSkew=eNeutral;
return;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
static eAVLStatus
avlInsert(nsAVLNode*& aRootNode, nsAVLNode* aNewNode,
nsAVLNodeComparitor& aComparitor) {
eAVLStatus result=eAVL_unknown;
if(!aRootNode) {
aRootNode = aNewNode;
return eAVL_ok;
}
if(aNewNode==aRootNode->mValue) {
return eAVL_duplicate;
}
PRInt32 theCompareResult=aComparitor(aRootNode->mValue,aNewNode->mValue);
if(0 < theCompareResult) { //if(anItem<aRootNode->mValue)
result=avlInsert(aRootNode->mLeft,aNewNode,aComparitor);
if(eAVL_ok==result) {
switch(aRootNode->mSkew){
case eLeft:
avlRotateLeft(aRootNode);
result=eAVL_fail;
break;
case eRight:
aRootNode->mSkew=eNeutral;
result=eAVL_fail;
break;
case eNeutral:
aRootNode->mSkew=eLeft;
break;
} //switch
}//if
} //if
else {
result=avlInsert(aRootNode->mRight,aNewNode,aComparitor);
if(eAVL_ok==result) {
switch(aRootNode->mSkew){
case eLeft:
aRootNode->mSkew=eNeutral;
result=eAVL_fail;
break;
case eRight:
avlRotateRight(aRootNode);
result=eAVL_fail;
break;
case eNeutral:
aRootNode->mSkew=eRight;
break;
} //switch
}
} //if
return result;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
static void
avlBalanceLeft(nsAVLNode*& aRootNode, PRBool& delOk){
nsAVLNode* ptr2;
nsAVLNode* ptr3;
eLean balnc2;
eLean balnc3;
switch(aRootNode->mSkew){
case eLeft:
ptr2=aRootNode->mLeft;
balnc2=ptr2->mSkew;
if(balnc2!=eRight) {
aRootNode->mLeft=ptr2->mRight;
ptr2->mRight=aRootNode;
if(balnc2==eNeutral){
aRootNode->mSkew=eLeft;
ptr2->mSkew=eRight;
delOk=PR_FALSE;
}
else{
aRootNode->mSkew=eNeutral;
ptr2->mSkew=eNeutral;
}
aRootNode=ptr2;
}
else{
ptr3=ptr2->mRight;
balnc3=ptr3->mSkew;
ptr2->mRight=ptr3->mLeft;
ptr3->mLeft=ptr2;
aRootNode->mLeft=ptr3->mRight;
ptr3->mRight=aRootNode;
if(balnc3==eRight) {
ptr2->mSkew=eLeft;
}
else {
ptr2->mSkew=eNeutral;
}
if(balnc3==eLeft) {
aRootNode->mSkew=eRight;
}
else {
aRootNode->mSkew=eNeutral;
}
aRootNode=ptr3;
ptr3->mSkew=eNeutral;
}
break;
case eRight:
aRootNode->mSkew=eNeutral;
break;
case eNeutral:
aRootNode->mSkew=eLeft;
delOk=PR_FALSE;
break;
}//switch
return;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
static void
avlBalanceRight(nsAVLNode*& aRootNode, PRBool& delOk){
nsAVLNode* ptr2;
nsAVLNode* ptr3;
eLean balnc2;
eLean balnc3;
switch(aRootNode->mSkew){
case eLeft:
aRootNode->mSkew=eNeutral;
break;
case eRight:
ptr2=aRootNode->mRight;
balnc2=ptr2->mSkew;
if(balnc2!=eLeft) {
aRootNode->mRight=ptr2->mLeft;
ptr2->mLeft=aRootNode;
if(balnc2==eNeutral){
aRootNode->mSkew=eRight;
ptr2->mSkew=eLeft;
delOk=PR_FALSE;
}
else{
aRootNode->mSkew=eNeutral;
ptr2->mSkew=eNeutral;
}
aRootNode=ptr2;
}
else{
ptr3=ptr2->mLeft;
balnc3=ptr3->mSkew;
ptr2->mLeft=ptr3->mRight;
ptr3->mRight=ptr2;
aRootNode->mRight=ptr3->mLeft;
ptr3->mLeft=aRootNode;
if(balnc3==eLeft) {
ptr2->mSkew=eRight;
}
else {
ptr2->mSkew=eNeutral;
}
if(balnc3==eRight) {
aRootNode->mSkew=eLeft;
}
else {
aRootNode->mSkew=eNeutral;
}
aRootNode=ptr3;
ptr3->mSkew=eNeutral;
}
break;
case eNeutral:
aRootNode->mSkew=eRight;
delOk=PR_FALSE;
break;
}//switch
return;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
static eAVLStatus
avlRemoveChildren(nsAVLNode*& aRootNode,nsAVLNode*& anotherNode, PRBool& delOk){
eAVLStatus result=eAVL_ok;
if(!anotherNode->mRight){
aRootNode->mValue=anotherNode->mValue; //swap
anotherNode=anotherNode->mLeft;
delOk=PR_TRUE;
}
else{
avlRemoveChildren(aRootNode,anotherNode->mRight,delOk);
if(delOk)
avlBalanceLeft(anotherNode,delOk);
}
return result;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
static eAVLStatus
avlRemove(nsAVLNode*& aRootNode, void* anItem, PRBool& delOk,
nsAVLNodeComparitor& aComparitor){
eAVLStatus result=eAVL_ok;
if(!aRootNode)
delOk=PR_FALSE;
else {
PRInt32 cmp=aComparitor(anItem,aRootNode->mValue);
if(cmp<0){
avlRemove(aRootNode->mLeft,anItem,delOk,aComparitor);
if(delOk)
avlBalanceRight(aRootNode,delOk);
}
else if(cmp>0){
avlRemove(aRootNode->mRight,anItem,delOk,aComparitor);
if(delOk)
avlBalanceLeft(aRootNode,delOk);
}
else{ //they match...
nsAVLNode* temp=aRootNode;
if(!aRootNode->mRight) {
aRootNode=aRootNode->mLeft;
delOk=PR_TRUE;
delete temp;
}
else if(!aRootNode->mLeft) {
aRootNode=aRootNode->mRight;
delOk=PR_TRUE;
delete temp;
}
else {
avlRemoveChildren(aRootNode,aRootNode->mLeft,delOk);
if(delOk)
avlBalanceRight(aRootNode,delOk);
}
}
}
return result;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
eAVLStatus
nsAVLTree::AddItem(void* anItem){
eAVLStatus result=eAVL_ok;
nsAVLNode* theNewNode=new nsAVLNode(anItem);
result=avlInsert(mRoot,theNewNode,mComparitor);
if(eAVL_duplicate!=result)
mCount++;
else {
delete theNewNode;
}
return result;
}
/** ------------------------------------------------
*
*
* @update gess 4/22/98
* @param
* @return
*/ //----------------------------------------------
void* nsAVLTree::FindItem(void* aValue) const{
nsAVLNode* result=mRoot;
PRInt32 count=0;
while(result) {
count++;
PRInt32 cmp=mComparitor(aValue,result->mValue);
if(0==cmp) {
//we matched...
break;
}
else if(0>cmp){
//theNode was greater...
result=result->mLeft;
}
else {
//aValue is greater...
result=result->mRight;
}
}
if(result) {
return result->mValue;
}
return nsnull;
}
/**
*
* @update gess12/30/98
* @param
* @return
*/
eAVLStatus
nsAVLTree::RemoveItem(void* aValue){
PRBool delOk=PR_TRUE;
eAVLStatus result=avlRemove(mRoot,aValue,delOk,mComparitor);
if(eAVL_ok==result)
mCount--;
return result;
}
/**
*
* @update gess9/11/98
* @param
* @return
*/
static void
avlForEachDepthFirst(nsAVLNode* aNode, nsAVLNodeFunctor& aFunctor){
if(aNode) {
avlForEachDepthFirst(aNode->mLeft,aFunctor);
avlForEachDepthFirst(aNode->mRight,aFunctor);
aFunctor(aNode->mValue);
}
}
/**
*
* @update gess9/11/98
* @param
* @return
*/
void
nsAVLTree::ForEachDepthFirst(nsAVLNodeFunctor& aFunctor) const{
::avlForEachDepthFirst(mRoot,aFunctor);
}
/**
*
* @update gess9/11/98
* @param
* @return
*/
static void
avlForEach(nsAVLNode* aNode, nsAVLNodeFunctor& aFunctor) {
if(aNode) {
avlForEach(aNode->mLeft,aFunctor);
aFunctor(aNode->mValue);
avlForEach(aNode->mRight,aFunctor);
}
}
/**
*
* @update gess9/11/98
* @param
* @return
*/
void
nsAVLTree::ForEach(nsAVLNodeFunctor& aFunctor) const{
::avlForEach(mRoot,aFunctor);
}
/**
*
* @update gess9/11/98
* @param
* @return
*/
static void*
avlFirstThat(nsAVLNode* aNode, nsAVLNodeFunctor& aFunctor) {
void* result=nsnull;
if(aNode) {
result = avlFirstThat(aNode->mLeft,aFunctor);
if (result) {
return result;
}
result = aFunctor(aNode->mValue);
if (result) {
return result;
}
result = avlFirstThat(aNode->mRight,aFunctor);
}
return result;
}
/**
*
* @update gess9/11/98
* @param
* @return
*/
void*
nsAVLTree::FirstThat(nsAVLNodeFunctor& aFunctor) const{
return ::avlFirstThat(mRoot,aFunctor);
}

View File

@@ -0,0 +1,74 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsAVLTree_h___
#define nsAVLTree_h___
#include "nscore.h"
enum eAVLStatus {eAVL_unknown,eAVL_ok,eAVL_fail,eAVL_duplicate};
struct nsAVLNode;
/**
*
* @update gess12/26/98
* @param anObject1 is the first object to be compared
* @param anObject2 is the second object to be compared
* @return -1,0,1 if object1 is less, equal, greater than object2
*/
class NS_COM nsAVLNodeComparitor {
public:
virtual PRInt32 operator()(void* anItem1,void* anItem2)=0;
};
class NS_COM nsAVLNodeFunctor {
public:
virtual void* operator()(void* anItem)=0;
};
class NS_COM nsAVLTree {
public:
nsAVLTree(nsAVLNodeComparitor& aComparitor, nsAVLNodeFunctor* aDeallocator);
~nsAVLTree(void);
PRBool operator==(const nsAVLTree& aOther) const;
PRInt32 GetCount(void) const {return mCount;}
//main functions...
eAVLStatus AddItem(void* anItem);
eAVLStatus RemoveItem(void* anItem);
void* FindItem(void* anItem) const;
void ForEach(nsAVLNodeFunctor& aFunctor) const;
void ForEachDepthFirst(nsAVLNodeFunctor& aFunctor) const;
void* FirstThat(nsAVLNodeFunctor& aFunctor) const;
protected:
nsAVLNode* mRoot;
PRInt32 mCount;
nsAVLNodeComparitor& mComparitor;
nsAVLNodeFunctor* mDeallocator;
};
#endif /* nsAVLTree_h___ */

View File

@@ -1,123 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.4-1.js
ECMA Section: 15.4 Array Objects
Description: Every Array object has a length property whose value
is always an integer with positive sign and less than
Math.pow(2,32).
Author: christine@netscape.com
Date: 28 october 1997
*/
var SECTION = "15.4-1";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Array Objects";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = getTestCases();
test();
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = new TestCase( SECTION,
"var myarr = new Array(); myarr[Math.pow(2,32)-2]='hi'; myarr[Math.pow(2,32)-2]",
"hi",
eval("var myarr = new Array(); myarr[Math.pow(2,32)-2]='hi'; myarr[Math.pow(2,32)-2]")
);
array[item++] = new TestCase( SECTION,
"var myarr = new Array(); myarr[Math.pow(2,32)-2]='hi'; myarr.length",
(Math.pow(2,32)-1),
eval("var myarr = new Array(); myarr[Math.pow(2,32)-2]='hi'; myarr.length")
);
array[item++] = new TestCase( SECTION,
"var myarr = new Array(); myarr[Math.pow(2,32)-3]='hi'; myarr[Math.pow(2,32)-3]",
"hi",
eval("var myarr = new Array(); myarr[Math.pow(2,32)-3]='hi'; myarr[Math.pow(2,32)-3]")
);
array[item++] = new TestCase( SECTION,
"var myarr = new Array(); myarr[Math.pow(2,32)-3]='hi'; myarr.length",
(Math.pow(2,32)-2),
eval("var myarr = new Array(); myarr[Math.pow(2,32)-3]='hi'; myarr.length")
);
array[item++] = new TestCase( SECTION,
"var myarr = new Array(); myarr[Math.pow(2,31)-2]='hi'; myarr[Math.pow(2,31)-2]",
"hi",
eval("var myarr = new Array(); myarr[Math.pow(2,31)-2]='hi'; myarr[Math.pow(2,31)-2]")
);
array[item++] = new TestCase( SECTION,
"var myarr = new Array(); myarr[Math.pow(2,31)-2]='hi'; myarr.length",
(Math.pow(2,31)-1),
eval("var myarr = new Array(); myarr[Math.pow(2,31)-2]='hi'; myarr.length")
);
array[item++] = new TestCase( SECTION,
"var myarr = new Array(); myarr[Math.pow(2,31)-1]='hi'; myarr[Math.pow(2,31)-1]",
"hi",
eval("var myarr = new Array(); myarr[Math.pow(2,31)-1]='hi'; myarr[Math.pow(2,31)-1]")
);
array[item++] = new TestCase( SECTION,
"var myarr = new Array(); myarr[Math.pow(2,31)-1]='hi'; myarr.length",
(Math.pow(2,31)),
eval("var myarr = new Array(); myarr[Math.pow(2,31)-1]='hi'; myarr.length")
);
array[item++] = new TestCase( SECTION,
"var myarr = new Array(); myarr[Math.pow(2,31)]='hi'; myarr[Math.pow(2,31)]",
"hi",
eval("var myarr = new Array(); myarr[Math.pow(2,31)]='hi'; myarr[Math.pow(2,31)]")
);
array[item++] = new TestCase( SECTION,
"var myarr = new Array(); myarr[Math.pow(2,31)]='hi'; myarr.length",
(Math.pow(2,31)+1),
eval("var myarr = new Array(); myarr[Math.pow(2,31)]='hi'; myarr.length")
);
array[item++] = new TestCase( SECTION,
"var myarr = new Array(); myarr[Math.pow(2,30)-2]='hi'; myarr[Math.pow(2,30)-2]",
"hi",
eval("var myarr = new Array(); myarr[Math.pow(2,30)-2]='hi'; myarr[Math.pow(2,30)-2]")
);
array[item++] = new TestCase( SECTION,
"var myarr = new Array(); myarr[Math.pow(2,30)-2]='hi'; myarr.length",
(Math.pow(2,30)-1),
eval("var myarr = new Array(); myarr[Math.pow(2,30)-2]='hi'; myarr.length")
);
return ( array );
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+ testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,80 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.4-2.js
ECMA Section: 15.4 Array Objects
Description: Whenever a property is added whose name is an array
index, the length property is changed, if necessary,
to be one more than the numeric value of that array
index; and whenever the length property is changed,
every property whose name is an array index whose value
is not smaller than the new length is automatically
deleted. This constraint applies only to the Array
object itself, and is unaffected by length or array
index properties that may be inherited from its
prototype.
Author: christine@netscape.com
Date: 28 october 1997
*/
var SECTION = "15.4-2";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Array Objects";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = getTestCases();
test();
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = new TestCase( SECTION, "var arr=new Array(); arr[Math.pow(2,16)] = 'hi'; arr.length", Math.pow(2,16)+1, eval("var arr=new Array(); arr[Math.pow(2,16)] = 'hi'; arr.length") );
array[item++] = new TestCase( SECTION, "var arr=new Array(); arr[Math.pow(2,30)-2] = 'hi'; arr.length", Math.pow(2,30)-1, eval("var arr=new Array(); arr[Math.pow(2,30)-2] = 'hi'; arr.length") );
array[item++] = new TestCase( SECTION, "var arr=new Array(); arr[Math.pow(2,30)-1] = 'hi'; arr.length", Math.pow(2,30), eval("var arr=new Array(); arr[Math.pow(2,30)-1] = 'hi'; arr.length") );
array[item++] = new TestCase( SECTION, "var arr=new Array(); arr[Math.pow(2,30)] = 'hi'; arr.length", Math.pow(2,30)+1, eval("var arr=new Array(); arr[Math.pow(2,30)] = 'hi'; arr.length") );
array[item++] = new TestCase( SECTION, "var arr=new Array(); arr[Math.pow(2,31)-2] = 'hi'; arr.length", Math.pow(2,31)-1, eval("var arr=new Array(); arr[Math.pow(2,31)-2] = 'hi'; arr.length") );
array[item++] = new TestCase( SECTION, "var arr=new Array(); arr[Math.pow(2,31)-1] = 'hi'; arr.length", Math.pow(2,31), eval("var arr=new Array(); arr[Math.pow(2,31)-1] = 'hi'; arr.length") );
array[item++] = new TestCase( SECTION, "var arr=new Array(); arr[Math.pow(2,31)] = 'hi'; arr.length", Math.pow(2,31)+1, eval("var arr=new Array(); arr[Math.pow(2,31)] = 'hi'; arr.length") );
array[item++] = new TestCase( SECTION, "var arr = new Array(0,1,2,3,4,5); arr.length = 2; String(arr)", "0,1", eval("var arr = new Array(0,1,2,3,4,5); arr.length = 2; String(arr)") );
array[item++] = new TestCase( SECTION, "var arr = new Array(0,1); arr.length = 3; String(arr)", "0,1,", eval("var arr = new Array(0,1); arr.length = 3; String(arr)") );
// array[item++] = new TestCase( SECTION, "var arr = new Array(0,1,2,3,4,5); delete arr[0]; arr.length", 5, eval("var arr = new Array(0,1,2,3,4,5); delete arr[0]; arr.length") );
// array[item++] = new TestCase( SECTION, "var arr = new Array(0,1,2,3,4,5); delete arr[6]; arr.length", 5, eval("var arr = new Array(0,1,2,3,4,5); delete arr[6]; arr.length") );
return ( array );
}
function test( array ) {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+ testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,85 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.4.1.1.js
ECMA Section: 15.4.1 Array( item0, item1,... )
Description: When Array is called as a function rather than as a
constructor, it creates and initializes a new array
object. Thus, the function call Array(...) is
equivalent to the object creation new Array(...) with
the same arguments.
An array is created and returned as if by the expression
new Array( item0, item1, ... ).
Author: christine@netscape.com
Date: 7 october 1997
*/
var SECTION = "15.4.1.1";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Array Constructor Called as a Function";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = getTestCases();
test();
function ToUint32( n ) {
n = Number( n );
if( isNaN(n) || n == 0 || n == Number.POSITIVE_INFINITY ||
n == Number.NEGATIVE_INFINITY ) {
return 0;
}
var sign = n < 0 ? -1 : 1;
return ( sign * ( n * Math.floor( Math.abs(n) ) ) ) % Math.pow(2, 32);
}
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = new TestCase( SECTION, "typeof Array(1,2)", "object", typeof Array(1,2) );
array[item++] = new TestCase( SECTION, "(Array(1,2)).toString", Array.prototype.toString, (Array(1,2)).toString );
array[item++] = new TestCase( SECTION,
"var arr = Array(1,2,3); arr.toString = Object.prototype.toString; arr.toString()",
"[object Array]",
eval("var arr = Array(1,2,3); arr.toString = Object.prototype.toString; arr.toString()") );
array[item++] = new TestCase( SECTION, "(Array(1,2)).length", 2, (Array(1,2)).length );
array[item++] = new TestCase( SECTION, "var arr = (Array(1,2)); arr[0]", 1, eval("var arr = (Array(1,2)); arr[0]") );
array[item++] = new TestCase( SECTION, "var arr = (Array(1,2)); arr[1]", 2, eval("var arr = (Array(1,2)); arr[1]") );
array[item++] = new TestCase( SECTION, "var arr = (Array(1,2)); String(arr)", "1,2", eval("var arr = (Array(1,2)); String(arr)") );
return ( array );
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+ testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,101 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.4.1.2.js
ECMA Section: 15.4.1.2 Array(len)
Description: When Array is called as a function rather than as a
constructor, it creates and initializes a new array
object. Thus, the function call Array(...) is
equivalent to the object creationi new Array(...) with
the same arguments.
An array is created and returned as if by the
expression new Array(len).
Author: christine@netscape.com
Date: 7 october 1997
*/
var SECTION = "15.4.1.2";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Array Constructor Called as a Function: Array(len)";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = getTestCases();
test();
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = new TestCase( SECTION, "(Array()).length", 0, (Array()).length );
array[item++] = new TestCase( SECTION, "(Array(0)).length", 0, (Array(0)).length );
array[item++] = new TestCase( SECTION, "(Array(1)).length", 1, (Array(1)).length );
array[item++] = new TestCase( SECTION, "(Array(-1)).length", ToUint32(-1), (Array(-1)).length );
array[item++] = new TestCase( SECTION, "(Array(10)).length", 10, (Array(10)).length );
array[item++] = new TestCase( SECTION, "(Array('1')).length", 1, (Array('1')).length );
array[item++] = new TestCase( SECTION, "(Array(1000)).length", 1000, (Array(1000)).length );
array[item++] = new TestCase( SECTION, "(Array('1000')).length", 1, (Array('1000')).length );
array[item++] = new TestCase( SECTION, "(Array(4294967295)).length", ToUint32(4294967295), (Array(4294967295)).length );
array[item++] = new TestCase( SECTION, "(Array(4294967296)).length", ToUint32(4294967296), (Array(4294967296)).length );
array[item++] = new TestCase( SECTION, "(Array(4294967297)).length", ToUint32(4294967297), (Array(4294967297)).length );
array[item++] = new TestCase( SECTION, "(Array(Math.pow(2,31)-1)).length", ToUint32(Math.pow(2,31)-1), (Array(Math.pow(2,31)-1)).length );
array[item++] = new TestCase( SECTION, "(Array(Math.pow(2,31))).length", ToUint32(Math.pow(2,31)), (Array(Math.pow(2,31))).length );
array[item++] = new TestCase( SECTION, "(Array(Math.pow(2,31)+1)).length", ToUint32(Math.pow(2,31)+1), (Array(Math.pow(2,31)+1)).length );
array[item++] = new TestCase( SECTION, "(Array(8589934592)).length", ToUint32(8589934592), (Array(8589934592)).length );
array[item++] = new TestCase( SECTION, "(Array('8589934592')).length", 1, (Array("8589934592")).length );
array[item++] = new TestCase( SECTION, "(Array('4294967296')).length", 1, (Array("4294967296")).length );
array[item++] = new TestCase( SECTION, "(Array(3.14159)).length", ToUint32(3.14159), (Array(3.14159)).length );
array[item++] = new TestCase( SECTION, "(Array(-3.14159)).length", ToUint32(-3.14159), (Array(-3.14159)).length );
array[item++] = new TestCase( SECTION, "(Array(1073741823)).length", ToUint32(1073741823), (Array(1073741823)).length );
array[item++] = new TestCase( SECTION, "(Array(1073741824)).length", ToUint32(1073741824), (Array(1073741824)).length );
array[item++] = new TestCase( SECTION, "(Array('a string')).length", 1, (Array("a string")).length );
return ( array );
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+ testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}
function ToUint32( n ) {
n = Number( n );
var sign = ( n < 0 ) ? -1 : 1;
if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) {
return 0;
}
n = sign * Math.floor( Math.abs(n) )
n = n % Math.pow(2,32);
if ( n < 0 ){
n += Math.pow(2,32);
}
return ( n );
}

View File

@@ -1,83 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.4.1.3.js
ECMA Section: 15.4.1.3 Array()
Description: When Array is called as a function rather than as a
constructor, it creates and initializes a new array
object. Thus, the function call Array(...) is
equivalent to the object creationi new Array(...) with
the same arguments.
An array is created and returned as if by the
expression new Array(len).
Author: christine@netscape.com
Date: 7 october 1997
*/
var SECTION = "15.4.1.3";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Array Constructor Called as a Function: Array()";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = getTestCases();
test();
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = new TestCase( SECTION,
"typeof Array()",
"object",
typeof Array() );
array[item++] = new TestCase( SECTION,
"MYARR = new Array();MYARR.getClass = Object.prototype.toString;MYARR.getClass()",
"[object Array]",
eval("MYARR = Array();MYARR.getClass = Object.prototype.toString;MYARR.getClass()") );
array[item++] = new TestCase( SECTION,
"(Array()).length",
0, (
Array()).length );
array[item++] = new TestCase( SECTION,
"Array().toString()",
"",
Array().toString() );
return ( array );
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+ testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,130 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.4.1.js
ECMA Section: 15.4.1 The Array Constructor Called as a Function
Description: When Array is called as a function rather than as a
constructor, it creates and initializes a new array
object. Thus, the function call Array(...) is
equivalent to the object creationi new Array(...) with
the same arguments.
Author: christine@netscape.com
Date: 7 october 1997
*/
var SECTION = "15.4.1";
var VERSION = "ECMA_1";
startTest();
var TITLE = "The Array Constructor Called as a Function";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = getTestCases();
test();
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = new TestCase( SECTION,
"Array() +''",
"",
Array() +"" );
array[item++] = new TestCase( SECTION,
"typeof Array()",
"object",
typeof Array() );
array[item++] = new TestCase( SECTION,
"var arr = Array(); arr.getClass = Object.prototype.toString; arr.getClass()",
"[object Array]",
eval("var arr = Array(); arr.getClass = Object.prototype.toString; arr.getClass()") );
array[item++] = new TestCase( SECTION,
"var arr = Array(); arr.toString == Array.prototype.toString",
true,
eval("var arr = Array(); arr.toString == Array.prototype.toString") );
array[item++] = new TestCase( SECTION,
"Array().length",
0,
Array().length );
array[item++] = new TestCase( SECTION,
"Array(1,2,3) +''",
"1,2,3",
Array(1,2,3) +"" );
array[item++] = new TestCase( SECTION,
"typeof Array(1,2,3)",
"object",
typeof Array(1,2,3) );
array[item++] = new TestCase( SECTION,
"var arr = Array(1,2,3); arr.getClass = Object.prototype.toString; arr.getClass()",
"[object Array]",
eval("var arr = Array(1,2,3); arr.getClass = Object.prototype.toString; arr.getClass()") );
array[item++] = new TestCase( SECTION,
"var arr = Array(1,2,3); arr.toString == Array.prototype.toString",
true,
eval("var arr = Array(1,2,3); arr.toString == Array.prototype.toString") );
array[item++] = new TestCase( SECTION,
"Array(1,2,3).length",
3,
Array(1,2,3).length );
array[item++] = new TestCase( SECTION,
"typeof Array(12345)",
"object",
typeof Array(12345) );
array[item++] = new TestCase( SECTION,
"var arr = Array(12345); arr.getClass = Object.prototype.toString; arr.getClass()",
"[object Array]",
eval("var arr = Array(12345); arr.getClass = Object.prototype.toString; arr.getClass()") );
array[item++] = new TestCase( SECTION,
"var arr = Array(1,2,3,4,5); arr.toString == Array.prototype.toString",
true,
eval("var arr = Array(1,2,3,4,5); arr.toString == Array.prototype.toString") );
array[item++] = new TestCase( SECTION,
"Array(12345).length",
12345,
Array(12345).length );
return ( array );
}
function test() {
for (tc=0 ; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+ testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,89 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.4.2.1-1.js
ECMA Section: 15.4.2.1 new Array( item0, item1, ... )
Description: This description only applies of the constructor is
given two or more arguments.
The [[Prototype]] property of the newly constructed
object is set to the original Array prototype object,
the one that is the initial value of Array.prototype
(15.4.3.1).
The [[Class]] property of the newly constructed object
is set to "Array".
The length property of the newly constructed object is
set to the number of arguments.
The 0 property of the newly constructed object is set
to item0... in general, for as many arguments as there
are, the k property of the newly constructed object is
set to argument k, where the first argument is
considered to be argument number 0.
This file tests the typeof the newly constructed object.
Author: christine@netscape.com
Date: 7 october 1997
*/
var SECTION = "15.4.2.1-1";
var VERSION = "ECMA_1";
startTest();
var TITLE = "The Array Constructor: new Array( item0, item1, ...)";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = getTestCases();
test();
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = new TestCase( SECTION, "typeof new Array(1,2)", "object", typeof new Array(1,2) );
array[item++] = new TestCase( SECTION, "(new Array(1,2)).toString", Array.prototype.toString, (new Array(1,2)).toString );
array[item++] = new TestCase( SECTION,
"var arr = new Array(1,2,3); arr.getClass = Object.prototype.toString; arr.getClass()",
"[object Array]",
eval("var arr = new Array(1,2,3); arr.getClass = Object.prototype.toString; arr.getClass()") );
array[item++] = new TestCase( SECTION, "(new Array(1,2)).length", 2, (new Array(1,2)).length );
array[item++] = new TestCase( SECTION, "var arr = (new Array(1,2)); arr[0]", 1, eval("var arr = (new Array(1,2)); arr[0]") );
array[item++] = new TestCase( SECTION, "var arr = (new Array(1,2)); arr[1]", 2, eval("var arr = (new Array(1,2)); arr[1]") );
array[item++] = new TestCase( SECTION, "var arr = (new Array(1,2)); String(arr)", "1,2", eval("var arr = (new Array(1,2)); String(arr)") );
return ( array );
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,80 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.4.2.1-2.js
ECMA Section: 15.4.2.1 new Array( item0, item1, ... )
Description: This description only applies of the constructor is
given two or more arguments.
The [[Prototype]] property of the newly constructed
object is set to the original Array prototype object,
the one that is the initial value of Array.prototype
(15.4.3.1).
The [[Class]] property of the newly constructed object
is set to "Array".
The length property of the newly constructed object is
set to the number of arguments.
The 0 property of the newly constructed object is set
to item0... in general, for as many arguments as there
are, the k property of the newly constructed object is
set to argument k, where the first argument is
considered to be argument number 0.
Author: christine@netscape.com
Date: 7 october 1997
*/
var SECTION = "15.4.2.1-2";
var VERSION = "ECMA_1";
startTest();
var TITLE = "The Array Constructor: new Array( item0, item1, ...)";
writeHeaderToLog( SECTION + " "+ TITLE);
testcases = getTestCases();
test();
function getTestCases() {
var array = new Array();
var TEST_STRING = "new Array(";
var ARGUMENTS = ""
var TEST_LENGTH = Math.pow(2,10); //Math.pow(2,32);
for ( var index = 0; index < TEST_LENGTH; index++ ) {
ARGUMENTS += index;
ARGUMENTS += (index == (TEST_LENGTH-1) ) ? "" : ",";
}
TEST_STRING += ARGUMENTS + ")";
TEST_ARRAY = eval( TEST_STRING );
for ( item = 0; item < TEST_LENGTH; item++ ) {
array[item] = new TestCase( SECTION, "["+item+"]", item, TEST_ARRAY[item] );
}
array[item++ ] = new TestCase( SECTION, "new Array( ["+TEST_LENGTH+" arguments] ) +''", ARGUMENTS, TEST_ARRAY +"" );
return ( array );
}

View File

@@ -1,109 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.4.2.1-3.js
ECMA Section: 15.4.2.1 new Array( item0, item1, ... )
Description: This description only applies of the constructor is
given two or more arguments.
The [[Prototype]] property of the newly constructed
object is set to the original Array prototype object,
the one that is the initial value of Array.prototype
(15.4.3.1).
The [[Class]] property of the newly constructed object
is set to "Array".
The length property of the newly constructed object is
set to the number of arguments.
The 0 property of the newly constructed object is set
to item0... in general, for as many arguments as there
are, the k property of the newly constructed object is
set to argument k, where the first argument is
considered to be argument number 0.
This test stresses the number of arguments presented to
the Array constructor. Should support up to Math.pow
(2,32) arguments, since that is the maximum length of an
ECMAScript array.
***Change TEST_LENGTH to Math.pow(2,32) when larger array
lengths are supported.
Author: christine@netscape.com
Date: 7 october 1997
*/
var SECTION = "15.4.2.1-3";
var VERSION = "ECMA_1";
startTest();
var TITLE = "The Array Constructor: new Array( item0, item1, ...)";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = getTestCases();
test();
function getTestCases() {
var array = new Array();
var TEST_STRING = "new Array(";
var ARGUMENTS = ""
var TEST_LENGTH = Math.pow(2,10); //Math.pow(2,32);
for ( var index = 0; index < TEST_LENGTH; index++ ) {
ARGUMENTS += index;
ARGUMENTS += (index == (TEST_LENGTH-1) ) ? "" : ",";
}
TEST_STRING += ARGUMENTS + ")";
TEST_ARRAY = eval( TEST_STRING );
for ( item = 0; item < TEST_LENGTH; item++ ) {
array[item] = new TestCase( SECTION, "TEST_ARRAY["+item+"]", item, TEST_ARRAY[item] );
}
array[item++] = new TestCase( SECTION, "new Array( ["+TEST_LENGTH+" arguments] ) +''", ARGUMENTS, TEST_ARRAY +"" );
array[item++] = new TestCase( SECTION, "TEST_ARRAY.toString", Array.prototype.toString, TEST_ARRAY.toString );
array[item++] = new TestCase( SECTION, "TEST_ARRAY.join", Array.prototype.join, TEST_ARRAY.join );
array[item++] = new TestCase( SECTION, "TEST_ARRAY.sort", Array.prototype.sort, TEST_ARRAY.sort );
array[item++] = new TestCase( SECTION, "TEST_ARRAY.reverse", Array.prototype.reverse, TEST_ARRAY.reverse );
array[item++] = new TestCase( SECTION, "TEST_ARRAY.length", TEST_LENGTH, TEST_ARRAY.length );
array[item++] = new TestCase( SECTION,
"TEST_ARRAY.toString = Object.prototype.toString; TEST_ARRAY.toString()",
"[object Array]",
eval("TEST_ARRAY.toString = Object.prototype.toString; TEST_ARRAY.toString()") );
return ( array );
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,133 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.4.2.2-1.js
ECMA Section: 15.4.2.2 new Array(len)
Description: This description only applies of the constructor is
given two or more arguments.
The [[Prototype]] property of the newly constructed
object is set to the original Array prototype object,
the one that is the initial value of Array.prototype(0)
(15.4.3.1).
The [[Class]] property of the newly constructed object
is set to "Array".
If the argument len is a number, then the length
property of the newly constructed object is set to
ToUint32(len).
If the argument len is not a number, then the length
property of the newly constructed object is set to 1
and the 0 property of the newly constructed object is
set to len.
This file tests cases where len is a number.
The cases in this test need to be updated since the
ToUint32 description has changed.
Author: christine@netscape.com
Date: 7 october 1997
*/
var SECTION = "15.4.2.2-1";
var VERSION = "ECMA_1";
startTest();
var TITLE = "The Array Constructor: new Array( len )";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = getTestCases();
test();
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = new TestCase( SECTION, "new Array(0)", "", (new Array(0)).toString() );
array[item++] = new TestCase( SECTION, "typeof new Array(0)", "object", (typeof new Array(0)) );
array[item++] = new TestCase( SECTION, "(new Array(0)).length", 0, (new Array(0)).length );
array[item++] = new TestCase( SECTION, "(new Array(0)).toString", Array.prototype.toString, (new Array(0)).toString );
array[item++] = new TestCase( SECTION, "new Array(1)", "", (new Array(1)).toString() );
array[item++] = new TestCase( SECTION, "new Array(1).length", 1, (new Array(1)).length );
array[item++] = new TestCase( SECTION, "(new Array(1)).toString", Array.prototype.toString, (new Array(1)).toString );
array[item++] = new TestCase( SECTION, "(new Array(Number.NaN)).length", 0, (new Array(Number.NaN)).length );
array[item++] = new TestCase( SECTION, "(new Array(Number.POSITIVE_INFINITY)).length", 0, (new Array(Number.POSITIVE_INFINITY)).length );
array[item++] = new TestCase( SECTION, "(new Array(Number.NEGATIVE_INFINITY)).length", 0, (new Array(Number.NEGATIVE_INFINITY)).length );
array[item++] = new TestCase( SECTION, "(new Array(-0)).length", 0, (new Array(-0)).length );
array[item++] = new TestCase( SECTION, "(new Array(0)).length", 0, (new Array(0)).length );
array[item++] = new TestCase( SECTION, "(new Array(-1000)).length", ToUint32(-1000), (new Array(-1000)).length );
array[item++] = new TestCase( SECTION, "(new Array(10)).length", 10, (new Array(10)).length );
array[item++] = new TestCase( SECTION, "(new Array('1')).length", 1, (new Array('1')).length );
array[item++] = new TestCase( SECTION, "(new Array(1000)).length", 1000, (new Array(1000)).length );
array[item++] = new TestCase( SECTION, "(new Array('1000')).length", 1, (new Array('1000')).length );
// array[item++] = new TestCase( SECTION, "(new Array(4294967295)).length", ToUint32(4294967295), (new Array(4294967295)).length );
array[item++] = new TestCase( SECTION, "(new Array(4294967296)).length", ToUint32(4294967296), (new Array(4294967296)).length );
array[item++] = new TestCase( SECTION, "(new Array(4294967297)).length", ToUint32(4294967297), (new Array(4294967297)).length );
array[item++] = new TestCase( SECTION, "(new Array(4294967298)).length", ToUint32(4294967298), (new Array(4294967298)).length );
array[item++] = new TestCase( SECTION, "(new Array(8589934592)).length", ToUint32(8589934592), (new Array(8589934592)).length );
array[item++] = new TestCase( SECTION, "(new Array('8589934592')).length", 1, (new Array("8589934592")).length );
array[item++] = new TestCase( SECTION, "(new Array('4294967296')).length", 1, (new Array("4294967296")).length );
array[item++] = new TestCase( SECTION, "(new Array(3.14159)).length", ToUint32(3.14159), (new Array(3.14159)).length );
array[item++] = new TestCase( SECTION, "(new Array(-3.14159)).length", ToUint32(-3.14159), (new Array(-3.14159)).length );
// array[item++] = new TestCase( SECTION, "(new Array(1073741823)).length", ToUint32(1073741823), (new Array(1073741823)).length );
array[item++] = new TestCase( SECTION, "(new Array(1073741824)).length", ToUint32(1073741824), (new Array(1073741824)).length );
return ( array );
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed )
? ""
: "wrong value ";
}
stopTest();
return ( testcases );
}
function ToUint32( n ) {
n = Number( n );
var sign = ( n < 0 ) ? -1 : 1;
if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY) {
return 0;
}
n = sign * Math.floor( Math.abs(n) )
n = n % Math.pow(2,32);
if ( n < 0 ){
n += Math.pow(2,32);
}
return ( n );
}

View File

@@ -1,86 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.4.2.2-2.js
ECMA Section: 15.4.2.2 new Array(len)
Description: This description only applies of the constructor is
given two or more arguments.
The [[Prototype]] property of the newly constructed
object is set to the original Array prototype object,
the one that is the initial value of Array.prototype(0)
(15.4.3.1).
The [[Class]] property of the newly constructed object
is set to "Array".
If the argument len is a number, then the length
property of the newly constructed object is set to
ToUint32(len).
If the argument len is not a number, then the length
property of the newly constructed object is set to 1
and the 0 property of the newly constructed object is
set to len.
This file tests length of the newly constructed array
when len is not a number.
Author: christine@netscape.com
Date: 7 october 1997
*/
var SECTION = "15.4.2.2-2";
var VERSION = "ECMA_1";
startTest();
var TITLE = "The Array Constructor: new Array( len )";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = getTestCases();
test();
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = new TestCase( SECTION, "(new Array(new Number(1073741823))).length", 1, (new Array(new Number(1073741823))).length );
array[item++] = new TestCase( SECTION, "(new Array(new Number(0))).length", 1, (new Array(new Number(0))).length );
array[item++] = new TestCase( SECTION, "(new Array(new Number(1000))).length", 1, (new Array(new Number(1000))).length );
array[item++] = new TestCase( SECTION, "(new Array('mozilla, larryzilla, curlyzilla')).length", 1, (new Array('mozilla, larryzilla, curlyzilla')).length );
array[item++] = new TestCase( SECTION, "(new Array(true)).length", 1, (new Array(true)).length );
array[item++] = new TestCase( SECTION, "(new Array(false)).length", 1, (new Array(false)).length);
array[item++] = new TestCase( SECTION, "(new Array(new Boolean(true)).length", 1, (new Array(new Boolean(true))).length );
array[item++] = new TestCase( SECTION, "(new Array(new Boolean(false)).length", 1, (new Array(new Boolean(false))).length );
return ( array );
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed )
? ""
: "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,71 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.4.2.3.js
ECMA Section: 15.4.2.3 new Array()
Description: The [[Prototype]] property of the newly constructed
object is set to the origianl Array prototype object,
the one that is the initial value of Array.prototype.
The [[Class]] property of the new object is set to
"Array". The length of the object is set to 0.
Author: christine@netscape.com
Date: 7 october 1997
*/
var SECTION = "15.4.2.3";
var VERSION = "ECMA_1";
startTest();
var TITLE = "The Array Constructor: new Array()";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = getTestCases();
test();
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = new TestCase( SECTION, "new Array() +''", "", (new Array()) +"" );
array[item++] = new TestCase( SECTION, "typeof new Array()", "object", (typeof new Array()) );
array[item++] = new TestCase( SECTION,
"var arr = new Array(); arr.getClass = Object.prototype.toString; arr.getClass()",
"[object Array]",
eval("var arr = new Array(); arr.getClass = Object.prototype.toString; arr.getClass()") );
array[item++] = new TestCase( SECTION, "(new Array()).length", 0, (new Array()).length );
array[item++] = new TestCase( SECTION, "(new Array()).toString == Array.prototype.toString", true, (new Array()).toString == Array.prototype.toString );
array[item++] = new TestCase( SECTION, "(new Array()).join == Array.prototype.join", true, (new Array()).join == Array.prototype.join );
array[item++] = new TestCase( SECTION, "(new Array()).reverse == Array.prototype.reverse", true, (new Array()).reverse == Array.prototype.reverse );
array[item++] = new TestCase( SECTION, "(new Array()).sort == Array.prototype.sort", true, (new Array()).sort == Array.prototype.sort );
return ( array );
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+ testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,63 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.4.3.1-1.js
ECMA Section: 15.4.3.1 Array.prototype
Description: The initial value of Array.prototype is the built-in
Array prototype object (15.4.4).
Author: christine@netscape.com
Date: 7 october 1997
*/
var SECTION = "15.4.3.1-1";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Array.prototype";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = getTestCases();
test();
function getTestCases() {
var array = new Array();
var item = 0;
var ARRAY_PROTO = Array.prototype;
array[item++] = new TestCase( SECTION, "var props = ''; for ( p in Array ) { props += p } props", "", eval("var props = ''; for ( p in Array ) { props += p } props") );
array[item++] = new TestCase( SECTION, "Array.prototype = null; Array.prototype", ARRAY_PROTO, eval("Array.prototype = null; Array.prototype") );
array[item++] = new TestCase( SECTION, "delete Array.prototype", false, delete Array.prototype );
array[item++] = new TestCase( SECTION, "delete Array.prototype; Array.prototype", ARRAY_PROTO, eval("delete Array.prototype; Array.prototype") );
return ( array );
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+ testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,54 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.4.3.2.js
ECMA Section: 15.4.3.2 Array.length
Description: The length property is 1.
Author: christine@netscape.com
Date: 7 october 1997
*/
var SECTION = "15.4.3.2";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Array.length";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = getTestCases();
test();
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = new TestCase( SECTION, "Array.length", 1, Array.length );
return ( array );
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+ testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,60 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.4.3.js
ECMA Section: 15.4.3 Properties of the Array Constructor
Description: The value of the internal [[Prototype]] property of the
Array constructor is the Function prototype object.
Author: christine@netscape.com
Date: 7 october 1997
*/
var SECTION = "15.4.3";
var VERSION = "ECMA_2";
startTest();
var TITLE = "Properties of the Array Constructor";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = getTestCases();
test();
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = new TestCase( SECTION, "Array.__proto__", Function.prototype, Array.__proto__ );
return ( array );
}
function test() {
for (tc=0 ; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+ testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,54 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.4.4.1.js
ECMA Section: 15.4.4.1 Array.prototype.constructor
Description: The initial value of Array.prototype.constructor
is the built-in Array constructor.
Author: christine@netscape.com
Date: 7 october 1997
*/
var SECTION = "15.4.4.1";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Array.prototype.constructor";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = getTestCases();
test();
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = new TestCase( SECTION, "Array.prototype.constructor == Array", true, Array.prototype.constructor == Array);
return ( array );
}
function test() {
for (tc=0 ; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+ testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,80 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.4.4.2.js
ECMA Section: 15.4.4.2 Array.prototype.toString()
Description: The elements of this object are converted to strings
and these strings are then concatenated, separated by
comma characters. The result is the same as if the
built-in join method were invoiked for this object
with no argument.
Author: christine@netscape.com
Date: 7 october 1997
*/
var SECTION = "15.4.4.2";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Array.prototype.toString";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = getTestCases();
test();
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = new TestCase( SECTION, "Array.prototype.toString.length", 0, Array.prototype.toString.length );
array[item++] = new TestCase( SECTION, "(new Array()).toString()", "", (new Array()).toString() );
array[item++] = new TestCase( SECTION, "(new Array(2)).toString()", ",", (new Array(2)).toString() );
array[item++] = new TestCase( SECTION, "(new Array(0,1)).toString()", "0,1", (new Array(0,1)).toString() );
array[item++] = new TestCase( SECTION, "(new Array( Number.NaN, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY)).toString()", "NaN,Infinity,-Infinity", (new Array( Number.NaN, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY)).toString() );
array[item++] = new TestCase( SECTION, "(new Array( Boolean(1), Boolean(0))).toString()", "true,false", (new Array(Boolean(1),Boolean(0))).toString() );
array[item++] = new TestCase( SECTION, "(new Array(void 0,null)).toString()", ",", (new Array(void 0,null)).toString() );
var EXPECT_STRING = "";
var MYARR = new Array();
for ( var i = -50; i < 50; i+= 0.25 ) {
MYARR[MYARR.length] = i;
EXPECT_STRING += i +",";
}
EXPECT_STRING = EXPECT_STRING.substring( 0, EXPECT_STRING.length -1 );
array[item++] = new TestCase( SECTION, "MYARR.toString()", EXPECT_STRING, MYARR.toString() );
return ( array );
}
function test() {
for ( tc=0 ; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+ testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,151 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.4.4.3-1.js
ECMA Section: 15.4.4.3-1 Array.prototype.join()
Description: The elements of this object are converted to strings
and these strings are then concatenated, separated by
comma characters. The result is the same as if the
built-in join method were invoiked for this object
with no argument.
Author: christine@netscape.com
Date: 7 october 1997
*/
var SECTION = "15.4.4.3-1";
var VERSION = "ECMA_1";
startTest();
writeHeaderToLog( SECTION + " Array.prototype.join()");
var testcases = getTestCases();
test();
function getTestCases() {
var array = new Array();
var item = 0;
var ARR_PROTOTYPE = Array.prototype;
array[item++] = new TestCase( SECTION, "Array.prototype.join.length", 1, Array.prototype.join.length );
array[item++] = new TestCase( SECTION, "delete Array.prototype.join.length", false, delete Array.prototype.join.length );
array[item++] = new TestCase( SECTION, "delete Array.prototype.join.length; Array.prototype.join.length", 1, eval("delete Array.prototype.join.length; Array.prototype.join.length") );
// case where array length is 0
array[item++] = new TestCase( SECTION,
"var TEST_ARRAY = new Array(); TEST_ARRAY.join()",
"",
eval("var TEST_ARRAY = new Array(); TEST_ARRAY.join()") );
// array length is 0, but spearator is specified
array[item++] = new TestCase( SECTION,
"var TEST_ARRAY = new Array(); TEST_ARRAY.join(' ')",
"",
eval("var TEST_ARRAY = new Array(); TEST_ARRAY.join(' ')") );
// length is greater than 0, separator is supplied
array[item++] = new TestCase( SECTION,
"var TEST_ARRAY = new Array(null, void 0, true, false, 123, new Object(), new Boolean(true) ); TEST_ARRAY.join('&')",
"&&true&false&123&[object Object]&true",
eval("var TEST_ARRAY = new Array(null, void 0, true, false, 123, new Object(), new Boolean(true) ); TEST_ARRAY.join('&')") );
// length is greater than 0, separator is empty string
array[item++] = new TestCase( SECTION,
"var TEST_ARRAY = new Array(null, void 0, true, false, 123, new Object(), new Boolean(true) ); TEST_ARRAY.join('')",
"truefalse123[object Object]true",
eval("var TEST_ARRAY = new Array(null, void 0, true, false, 123, new Object(), new Boolean(true) ); TEST_ARRAY.join('')") );
// length is greater than 0, separator is undefined
array[item++] = new TestCase( SECTION,
"var TEST_ARRAY = new Array(null, void 0, true, false, 123, new Object(), new Boolean(true) ); TEST_ARRAY.join(void 0)",
"undefinedundefinedtrueundefinedfalseundefined123undefined[object Object]undefinedtrue",
eval("var TEST_ARRAY = new Array(null, void 0, true, false, 123, new Object(), new Boolean(true) ); TEST_ARRAY.join(void 0)") );
// length is greater than 0, separator is not supplied
array[item++] = new TestCase( SECTION,
"var TEST_ARRAY = new Array(null, void 0, true, false, 123, new Object(), new Boolean(true) ); TEST_ARRAY.join()",
",,true,false,123,[object Object],true",
eval("var TEST_ARRAY = new Array(null, void 0, true, false, 123, new Object(), new Boolean(true) ); TEST_ARRAY.join()") );
// separator is a control character
array[item++] = new TestCase( SECTION,
"var TEST_ARRAY = new Array(null, void 0, true, false, 123, new Object(), new Boolean(true) ); TEST_ARRAY.join('\v')",
unescape("%u000B%u000Btrue%u000Bfalse%u000B123%u000B[object Object]%u000Btrue"),
eval("var TEST_ARRAY = new Array(null, void 0, true, false, 123, new Object(), new Boolean(true) ); TEST_ARRAY.join('\v')") );
// length of array is 1
array[item++] = new TestCase( SECTION,
"var TEST_ARRAY = new Array(true) ); TEST_ARRAY.join('\v')",
"true",
eval("var TEST_ARRAY = new Array(true); TEST_ARRAY.join('\v')") );
SEPARATOR = "\t"
TEST_LENGTH = 100;
TEST_STRING = "";
ARGUMENTS = "";
TEST_RESULT = "";
for ( var index = 0; index < TEST_LENGTH; index++ ) {
ARGUMENTS += index;
ARGUMENTS += ( index == TEST_LENGTH -1 ) ? "" : ",";
TEST_RESULT += index;
TEST_RESULT += ( index == TEST_LENGTH -1 ) ? "" : SEPARATOR;
}
TEST_ARRAY = eval( "new Array( "+ARGUMENTS +")" );
array[item++] = new TestCase( SECTION, "TEST_ARRAY.join("+SEPARATOR+")", TEST_RESULT, TEST_ARRAY.join( SEPARATOR ) );
array[item++] = new TestCase( SECTION, "(new Array( Boolean(true), Boolean(false), null, void 0, Number(1e+21), Number(1e-7))).join()",
"true,false,,,1e+21,1e-7",
(new Array( Boolean(true), Boolean(false), null, void 0, Number(1e+21), Number(1e-7))).join() );
// this is not an Array object
array[item++] = new TestCase( SECTION,
"var OB = new Object_1('true,false,111,0.5,1.23e6,NaN,void 0,null'); OB.join(':')",
"true:false:111:0.5:1230000:NaN::",
eval("var OB = new Object_1('true,false,111,0.5,1.23e6,NaN,void 0,null'); OB.join(':')") );
return ( array );
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+ testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}
function Object_1( value ) {
this.array = value.split(",");
this.length = this.array.length;
for ( var i = 0; i < this.length; i++ ) {
this[i] = eval(this.array[i]);
}
this.join = Array.prototype.join;
this.getClass = Object.prototype.toString;
}

View File

@@ -1,269 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.4.4.3-1.js
ECMA Section: 15.4.4.3-1 Array.prototype.reverse()
Description:
The elements of the array are rearranged so as to reverse their order.
This object is returned as the result of the call.
1. Call the [[Get]] method of this object with argument "length".
2. Call ToUint32(Result(1)).
3. Compute floor(Result(2)/2).
4. Let k be 0.
5. If k equals Result(3), return this object.
6. Compute Result(2)k1.
7. Call ToString(k).
8. ToString(Result(6)).
9. Call the [[Get]] method of this object with argument Result(7).
10. Call the [[Get]] method of this object with argument Result(8).
11. If this object has a property named by Result(8), go to step 12; but
if this object has no property named by Result(8), then go to either
step 12 or step 14, depending on the implementation.
12. Call the [[Put]] method of this object with arguments Result(7) and
Result(10).
13. Go to step 15.
14. Call the [[Delete]] method on this object, providing Result(7) as the
name of the property to delete.
15. If this object has a property named by Result(7), go to step 16; but if
this object has no property named by Result(7), then go to either step 16
or step 18, depending on the implementation.
16. Call the [[Put]] method of this object with arguments Result(8) and
Result(9).
17. Go to step 19.
18. Call the [[Delete]] method on this object, providing Result(8) as the
name of the property to delete.
19. Increase k by 1.
20. Go to step 5.
Note that the reverse function is intentionally generic; it does not require
that its this value be an Array object. Therefore it can be transferred to other
kinds of objects for use as a method. Whether the reverse function can be applied
successfully to a host object is implementation dependent.
Note: Array.prototype.reverse allows some flexibility in implementation
regarding array indices that have not been populated. This test covers the
cases in which unpopulated indices are not deleted, since the JavaScript
implementation does not delete uninitialzed indices.
Author: christine@netscape.com
Date: 7 october 1997
*/
var SECTION = "15.4.4.4-1";
var VERSION = "ECMA_1";
startTest();
var BUGNUMBER="123724";
writeHeaderToLog( SECTION + " Array.prototype.reverse()");
var testcases = new Array();
getTestCases();
test();
function getTestCases() {
var ARR_PROTOTYPE = Array.prototype;
testcases[testcases.length] = new TestCase( SECTION, "Array.prototype.reverse.length", 0, Array.prototype.reverse.length );
testcases[testcases.length] = new TestCase( SECTION, "delete Array.prototype.reverse.length", false, delete Array.prototype.reverse.length );
testcases[testcases.length] = new TestCase( SECTION, "delete Array.prototype.reverse.length; Array.prototype.reverse.length", 0, eval("delete Array.prototype.reverse.length; Array.prototype.reverse.length") );
// length of array is 0
testcases[testcases.length] = new TestCase( SECTION,
"var A = new Array(); A.reverse(); A.length",
0,
eval("var A = new Array(); A.reverse(); A.length") );
// length of array is 1
var A = new Array(true);
var R = Reverse(A);
testcases[testcases.length] = new TestCase( SECTION,
"var A = new Array(true); A.reverse(); A.length",
R.length,
eval("var A = new Array(true); A.reverse(); A.length") );
CheckItems( R, A );
// length of array is 2
var S = "var A = new Array( true,false )";
eval(S);
var R = Reverse(A);
testcases[testcases.length] = new TestCase(
SECTION,
S +"; A.reverse(); A.length",
R.length,
eval( S + "; A.reverse(); A.length") );
CheckItems( R, A );
// length of array is 3
var S = "var A = new Array( true,false,null )";
eval(S);
var R = Reverse(A);
testcases[testcases.length] = new TestCase( SECTION,
S +"; A.reverse(); A.length",
R.length,
eval( S + "; A.reverse(); A.length") );
CheckItems( R, A );
// length of array is 4
var S = "var A = new Array( true,false,null,void 0 )";
eval(S);
var R = Reverse(A);
testcases[testcases.length] = new TestCase( SECTION,
S +"; A.reverse(); A.length",
R.length,
eval( S + "; A.reverse(); A.length") );
CheckItems( R, A );
// some array indexes have not been set
var S = "var A = new Array(); A[8] = 'hi', A[3] = 'yo'";
eval(S);
var R = Reverse(A);
testcases[testcases.length] = new TestCase( SECTION,
S +"; A.reverse(); A.length",
R.length,
eval( S + "; A.reverse(); A.length") );
CheckItems( R, A );
var OBJECT_OBJECT = new Object();
var FUNCTION_OBJECT = new Function( 'return this' );
var BOOLEAN_OBJECT = new Boolean;
var DATE_OBJECT = new Date(0);
var STRING_OBJECT = new String('howdy');
var NUMBER_OBJECT = new Number(Math.PI);
var ARRAY_OBJECT= new Array(1000);
var args = "null, void 0, Math.pow(2,32), 1.234e-32, OBJECT_OBJECT, BOOLEAN_OBJECT, FUNCTION_OBJECT, DATE_OBJECT, STRING_OBJECT,"+
"ARRAY_OBJECT, NUMBER_OBJECT, Math, true, false, 123, '90210'";
var S = "var A = new Array("+args+")";
eval(S);
var R = Reverse(A);
testcases[testcases.length] = new TestCase( SECTION,
S +"; A.reverse(); A.length",
R.length,
eval( S + "; A.reverse(); A.length") );
CheckItems( R, A );
var limit = 1000;
var args = "";
for (var i = 0; i < limit; i++ ) {
args += i +"";
if ( i + 1 < limit ) {
args += ",";
}
}
var S = "var A = new Array("+args+")";
eval(S);
var R = Reverse(A);
testcases[testcases.length] = new TestCase( SECTION,
S +"; A.reverse(); A.length",
R.length,
eval( S + "; A.reverse(); A.length") );
CheckItems( R, A );
var S = "var MYOBJECT = new Object_1( \"void 0, 1, null, 2, \'\'\" )";
eval(S);
var R = Reverse( A );
testcases[testcases.length] = new TestCase( SECTION,
S +"; A.reverse(); A.length",
R.length,
eval( S + "; A.reverse(); A.length") );
CheckItems( R, A );
return ( testcases );
}
function CheckItems( R, A ) {
for ( var i = 0; i < R.length; i++ ) {
testcases[testcases.length] = new TestCase(
SECTION,
"A["+i+ "]",
R[i],
A[i] );
}
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+ testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}
function Object_1( value ) {
this.array = value.split(",");
this.length = this.array.length;
for ( var i = 0; i < this.length; i++ ) {
this[i] = eval(this.array[i]);
}
this.join = Array.prototype.reverse;
this.getClass = Object.prototype.toString;
}
function Reverse( array ) {
var r2 = array.length;
var k = 0;
var r3 = Math.floor( r2/2 );
if ( r3 == k ) {
return array;
}
for ( k = 0; k < r3; k++ ) {
var r6 = r2 - k - 1;
// var r7 = String( k );
var r7 = k;
var r8 = String( r6 );
var r9 = array[r7];
var r10 = array[r8];
array[r7] = r10;
array[r8] = r9;
}
return array;
}
function Iterate( array ) {
for ( var i = 0; i < array.length; i++ ) {
// print( i+": "+ array[String(i)] );
}
}
function Object_1( value ) {
this.array = value.split(",");
this.length = this.array.length;
for ( var i = 0; i < this.length; i++ ) {
this[i] = this.array[i];
}
this.reverse = Array.prototype.reverse;
this.getClass = Object.prototype.toString;
}

View File

@@ -1,160 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.4.4.3-1.js
ECMA Section: 15.4.4.3-1 Array.prototype.reverse()
Description:
The elements of the array are rearranged so as to reverse their order.
This object is returned as the result of the call.
1. Call the [[Get]] method of this object with argument "length".
2. Call ToUint32(Result(1)).
3. Compute floor(Result(2)/2).
4. Let k be 0.
5. If k equals Result(3), return this object.
6. Compute Result(2)k1.
7. Call ToString(k).
8. ToString(Result(6)).
9. Call the [[Get]] method of this object with argument Result(7).
10. Call the [[Get]] method of this object with argument Result(8).
11. If this object has a property named by Result(8), go to step 12; but
if this object has no property named by Result(8), then go to either
step 12 or step 14, depending on the implementation.
12. Call the [[Put]] method of this object with arguments Result(7) and
Result(10).
13. Go to step 15.
14. Call the [[Delete]] method on this object, providing Result(7) as the
name of the property to delete.
15. If this object has a property named by Result(7), go to step 16; but if
this object has no property named by Result(7), then go to either step 16
or step 18, depending on the implementation.
16. Call the [[Put]] method of this object with arguments Result(8) and
Result(9).
17. Go to step 19.
18. Call the [[Delete]] method on this object, providing Result(8) as the
name of the property to delete.
19. Increase k by 1.
20. Go to step 5.
Note that the reverse function is intentionally generic; it does not require
that its this value be an Array object. Therefore it can be transferred to other
kinds of objects for use as a method. Whether the reverse function can be applied
successfully to a host object is implementation dependent.
Note: Array.prototype.reverse allows some flexibility in implementation
regarding array indices that have not been populated. This test covers the
cases in which unpopulated indices are not deleted, since the JavaScript
implementation does not delete uninitialzed indices.
Author: christine@netscape.com
Date: 7 october 1997
*/
var SECTION = "15.4.4.4-1";
var VERSION = "ECMA_1";
startTest();
var testcases = new Array();
writeHeaderToLog( SECTION + " Array.prototype.reverse()");
getTestCases();
test();
function getTestCases() {
var ARR_PROTOTYPE = Array.prototype;
testcases[testcases.length] = new TestCase( SECTION, "Array.prototype.reverse.length", 0, Array.prototype.reverse.length );
testcases[testcases.length] = new TestCase( SECTION, "delete Array.prototype.reverse.length", false, delete Array.prototype.reverse.length );
testcases[testcases.length] = new TestCase( SECTION, "delete Array.prototype.reverse.length; Array.prototype.reverse.length", 0, eval("delete Array.prototype.reverse.length; Array.prototype.reverse.length") );
// length of array is 0
testcases[testcases.length] = new TestCase( SECTION,
"var A = new Array(); A.reverse(); A.length",
0,
eval("var A = new Array(); A.reverse(); A.length") );
return ( testcases );
}
function CheckItems( R, A ) {
for ( var i = 0; i < R.length; i++ ) {
testcases[testcases.length] = new TestCase(
SECTION,
"A["+i+ "]",
R[i],
A[i] );
}
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+ testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}
function Object_1( value ) {
this.array = value.split(",");
this.length = this.array.length;
for ( var i = 0; i < this.length; i++ ) {
this[i] = eval(this.array[i]);
}
this.join = Array.prototype.reverse;
this.getClass = Object.prototype.toString;
}
function Reverse( array ) {
var r2 = array.length;
var k = 0;
var r3 = Math.floor( r2/2 );
if ( r3 == k ) {
return array;
}
for ( k = 0; k < r3; k++ ) {
var r6 = r2 - k - 1;
// var r7 = String( k );
var r7 = k;
var r8 = String( r6 );
var r9 = array[r7];
var r10 = array[r8];
array[r7] = r10;
array[r8] = r9;
}
return array;
}
function Iterate( array ) {
for ( var i = 0; i < array.length; i++ ) {
// print( i+": "+ array[String(i)] );
}
}
function Object_1( value ) {
this.array = value.split(",");
this.length = this.array.length;
for ( var i = 0; i < this.length; i++ ) {
this[i] = this.array[i];
}
this.reverse = Array.prototype.reverse;
this.getClass = Object.prototype.toString;
}

View File

@@ -1,220 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.4.4.5.js
ECMA Section: Array.prototype.sort(comparefn)
Description:
This test file tests cases in which the compare function is not supplied.
The elements of this array are sorted. The sort is not necessarily stable.
If comparefn is provided, it should be a function that accepts two arguments
x and y and returns a negative value if x < y, zero if x = y, or a positive
value if x > y.
1. Call the [[Get]] method of this object with argument "length".
2. Call ToUint32(Result(1)).
1. Perform an implementation-dependent sequence of calls to the
[[Get]] , [[Put]], and [[Delete]] methods of this object and
toSortCompare (described below), where the first argument for each call
to [[Get]], [[Put]] , or [[Delete]] is a nonnegative integer less
than Result(2) and where the arguments for calls to SortCompare are
results of previous calls to the [[Get]] method. After this sequence
is complete, this object must have the following two properties.
(1) There must be some mathematical permutation of the nonnegative
integers less than Result(2), such that for every nonnegative integer
j less than Result(2), if property old[j] existed, then new[(j)] is
exactly the same value as old[j],. but if property old[j] did not exist,
then new[(j)] either does not exist or exists with value undefined.
(2) If comparefn is not supplied or is a consistent comparison
function for the elements of this array, then for all nonnegative
integers j and k, each less than Result(2), if old[j] compares less
than old[k] (see SortCompare below), then (j) < (k). Here we use the
notation old[j] to refer to the hypothetical result of calling the [
[Get]] method of this object with argument j before this step is
executed, and the notation new[j] to refer to the hypothetical result
of calling the [[Get]] method of this object with argument j after this
step has been completely executed. A function is a consistent
comparison function for a set of values if (a) for any two of those
values (possibly the same value) considered as an ordered pair, it
always returns the same value when given that pair of values as its
two arguments, and the result of applying ToNumber to this value is
not NaN; (b) when considered as a relation, where the pair (x, y) is
considered to be in the relation if and only if applying the function
to x and y and then applying ToNumber to the result produces a
negative value, this relation is a partial order; and (c) when
considered as a different relation, where the pair (x, y) is considered
to be in the relation if and only if applying the function to x and y
and then applying ToNumber to the result produces a zero value (of either
sign), this relation is an equivalence relation. In this context, the
phrase "x compares less than y" means applying Result(2) to x and y and
then applying ToNumber to the result produces a negative value.
3.Return this object.
When the SortCompare operator is called with two arguments x and y, the following steps are taken:
1.If x and y are both undefined, return +0.
2.If x is undefined, return 1.
3.If y is undefined, return 1.
4.If the argument comparefn was not provided in the call to sort, go to step 7.
5.Call comparefn with arguments x and y.
6.Return Result(5).
7.Call ToString(x).
8.Call ToString(y).
9.If Result(7) < Result(8), return 1.
10.If Result(7) > Result(8), return 1.
11.Return +0.
Note that, because undefined always compared greater than any other value, undefined and nonexistent
property values always sort to the end of the result. It is implementation-dependent whether or not such
properties will exist or not at the end of the array when the sort is concluded.
Note that the sort function is intentionally generic; it does not require that its this value be an Array object.
Therefore it can be transferred to other kinds of objects for use as a method. Whether the sort function can be
applied successfully to a host object is implementation dependent .
Author: christine@netscape.com
Date: 12 november 1997
*/
var SECTION = "15.4.4.5-1";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Array.prototype.sort(comparefn)";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = new Array();
getTestCases();
test();
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}
function getTestCases() {
var S = new Array();
var item = 0;
// array is empty.
S[item++] = "var A = new Array()";
// array contains one item
S[item++] = "var A = new Array( true )";
// length of array is 2
S[item++] = "var A = new Array( true, false, new Boolean(true), new Boolean(false), 'true', 'false' )";
S[item++] = "var A = new Array(); A[3] = 'undefined'; A[6] = null; A[8] = 'null'; A[0] = void 0";
S[item] = "var A = new Array( ";
var limit = 0x0061;
for ( var i = 0x007A; i >= limit; i-- ) {
S[item] += "\'"+ String.fromCharCode(i) +"\'" ;
if ( i > limit ) {
S[item] += ",";
}
}
S[item] += ")";
item++;
for ( var i = 0; i < S.length; i++ ) {
CheckItems( S[i] );
}
}
function CheckItems( S ) {
eval( S );
var E = Sort( A );
testcases[testcases.length] = new TestCase( SECTION,
S +"; A.sort(); A.length",
E.length,
eval( S + "; A.sort(); A.length") );
for ( var i = 0; i < E.length; i++ ) {
testcases[testcases.length] = new TestCase(
SECTION,
"A["+i+ "].toString()",
E[i] +"",
A[i] +"");
if ( A[i] == void 0 && typeof A[i] == "undefined" ) {
testcases[testcases.length] = new TestCase(
SECTION,
"typeof A["+i+ "]",
typeof E[i],
typeof A[i] );
}
}
}
function Object_1( value ) {
this.array = value.split(",");
this.length = this.array.length;
for ( var i = 0; i < this.length; i++ ) {
this[i] = eval(this.array[i]);
}
this.sort = Array.prototype.sort;
this.getClass = Object.prototype.toString;
}
function Sort( a ) {
for ( i = 0; i < a.length; i++ ) {
for ( j = i+1; j < a.length; j++ ) {
var lo = a[i];
var hi = a[j];
var c = Compare( lo, hi );
if ( c == 1 ) {
a[i] = hi;
a[j] = lo;
}
}
}
return a;
}
function Compare( x, y ) {
if ( x == void 0 && y == void 0 && typeof x == "undefined" && typeof y == "undefined" ) {
return +0;
}
if ( x == void 0 && typeof x == "undefined" ) {
return 1;
}
if ( y == void 0 && typeof y == "undefined" ) {
return -1;
}
x = String(x);
y = String(y);
if ( x < y ) {
return -1;
}
if ( x > y ) {
return 1;
}
return 0;
}

View File

@@ -1,221 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.4.4.5-2.js
ECMA Section: Array.prototype.sort(comparefn)
Description:
This test file tests cases in which the compare function is supplied.
In this cases, the sort creates a reverse sort.
The elements of this array are sorted. The sort is not necessarily stable.
If comparefn is provided, it should be a function that accepts two arguments
x and y and returns a negative value if x < y, zero if x = y, or a positive
value if x > y.
1. Call the [[Get]] method of this object with argument "length".
2. Call ToUint32(Result(1)).
1. Perform an implementation-dependent sequence of calls to the
[[Get]] , [[Put]], and [[Delete]] methods of this object and
toSortCompare (described below), where the first argument for each call
to [[Get]], [[Put]] , or [[Delete]] is a nonnegative integer less
than Result(2) and where the arguments for calls to SortCompare are
results of previous calls to the [[Get]] method. After this sequence
is complete, this object must have the following two properties.
(1) There must be some mathematical permutation of the nonnegative
integers less than Result(2), such that for every nonnegative integer
j less than Result(2), if property old[j] existed, then new[(j)] is
exactly the same value as old[j],. but if property old[j] did not exist,
then new[(j)] either does not exist or exists with value undefined.
(2) If comparefn is not supplied or is a consistent comparison
function for the elements of this array, then for all nonnegative
integers j and k, each less than Result(2), if old[j] compares less
than old[k] (see SortCompare below), then (j) < (k). Here we use the
notation old[j] to refer to the hypothetical result of calling the [
[Get]] method of this object with argument j before this step is
executed, and the notation new[j] to refer to the hypothetical result
of calling the [[Get]] method of this object with argument j after this
step has been completely executed. A function is a consistent
comparison function for a set of values if (a) for any two of those
values (possibly the same value) considered as an ordered pair, it
always returns the same value when given that pair of values as its
two arguments, and the result of applying ToNumber to this value is
not NaN; (b) when considered as a relation, where the pair (x, y) is
considered to be in the relation if and only if applying the function
to x and y and then applying ToNumber to the result produces a
negative value, this relation is a partial order; and (c) when
considered as a different relation, where the pair (x, y) is considered
to be in the relation if and only if applying the function to x and y
and then applying ToNumber to the result produces a zero value (of either
sign), this relation is an equivalence relation. In this context, the
phrase "x compares less than y" means applying Result(2) to x and y and
then applying ToNumber to the result produces a negative value.
3.Return this object.
When the SortCompare operator is called with two arguments x and y, the following steps are taken:
1.If x and y are both undefined, return +0.
2.If x is undefined, return 1.
3.If y is undefined, return 1.
4.If the argument comparefn was not provided in the call to sort, go to step 7.
5.Call comparefn with arguments x and y.
6.Return Result(5).
7.Call ToString(x).
8.Call ToString(y).
9.If Result(7) < Result(8), return 1.
10.If Result(7) > Result(8), return 1.
11.Return +0.
Note that, because undefined always compared greater than any other value, undefined and nonexistent
property values always sort to the end of the result. It is implementation-dependent whether or not such
properties will exist or not at the end of the array when the sort is concluded.
Note that the sort function is intentionally generic; it does not require that its this value be an Array object.
Therefore it can be transferred to other kinds of objects for use as a method. Whether the sort function can be
applied successfully to a host object is implementation dependent .
Author: christine@netscape.com
Date: 12 november 1997
*/
var SECTION = "15.4.4.5-2";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Array.prototype.sort(comparefn)";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = new Array();
getTestCases();
test();
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}
function getTestCases() {
var S = new Array();
var item = 0;
// array is empty.
S[item++] = "var A = new Array()";
// array contains one item
S[item++] = "var A = new Array( true )";
// length of array is 2
S[item++] = "var A = new Array( true, false, new Boolean(true), new Boolean(false), 'true', 'false' )";
S[item++] = "var A = new Array(); A[3] = 'undefined'; A[6] = null; A[8] = 'null'; A[0] = void 0";
S[item] = "var A = new Array( ";
var limit = 0x0061;
for ( var i = 0x007A; i >= limit; i-- ) {
S[item] += "\'"+ String.fromCharCode(i) +"\'" ;
if ( i > limit ) {
S[item] += ",";
}
}
S[item] += ")";
for ( var i = 0; i < S.length; i++ ) {
CheckItems( S[i] );
}
}
function CheckItems( S ) {
eval( S );
var E = Sort( A );
testcases[testcases.length] = new TestCase( SECTION,
S +"; A.sort(Compare); A.length",
E.length,
eval( S + "; A.sort(Compare); A.length") );
for ( var i = 0; i < E.length; i++ ) {
testcases[testcases.length] = new TestCase(
SECTION,
"A["+i+ "].toString()",
E[i] +"",
A[i] +"");
if ( A[i] == void 0 && typeof A[i] == "undefined" ) {
testcases[testcases.length] = new TestCase(
SECTION,
"typeof A["+i+ "]",
typeof E[i],
typeof A[i] );
}
}
}
function Object_1( value ) {
this.array = value.split(",");
this.length = this.array.length;
for ( var i = 0; i < this.length; i++ ) {
this[i] = eval(this.array[i]);
}
this.sort = Array.prototype.sort;
this.getClass = Object.prototype.toString;
}
function Sort( a ) {
var r1 = a.length;
for ( i = 0; i < a.length; i++ ) {
for ( j = i+1; j < a.length; j++ ) {
var lo = a[i];
var hi = a[j];
var c = Compare( lo, hi );
if ( c == 1 ) {
a[i] = hi;
a[j] = lo;
}
}
}
return a;
}
function Compare( x, y ) {
if ( x == void 0 && y == void 0 && typeof x == "undefined" && typeof y == "undefined" ) {
return +0;
}
if ( x == void 0 && typeof x == "undefined" ) {
return 1;
}
if ( y == void 0 && typeof y == "undefined" ) {
return -1;
}
x = String(x);
y = String(y);
if ( x < y ) {
return 1;
}
if ( x > y ) {
return -1;
}
return 0;
}

View File

@@ -1,178 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.4.4.5-3.js
ECMA Section: Array.prototype.sort(comparefn)
Description:
This is a regression test for
http://scopus/bugsplat/show_bug.cgi?id=117144
Verify that sort is successfull, even if the sort compare function returns
a very large negative or positive value.
Author: christine@netscape.com
Date: 12 november 1997
*/
var SECTION = "15.4.4.5-3";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Array.prototype.sort(comparefn)";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = new Array();
getTestCases();
test();
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}
function getTestCases() {
var array = new Array();
array[array.length] = new Date( TIME_2000 * Math.PI );
array[array.length] = new Date( TIME_2000 * 10 );
array[array.length] = new Date( TIME_1900 + TIME_1900 );
array[array.length] = new Date(0);
array[array.length] = new Date( TIME_2000 );
array[array.length] = new Date( TIME_1900 + TIME_1900 +TIME_1900 );
array[array.length] = new Date( TIME_1900 * Math.PI );
array[array.length] = new Date( TIME_1900 * 10 );
array[array.length] = new Date( TIME_1900 );
array[array.length] = new Date( TIME_2000 + TIME_2000 );
array[array.length] = new Date( 1899, 0, 1 );
array[array.length] = new Date( 2000, 1, 29 );
array[array.length] = new Date( 2000, 0, 1 );
array[array.length] = new Date( 1999, 11, 31 );
var testarr1 = new Array()
clone( array, testarr1 );
testarr1.sort( comparefn1 );
var testarr2 = new Array()
clone( array, testarr2 );
testarr2.sort( comparefn2 );
testarr3 = new Array();
clone( array, testarr3 );
testarr3.sort( comparefn3 );
// when there's no sort function, sort sorts by the toString value of Date.
var testarr4 = new Array()
clone( array, testarr4 );
testarr4.sort();
var realarr = new Array();
clone( array, realarr );
realarr.sort( realsort );
var stringarr = new Array();
clone( array, stringarr );
stringarr.sort( stringsort );
for ( var i = 0, tc = 0; i < array.length; i++, tc++) {
testcases[tc] = new TestCase(
SECTION,
"testarr1["+i+"]",
realarr[i],
testarr1[i] );
}
for ( var i=0; i < array.length; i++, tc++) {
testcases[tc] = new TestCase(
SECTION,
"testarr2["+i+"]",
realarr[i],
testarr2[i] );
}
for ( var i=0; i < array.length; i++, tc++) {
testcases[tc] = new TestCase(
SECTION,
"testarr3["+i+"]",
realarr[i],
testarr3[i] );
}
for ( var i=0; i < array.length; i++, tc++) {
testcases[tc] = new TestCase(
SECTION,
"testarr4["+i+"]",
stringarr[i].toString(),
testarr4[i].toString() );
}
}
function comparefn1( x, y ) {
return x - y;
}
function comparefn2( x, y ) {
return x.valueOf() - y.valueOf();
}
function realsort( x, y ) {
return ( x.valueOf() == y.valueOf() ? 0 : ( x.valueOf() > y.valueOf() ? 1 : -1 ) );
}
function comparefn3( x, y ) {
return ( x == y ? 0 : ( x > y ? 1: -1 ) );
}
function clone( source, target ) {
for (i = 0; i < source.length; i++ ) {
target[i] = source[i];
}
}
function stringsort( x, y ) {
for ( var i = 0; i < x.toString().length; i++ ) {
var d = (x.toString()).charCodeAt(i) - (y.toString()).charCodeAt(i);
if ( d > 0 ) {
return 1;
} else {
if ( d < 0 ) {
return -1;
} else {
continue;
}
}
var d = x.length - y.length;
if ( d > 0 ) {
return 1;
} else {
if ( d < 0 ) {
return -1;
}
}
}
return 0;
}

View File

@@ -1,74 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.4.4.js
ECMA Section: 15.4.4 Properties of the Array Prototype Object
Description: The value of the internal [[Prototype]] property of
the Array prototype object is the Object prototype
object.
Note that the Array prototype object is itself an
array; it has a length property (whose initial value
is (0) and the special [[Put]] method.
Author: christine@netscape.com
Date: 7 october 1997
*/
var SECTION = "15.4.4";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Properties of the Array Prototype Object";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = getTestCases();
test();
function getTestCases() {
var array = new Array();
var item = 0;
// these testcases are ECMA_2
// array[item++] = new TestCase( SECTION, "Array.prototype.__proto__", Object.prototype, Array.prototype.__proto__ );
// array[item++] = new TestCase( SECTION, "Array.__proto__.valueOf == Object.__proto__.valueOf", true, (Array.__proto__.valueOf == Object.__proto__.valueOf) );
array[item++] = new TestCase( SECTION, "Array.prototype.length", 0, Array.prototype.length );
// verify that prototype object is an Array object.
array[item++] = new TestCase( SECTION, "typeof Array.prototype", "object", typeof Array.prototype );
array[item++] = new TestCase( SECTION,
"Array.prototype.toString = Object.prototype.toString; Array.prototype.toString()",
"[object Array]",
eval("Array.prototype.toString = Object.prototype.toString; Array.prototype.toString()") );
return ( array );
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+ testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,184 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.4.5.1-1.js
ECMA Section: [[ Put]] (P, V)
Description:
Array objects use a variation of the [[Put]] method used for other native
ECMAScript objects (section 8.6.2.2).
Assume A is an Array object and P is a string.
When the [[Put]] method of A is called with property P and value V, the
following steps are taken:
1. Call the [[CanPut]] method of A with name P.
2. If Result(1) is false, return.
3. If A doesn't have a property with name P, go to step 7.
4. If P is "length", go to step 12.
5. Set the value of property P of A to V.
6. Go to step 8.
7. Create a property with name P, set its value to V and give it empty
attributes.
8. If P is not an array index, return.
9. If A itself has a property (not an inherited property) named "length",
andToUint32(P) is less than the value of the length property of A, then
return.
10. Change (or set) the value of the length property of A to ToUint32(P)+1.
11. Return.
12. Compute ToUint32(V).
13. For every integer k that is less than the value of the length property
of A but not less than Result(12), if A itself has a property (not an
inherited property) named ToString(k), then delete that property.
14. Set the value of property P of A to Result(12).
15. Return.
Author: christine@netscape.com
Date: 12 november 1997
*/
var SECTION = "15.4.5.1-1";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Array [[Put]] (P, V)";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = getTestCases();
test();
function getTestCases() {
var array = new Array();
var item = 0;
// P is "length"
array[item++] = new TestCase( SECTION,
"var A = new Array(); A.length = 1000; A.length",
1000,
eval("var A = new Array(); A.length = 1000; A.length") );
array[item++] = new TestCase( SECTION,
"var A = new Array(1000); A.length = Math.pow(2,32); A.length",
0,
eval("var A = new Array(1000); A.length = Math.pow(2,32); A.length") );
array[item++] = new TestCase( SECTION,
"var A = new Array(1); A.length = Math.pow(2,32) +1000; A.length",
1000,
eval("var A = new Array(1); A.length = Math.pow(2,32) +1000; A.length") );
array[item++] = new TestCase( SECTION,
"var A = new Array(1000); A.length = Math.pow(2,32) +1; A.length",
1,
eval("var A = new Array(1000); A.length = Math.pow(2,32) +1; A.length") );
// A has Property P, and P is not length or an array index
array[item++] = new TestCase( SECTION,
"var A = new Array(1000); A.name = 'name of this array'; A.name",
'name of this array',
eval("var A = new Array(1000); A.name = 'name of this array'; A.name") );
array[item++] = new TestCase( SECTION,
"var A = new Array(1000); A.name = 'name of this array'; A.length",
1000,
eval("var A = new Array(1000); A.name = 'name of this array'; A.length") );
// A has Property P, P is not length, P is an array index, and ToUint32(p) is less than the
// value of length
array[item++] = new TestCase( SECTION,
"var A = new Array(1000); A[123] = 'hola'; A[123]",
'hola',
eval("var A = new Array(1000); A[123] = 'hola'; A[123]") );
array[item++] = new TestCase( SECTION,
"var A = new Array(1000); A[123] = 'hola'; A.length",
1000,
eval("var A = new Array(1000); A[123] = 'hola'; A.length") );
for ( var i = 0X0020, TEST_STRING = "var A = new Array( " ; i < 0x00ff; i++ ) {
TEST_STRING += "\'\\"+ String.fromCharCode( i ) +"\'";
if ( i < 0x00FF - 1 ) {
TEST_STRING += ",";
} else {
TEST_STRING += ");"
}
}
var LENGTH = 0x00ff - 0x0020;
array[item++] = new TestCase( SECTION,
TEST_STRING +" A[150] = 'hello'; A[150]",
'hello',
eval( TEST_STRING + " A[150] = 'hello'; A[150]" ) );
array[item++] = new TestCase( SECTION,
TEST_STRING +" A[150] = 'hello'; A[150]",
LENGTH,
eval( TEST_STRING + " A[150] = 'hello'; A.length" ) );
// A has Property P, P is not length, P is an array index, and ToUint32(p) is not less than the
// value of length
array[item++] = new TestCase( SECTION,
"var A = new Array(); A[123] = true; A.length",
124,
eval("var A = new Array(); A[123] = true; A.length") );
array[item++] = new TestCase( SECTION,
"var A = new Array(0,1,2,3,4,5,6,7,8,9,10); A[15] ='15'; A.length",
16,
eval("var A = new Array(0,1,2,3,4,5,6,7,8,9,10); A[15] ='15'; A.length") );
for ( var i = 0; i < A.length; i++, item++ ) {
array[item] = new TestCase( SECTION,
"var A = new Array(0,1,2,3,4,5,6,7,8,9,10); A[15] ='15'; A[" +i +"]",
(i <= 10) ? i : ( i == 15 ? '15' : void 0 ),
A[i] );
}
// P is not an array index, and P is not "length"
array[item++] = new TestCase( SECTION,
"var A = new Array(); A.join.length = 4; A.join.length",
1,
eval("var A = new Array(); A.join.length = 4; A.join.length") );
array[item++] = new TestCase( SECTION,
"var A = new Array(); A.join.length = 4; A.length",
0,
eval("var A = new Array(); A.join.length = 4; A.length") );
return array;
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,147 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.4.5.1-2.js
ECMA Section: [[ Put]] (P, V)
Description:
Array objects use a variation of the [[Put]] method used for other native
ECMAScript objects (section 8.6.2.2).
Assume A is an Array object and P is a string.
When the [[Put]] method of A is called with property P and value V, the
following steps are taken:
1. Call the [[CanPut]] method of A with name P.
2. If Result(1) is false, return.
3. If A doesn't have a property with name P, go to step 7.
4. If P is "length", go to step 12.
5. Set the value of property P of A to V.
6. Go to step 8.
7. Create a property with name P, set its value to V and give it empty
attributes.
8. If P is not an array index, return.
9. If A itself has a property (not an inherited property) named "length",
andToUint32(P) is less than the value of the length property of A, then
return.
10. Change (or set) the value of the length property of A to ToUint32(P)+1.
11. Return.
12. Compute ToUint32(V).
13. For every integer k that is less than the value of the length property
of A but not less than Result(12), if A itself has a property (not an
inherited property) named ToString(k), then delete that property.
14. Set the value of property P of A to Result(12).
15. Return.
These are testcases from Waldemar, detailed in
http://scopus.mcom.com/bugsplat/show_bug.cgi?id=123552
Author: christine@netscape.com
Date: 15 June 1998
*/
var SECTION = "15.4.5.1-2";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Array [[Put]] (P,V)";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = new Array();
var a = new Array();
AddCase( "3.00", "three" );
AddCase( "00010", "eight" );
AddCase( "37xyz", "thirty-five" );
AddCase("5000000000", 5)
AddCase( "-2", -3 );
testcases[tc++] = new TestCase( SECTION,
"a[10]",
void 0,
a[10] );
testcases[tc++] = new TestCase( SECTION,
"a[3]",
void 0,
a[3] );
a[4] = "four";
testcases[tc++] = new TestCase( SECTION,
"a[4] = \"four\"; a[4]",
"four",
a[4] );
testcases[tc++] = new TestCase( SECTION,
"a[\"4\"]",
"four",
a["4"] );
testcases[tc++] = new TestCase( SECTION,
"a[\"4.00\"]",
void 0,
a["4.00"] );
testcases[tc++] = new TestCase( SECTION,
"a.length",
5,
a.length );
a["5000000000"] = 5;
testcases[tc++] = new TestCase( SECTION,
"a[\"5000000000\"] = 5; a.length",
5,
a.length );
testcases[tc++] = new TestCase( SECTION,
"a[\"-2\"] = -3; a.length",
5,
a.length );
test();
function AddCase ( arg, value ) {
a[arg] = value;
testcases[tc++] = new TestCase( SECTION,
"a[\"" + arg + "\"] = "+ value +"; a.length",
0,
a.length );
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,90 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.4.5.2-1.js
ECMA Section: Array.length
Description:
15.4.5.2 length
The length property of this Array object is always numerically greater
than the name of every property whose name is an array index.
The length property has the attributes { DontEnum, DontDelete }.
Author: christine@netscape.com
Date: 12 november 1997
*/
var SECTION = "15.4.5.2-1";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Array.length";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = getTestCases();
test();
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = new TestCase( SECTION,
"var A = new Array(); A.length",
0,
eval("var A = new Array(); A.length") );
array[item++] = new TestCase( SECTION,
"var A = new Array(); A[Math.pow(2,32)-2] = 'hi'; A.length",
Math.pow(2,32)-1,
eval("var A = new Array(); A[Math.pow(2,32)-2] = 'hi'; A.length") );
array[item++] = new TestCase( SECTION,
"var A = new Array(); A.length = 123; A.length",
123,
eval("var A = new Array(); A.length = 123; A.length") );
array[item++] = new TestCase( SECTION,
"var A = new Array(); A.length = 123; var PROPS = ''; for ( var p in A ) { PROPS += ( p == 'length' ? p : ''); } PROPS",
"",
eval("var A = new Array(); A.length = 123; var PROPS = ''; for ( var p in A ) { PROPS += ( p == 'length' ? p : ''); } PROPS") );
array[item++] = new TestCase( SECTION,
"var A = new Array(); A.length = 123; delete A.length",
false ,
eval("var A = new Array(); A.length = 123; delete A.length") );
array[item++] = new TestCase( SECTION,
"var A = new Array(); A.length = 123; delete A.length; A.length",
123,
eval("var A = new Array(); A.length = 123; delete A.length; A.length") );
return array;
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,121 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.4.5.2-2.js
ECMA Section: Array.length
Description:
15.4.5.2 length
The length property of this Array object is always numerically greater
than the name of every property whose name is an array index.
The length property has the attributes { DontEnum, DontDelete }.
This test verifies that the Array.length property is not Read Only.
Author: christine@netscape.com
Date: 12 november 1997
*/
var SECTION = "15.4.5.2-2";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Array.length";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = new Array();
addCase( new Array(), 0, Math.pow(2,14), Math.pow(2,14) );
addCase( new Array(), 0, 1, 1 );
addCase( new Array(), 0, -Math.pow(2,31), Math.pow(2,32)-Math.pow(2,31));
addCase( new Array(Math.pow(2,12)), Math.pow(2,12), 0, 0 );
addCase( new Array(Math.pow(2,13)), Math.pow(2,13), Math.pow(2,12), Math.pow(2,12) );
addCase( new Array(Math.pow(2,12)), Math.pow(2,12), Math.pow(2,12), Math.pow(2,12) );
addCase( new Array(Math.pow(2,14)), Math.pow(2,14), Math.pow(2,12), Math.pow(2,12) )
// some tests where array is not empty
// array is populated with strings
for ( var arg = "", i = 0; i < Math.pow(2,12); i++ ) {
arg += String(i) + ( i != Math.pow(2,12)-1 ? "," : "" );
}
// print(i +":"+arg);
var a = eval( "new Array("+arg+")" );
addCase( a, i, i, i );
addCase( a, i, Math.pow(2,12)+i+1, Math.pow(2,12)+i+1, true );
addCase( a, Math.pow(2,12)+5, 0, 0, true );
test();
function addCase( object, old_len, set_len, new_len, checkitems ) {
object.length = set_len;
testcases[testcases.length] = new TestCase( SECTION,
"array = new Array("+ old_len+"); array.length = " + set_len +
"; array.length",
new_len,
object.length );
if ( checkitems ) {
// verify that items between old and newlen are all undefined
if ( new_len < old_len ) {
var passed = true;
for ( var i = new_len; i < old_len; i++ ) {
if ( object[i] != void 0 ) {
passed = false;
}
}
testcases[testcases.length] = new TestCase( SECTION,
"verify that array items have been deleted",
true,
passed );
}
if ( new_len > old_len ) {
var passed = true;
for ( var i = old_len; i < new_len; i++ ) {
if ( object[i] != void 0 ) {
passed = false;
}
}
testcases[testcases.length] = new TestCase( SECTION,
"verify that new items are undefined",
true,
passed );
}
}
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,93 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.6.1.js
ECMA Section: 15.6.1 The Boolean Function
15.6.1.1 Boolean( value )
15.6.1.2 Boolean ()
Description: Boolean( value ) should return a Boolean value
not a Boolean object) computed by
Boolean.toBooleanValue( value)
15.6.1.2 Boolean() returns false
Author: christine@netscape.com
Date: 27 jun 1997
Data File Fields:
VALUE Argument passed to the Boolean function
TYPE typeof VALUE (not used, but helpful in understanding
the data file)
E_RETURN Expected return value of Boolean( VALUE )
*/
var SECTION = "15.6.1";
var VERSION = "ECMA_1";
startTest();
var TITLE = "The Boolean constructor called as a function: Boolean( value ) and Boolean()";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = getTestCases();
test();
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = new TestCase( SECTION, "Boolean(1)", true, Boolean(1) );
array[item++] = new TestCase( SECTION, "Boolean(0)", false, Boolean(0) );
array[item++] = new TestCase( SECTION, "Boolean(-1)", true, Boolean(-1) );
array[item++] = new TestCase( SECTION, "Boolean('1')", true, Boolean("1") );
array[item++] = new TestCase( SECTION, "Boolean('0')", true, Boolean("0") );
array[item++] = new TestCase( SECTION, "Boolean('-1')", true, Boolean("-1") );
array[item++] = new TestCase( SECTION, "Boolean(true)", true, Boolean(true) );
array[item++] = new TestCase( SECTION, "Boolean(false)", false, Boolean(false) );
array[item++] = new TestCase( SECTION, "Boolean('true')", true, Boolean("true") );
array[item++] = new TestCase( SECTION, "Boolean('false')", true, Boolean("false") );
array[item++] = new TestCase( SECTION, "Boolean(null)", false, Boolean(null) );
array[item++] = new TestCase( SECTION, "Boolean(-Infinity)", true, Boolean(Number.NEGATIVE_INFINITY) );
array[item++] = new TestCase( SECTION, "Boolean(NaN)", false, Boolean(Number.NaN) );
array[item++] = new TestCase( SECTION, "Boolean(void(0))", false, Boolean( void(0) ) );
array[item++] = new TestCase( SECTION, "Boolean(x=0)", false, Boolean( x=0 ) );
array[item++] = new TestCase( SECTION, "Boolean(x=1)", true, Boolean( x=1 ) );
array[item++] = new TestCase( SECTION, "Boolean(x=false)", false, Boolean( x=false ) );
array[item++] = new TestCase( SECTION, "Boolean(x=true)", true, Boolean( x=true ) );
array[item++] = new TestCase( SECTION, "Boolean(x=null)", false, Boolean( x=null ) );
array[item++] = new TestCase( SECTION, "Boolean()", false, Boolean() );
// array[item++] = new TestCase( SECTION, "Boolean(var someVar)", false, Boolean( someVar ) );
return ( array );
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,157 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.6.2.js
ECMA Section: 15.6.2 The Boolean Constructor
15.6.2.1 new Boolean( value )
15.6.2.2 new Boolean()
This test verifies that the Boolean constructor
initializes a new object (typeof should return
"object"). The prototype of the new object should
be Boolean.prototype. The value of the object
should be ToBoolean( value ) (a boolean value).
Description:
Author: christine@netscape.com
Date: june 27, 1997
*/
var SECTION = "15.6.2";
var VERSION = "ECMA_1";
startTest();
var TITLE = "15.6.2 The Boolean Constructor; 15.6.2.1 new Boolean( value ); 15.6.2.2 new Boolean()";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = getTestCases();
test();
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = new TestCase( SECTION, "typeof (new Boolean(1))", "object", typeof (new Boolean(1)) );
array[item++] = new TestCase( SECTION, "(new Boolean(1)).constructor", Boolean.prototype.constructor, (new Boolean(1)).constructor );
array[item++] = new TestCase( SECTION,
"TESTBOOL=new Boolean(1);TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()",
"[object Boolean]",
eval("TESTBOOL=new Boolean(1);TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()") );
array[item++] = new TestCase( SECTION, "(new Boolean(1)).valueOf()", true, (new Boolean(1)).valueOf() );
array[item++] = new TestCase( SECTION, "typeof new Boolean(1)", "object", typeof new Boolean(1) );
array[item++] = new TestCase( SECTION, "(new Boolean(0)).constructor", Boolean.prototype.constructor, (new Boolean(0)).constructor );
array[item++] = new TestCase( SECTION,
"TESTBOOL=new Boolean(0);TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()",
"[object Boolean]",
eval("TESTBOOL=new Boolean(0);TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()") );
array[item++] = new TestCase( SECTION, "(new Boolean(0)).valueOf()", false, (new Boolean(0)).valueOf() );
array[item++] = new TestCase( SECTION, "typeof new Boolean(0)", "object", typeof new Boolean(0) );
array[item++] = new TestCase( SECTION, "(new Boolean(-1)).constructor", Boolean.prototype.constructor, (new Boolean(-1)).constructor );
array[item++] = new TestCase( SECTION,
"TESTBOOL=new Boolean(-1);TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()",
"[object Boolean]",
eval("TESTBOOL=new Boolean(-1);TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()") );
array[item++] = new TestCase( SECTION, "(new Boolean(-1)).valueOf()", true, (new Boolean(-1)).valueOf() );
array[item++] = new TestCase( SECTION, "typeof new Boolean(-1)", "object", typeof new Boolean(-1) );
array[item++] = new TestCase( SECTION, "(new Boolean('1')).constructor", Boolean.prototype.constructor, (new Boolean('1')).constructor );
array[item++] = new TestCase( SECTION,
"TESTBOOL=new Boolean('1');TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()",
"[object Boolean]",
eval("TESTBOOL=new Boolean('1');TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()") );
array[item++] = new TestCase( SECTION, "(new Boolean('1')).valueOf()", true, (new Boolean('1')).valueOf() );
array[item++] = new TestCase( SECTION, "typeof new Boolean('1')", "object", typeof new Boolean('1') );
array[item++] = new TestCase( SECTION, "(new Boolean('0')).constructor", Boolean.prototype.constructor, (new Boolean('0')).constructor );
array[item++] = new TestCase( SECTION,
"TESTBOOL=new Boolean('0');TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()",
"[object Boolean]",
eval("TESTBOOL=new Boolean('0');TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()") );
array[item++] = new TestCase( SECTION, "(new Boolean('0')).valueOf()", true, (new Boolean('0')).valueOf() );
array[item++] = new TestCase( SECTION, "typeof new Boolean('0')", "object", typeof new Boolean('0') );
array[item++] = new TestCase( SECTION, "(new Boolean('-1')).constructor", Boolean.prototype.constructor, (new Boolean('-1')).constructor );
array[item++] = new TestCase( SECTION,
"TESTBOOL=new Boolean('-1');TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()",
"[object Boolean]",
eval("TESTBOOL=new Boolean('-1');TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()") );
array[item++] = new TestCase( SECTION, "(new Boolean('-1')).valueOf()", true, (new Boolean('-1')).valueOf() );
array[item++] = new TestCase( SECTION, "typeof new Boolean('-1')", "object", typeof new Boolean('-1') );
array[item++] = new TestCase( SECTION, "(new Boolean(new Boolean(true))).constructor", Boolean.prototype.constructor, (new Boolean(new Boolean(true))).constructor );
array[item++] = new TestCase( SECTION,
"TESTBOOL=new Boolean(new Boolean(true));TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()",
"[object Boolean]",
eval("TESTBOOL=new Boolean(new Boolean(true));TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()") );
array[item++] = new TestCase( SECTION, "(new Boolean(new Boolean(true))).valueOf()", true, (new Boolean(new Boolean(true))).valueOf() );
array[item++] = new TestCase( SECTION, "typeof new Boolean(new Boolean(true))", "object", typeof new Boolean(new Boolean(true)) );
array[item++] = new TestCase( SECTION, "(new Boolean(Number.NaN)).constructor", Boolean.prototype.constructor, (new Boolean(Number.NaN)).constructor );
array[item++] = new TestCase( SECTION,
"TESTBOOL=new Boolean(Number.NaN);TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()",
"[object Boolean]",
eval("TESTBOOL=new Boolean(Number.NaN);TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()") );
array[item++] = new TestCase( SECTION, "(new Boolean(Number.NaN)).valueOf()", false, (new Boolean(Number.NaN)).valueOf() );
array[item++] = new TestCase( SECTION, "typeof new Boolean(Number.NaN)", "object", typeof new Boolean(Number.NaN) );
array[item++] = new TestCase( SECTION, "(new Boolean(null)).constructor", Boolean.prototype.constructor, (new Boolean(null)).constructor );
array[item++] = new TestCase( SECTION,
"TESTBOOL=new Boolean(null);TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()",
"[object Boolean]",
eval("TESTBOOL=new Boolean(null);TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()") );
array[item++] = new TestCase( SECTION, "(new Boolean(null)).valueOf()", false, (new Boolean(null)).valueOf() );
array[item++] = new TestCase( SECTION, "typeof new Boolean(null)", "object", typeof new Boolean(null) );
array[item++] = new TestCase( SECTION, "(new Boolean(void 0)).constructor", Boolean.prototype.constructor, (new Boolean(void 0)).constructor );
array[item++] = new TestCase( SECTION,
"TESTBOOL=new Boolean(void 0);TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()",
"[object Boolean]",
eval("TESTBOOL=new Boolean(void 0);TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()") );
array[item++] = new TestCase( SECTION, "(new Boolean(void 0)).valueOf()", false, (new Boolean(void 0)).valueOf() );
array[item++] = new TestCase( SECTION, "typeof new Boolean(void 0)", "object", typeof new Boolean(void 0) );
array[item++] = new TestCase( SECTION, "(new Boolean(Number.POSITIVE_INFINITY)).constructor", Boolean.prototype.constructor, (new Boolean(Number.POSITIVE_INFINITY)).constructor );
array[item++] = new TestCase( SECTION,
"TESTBOOL=new Boolean(Number.POSITIVE_INFINITY);TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()",
"[object Boolean]",
eval("TESTBOOL=new Boolean(Number.POSITIVE_INFINITY);TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()") );
array[item++] = new TestCase( SECTION, "(new Boolean(Number.POSITIVE_INFINITY)).valueOf()", true, (new Boolean(Number.POSITIVE_INFINITY)).valueOf() );
array[item++] = new TestCase( SECTION, "typeof new Boolean(Number.POSITIVE_INFINITY)", "object", typeof new Boolean(Number.POSITIVE_INFINITY) );
array[item++] = new TestCase( SECTION, "(new Boolean(Number.NEGATIVE_INFINITY)).constructor", Boolean.prototype.constructor, (new Boolean(Number.NEGATIVE_INFINITY)).constructor );
array[item++] = new TestCase( SECTION,
"TESTBOOL=new Boolean(Number.NEGATIVE_INFINITY);TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()",
"[object Boolean]",
eval("TESTBOOL=new Boolean(Number.NEGATIVE_INFINITY);TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()") );
array[item++] = new TestCase( SECTION, "(new Boolean(Number.NEGATIVE_INFINITY)).valueOf()", true, (new Boolean(Number.NEGATIVE_INFINITY)).valueOf() );
array[item++] = new TestCase( SECTION, "typeof new Boolean(Number.NEGATIVE_INFINITY)", "object", typeof new Boolean(Number.NEGATIVE_INFINITY) );
array[item++] = new TestCase( SECTION, "(new Boolean(Number.NEGATIVE_INFINITY)).constructor", Boolean.prototype.constructor, (new Boolean(Number.NEGATIVE_INFINITY)).constructor );
array[item++] = new TestCase( "15.6.2.2",
"TESTBOOL=new Boolean();TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()",
"[object Boolean]",
eval("TESTBOOL=new Boolean();TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()") );
array[item++] = new TestCase( "15.6.2.2", "(new Boolean()).valueOf()", false, (new Boolean()).valueOf() );
array[item++] = new TestCase( "15.6.2.2", "typeof new Boolean()", "object", typeof new Boolean() );
return ( array );
}
function test() {
for ( tc = 0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+ testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,69 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.6.3.1-1.js
ECMA Section: 15.6.3 Boolean.prototype
Description: The initial value of Boolean.prototype is the built-in
Boolean prototype object (15.6.4).
The property shall have the attributes [DontEnum,
DontDelete, ReadOnly ].
This tests the DontEnum property of Boolean.prototype
Author: christine@netscape.com
Date: june 27, 1997
*/
var SECTION = "15.6.3.1-1";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Boolean.prototype";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = getTestCases();
test();
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = new TestCase( SECTION,
"var str='';for ( p in Boolean ) { str += p } str;",
"",
eval("var str='';for ( p in Boolean ) { str += p } str;") );
return ( array );
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,66 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.6.3.1-2.js
ECMA Section: 15.6.3.1 Boolean.prototype
Description: The initial valu eof Boolean.prototype is the built-in
Boolean prototype object (15.6.4).
The property shall have the attributes [DontEnum,
DontDelete, ReadOnly ].
This tests the DontDelete property of Boolean.prototype
Author: christine@netscape.com
Date: june 27, 1997
*/
var SECTION = "15.6.3.1-2";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Boolean.prototype"
writeHeaderToLog( SECTION + TITLE );
var testcases = getTestCases();
test();
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = new TestCase( SECTION,
"delete( Boolean.prototype)",
false,
delete( Boolean.prototype) );
return ( array );
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,66 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.6.3.1-3.js
ECMA Section: 15.6.3.1 Boolean.prototype
Description: The initial valu eof Boolean.prototype is the built-in
Boolean prototype object (15.6.4).
The property shall have the attributes [DontEnum,
DontDelete, ReadOnly ].
This tests the DontDelete property of Boolean.prototype
Author: christine@netscape.com
Date: june 27, 1997
*/
var SECTION = "15.6.3.1-3";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Boolean.prototype"
writeHeaderToLog( SECTION + TITLE );
var testcases = getTestCases();
test();
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = new TestCase( SECTION,
"delete( Boolean.prototype); Boolean.prototype",
Boolean.prototype,
eval("delete( Boolean.prototype); Boolean.prototype") );
return ( array );
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,76 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.6.3.1-4.js
ECMA Section: 15.6.3.1 Properties of the Boolean Prototype Object
Description: The initial value of Boolean.prototype is the built-in
Boolean prototype object (15.6.4).
The property shall have the attributes [DontEnum,
DontDelete, ReadOnly ].
This tests the ReadOnly property of Boolean.prototype
Author: christine@netscape.com
Date: 30 september 1997
*/
var SECTION = "15.6.3.1-4";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Boolean.prototype"
writeHeaderToLog( SECTION + TITLE );
var testcases = getTestCases();
test();
function getTestCases() {
var array = new Array();
var item = 0;
var BOOL_PROTO = Boolean.prototype;
array[item++] = new TestCase( SECTION,
"var BOOL_PROTO = Boolean.prototype; Boolean.prototype=null; Boolean.prototype == BOOL_PROTO",
true,
eval("var BOOL_PROTO = Boolean.prototype; Boolean.prototype=null; Boolean.prototype == BOOL_PROTO") );
array[item++] = new TestCase( SECTION,
"var BOOL_PROTO = Boolean.prototype; Boolean.prototype=null; Boolean.prototype == null",
false,
eval("var BOOL_PROTO = Boolean.prototype; Boolean.prototype=null; Boolean.prototype == null") );
return ( array );
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,58 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.6.3.1-5.js
ECMA Section: 15.6.3.1 Boolean.prototype
Description:
Author: christine@netscape.com
Date: 28 october 1997
*/
var VERSION = "ECMA_2";
startTest();
var SECTION = "15.6.3.1-5";
var TITLE = "Boolean.prototype"
writeHeaderToLog( SECTION + " " + TITLE );
var tc= 0;
var testcases = getTestCases();
// all tests must call a function that returns an array of TestCase objects.
test();
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = new TestCase( SECTION, "Function.prototype == Boolean.__proto__", true, Function.prototype == Boolean.__proto__ );
return ( array );
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,69 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.6.3.1.js
ECMA Section: 15.6.3.1 Boolean.prototype
Description: The initial valu eof Boolean.prototype is the built-in
Boolean prototype object (15.6.4).
The property shall have the attributes [DontEnum,
DontDelete, ReadOnly ].
It has the internal [[Call]] and [[Construct]]
properties (not tested), and the length property.
Author: christine@netscape.com
Date: june 27, 1997
*/
var SECTION = "15.6.3.1";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Boolean.prototype";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = getTestCases();
test();
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = new TestCase( SECTION, "Boolean.prototype.valueOf()", false, Boolean.prototype.valueOf() );
array[item++] = new TestCase( SECTION, "Boolean.length", 1, Boolean.length );
return ( array );
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,64 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.6.3.js
ECMA Section: 15.6.3 Properties of the Boolean Constructor
Description: The value of the internal prototype property is
the Function prototype object.
It has the internal [[Call]] and [[Construct]]
properties, and the length property.
Author: christine@netscape.com
Date: june 27, 1997
*/
var SECTION = "15.6.3";
var VERSION = "ECMA_2";
startTest();
var TITLE = "Properties of the Boolean Constructor"
writeHeaderToLog( SECTION + TITLE );
var testcases = getTestCases();
test();
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = new TestCase( SECTION, "Boolean.__proto__ == Function.prototype", true, Boolean.__proto__ == Function.prototype );
array[item++] = new TestCase( SECTION, "Boolean.length", 1, Boolean.length );
return ( array );
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,70 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.6.4-1.js
ECMA Section: 15.6.4 Properties of the Boolean Prototype Object
Description:
The Boolean prototype object is itself a Boolean object (its [[Class]] is
"Boolean") whose value is false.
The value of the internal [[Prototype]] property of the Boolean prototype object
is the Object prototype object (15.2.3.1).
Author: christine@netscape.com
Date: 30 september 1997
*/
var VERSION = "ECMA_1"
startTest();
var SECTION = "15.6.4-1";
writeHeaderToLog( SECTION + " Properties of the Boolean Prototype Object");
var testcases = getTestCases();
test();
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = new TestCase( SECTION, "typeof Boolean.prototype == typeof( new Boolean )", true, typeof Boolean.prototype == typeof( new Boolean ) );
array[item++] = new TestCase( SECTION, "typeof( Boolean.prototype )", "object", typeof(Boolean.prototype) );
array[item++] = new TestCase( SECTION,
"Boolean.prototype.toString = Object.prototype.toString; Boolean.prototype.toString()",
"[object Boolean]",
eval("Boolean.prototype.toString = Object.prototype.toString; Boolean.prototype.toString()") );
array[item++] = new TestCase( SECTION, "Boolean.prototype.valueOf()", false, Boolean.prototype.valueOf() );
return ( array );
}
function test() {
for (tc = 0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+ testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "
}
stopTest();
return ( testcases );
}

View File

@@ -1,64 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.6.4-2.js
ECMA Section: 15.6.4 Properties of the Boolean Prototype Object
Description:
The Boolean prototype object is itself a Boolean object (its [[Class]] is
"Boolean") whose value is false.
The value of the internal [[Prototype]] property of the Boolean prototype object
is the Object prototype object (15.2.3.1).
Author: christine@netscape.com
Date: 30 september 1997
*/
var VERSION = "ECMA_2"
startTest();
var SECTION = "15.6.4-2";
writeHeaderToLog( SECTION + " Properties of the Boolean Prototype Object");
var testcases = getTestCases();
test();
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = new TestCase( SECTION, "Boolean.prototype.__proto__", Object.prototype, Boolean.prototype.__proto__ );
return ( array );
}
function test() {
for (tc = 0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+ testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value "
}
stopTest();
return ( testcases );
}

View File

@@ -1,62 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.6.4.1.js
ECMA Section: 15.6.4.1 Boolean.prototype.constructor
Description: The initial value of Boolean.prototype.constructor
is the built-in Boolean constructor.
Author: christine@netscape.com
Date: 30 september 1997
*/
var SECTION = "15.6.4.1";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Boolean.prototype.constructor"
writeHeaderToLog( SECTION + TITLE );
var testcases = getTestCases();
test();
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = new TestCase( SECTION,
"( Boolean.prototype.constructor == Boolean )",
true ,
(Boolean.prototype.constructor == Boolean) );
return ( array );
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,94 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.6.4.2.js
ECMA Section: 15.6.4.2-1 Boolean.prototype.toString()
Description: If this boolean value is true, then the string "true"
is returned; otherwise this boolean value must be false,
and the string "false" is returned.
The toString function is not generic; it generates
a runtime error if its this value is not a Boolean
object. Therefore it cannot be transferred to other
kinds of objects for use as a method.
Author: christine@netscape.com
Date: june 27, 1997
*/
var SECTION = "15.6.4.2-1";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Boolean.prototype.toString()"
writeHeaderToLog( SECTION + TITLE );
var testcases = getTestCases();
test();
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = new TestCase( SECTION, "new Boolean(1)", "true", (new Boolean(1)).toString() );
array[item++] = new TestCase( SECTION, "new Boolean(0)", "false", (new Boolean(0)).toString() );
array[item++] = new TestCase( SECTION, "new Boolean(-1)", "true", (new Boolean(-1)).toString() );
array[item++] = new TestCase( SECTION, "new Boolean('1')", "true", (new Boolean("1")).toString() );
array[item++] = new TestCase( SECTION, "new Boolean('0')", "true", (new Boolean("0")).toString() );
array[item++] = new TestCase( SECTION, "new Boolean(true)", "true", (new Boolean(true)).toString() );
array[item++] = new TestCase( SECTION, "new Boolean(false)", "false", (new Boolean(false)).toString() );
array[item++] = new TestCase( SECTION, "new Boolean('true')", "true", (new Boolean('true')).toString() );
array[item++] = new TestCase( SECTION, "new Boolean('false')", "true", (new Boolean('false')).toString() );
array[item++] = new TestCase( SECTION, "new Boolean('')", "false", (new Boolean('')).toString() );
array[item++] = new TestCase( SECTION, "new Boolean(null)", "false", (new Boolean(null)).toString() );
array[item++] = new TestCase( SECTION, "new Boolean(void(0))", "false", (new Boolean(void(0))).toString() );
array[item++] = new TestCase( SECTION, "new Boolean(-Infinity)", "true", (new Boolean(Number.NEGATIVE_INFINITY)).toString() );
array[item++] = new TestCase( SECTION, "new Boolean(NaN)", "false", (new Boolean(Number.NaN)).toString() );
array[item++] = new TestCase( SECTION, "new Boolean()", "false", (new Boolean()).toString() );
array[item++] = new TestCase( SECTION, "new Boolean(x=1)", "true", (new Boolean(x=1)).toString() );
array[item++] = new TestCase( SECTION, "new Boolean(x=0)", "false", (new Boolean(x=0)).toString() );
array[item++] = new TestCase( SECTION, "new Boolean(x=false)", "false", (new Boolean(x=false)).toString() );
array[item++] = new TestCase( SECTION, "new Boolean(x=true)", "true", (new Boolean(x=true)).toString() );
array[item++] = new TestCase( SECTION, "new Boolean(x=null)", "false", (new Boolean(x=null)).toString() );
array[item++] = new TestCase( SECTION, "new Boolean(x='')", "false", (new Boolean(x="")).toString() );
array[item++] = new TestCase( SECTION, "new Boolean(x=' ')", "true", (new Boolean(x=" ")).toString() );
array[item++] = new TestCase( SECTION, "new Boolean(new MyObject(true))", "true", (new Boolean(new MyObject(true))).toString() );
array[item++] = new TestCase( SECTION, "new Boolean(new MyObject(false))", "true", (new Boolean(new MyObject(false))).toString() );
return ( array );
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}
function MyObject( value ) {
this.value = value;
this.valueOf = new Function( "return this.value" );
return this;
}

View File

@@ -1,76 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.6.4.2-2.js
ECMA Section: 15.6.4.2 Boolean.prototype.toString()
Description: Returns this boolean value.
The toString function is not generic; it generates
a runtime error if its this value is not a Boolean
object. Therefore it cannot be transferred to other
kinds of objects for use as a method.
Author: christine@netscape.com
Date: june 27, 1997
*/
var SECTION = "15.6.4.2-2";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Boolean.prototype.toString()"
writeHeaderToLog( SECTION + TITLE );
var testcases = getTestCases();
test();
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = new TestCase( SECTION,
"tostr=Boolean.prototype.toString; x=new Boolean(); x.toString=tostr;x.toString()",
"false",
"tostr=Boolean.prototype.toString; x=new Boolean(); x.toString=tostr;x.toString()" );
array[item++] = new TestCase( SECTION,
"tostr=Boolean.prototype.toString; x=new Boolean(true); x.toString=tostr; x.toString()",
"true",
"tostr=Boolean.prototype.toString; x=new Boolean(true); x.toString=tostr; x.toString()" );
array[item++] = new TestCase( SECTION,
"tostr=Boolean.prototype.toString; x=new Boolean(false); x.toString=tostr;x.toString()",
"false",
"tostr=Boolean.prototype.toString; x=new Boolean(); x.toString=tostr;x.toString()" );
return ( array );
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].actual = eval( testcases[tc].actual );
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,64 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.6.4.2-3.js
ECMA Section: 15.6.4.2 Boolean.prototype.toString()
Description: Returns this boolean value.
The toString function is not generic; it generates
a runtime error if its this value is not a Boolean
object. Therefore it cannot be transferred to other
kinds of objects for use as a method.
Author: christine@netscape.com
Date: june 27, 1997
*/
var SECTION = "15.6.4.2-3";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Boolean.prototype.toString()"
writeHeaderToLog( SECTION + TITLE );
var testcases = getTestCases();
test();
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = new TestCase( SECTION, "tostr=Boolean.prototype.toString; x=true; x.toString=tostr;x.toString()", "true", eval("tostr=Boolean.prototype.toString; x=true; x.toString=tostr;x.toString()") );
array[item++] = new TestCase( SECTION, "tostr=Boolean.prototype.toString; x=false; x.toString=tostr;x.toString()", "false", eval("tostr=Boolean.prototype.toString; x=false; x.toString=tostr;x.toString()") );
return ( array );
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,67 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.6.4.2-4.js
ECMA Section: 15.6.4.2 Boolean.prototype.toString()
Description: Returns this boolean value.
The toString function is not generic; it generates
a runtime error if its this value is not a Boolean
object. Therefore it cannot be transferred to other
kinds of objects for use as a method.
Author: christine@netscape.com
Date: june 27, 1997
*/
var SECTION = "15.6.4.2-4-n";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Boolean.prototype.toString()";
writeHeaderToLog( SECTION +" "+ TITLE );
var testcases = getTestCases();
test();
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = new TestCase( SECTION,
"tostr=Boolean.prototype.toString; x=new String( 'hello' ); x.toString=tostr; x.toString()",
"error",
"tostr=Boolean.prototype.toString; x=new String( 'hello' ); x.toString=tostr; x.toString()" );
return ( array );
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].actual = eval(testcases[tc].actual);
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,88 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.6.4.3.js
ECMA Section: 15.6.4.3 Boolean.prototype.valueOf()
Description: Returns this boolean value.
The valueOf function is not generic; it generates
a runtime error if its this value is not a Boolean
object. Therefore it cannot be transferred to other
kinds of objects for use as a method.
Author: christine@netscape.com
Date: june 27, 1997
*/
var SECTION = "15.6.4.3-1";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Boolean.prototype.valueOf()";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = getTestCases();
test();
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = new TestCase( SECTION, "new Boolean(1)", true, (new Boolean(1)).valueOf() );
array[item++] = new TestCase( SECTION, "new Boolean(0)", false, (new Boolean(0)).valueOf() );
array[item++] = new TestCase( SECTION, "new Boolean(-1)", true, (new Boolean(-1)).valueOf() );
array[item++] = new TestCase( SECTION, "new Boolean('1')", true, (new Boolean("1")).valueOf() );
array[item++] = new TestCase( SECTION, "new Boolean('0')", true, (new Boolean("0")).valueOf() );
array[item++] = new TestCase( SECTION, "new Boolean(true)", true, (new Boolean(true)).valueOf() );
array[item++] = new TestCase( SECTION, "new Boolean(false)", false, (new Boolean(false)).valueOf() );
array[item++] = new TestCase( SECTION, "new Boolean('true')", true, (new Boolean("true")).valueOf() );
array[item++] = new TestCase( SECTION, "new Boolean('false')", true, (new Boolean('false')).valueOf() );
array[item++] = new TestCase( SECTION, "new Boolean('')", false, (new Boolean('')).valueOf() );
array[item++] = new TestCase( SECTION, "new Boolean(null)", false, (new Boolean(null)).valueOf() );
array[item++] = new TestCase( SECTION, "new Boolean(void(0))", false, (new Boolean(void(0))).valueOf() );
array[item++] = new TestCase( SECTION, "new Boolean(-Infinity)", true, (new Boolean(Number.NEGATIVE_INFINITY)).valueOf() );
array[item++] = new TestCase( SECTION, "new Boolean(NaN)", false, (new Boolean(Number.NaN)).valueOf() );
array[item++] = new TestCase( SECTION, "new Boolean()", false, (new Boolean()).valueOf() );
array[item++] = new TestCase( SECTION, "new Boolean(x=1)", true, (new Boolean(x=1)).valueOf() );
array[item++] = new TestCase( SECTION, "new Boolean(x=0)", false, (new Boolean(x=0)).valueOf() );
array[item++] = new TestCase( SECTION, "new Boolean(x=false)", false, (new Boolean(x=false)).valueOf() );
array[item++] = new TestCase( SECTION, "new Boolean(x=true)", true, (new Boolean(x=true)).valueOf() );
array[item++] = new TestCase( SECTION, "new Boolean(x=null)", false, (new Boolean(x=null)).valueOf() );
array[item++] = new TestCase( SECTION, "new Boolean(x='')", false, (new Boolean(x="")).valueOf() );
array[item++] = new TestCase( SECTION, "new Boolean(x=' ')", true, (new Boolean(x=" ")).valueOf() );
return ( array );
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,65 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.6.4.3-2.js
ECMA Section: 15.6.4.3 Boolean.prototype.valueOf()
Description: Returns this boolean value.
The valueOf function is not generic; it generates
a runtime error if its this value is not a Boolean
object. Therefore it cannot be transferred to other
kinds of objects for use as a method.
Author: christine@netscape.com
Date: june 27, 1997
*/
var SECTION = "15.6.4.3-2";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Boolean.prototype.valueOf()";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = new Array();
testcases[tc++] = getTestCases();
test();
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = new TestCase( SECTION, "valof=Boolean.prototype.valueOf; x=new Boolean(); x.valueOf=valof;x.valueOf()", false, eval("valof=Boolean.prototype.valueOf; x=new Boolean(); x.valueOf=valof;x.valueOf()") );
array[item++] = new TestCase( SECTION, "valof=Boolean.prototype.valueOf; x=new Boolean(true); x.valueOf=valof;x.valueOf()", true, eval("valof=Boolean.prototype.valueOf; x=new Boolean(true); x.valueOf=valof;x.valueOf()") );
return ( array );
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,68 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.6.4.3-3.js
ECMA Section: 15.6.4.3 Boolean.prototype.valueOf()
Description: Returns this boolean value.
The valueOf function is not generic; it generates
a runtime error if its this value is not a Boolean
object. Therefore it cannot be transferred to other
kinds of objects for use as a method.
Author: christine@netscape.com
Date: june 27, 1997
*/
var SECTION = "15.6.4.3-3";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Boolean.prototype.valueOf()";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = new Array();
testcases = getTestCases();
test();
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = new TestCase( SECTION,
"x=true; x.valueOf=Boolean.prototype.valueOf;x.valueOf()",
true,
eval("x=true; x.valueOf=Boolean.prototype.valueOf;x.valueOf()") );
return ( array );
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,68 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.6.4.3-4.js
ECMA Section: 15.6.4.3 Boolean.prototype.valueOf()
Description: Returns this boolean value.
The valueOf function is not generic; it generates
a runtime error if its this value is not a Boolean
object. Therefore it cannot be transferred to other
kinds of objects for use as a method.
Author: christine@netscape.com
Date: june 27, 1997
*/
var SECTION = "15.6.4.3-4-n";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Boolean.prototype.valueOf()";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = getTestCases();
test();
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = new TestCase( SECTION,
"valof=Boolean.prototype.valueOf; x=new String( 'hello' ); x.valueOf=valof;x.valueOf()",
"error",
"valof=Boolean.prototype.valueOf; x=new String( 'hello' ); x.valueOf=valof;x.valueOf()" );
return ( array );
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].actual = eval( testcases[tc].actual );
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,94 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.6.4.3.js
ECMA Section: 15.6.4.3 Boolean.prototype.valueOf()
Description: Returns this boolean value.
The valueOf function is not generic; it generates
a runtime error if its this value is not a Boolean
object. Therefore it cannot be transferred to other
kinds of objects for use as a method.
Author: christine@netscape.com
Date: june 27, 1997
*/
function getTestCases() {
var array = new Array();
var item = 0;
array[item++] = new TestCase( "15.8.6.4", "new Boolean(1)", true, (new Boolean(1)).valueOf() );
array[item++] = new TestCase( "15.8.6.4", "new Boolean(0)", false, (new Boolean(0)).valueOf() );
array[item++] = new TestCase( "15.8.6.4", "new Boolean(-1)", true, (new Boolean(-1)).valueOf() );
array[item++] = new TestCase( "15.8.6.4", "new Boolean('1')", true, (new Boolean("1")).valueOf() );
array[item++] = new TestCase( "15.8.6.4", "new Boolean('0')", true, (new Boolean("0")).valueOf() );
array[item++] = new TestCase( "15.8.6.4", "new Boolean(true)", true, (new Boolean(true)).valueOf() );
array[item++] = new TestCase( "15.8.6.4", "new Boolean(false)", false, (new Boolean(false)).valueOf() );
array[item++] = new TestCase( "15.8.6.4", "new Boolean('true')", true, (new Boolean("true")).valueOf() );
array[item++] = new TestCase( "15.8.6.4", "new Boolean('false')", true, (new Boolean('false')).valueOf() );
array[item++] = new TestCase( "15.8.6.4", "new Boolean('')", false, (new Boolean('')).valueOf() );
array[item++] = new TestCase( "15.8.6.4", "new Boolean(null)", false, (new Boolean(null)).valueOf() );
array[item++] = new TestCase( "15.8.6.4", "new Boolean(void(0))", false, (new Boolean(void(0))).valueOf() );
array[item++] = new TestCase( "15.8.6.4", "new Boolean(-Infinity)", true, (new Boolean(Number.NEGATIVE_INFINITY)).valueOf() );
array[item++] = new TestCase( "15.8.6.4", "new Boolean(NaN)", false, (new Boolean(Number.NaN)).valueOf() );
array[item++] = new TestCase( "15.8.6.4", "new Boolean()", false, (new Boolean()).valueOf() );
array[item++] = new TestCase( "15.8.6.4", "new Boolean(x=1)", true, (new Boolean(x=1)).valueOf() );
array[item++] = new TestCase( "15.8.6.4", "new Boolean(x=0)", false, (new Boolean(x=0)).valueOf() );
array[item++] = new TestCase( "15.8.6.4", "new Boolean(x=false)", false, (new Boolean(x=false)).valueOf() );
array[item++] = new TestCase( "15.8.6.4", "new Boolean(x=true)", true, (new Boolean(x=true)).valueOf() );
array[item++] = new TestCase( "15.8.6.4", "new Boolean(x=null)", false, (new Boolean(x=null)).valueOf() );
array[item++] = new TestCase( "15.8.6.4", "new Boolean(x='')", false, (new Boolean(x="")).valueOf() );
array[item++] = new TestCase( "15.8.6.4", "new Boolean(x=' ')", true, (new Boolean(x=" ")).valueOf() );
return ( array );
}
function test( array ) {
var passed = true;
writeHeaderToLog("15.8.6.4.3 Properties of the Boolean Object: valueOf");
for ( i = 0; i < array.length; i++ ) {
array[i].passed = writeTestCaseResult(
array[i].expect,
array[i].actual,
"( "+ array[i].description +" ).valueOf() = "+ array[i].actual );
array[i].reason += ( array[i].passed ) ? "" : "wrong value ";
passed = ( array[i].passed ) ? passed : false;
}
stopTest();
// all tests must return a boolean value
return ( array );
}
// for TCMS, the testcases array must be global.
var testcases = getTestCases();
// all tests must call a function that returns a boolean value
test( testcases );

View File

@@ -1,74 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.6.4.js
ECMA Section: Properties of the Boolean Prototype Object
Description:
The Boolean prototype object is itself a Boolean object (its [[Class]] is "
Boolean") whose value is false.
The value of the internal [[Prototype]] property of the Boolean prototype
object is the Object prototype object (15.2.3.1).
In following descriptions of functions that are properties of the Boolean
prototype object, the phrase "this Boolean object" refers to the object that
is the this value for the invocation of the function; it is an error if
this does not refer to an object for which the value of the internal
[[Class]] property is "Boolean". Also, the phrase "this boolean value"
refers to the boolean value represented by this Boolean object, that is,
the value of the internal [[Value]] property of this Boolean object.
Author: christine@netscape.com
Date: 12 november 1997
*/
var SECTION = "15.6.4";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Properties of the Boolean Prototype Object";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = new Array();
testcases[tc++] = new TestCase( SECTION,
"Boolean.prototype == false",
true,
Boolean.prototype == false );
testcases[tc++] = new TestCase( SECTION,
"Boolean.prototype.toString = Object.prototype.toString; Boolean.prototype.toString()",
"[object Boolean]",
eval("Boolean.prototype.toString = Object.prototype.toString; Boolean.prototype.toString()") );
test();
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,84 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.1.1-1.js
ECMA Section: 15.9.1.1 Time Range
Description:
- leap seconds are ignored
- assume 86400000 ms / day
- numbers range fom +/- 9,007,199,254,740,991
- ms precision for any instant that is within
approximately +/-285,616 years from 1 jan 1970
UTC
- range of times supported is -100,000,000 days
to 100,000,000 days from 1 jan 1970 12:00 am
- time supported is 8.64e5*10e8 milliseconds from
1 jan 1970 UTC (+/-273972.6027397 years)
- this test generates its own data -- it does not
read data from a file.
Author: christine@netscape.com
Date: 7 july 1997
Static variables:
FOUR_HUNDRED_YEARS
*/
function test() {
writeHeaderToLog("15.8.1.1 Time Range");
for ( M_SECS = 0, CURRENT_YEAR = 1970;
M_SECS < 8640000000000000;
tc++, M_SECS += FOUR_HUNDRED_YEARS, CURRENT_YEAR += 400 ) {
testcases[tc] = new TestCase( SECTION, "new Date("+M_SECS+")", CURRENT_YEAR, (new Date( M_SECS)).getUTCFullYear() );
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
if ( ! testcases[tc].passed ) {
testcases[tc].reason = "wrong year value";
}
}
stopTest();
return ( testcases );
}
// every one hundred years contains:
// 24 years with 366 days
//
// every four hundred years contains:
// 97 years with 366 days
// 303 years with 365 days
//
// 86400000*365*97 = 3067372800000
// +86400000*366*303 = + 9555408000000
// = 1.26227808e+13
var FOUR_HUNDRED_YEARS = 1.26227808e+13;
var SECTION = "15.9.1.1-1";
var tc = 0;
var testcases = new Array();
test();

View File

@@ -1,79 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.1.1-2.js
ECMA Section: 15.9.1.1 Time Range
Description:
- leap seconds are ignored
- assume 86400000 ms / day
- numbers range fom +/- 9,007,199,254,740,991
- ms precision for any instant that is within
approximately +/-285,616 years from 1 jan 1970
UTC
- range of times supported is -100,000,000 days
to 100,000,000 days from 1 jan 1970 12:00 am
- time supported is 8.64e5*10e8 milliseconds from
1 jan 1970 UTC (+/-273972.6027397 years)
Author: christine@netscape.com
Date: 9 july 1997
*/
function test() {
writeHeaderToLog("15.8.1.1 Time Range");
for ( M_SECS = 0, CURRENT_YEAR = 1970;
M_SECS > -8640000000000000;
tc++, M_SECS -= FOUR_HUNDRED_YEARS, CURRENT_YEAR -= 400 ) {
testcases[tc] = new TestCase( SECTION, "new Date("+M_SECS+")", CURRENT_YEAR, (new Date( M_SECS )).getUTCFullYear() );
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description + " = " +
testcases[tc].actual );
if ( ! testcases[tc].passed ) {
testcases[tc].reason = "wrong year value";
}
}
stopTest();
return ( testcases );
}
// every one hundred years contains:
// 24 years with 366 days
//
// every four hundred years contains:
// 97 years with 366 days
// 303 years with 365 days
//
// 86400000*366*97 = 3067372800000
// +86400000*365*303 = + 9555408000000
// = 1.26227808e+13
var FOUR_HUNDRED_YEARS = 1.26227808e+13;
var SECTION = "15.9.1.1-2";
var tc = 0;
var testcases = new Array();
test();

View File

@@ -1,105 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.2.1.js
ECMA Section: 15.9.2.1 Date constructor used as a function
Date( year, month, date, hours, minutes, seconds, ms )
Description: The arguments are accepted, but are completely ignored.
A string is created and returned as if by the
expression (new Date()).toString().
Author: christine@netscape.com
Date: 28 october 1997
*/
var VERSION = "ECMA_1";
startTest();
var SECTION = "15.9.2.1";
var TITLE = "Date Constructor used as a function";
var TYPEOF = "string";
var TOLERANCE = 1000;
writeHeaderToLog("15.9.2.1 The Date Constructor Called as a Function: " +
"Date( year, month, date, hours, minutes, seconds, ms )" );
var tc= 0;
var testcases = getTestCases();
// all tests must call a function that returns an array of TestCase objects.
test();
function getTestCases() {
var array = new Array();
var item = 0;
var TODAY = new Date();
// Dates around 1970
array[item++] = new TestCase( SECTION, "Date(1970,0,1,0,0,0,0)", (new Date()).toString(), Date(1970,0,1,0,0,0,0) );
array[item++] = new TestCase( SECTION, "Date(1969,11,31,15,59,59,999)", (new Date()).toString(), Date(1969,11,31,15,59,59,999))
array[item++] = new TestCase( SECTION, "Date(1969,11,31,16,0,0,0)", (new Date()).toString(), Date(1969,11,31,16,0,0,0))
array[item++] = new TestCase( SECTION, "Date(1969,11,31,16,0,0,1)", (new Date()).toString(), Date(1969,11,31,16,0,0,1))
// Dates around 2000
array[item++] = new TestCase( SECTION, "Date(1999,11,15,59,59,999)", (new Date()).toString(), Date(1999,11,15,59,59,999));
array[item++] = new TestCase( SECTION, "Date(1999,11,16,0,0,0,0)", (new Date()).toString(), Date(1999,11,16,0,0,0,0));
array[item++] = new TestCase( SECTION, "Date(1999,11,31,23,59,59,999)", (new Date()).toString(), Date(1999,11,31,23,59,59,999) );
array[item++] = new TestCase( SECTION, "Date(2000,0,1,0,0,0,0)", (new Date()).toString(), Date(2000,0,0,0,0,0,0) );
array[item++] = new TestCase( SECTION, "Date(2000,0,1,0,0,0,1)", (new Date()).toString(), Date(2000,0,0,0,0,0,1) );
// Dates around 1900
array[item++] = new TestCase( SECTION, "Date(1899,11,31,23,59,59,999)", (new Date()).toString(), Date(1899,11,31,23,59,59,999));
array[item++] = new TestCase( SECTION, "Date(1900,0,1,0,0,0,0)", (new Date()).toString(), Date(1900,0,1,0,0,0,0) );
array[item++] = new TestCase( SECTION, "Date(1900,0,1,0,0,0,1)", (new Date()).toString(), Date(1900,0,1,0,0,0,1) );
array[item++] = new TestCase( SECTION, "Date(1899,11,31,16,0,0,0,0)", (new Date()).toString(), Date(1899,11,31,16,0,0,0,0));
// Dates around feb 29, 2000
array[item++] = new TestCase( SECTION, "Date( 2000,1,29,0,0,0,0)", (new Date()).toString(), Date(2000,1,29,0,0,0,0));
array[item++] = new TestCase( SECTION, "Date( 2000,1,28,23,59,59,999)", (new Date()).toString(), Date( 2000,1,28,23,59,59,999));
array[item++] = new TestCase( SECTION, "Date( 2000,1,27,16,0,0,0)", (new Date()).toString(), Date(2000,1,27,16,0,0,0));
// Dates around jan 1, 2005
array[item++] = new TestCase( SECTION, "Date(2004,11,31,23,59,59,999)", (new Date()).toString(), Date(2004,11,31,23,59,59,999));
array[item++] = new TestCase( SECTION, "Date(2005,0,1,0,0,0,0)", (new Date()).toString(), Date(2005,0,1,0,0,0,0) );
array[item++] = new TestCase( SECTION, "Date(2005,0,1,0,0,0,1)", (new Date()).toString(), Date(2005,0,1,0,0,0,1) );
array[item++] = new TestCase( SECTION, "Date(2004,11,31,16,0,0,0,0)", (new Date()).toString(), Date(2004,11,31,16,0,0,0,0));
// Dates around jan 1, 2032
array[item++] = new TestCase( SECTION, "Date(2031,11,31,23,59,59,999)", (new Date()).toString(), Date(2031,11,31,23,59,59,999));
array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,0,0)", (new Date()).toString(), Date(2032,0,1,0,0,0,0) );
array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,0,1)", (new Date()).toString(), Date(2032,0,1,0,0,0,1) );
array[item++] = new TestCase( SECTION, "Date(2031,11,31,16,0,0,0,0)", (new Date()).toString(), Date(2031,11,31,16,0,0,0,0));
return ( array );
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,102 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.2.2.js
ECMA Section: 15.9.2.2 Date constructor used as a function
Date( year, month, date, hours, minutes, seconds )
Description: The arguments are accepted, but are completely ignored.
A string is created and returned as if by the
expression (new Date()).toString().
Author: christine@netscape.com
Date: 28 october 1997
Version: 9706
*/
var VERSION = 9706;
startTest();
var SECTION = "15.9.2.2";
var TOLERANCE = 100;
var TITLE = "The Date Constructor Called as a Function";
writeHeaderToLog(SECTION+" "+TITLE );
var tc= 0;
var testcases = getTestCases();
// all tests must call a function that returns an array of TestCase objects.
test();
function getTestCases() {
var array = new Array();
var item = 0;
// Dates around 1970
array[item++] = new TestCase( SECTION, "Date(1970,0,1,0,0,0)", (new Date()).toString(), Date(1970,0,1,0,0,0) );
array[item++] = new TestCase( SECTION, "Date(1969,11,31,15,59,59)", (new Date()).toString(), Date(1969,11,31,15,59,59))
array[item++] = new TestCase( SECTION, "Date(1969,11,31,16,0,0)", (new Date()).toString(), Date(1969,11,31,16,0,0))
array[item++] = new TestCase( SECTION, "Date(1969,11,31,16,0,1)", (new Date()).toString(), Date(1969,11,31,16,0,1))
/*
// Dates around 2000
array[item++] = new TestCase( SECTION, "Date(1999,11,15,59,59)", (new Date()).toString(), Date(1999,11,15,59,59));
array[item++] = new TestCase( SECTION, "Date(1999,11,16,0,0,0)", (new Date()).toString(), Date(1999,11,16,0,0,0));
array[item++] = new TestCase( SECTION, "Date(1999,11,31,23,59,59)", (new Date()).toString(), Date(1999,11,31,23,59,59) );
array[item++] = new TestCase( SECTION, "Date(2000,0,1,0,0,0)", (new Date()).toString(), Date(2000,0,0,0,0,0) );
array[item++] = new TestCase( SECTION, "Date(2000,0,1,0,0,1)", (new Date()).toString(), Date(2000,0,0,0,0,1) );
// Dates around 1900
array[item++] = new TestCase( SECTION, "Date(1899,11,31,23,59,59)", (new Date()).toString(), Date(1899,11,31,23,59,59));
array[item++] = new TestCase( SECTION, "Date(1900,0,1,0,0,0)", (new Date()).toString(), Date(1900,0,1,0,0,0) );
array[item++] = new TestCase( SECTION, "Date(1900,0,1,0,0,1)", (new Date()).toString(), Date(1900,0,1,0,0,1) );
array[item++] = new TestCase( SECTION, "Date(1899,11,31,16,0,0,0)", (new Date()).toString(), Date(1899,11,31,16,0,0,0));
// Dates around feb 29, 2000
array[item++] = new TestCase( SECTION, "Date( 2000,1,29,0,0,0)", (new Date()).toString(), Date(2000,1,29,0,0,0));
array[item++] = new TestCase( SECTION, "Date( 2000,1,28,23,59,59)", (new Date()).toString(), Date( 2000,1,28,23,59,59));
array[item++] = new TestCase( SECTION, "Date( 2000,1,27,16,0,0)", (new Date()).toString(), Date(2000,1,27,16,0,0));
// Dates around jan 1, 2005
array[item++] = new TestCase( SECTION, "Date(2004,11,31,23,59,59)", (new Date()).toString(), Date(2004,11,31,23,59,59));
array[item++] = new TestCase( SECTION, "Date(2005,0,1,0,0,0)", (new Date()).toString(), Date(2005,0,1,0,0,0) );
array[item++] = new TestCase( SECTION, "Date(2005,0,1,0,0,1)", (new Date()).toString(), Date(2005,0,1,0,0,1) );
array[item++] = new TestCase( SECTION, "Date(2004,11,31,16,0,0,0)", (new Date()).toString(), Date(2004,11,31,16,0,0,0));
// Dates around jan 1, 2032
array[item++] = new TestCase( SECTION, "Date(2031,11,31,23,59,59)", (new Date()).toString(), Date(2031,11,31,23,59,59));
array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,0)", (new Date()).toString(), Date(2032,0,1,0,0,0) );
array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,1)", (new Date()).toString(), Date(2032,0,1,0,0,1) );
array[item++] = new TestCase( SECTION, "Date(2031,11,31,16,0,0,0)", (new Date()).toString(), Date(2031,11,31,16,0,0,0));
*/
return ( array );
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,96 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.2.2.js
ECMA Section: 15.9.2.2 Date constructor used as a function
Date( year, month, date, hours, minutes, seconds )
Description: The arguments are accepted, but are completely ignored.
A string is created and returned as if by the
expression (new Date()).toString().
Author: christine@netscape.com
Date: 28 october 1997
Version: 9706
*/
var VERSION = 9706;
startTest();
var SECTION = "15.9.2.2";
var TOLERANCE = 100;
var TITLE = "The Date Constructor Called as a Function";
writeHeaderToLog(SECTION+" "+TITLE );
var tc= 0;
var testcases = getTestCases();
// all tests must call a function that returns an array of TestCase objects.
test();
function getTestCases() {
var array = new Array();
var item = 0;
// Dates around 2000
array[item++] = new TestCase( SECTION, "Date(1999,11,15,59,59)", (new Date()).toString(), Date(1999,11,15,59,59));
array[item++] = new TestCase( SECTION, "Date(1999,11,16,0,0,0)", (new Date()).toString(), Date(1999,11,16,0,0,0));
array[item++] = new TestCase( SECTION, "Date(1999,11,31,23,59,59)", (new Date()).toString(), Date(1999,11,31,23,59,59) );
array[item++] = new TestCase( SECTION, "Date(2000,0,1,0,0,0)", (new Date()).toString(), Date(2000,0,0,0,0,0) );
array[item++] = new TestCase( SECTION, "Date(2000,0,1,0,0,1)", (new Date()).toString(), Date(2000,0,0,0,0,1) );
/*
// Dates around 1900
array[item++] = new TestCase( SECTION, "Date(1899,11,31,23,59,59)", (new Date()).toString(), Date(1899,11,31,23,59,59));
array[item++] = new TestCase( SECTION, "Date(1900,0,1,0,0,0)", (new Date()).toString(), Date(1900,0,1,0,0,0) );
array[item++] = new TestCase( SECTION, "Date(1900,0,1,0,0,1)", (new Date()).toString(), Date(1900,0,1,0,0,1) );
array[item++] = new TestCase( SECTION, "Date(1899,11,31,16,0,0,0)", (new Date()).toString(), Date(1899,11,31,16,0,0,0));
// Dates around feb 29, 2000
array[item++] = new TestCase( SECTION, "Date( 2000,1,29,0,0,0)", (new Date()).toString(), Date(2000,1,29,0,0,0));
array[item++] = new TestCase( SECTION, "Date( 2000,1,28,23,59,59)", (new Date()).toString(), Date( 2000,1,28,23,59,59));
array[item++] = new TestCase( SECTION, "Date( 2000,1,27,16,0,0)", (new Date()).toString(), Date(2000,1,27,16,0,0));
// Dates around jan 1, 2005
array[item++] = new TestCase( SECTION, "Date(2004,11,31,23,59,59)", (new Date()).toString(), Date(2004,11,31,23,59,59));
array[item++] = new TestCase( SECTION, "Date(2005,0,1,0,0,0)", (new Date()).toString(), Date(2005,0,1,0,0,0) );
array[item++] = new TestCase( SECTION, "Date(2005,0,1,0,0,1)", (new Date()).toString(), Date(2005,0,1,0,0,1) );
array[item++] = new TestCase( SECTION, "Date(2004,11,31,16,0,0,0)", (new Date()).toString(), Date(2004,11,31,16,0,0,0));
// Dates around jan 1, 2032
array[item++] = new TestCase( SECTION, "Date(2031,11,31,23,59,59)", (new Date()).toString(), Date(2031,11,31,23,59,59));
array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,0)", (new Date()).toString(), Date(2032,0,1,0,0,0) );
array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,1)", (new Date()).toString(), Date(2032,0,1,0,0,1) );
array[item++] = new TestCase( SECTION, "Date(2031,11,31,16,0,0,0)", (new Date()).toString(), Date(2031,11,31,16,0,0,0));
*/
return ( array );
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,89 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.2.2.js
ECMA Section: 15.9.2.2 Date constructor used as a function
Date( year, month, date, hours, minutes, seconds )
Description: The arguments are accepted, but are completely ignored.
A string is created and returned as if by the
expression (new Date()).toString().
Author: christine@netscape.com
Date: 28 october 1997
Version: 9706
*/
var VERSION = 9706;
startTest();
var SECTION = "15.9.2.2";
var TOLERANCE = 100;
var TITLE = "The Date Constructor Called as a Function";
writeHeaderToLog(SECTION+" "+TITLE );
var tc= 0;
var testcases = getTestCases();
// all tests must call a function that returns an array of TestCase objects.
test();
function getTestCases() {
var array = new Array();
var item = 0;
// Dates around 1900
array[item++] = new TestCase( SECTION, "Date(1899,11,31,23,59,59)", (new Date()).toString(), Date(1899,11,31,23,59,59));
array[item++] = new TestCase( SECTION, "Date(1900,0,1,0,0,0)", (new Date()).toString(), Date(1900,0,1,0,0,0) );
array[item++] = new TestCase( SECTION, "Date(1900,0,1,0,0,1)", (new Date()).toString(), Date(1900,0,1,0,0,1) );
array[item++] = new TestCase( SECTION, "Date(1899,11,31,16,0,0,0)", (new Date()).toString(), Date(1899,11,31,16,0,0,0));
/*
// Dates around feb 29, 2000
array[item++] = new TestCase( SECTION, "Date( 2000,1,29,0,0,0)", (new Date()).toString(), Date(2000,1,29,0,0,0));
array[item++] = new TestCase( SECTION, "Date( 2000,1,28,23,59,59)", (new Date()).toString(), Date( 2000,1,28,23,59,59));
array[item++] = new TestCase( SECTION, "Date( 2000,1,27,16,0,0)", (new Date()).toString(), Date(2000,1,27,16,0,0));
// Dates around jan 1, 2005
array[item++] = new TestCase( SECTION, "Date(2004,11,31,23,59,59)", (new Date()).toString(), Date(2004,11,31,23,59,59));
array[item++] = new TestCase( SECTION, "Date(2005,0,1,0,0,0)", (new Date()).toString(), Date(2005,0,1,0,0,0) );
array[item++] = new TestCase( SECTION, "Date(2005,0,1,0,0,1)", (new Date()).toString(), Date(2005,0,1,0,0,1) );
array[item++] = new TestCase( SECTION, "Date(2004,11,31,16,0,0,0)", (new Date()).toString(), Date(2004,11,31,16,0,0,0));
// Dates around jan 1, 2032
array[item++] = new TestCase( SECTION, "Date(2031,11,31,23,59,59)", (new Date()).toString(), Date(2031,11,31,23,59,59));
array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,0)", (new Date()).toString(), Date(2032,0,1,0,0,0) );
array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,1)", (new Date()).toString(), Date(2032,0,1,0,0,1) );
array[item++] = new TestCase( SECTION, "Date(2031,11,31,16,0,0,0)", (new Date()).toString(), Date(2031,11,31,16,0,0,0));
*/
return ( array );
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,82 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.2.2.js
ECMA Section: 15.9.2.2 Date constructor used as a function
Date( year, month, date, hours, minutes, seconds )
Description: The arguments are accepted, but are completely ignored.
A string is created and returned as if by the
expression (new Date()).toString().
Author: christine@netscape.com
Date: 28 october 1997
Version: 9706
*/
var VERSION = 9706;
startTest();
var SECTION = "15.9.2.2";
var TOLERANCE = 100;
var TITLE = "The Date Constructor Called as a Function";
writeHeaderToLog(SECTION+" "+TITLE );
var tc= 0;
var testcases = getTestCases();
// all tests must call a function that returns an array of TestCase objects.
test();
function getTestCases() {
var array = new Array();
var item = 0;
// Dates around feb 29, 2000
array[item++] = new TestCase( SECTION, "Date( 2000,1,29,0,0,0)", (new Date()).toString(), Date(2000,1,29,0,0,0));
array[item++] = new TestCase( SECTION, "Date( 2000,1,28,23,59,59)", (new Date()).toString(), Date( 2000,1,28,23,59,59));
array[item++] = new TestCase( SECTION, "Date( 2000,1,27,16,0,0)", (new Date()).toString(), Date(2000,1,27,16,0,0));
/*
// Dates around jan 1, 2005
array[item++] = new TestCase( SECTION, "Date(2004,11,31,23,59,59)", (new Date()).toString(), Date(2004,11,31,23,59,59));
array[item++] = new TestCase( SECTION, "Date(2005,0,1,0,0,0)", (new Date()).toString(), Date(2005,0,1,0,0,0) );
array[item++] = new TestCase( SECTION, "Date(2005,0,1,0,0,1)", (new Date()).toString(), Date(2005,0,1,0,0,1) );
array[item++] = new TestCase( SECTION, "Date(2004,11,31,16,0,0,0)", (new Date()).toString(), Date(2004,11,31,16,0,0,0));
// Dates around jan 1, 2032
array[item++] = new TestCase( SECTION, "Date(2031,11,31,23,59,59)", (new Date()).toString(), Date(2031,11,31,23,59,59));
array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,0)", (new Date()).toString(), Date(2032,0,1,0,0,0) );
array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,1)", (new Date()).toString(), Date(2032,0,1,0,0,1) );
array[item++] = new TestCase( SECTION, "Date(2031,11,31,16,0,0,0)", (new Date()).toString(), Date(2031,11,31,16,0,0,0));
*/
return ( array );
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,75 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.2.2.js
ECMA Section: 15.9.2.2 Date constructor used as a function
Date( year, month, date, hours, minutes, seconds )
Description: The arguments are accepted, but are completely ignored.
A string is created and returned as if by the
expression (new Date()).toString().
Author: christine@netscape.com
Date: 28 october 1997
Version: 9706
*/
var VERSION = 9706;
startTest();
var SECTION = "15.9.2.2";
var TOLERANCE = 100;
var TITLE = "The Date Constructor Called as a Function";
writeHeaderToLog(SECTION+" "+TITLE );
var tc= 0;
var testcases = getTestCases();
// all tests must call a function that returns an array of TestCase objects.
test();
function getTestCases() {
var array = new Array();
var item = 0;
// Dates around jan 1, 2005
array[item++] = new TestCase( SECTION, "Date(2004,11,31,23,59,59)", (new Date()).toString(), Date(2004,11,31,23,59,59));
array[item++] = new TestCase( SECTION, "Date(2005,0,1,0,0,0)", (new Date()).toString(), Date(2005,0,1,0,0,0) );
array[item++] = new TestCase( SECTION, "Date(2005,0,1,0,0,1)", (new Date()).toString(), Date(2005,0,1,0,0,1) );
array[item++] = new TestCase( SECTION, "Date(2004,11,31,16,0,0,0)", (new Date()).toString(), Date(2004,11,31,16,0,0,0));
/*
// Dates around jan 1, 2032
array[item++] = new TestCase( SECTION, "Date(2031,11,31,23,59,59)", (new Date()).toString(), Date(2031,11,31,23,59,59));
array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,0)", (new Date()).toString(), Date(2032,0,1,0,0,0) );
array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,1)", (new Date()).toString(), Date(2032,0,1,0,0,1) );
array[item++] = new TestCase( SECTION, "Date(2031,11,31,16,0,0,0)", (new Date()).toString(), Date(2031,11,31,16,0,0,0));
*/
return ( array );
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,69 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.2.2.js
ECMA Section: 15.9.2.2 Date constructor used as a function
Date( year, month, date, hours, minutes, seconds )
Description: The arguments are accepted, but are completely ignored.
A string is created and returned as if by the
expression (new Date()).toString().
Author: christine@netscape.com
Date: 28 october 1997
Version: 9706
*/
var VERSION = 9706;
startTest();
var SECTION = "15.9.2.2";
var TOLERANCE = 100;
var TITLE = "The Date Constructor Called as a Function";
writeHeaderToLog(SECTION+" "+TITLE );
var tc= 0;
var testcases = getTestCases();
// all tests must call a function that returns an array of TestCase objects.
test();
function getTestCases() {
var array = new Array();
var item = 0;
// Dates around jan 1, 2032
array[item++] = new TestCase( SECTION, "Date(2031,11,31,23,59,59)", (new Date()).toString(), Date(2031,11,31,23,59,59));
array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,0)", (new Date()).toString(), Date(2032,0,1,0,0,0) );
array[item++] = new TestCase( SECTION, "Date(2032,0,1,0,0,1)", (new Date()).toString(), Date(2032,0,1,0,0,1) );
array[item++] = new TestCase( SECTION, "Date(2031,11,31,16,0,0,0)", (new Date()).toString(), Date(2031,11,31,16,0,0,0));
return ( array );
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,269 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.3.1.js
ECMA Section: 15.9.3.1 new Date (year, month, date, hours, minutes, seconds, ms)
Description: The [[Prototype]] property of the newly constructed
object is set to the original Date prototype object,
the one that is the initial value of Date.prototype.
The [[Class]] property of the newly constructed object
is set as follows:
1. Call ToNumber(year)
2. Call ToNumber(month)
3. Call ToNumber(date)
4. Call ToNumber(hours)
5. Call ToNumber(minutes)
6. Call ToNumber(seconds)
7. Call ToNumber(ms)
8. If Result(1) is NaN and 0 <= ToInteger(Result(1)) <=
99, Result(8) is 1900+ToInteger(Result(1)); otherwise,
Result(8) is Result(1)
9. Compute MakeDay(Result(8), Result(2), Result(3)
10. Compute MakeTime(Result(4), Result(5), Result(6),
Result(7)
11. Compute MakeDate(Result(9), Result(10))
12. Set the [[Value]] property of the newly constructed
object to TimeClip(UTC(Result(11))).
This tests the returned value of a newly constructed
Date object.
Author: christine@netscape.com
Date: 7 july 1997
*/
var SECTION = "15.9.3.1";
var VERSION = "ECMA_1";
startTest();
var TITLE = "new Date( year, month, date, hours, minutes, seconds, ms )";
var TIME = 0;
var UTC_YEAR = 1;
var UTC_MONTH = 2;
var UTC_DATE = 3;
var UTC_DAY = 4;
var UTC_HOURS = 5;
var UTC_MINUTES = 6;
var UTC_SECONDS = 7;
var UTC_MS = 8;
var YEAR = 9;
var MONTH = 10;
var DATE = 11;
var DAY = 12;
var HOURS = 13;
var MINUTES = 14;
var SECONDS = 15;
var MS = 16;
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = new Array();
getTestCases();
test();
function getTestCases( ) {
var TZ_ADJUST = TZ_DIFF * msPerHour;
// Dates around 1970
addNewTestCase( new Date( 1969,11,31,15,59,59,999),
"new Date( 1969,11,31,15,59,59,999)",
[TIME_1970-1,1969,11,31,3,23,59,59,999,1969,11,31,3,15,59,59,999] );
addNewTestCase( new Date( 1969,11,31,23,59,59,999),
"new Date( 1969,11,31,23,59,59,999)",
[TIME_1970-TZ_ADJUST-1,1970,0,1,4,7,59,59,999,1969,11,31,3,23,59,59,999] );
addNewTestCase( new Date( 1970,0,1,0,0,0,0),
"new Date( 1970,0,1,0,0,0,0)",
[TIME_1970-TZ_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] );
addNewTestCase( new Date( 1969,11,31,16,0,0,0),
"new Date( 1969,11,31,16,0,0,0)",
[TIME_1970,1970,0,1,4,0,0,0,0,1969,11,31,3,16,0,0,0] );
addNewTestCase( new Date(1969,12,1,0,0,0,0),
"new Date(1969,12,1,0,0,0,0)",
[TIME_1970-TZ_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] );
addNewTestCase( new Date(1969,11,32,0,0,0,0),
"new Date(1969,11,32,0,0,0,0)",
[TIME_1970-TZ_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] );
addNewTestCase( new Date(1969,11,31,24,0,0,0),
"new Date(1969,11,31,24,0,0,0)",
[TIME_1970-TZ_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] );
addNewTestCase( new Date(1969,11,31,23,60,0,0),
"new Date(1969,11,31,23,60,0,0)",
[TIME_1970-TZ_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] );
addNewTestCase( new Date(1969,11,31,23,59,60,0),
"new Date(1969,11,31,23,59,60,0)",
[TIME_1970-TZ_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] );
addNewTestCase( new Date(1969,11,31,23,59,59,1000),
"new Date(1969,11,31,23,59,59,1000)",
[TIME_1970-TZ_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] );
/*
// Dates around 2000
addNewTestCase( new Date( 1999,11,31,15,59,59,999),
"new Date( 1999,11,31,15,59,59,999)",
[TIME_2000-1,1999,11,31,5,23,59,59,999,1999,11,31,5,15,59,59,999] );
addNewTestCase( new Date( 1999,11,31,16,0,0,0),
"new Date( 1999,11,31,16,0,0,0)",
[TIME_2000,2000,0,1,6,0,0,0,0,1999,11,31,5, 16,0,0,0] );
addNewTestCase( new Date( 1999,11,31,23,59,59,999),
"new Date( 1999,11,31,23,59,59,999)",
[TIME_2000-TZ_ADJUST-1,2000,0,1,6,7,59,59,999,1999,11,31,5,23,59,59,999] );
addNewTestCase( new Date( 2000,0,1,0,0,0,0),
"new Date( 2000,0,1,0,0,0,0)",
[TIME_2000-TZ_ADJUST,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] );
addNewTestCase( new Date( 2000,0,1,0,0,0,1),
"new Date( 2000,0,1,0,0,0,1)",
[TIME_2000-TZ_ADJUST+1,2000,0,1,6,8,0,0,1,2000,0,1,6,0,0,0,1] );
// Dates around 29 Feb 2000
var UTC_FEB_29_2000 = TIME_2000 + ( 30 * msPerDay ) + ( 29 * msPerDay );
addNewTestCase( new Date(2000,1,28,16,0,0,0),
"new Date(2000,1,28,16,0,0,0)",
[UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] );
addNewTestCase( new Date(2000,1,29,0,0,0,0),
"new Date(2000,1,29,0,0,0,0)",
[UTC_FEB_29_2000-TZ_ADJUST,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
addNewTestCase( new Date(2000,1,28,24,0,0,0),
"new Date(2000,1,28,24,0,0,0)",
[UTC_FEB_29_2000-TZ_ADJUST,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
// Dates around 1900
addNewTestCase( new Date(1899,11,31,16,0,0,0),
"new Date(1899,11,31,16,0,0,0)",
[TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
addNewTestCase( new Date(1899,11,31,15,59,59,999),
"new Date(1899,11,31,15,59,59,999)",
[TIME_1900-1,1899,11,31,0,23,59,59,999,1899,11,31,0,15,59,59,999] );
addNewTestCase( new Date(1899,11,31,23,59,59,999),
"new Date(1899,11,31,23,59,59,999)",
[TIME_1900-TZ_ADJUST-1,1900,0,1,1,7,59,59,999,1899,11,31,0,23,59,59,999] );
addNewTestCase( new Date(1900,0,1,0,0,0,0),
"new Date(1900,0,1,0,0,0,0)",
[TIME_1900-TZ_ADJUST,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
addNewTestCase( new Date(1900,0,1,0,0,0,1),
"new Date(1900,0,1,0,0,0,1)",
[TIME_1900-TZ_ADJUST+1,1900,0,1,1,8,0,0,1,1900,0,1,1,0,0,0,1] );
// Dates around 2005
var UTC_YEAR_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) +
TimeInYear(2002) + TimeInYear(2003) + TimeInYear(2004);
addNewTestCase( new Date(2005,0,1,0,0,0,0),
"new Date(2005,0,1,0,0,0,0)",
[UTC_YEAR_2005-TZ_ADJUST,2005,0,1,6,8,0,0,0,2005,0,1,6,0,0,0,0] );
addNewTestCase( new Date(2004,11,31,16,0,0,0),
"new Date(2004,11,31,16,0,0,0)",
[UTC_YEAR_2005,2005,0,1,6,0,0,0,0,2004,11,31,5,16,0,0,0] );
*/
/*
This test case is incorrect. Need to fix the DaylightSavings functions in
shell.js for this to work properly.
// Daylight Savings test case
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
addNewTestCase( new Date(1998,3,5,1,59,59,999),
"new Date(1998,3,5,1,59,59,999)",
[DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] );
addNewTestCase( new Date(1998,3,5,2,0,0,0),
"new Date(1998,3,5,2,0,0,0)",
[DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]);
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addNewTestCase ( new Date(1998,9,25,1,59,59,999),
"new Date(1998,9,25,1,59,59,999)",
[DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] );
addNewTestCase ( new Date(1998,9,25,2,0,0,0),
"new Date(1998,9,25,2,0,0,0)",
[DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] );
*/
}
function addNewTestCase( DateCase, DateString, ResultArray ) {
DateCase = DateCase;
var item = testcases.length;
testcases[item++] = new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() );
testcases[item++] = new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() );
testcases[item++] = new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() );
testcases[item++] = new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() );
testcases[item++] = new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() );
testcases[item++] = new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() );
testcases[item++] = new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() );
testcases[item++] = new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() );
}
function test() {
for( tc = 0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = " +
testcases[tc].actual );
}
stopTest();
return testcases;
}

View File

@@ -1,227 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.3.1.js
ECMA Section: 15.9.3.1 new Date (year, month, date, hours, minutes, seconds, ms)
Description: The [[Prototype]] property of the newly constructed
object is set to the original Date prototype object,
the one that is the initial value of Date.prototype.
The [[Class]] property of the newly constructed object
is set as follows:
1. Call ToNumber(year)
2. Call ToNumber(month)
3. Call ToNumber(date)
4. Call ToNumber(hours)
5. Call ToNumber(minutes)
6. Call ToNumber(seconds)
7. Call ToNumber(ms)
8. If Result(1) is NaN and 0 <= ToInteger(Result(1)) <=
99, Result(8) is 1900+ToInteger(Result(1)); otherwise,
Result(8) is Result(1)
9. Compute MakeDay(Result(8), Result(2), Result(3)
10. Compute MakeTime(Result(4), Result(5), Result(6),
Result(7)
11. Compute MakeDate(Result(9), Result(10))
12. Set the [[Value]] property of the newly constructed
object to TimeClip(UTC(Result(11))).
This tests the returned value of a newly constructed
Date object.
Author: christine@netscape.com
Date: 7 july 1997
*/
var SECTION = "15.9.3.1";
var VERSION = "ECMA_1";
startTest();
var TITLE = "new Date( year, month, date, hours, minutes, seconds, ms )";
var TIME = 0;
var UTC_YEAR = 1;
var UTC_MONTH = 2;
var UTC_DATE = 3;
var UTC_DAY = 4;
var UTC_HOURS = 5;
var UTC_MINUTES = 6;
var UTC_SECONDS = 7;
var UTC_MS = 8;
var YEAR = 9;
var MONTH = 10;
var DATE = 11;
var DAY = 12;
var HOURS = 13;
var MINUTES = 14;
var SECONDS = 15;
var MS = 16;
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = new Array();
getTestCases();
test();
function getTestCases( ) {
var TZ_ADJUST = TZ_DIFF * msPerHour;
// Dates around 2000
addNewTestCase( new Date( 1999,11,31,15,59,59,999),
"new Date( 1999,11,31,15,59,59,999)",
[TIME_2000-1,1999,11,31,5,23,59,59,999,1999,11,31,5,15,59,59,999] );
addNewTestCase( new Date( 1999,11,31,16,0,0,0),
"new Date( 1999,11,31,16,0,0,0)",
[TIME_2000,2000,0,1,6,0,0,0,0,1999,11,31,5, 16,0,0,0] );
addNewTestCase( new Date( 1999,11,31,23,59,59,999),
"new Date( 1999,11,31,23,59,59,999)",
[TIME_2000-TZ_ADJUST-1,2000,0,1,6,7,59,59,999,1999,11,31,5,23,59,59,999] );
addNewTestCase( new Date( 2000,0,1,0,0,0,0),
"new Date( 2000,0,1,0,0,0,0)",
[TIME_2000-TZ_ADJUST,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] );
addNewTestCase( new Date( 2000,0,1,0,0,0,1),
"new Date( 2000,0,1,0,0,0,1)",
[TIME_2000-TZ_ADJUST+1,2000,0,1,6,8,0,0,1,2000,0,1,6,0,0,0,1] );
/*
// Dates around 29 Feb 2000
var UTC_FEB_29_2000 = TIME_2000 + ( 30 * msPerDay ) + ( 29 * msPerDay );
addNewTestCase( new Date(2000,1,28,16,0,0,0),
"new Date(2000,1,28,16,0,0,0)",
[UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] );
addNewTestCase( new Date(2000,1,29,0,0,0,0),
"new Date(2000,1,29,0,0,0,0)",
[UTC_FEB_29_2000-TZ_ADJUST,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
addNewTestCase( new Date(2000,1,28,24,0,0,0),
"new Date(2000,1,28,24,0,0,0)",
[UTC_FEB_29_2000-TZ_ADJUST,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
// Dates around 1900
addNewTestCase( new Date(1899,11,31,16,0,0,0),
"new Date(1899,11,31,16,0,0,0)",
[TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
addNewTestCase( new Date(1899,11,31,15,59,59,999),
"new Date(1899,11,31,15,59,59,999)",
[TIME_1900-1,1899,11,31,0,23,59,59,999,1899,11,31,0,15,59,59,999] );
addNewTestCase( new Date(1899,11,31,23,59,59,999),
"new Date(1899,11,31,23,59,59,999)",
[TIME_1900-TZ_ADJUST-1,1900,0,1,1,7,59,59,999,1899,11,31,0,23,59,59,999] );
addNewTestCase( new Date(1900,0,1,0,0,0,0),
"new Date(1900,0,1,0,0,0,0)",
[TIME_1900-TZ_ADJUST,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
addNewTestCase( new Date(1900,0,1,0,0,0,1),
"new Date(1900,0,1,0,0,0,1)",
[TIME_1900-TZ_ADJUST+1,1900,0,1,1,8,0,0,1,1900,0,1,1,0,0,0,1] );
// Dates around 2005
var UTC_YEAR_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) +
TimeInYear(2002) + TimeInYear(2003) + TimeInYear(2004);
addNewTestCase( new Date(2005,0,1,0,0,0,0),
"new Date(2005,0,1,0,0,0,0)",
[UTC_YEAR_2005-TZ_ADJUST,2005,0,1,6,8,0,0,0,2005,0,1,6,0,0,0,0] );
addNewTestCase( new Date(2004,11,31,16,0,0,0),
"new Date(2004,11,31,16,0,0,0)",
[UTC_YEAR_2005,2005,0,1,6,0,0,0,0,2004,11,31,5,16,0,0,0] );
*/
/*
This test case is incorrect. Need to fix the DaylightSavings functions in
shell.js for this to work properly.
// Daylight Savings test case
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
addNewTestCase( new Date(1998,3,5,1,59,59,999),
"new Date(1998,3,5,1,59,59,999)",
[DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] );
addNewTestCase( new Date(1998,3,5,2,0,0,0),
"new Date(1998,3,5,2,0,0,0)",
[DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]);
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addNewTestCase ( new Date(1998,9,25,1,59,59,999),
"new Date(1998,9,25,1,59,59,999)",
[DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] );
addNewTestCase ( new Date(1998,9,25,2,0,0,0),
"new Date(1998,9,25,2,0,0,0)",
[DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] );
*/
}
function addNewTestCase( DateCase, DateString, ResultArray ) {
DateCase = DateCase;
var item = testcases.length;
testcases[item++] = new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() );
testcases[item++] = new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() );
testcases[item++] = new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() );
testcases[item++] = new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() );
testcases[item++] = new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() );
testcases[item++] = new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() );
testcases[item++] = new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() );
testcases[item++] = new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() );
}
function test() {
for( tc = 0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = " +
testcases[tc].actual );
}
stopTest();
return testcases;
}

View File

@@ -1,205 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.3.1.js
ECMA Section: 15.9.3.1 new Date (year, month, date, hours, minutes, seconds, ms)
Description: The [[Prototype]] property of the newly constructed
object is set to the original Date prototype object,
the one that is the initial value of Date.prototype.
The [[Class]] property of the newly constructed object
is set as follows:
1. Call ToNumber(year)
2. Call ToNumber(month)
3. Call ToNumber(date)
4. Call ToNumber(hours)
5. Call ToNumber(minutes)
6. Call ToNumber(seconds)
7. Call ToNumber(ms)
8. If Result(1) is NaN and 0 <= ToInteger(Result(1)) <=
99, Result(8) is 1900+ToInteger(Result(1)); otherwise,
Result(8) is Result(1)
9. Compute MakeDay(Result(8), Result(2), Result(3)
10. Compute MakeTime(Result(4), Result(5), Result(6),
Result(7)
11. Compute MakeDate(Result(9), Result(10))
12. Set the [[Value]] property of the newly constructed
object to TimeClip(UTC(Result(11))).
This tests the returned value of a newly constructed
Date object.
Author: christine@netscape.com
Date: 7 july 1997
*/
var SECTION = "15.9.3.1";
var VERSION = "ECMA_1";
startTest();
var TITLE = "new Date( year, month, date, hours, minutes, seconds, ms )";
var TIME = 0;
var UTC_YEAR = 1;
var UTC_MONTH = 2;
var UTC_DATE = 3;
var UTC_DAY = 4;
var UTC_HOURS = 5;
var UTC_MINUTES = 6;
var UTC_SECONDS = 7;
var UTC_MS = 8;
var YEAR = 9;
var MONTH = 10;
var DATE = 11;
var DAY = 12;
var HOURS = 13;
var MINUTES = 14;
var SECONDS = 15;
var MS = 16;
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = new Array();
getTestCases();
test();
function getTestCases( ) {
var TZ_ADJUST = TZ_DIFF * msPerHour;
// Dates around 29 Feb 2000
var UTC_FEB_29_2000 = TIME_2000 + ( 30 * msPerDay ) + ( 29 * msPerDay );
addNewTestCase( new Date(2000,1,28,16,0,0,0),
"new Date(2000,1,28,16,0,0,0)",
[UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] );
addNewTestCase( new Date(2000,1,29,0,0,0,0),
"new Date(2000,1,29,0,0,0,0)",
[UTC_FEB_29_2000-TZ_ADJUST,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
addNewTestCase( new Date(2000,1,28,24,0,0,0),
"new Date(2000,1,28,24,0,0,0)",
[UTC_FEB_29_2000-TZ_ADJUST,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
/*
// Dates around 1900
addNewTestCase( new Date(1899,11,31,16,0,0,0),
"new Date(1899,11,31,16,0,0,0)",
[TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
addNewTestCase( new Date(1899,11,31,15,59,59,999),
"new Date(1899,11,31,15,59,59,999)",
[TIME_1900-1,1899,11,31,0,23,59,59,999,1899,11,31,0,15,59,59,999] );
addNewTestCase( new Date(1899,11,31,23,59,59,999),
"new Date(1899,11,31,23,59,59,999)",
[TIME_1900-TZ_ADJUST-1,1900,0,1,1,7,59,59,999,1899,11,31,0,23,59,59,999] );
addNewTestCase( new Date(1900,0,1,0,0,0,0),
"new Date(1900,0,1,0,0,0,0)",
[TIME_1900-TZ_ADJUST,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
addNewTestCase( new Date(1900,0,1,0,0,0,1),
"new Date(1900,0,1,0,0,0,1)",
[TIME_1900-TZ_ADJUST+1,1900,0,1,1,8,0,0,1,1900,0,1,1,0,0,0,1] );
// Dates around 2005
var UTC_YEAR_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) +
TimeInYear(2002) + TimeInYear(2003) + TimeInYear(2004);
addNewTestCase( new Date(2005,0,1,0,0,0,0),
"new Date(2005,0,1,0,0,0,0)",
[UTC_YEAR_2005-TZ_ADJUST,2005,0,1,6,8,0,0,0,2005,0,1,6,0,0,0,0] );
addNewTestCase( new Date(2004,11,31,16,0,0,0),
"new Date(2004,11,31,16,0,0,0)",
[UTC_YEAR_2005,2005,0,1,6,0,0,0,0,2004,11,31,5,16,0,0,0] );
*/
/*
This test case is incorrect. Need to fix the DaylightSavings functions in
shell.js for this to work properly.
// Daylight Savings test case
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
addNewTestCase( new Date(1998,3,5,1,59,59,999),
"new Date(1998,3,5,1,59,59,999)",
[DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] );
addNewTestCase( new Date(1998,3,5,2,0,0,0),
"new Date(1998,3,5,2,0,0,0)",
[DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]);
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addNewTestCase ( new Date(1998,9,25,1,59,59,999),
"new Date(1998,9,25,1,59,59,999)",
[DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] );
addNewTestCase ( new Date(1998,9,25,2,0,0,0),
"new Date(1998,9,25,2,0,0,0)",
[DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] );
*/
}
function addNewTestCase( DateCase, DateString, ResultArray ) {
DateCase = DateCase;
var item = testcases.length;
testcases[item++] = new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() );
testcases[item++] = new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() );
testcases[item++] = new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() );
testcases[item++] = new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() );
testcases[item++] = new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() );
testcases[item++] = new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() );
testcases[item++] = new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() );
testcases[item++] = new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() );
}
function test() {
for( tc = 0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = " +
testcases[tc].actual );
}
stopTest();
return testcases;
}

View File

@@ -1,189 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.3.1.js
ECMA Section: 15.9.3.1 new Date (year, month, date, hours, minutes, seconds, ms)
Description: The [[Prototype]] property of the newly constructed
object is set to the original Date prototype object,
the one that is the initial value of Date.prototype.
The [[Class]] property of the newly constructed object
is set as follows:
1. Call ToNumber(year)
2. Call ToNumber(month)
3. Call ToNumber(date)
4. Call ToNumber(hours)
5. Call ToNumber(minutes)
6. Call ToNumber(seconds)
7. Call ToNumber(ms)
8. If Result(1) is NaN and 0 <= ToInteger(Result(1)) <=
99, Result(8) is 1900+ToInteger(Result(1)); otherwise,
Result(8) is Result(1)
9. Compute MakeDay(Result(8), Result(2), Result(3)
10. Compute MakeTime(Result(4), Result(5), Result(6),
Result(7)
11. Compute MakeDate(Result(9), Result(10))
12. Set the [[Value]] property of the newly constructed
object to TimeClip(UTC(Result(11))).
This tests the returned value of a newly constructed
Date object.
Author: christine@netscape.com
Date: 7 july 1997
*/
var SECTION = "15.9.3.1";
var VERSION = "ECMA_1";
startTest();
var TITLE = "new Date( year, month, date, hours, minutes, seconds, ms )";
var TIME = 0;
var UTC_YEAR = 1;
var UTC_MONTH = 2;
var UTC_DATE = 3;
var UTC_DAY = 4;
var UTC_HOURS = 5;
var UTC_MINUTES = 6;
var UTC_SECONDS = 7;
var UTC_MS = 8;
var YEAR = 9;
var MONTH = 10;
var DATE = 11;
var DAY = 12;
var HOURS = 13;
var MINUTES = 14;
var SECONDS = 15;
var MS = 16;
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = new Array();
getTestCases();
test();
function getTestCases( ) {
var TZ_ADJUST = TZ_DIFF * msPerHour;
// Dates around 1900
addNewTestCase( new Date(1899,11,31,16,0,0,0),
"new Date(1899,11,31,16,0,0,0)",
[TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
addNewTestCase( new Date(1899,11,31,15,59,59,999),
"new Date(1899,11,31,15,59,59,999)",
[TIME_1900-1,1899,11,31,0,23,59,59,999,1899,11,31,0,15,59,59,999] );
addNewTestCase( new Date(1899,11,31,23,59,59,999),
"new Date(1899,11,31,23,59,59,999)",
[TIME_1900-TZ_ADJUST-1,1900,0,1,1,7,59,59,999,1899,11,31,0,23,59,59,999] );
addNewTestCase( new Date(1900,0,1,0,0,0,0),
"new Date(1900,0,1,0,0,0,0)",
[TIME_1900-TZ_ADJUST,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
addNewTestCase( new Date(1900,0,1,0,0,0,1),
"new Date(1900,0,1,0,0,0,1)",
[TIME_1900-TZ_ADJUST+1,1900,0,1,1,8,0,0,1,1900,0,1,1,0,0,0,1] );
/*
// Dates around 2005
var UTC_YEAR_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) +
TimeInYear(2002) + TimeInYear(2003) + TimeInYear(2004);
addNewTestCase( new Date(2005,0,1,0,0,0,0),
"new Date(2005,0,1,0,0,0,0)",
[UTC_YEAR_2005-TZ_ADJUST,2005,0,1,6,8,0,0,0,2005,0,1,6,0,0,0,0] );
addNewTestCase( new Date(2004,11,31,16,0,0,0),
"new Date(2004,11,31,16,0,0,0)",
[UTC_YEAR_2005,2005,0,1,6,0,0,0,0,2004,11,31,5,16,0,0,0] );
*/
/*
This test case is incorrect. Need to fix the DaylightSavings functions in
shell.js for this to work properly.
// Daylight Savings test case
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
addNewTestCase( new Date(1998,3,5,1,59,59,999),
"new Date(1998,3,5,1,59,59,999)",
[DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] );
addNewTestCase( new Date(1998,3,5,2,0,0,0),
"new Date(1998,3,5,2,0,0,0)",
[DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]);
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addNewTestCase ( new Date(1998,9,25,1,59,59,999),
"new Date(1998,9,25,1,59,59,999)",
[DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] );
addNewTestCase ( new Date(1998,9,25,2,0,0,0),
"new Date(1998,9,25,2,0,0,0)",
[DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] );
*/
}
function addNewTestCase( DateCase, DateString, ResultArray ) {
DateCase = DateCase;
var item = testcases.length;
testcases[item++] = new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() );
testcases[item++] = new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() );
testcases[item++] = new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() );
testcases[item++] = new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() );
testcases[item++] = new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() );
testcases[item++] = new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() );
testcases[item++] = new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() );
testcases[item++] = new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() );
}
function test() {
for( tc = 0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = " +
testcases[tc].actual );
}
stopTest();
return testcases;
}

View File

@@ -1,166 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.3.1.js
ECMA Section: 15.9.3.1 new Date (year, month, date, hours, minutes, seconds, ms)
Description: The [[Prototype]] property of the newly constructed
object is set to the original Date prototype object,
the one that is the initial value of Date.prototype.
The [[Class]] property of the newly constructed object
is set as follows:
1. Call ToNumber(year)
2. Call ToNumber(month)
3. Call ToNumber(date)
4. Call ToNumber(hours)
5. Call ToNumber(minutes)
6. Call ToNumber(seconds)
7. Call ToNumber(ms)
8. If Result(1) is NaN and 0 <= ToInteger(Result(1)) <=
99, Result(8) is 1900+ToInteger(Result(1)); otherwise,
Result(8) is Result(1)
9. Compute MakeDay(Result(8), Result(2), Result(3)
10. Compute MakeTime(Result(4), Result(5), Result(6),
Result(7)
11. Compute MakeDate(Result(9), Result(10))
12. Set the [[Value]] property of the newly constructed
object to TimeClip(UTC(Result(11))).
This tests the returned value of a newly constructed
Date object.
Author: christine@netscape.com
Date: 7 july 1997
*/
var SECTION = "15.9.3.1";
var VERSION = "ECMA_1";
startTest();
var TITLE = "new Date( year, month, date, hours, minutes, seconds, ms )";
var TIME = 0;
var UTC_YEAR = 1;
var UTC_MONTH = 2;
var UTC_DATE = 3;
var UTC_DAY = 4;
var UTC_HOURS = 5;
var UTC_MINUTES = 6;
var UTC_SECONDS = 7;
var UTC_MS = 8;
var YEAR = 9;
var MONTH = 10;
var DATE = 11;
var DAY = 12;
var HOURS = 13;
var MINUTES = 14;
var SECONDS = 15;
var MS = 16;
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = new Array();
getTestCases();
test();
function getTestCases( ) {
var TZ_ADJUST = TZ_DIFF * msPerHour;
// Dates around 2005
var UTC_YEAR_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) +
TimeInYear(2002) + TimeInYear(2003) + TimeInYear(2004);
addNewTestCase( new Date(2005,0,1,0,0,0,0),
"new Date(2005,0,1,0,0,0,0)",
[UTC_YEAR_2005-TZ_ADJUST,2005,0,1,6,8,0,0,0,2005,0,1,6,0,0,0,0] );
addNewTestCase( new Date(2004,11,31,16,0,0,0),
"new Date(2004,11,31,16,0,0,0)",
[UTC_YEAR_2005,2005,0,1,6,0,0,0,0,2004,11,31,5,16,0,0,0] );
/*
This test case is incorrect. Need to fix the DaylightSavings functions in
shell.js for this to work properly.
// Daylight Savings test case
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
addNewTestCase( new Date(1998,3,5,1,59,59,999),
"new Date(1998,3,5,1,59,59,999)",
[DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] );
addNewTestCase( new Date(1998,3,5,2,0,0,0),
"new Date(1998,3,5,2,0,0,0)",
[DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]);
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addNewTestCase ( new Date(1998,9,25,1,59,59,999),
"new Date(1998,9,25,1,59,59,999)",
[DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] );
addNewTestCase ( new Date(1998,9,25,2,0,0,0),
"new Date(1998,9,25,2,0,0,0)",
[DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] );
*/
}
function addNewTestCase( DateCase, DateString, ResultArray ) {
DateCase = DateCase;
var item = testcases.length;
testcases[item++] = new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() );
testcases[item++] = new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() );
testcases[item++] = new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() );
testcases[item++] = new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() );
testcases[item++] = new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() );
testcases[item++] = new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() );
testcases[item++] = new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() );
testcases[item++] = new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() );
}
function test() {
for( tc = 0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = " +
testcases[tc].actual );
}
stopTest();
return testcases;
}

View File

@@ -1,238 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.3.1.js
ECMA Section: 15.9.3.1 new Date (year, month, date, hours, minutes, seconds, ms)
Description: The [[Prototype]] property of the newly constructed
object is set to the original Date prototype object,
the one that is the initial value of Date.prototype.
The [[Class]] property of the newly constructed object
is set as follows:
1. Call ToNumber(year)
2. Call ToNumber(month)
3. Call ToNumber(date)
4. Call ToNumber(hours)
5. Call ToNumber(minutes)
6. Call ToNumber(seconds)
7. Call ToNumber(ms)
8. If Result(1)is NaN and 0 <= ToInteger(Result(1)) <=
99, Result(8) is 1900+ToInteger(Result(1)); otherwise,
Result(8) is Result(1)
9. Compute MakeDay(Result(8), Result(2), Result(3)
10. Compute MakeTime(Result(4), Result(5), Result(6),
Result(7)
11. Compute MakeDate(Result(9), Result(10))
12. Set the [[Value]] property of the newly constructed
object to TimeClip(UTC(Result(11))).
This tests the returned value of a newly constructed
Date object.
Author: christine@netscape.com
Date: 7 july 1997
*/
var TIME = 0;
var UTC_YEAR = 1;
var UTC_MONTH = 2;
var UTC_DATE = 3;
var UTC_DAY = 4;
var UTC_HOURS = 5;
var UTC_MINUTES = 6;
var UTC_SECONDS = 7;
var UTC_MS = 8;
var YEAR = 9;
var MONTH = 10;
var DATE = 11;
var DAY = 12;
var HOURS = 13;
var MINUTES = 14;
var SECONDS = 15;
var MS = 16;
// for TCMS, the testcases array must be global.
var SECTION = "15.9.3.1";
var TITLE = "Date( year, month, date, hours, minutes, seconds )";
writeHeaderToLog( SECTION+" " +TITLE );
var testcases = new Array();
getTestCases();
// all tests must call a function that returns an array of TestCase object
test();
function getTestCases( ) {
// Dates around 1970
addNewTestCase( new Date( 1969,11,31,15,59,59),
"new Date( 1969,11,31,15,59,59)",
[-1000,1969,11,31,3,23,59,59,0,1969,11,31,3,15,59,59,0] );
addNewTestCase( new Date( 1969,11,31,16,0,0),
"new Date( 1969,11,31,16,0,0)",
[0,1970,0,1,4,0,0,0,0,1969,11,31,3,16,0,0,0] );
addNewTestCase( new Date( 1969,11,31,23,59,59),
"new Date( 1969,11,31,23,59,59)",
[28799000,1970,0,1,4,7,59,59,0,1969,11,31,3,23,59,59,0] );
addNewTestCase( new Date( 1970, 0, 1, 0, 0, 0),
"new Date( 1970, 0, 1, 0, 0, 0)",
[28800000,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] );
addNewTestCase( new Date( 1969,11,31,16,0,0),
"new Date( 1969,11,31,16,0,0)",
[0,1970,0,1,4,0,0,0,0,1969,11,31,3,16,0,0,0] );
/*
// Dates around 2000
addNewTestCase( new Date( 1999,11,31,15,59,59),
"new Date( 1999,11,31,15,59,59)",
[946684799000,1999,11,31,5,23,59,59,0,1999,11,31,5,15,59,59,0] );
addNewTestCase( new Date( 1999,11,31,16,0,0),
"new Date( 1999,11,31,16,0,0)",
[946684800000,2000,0,1,6,0,0,0,0,1999,11,31,5, 16,0,0,0] );
addNewTestCase( new Date( 2000,0,1,0,0,0),
"new Date( 2000,0,1,0,0,0)",
[946713600000,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] );
// Dates around 1900
addNewTestCase( new Date(1899,11,31,16,0,0),
"new Date(1899,11,31,16,0,0)",
[-2208988800000,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
addNewTestCase( new Date(1899,11,31,15,59,59),
"new Date(1899,11,31,15,59,59)",
[-2208988801000,1899,11,31,0,23,59,59,0,1899,11,31,0,15,59,59,0] );
addNewTestCase( new Date(1900,0,1,0,0,0),
"new Date(1900,0,1,0,0,0)",
[-2208960000000,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
addNewTestCase( new Date(1900,0,1,0,0,1),
"new Date(1900,0,1,0,0,1)",
[-2208959999000,1900,0,1,1,8,0,1,0,1900,0,1,1,0,0,1,0] );
var UTC_FEB_29_2000 = TIME_2000 + msPerDay*31 + msPerDay*28;
var PST_FEB_29_2000 = UTC_FEB_29_2000 + 8*msPerHour;
// Dates around Feb 29, 2000
addNewTestCase( new Date(2000,1,28,16,0,0,0),
"new Date(2000,1,28,16,0,0,0)",
[UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0,0] );
addNewTestCase( new Date(2000,1,29,0,0,0,0),
"new Date(2000,1,29,0,0,0,0)",
[PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
addNewTestCase( new Date(2000,1,29,24,0,0,0),
"new Date(2000,1,29,24,0,0,0)",
[PST_FEB_29_2000+msPerDay,2000,2,1,3,8,0,0,0,2000,2,1,3,0,0,0,0] );
// Dates around Jan 1, 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) +
TimeInYear(2002)+ TimeInYear(2003) + TimeInYear(2004);
var PST_JAN_1_2005 = UTC_JAN_1_2005 + 8*msPerHour;
addNewTestCase( new Date(2005,0,1,0,0,0,0),
"new Date(2005,0,1,0,0,0,0)",
[PST_JAN_1_2005,2005,0,1,6,8,0,0,0,2005,0,1,6,0,0,0,0] );
addNewTestCase( new Date(2004,11,31,16,0,0,0),
"new Date(2004,11,31,16,0,0,0)",
[UTC_JAN_1_2005,2005,0,1,6,0,0,0,0,2004,11,31,5,16,0,0,0] );
*/
/*
This test case is incorrect. Need to fix the DaylightSavings functions in
shell.js for this to work properly.
// Daylight Savings Time
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
addNewTestCase( new Date(1998,3,5,1,59,59,999),
"new Date(1998,3,5,1,59,59,999)",
[DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] );
addNewTestCase( new Date(1998,3,5,2,0,0,0),
"new Date(1998,3,5,2,0,0,0)",
[DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]);
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addNewTestCase ( new Date(1998,9,25,1,59,59,999),
"new Date(1998,9,25,1,59,59,999)",
[DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] );
addNewTestCase ( new Date(1998,9,25,2,0,0,0),
"new Date(1998,9,25,2,0,0,0)",
[DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] );
*/
}
function addNewTestCase( DateCase, DateString, ResultArray ) {
DateCase = DateCase;
item = testcases.length;
testcases[item++] = new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() );
testcases[item++] = new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() );
testcases[item++] = new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() );
testcases[item++] = new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() );
testcases[item++] = new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() );
testcases[item++] = new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() );
testcases[item++] = new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() );
testcases[item++] = new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() );
}
function test() {
for( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = " +
testcases[tc].actual );
}
stopTest();
return testcases;
}

View File

@@ -1,216 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.3.1.js
ECMA Section: 15.9.3.1 new Date (year, month, date, hours, minutes, seconds, ms)
Description: The [[Prototype]] property of the newly constructed
object is set to the original Date prototype object,
the one that is the initial value of Date.prototype.
The [[Class]] property of the newly constructed object
is set as follows:
1. Call ToNumber(year)
2. Call ToNumber(month)
3. Call ToNumber(date)
4. Call ToNumber(hours)
5. Call ToNumber(minutes)
6. Call ToNumber(seconds)
7. Call ToNumber(ms)
8. If Result(1)is NaN and 0 <= ToInteger(Result(1)) <=
99, Result(8) is 1900+ToInteger(Result(1)); otherwise,
Result(8) is Result(1)
9. Compute MakeDay(Result(8), Result(2), Result(3)
10. Compute MakeTime(Result(4), Result(5), Result(6),
Result(7)
11. Compute MakeDate(Result(9), Result(10))
12. Set the [[Value]] property of the newly constructed
object to TimeClip(UTC(Result(11))).
This tests the returned value of a newly constructed
Date object.
Author: christine@netscape.com
Date: 7 july 1997
*/
var TIME = 0;
var UTC_YEAR = 1;
var UTC_MONTH = 2;
var UTC_DATE = 3;
var UTC_DAY = 4;
var UTC_HOURS = 5;
var UTC_MINUTES = 6;
var UTC_SECONDS = 7;
var UTC_MS = 8;
var YEAR = 9;
var MONTH = 10;
var DATE = 11;
var DAY = 12;
var HOURS = 13;
var MINUTES = 14;
var SECONDS = 15;
var MS = 16;
// for TCMS, the testcases array must be global.
var SECTION = "15.9.3.1";
var TITLE = "Date( year, month, date, hours, minutes, seconds )";
writeHeaderToLog( SECTION+" " +TITLE );
var testcases = new Array();
getTestCases();
// all tests must call a function that returns an array of TestCase object
test();
function getTestCases( ) {
// Dates around 2000
addNewTestCase( new Date( 1999,11,31,15,59,59),
"new Date( 1999,11,31,15,59,59)",
[946684799000,1999,11,31,5,23,59,59,0,1999,11,31,5,15,59,59,0] );
addNewTestCase( new Date( 1999,11,31,16,0,0),
"new Date( 1999,11,31,16,0,0)",
[946684800000,2000,0,1,6,0,0,0,0,1999,11,31,5, 16,0,0,0] );
addNewTestCase( new Date( 2000,0,1,0,0,0),
"new Date( 2000,0,1,0,0,0)",
[946713600000,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] );
/*
// Dates around 1900
addNewTestCase( new Date(1899,11,31,16,0,0),
"new Date(1899,11,31,16,0,0)",
[-2208988800000,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
addNewTestCase( new Date(1899,11,31,15,59,59),
"new Date(1899,11,31,15,59,59)",
[-2208988801000,1899,11,31,0,23,59,59,0,1899,11,31,0,15,59,59,0] );
addNewTestCase( new Date(1900,0,1,0,0,0),
"new Date(1900,0,1,0,0,0)",
[-2208960000000,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
addNewTestCase( new Date(1900,0,1,0,0,1),
"new Date(1900,0,1,0,0,1)",
[-2208959999000,1900,0,1,1,8,0,1,0,1900,0,1,1,0,0,1,0] );
var UTC_FEB_29_2000 = TIME_2000 + msPerDay*31 + msPerDay*28;
var PST_FEB_29_2000 = UTC_FEB_29_2000 + 8*msPerHour;
// Dates around Feb 29, 2000
addNewTestCase( new Date(2000,1,28,16,0,0,0),
"new Date(2000,1,28,16,0,0,0)",
[UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0,0] );
addNewTestCase( new Date(2000,1,29,0,0,0,0),
"new Date(2000,1,29,0,0,0,0)",
[PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
addNewTestCase( new Date(2000,1,29,24,0,0,0),
"new Date(2000,1,29,24,0,0,0)",
[PST_FEB_29_2000+msPerDay,2000,2,1,3,8,0,0,0,2000,2,1,3,0,0,0,0] );
// Dates around Jan 1, 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) +
TimeInYear(2002)+ TimeInYear(2003) + TimeInYear(2004);
var PST_JAN_1_2005 = UTC_JAN_1_2005 + 8*msPerHour;
addNewTestCase( new Date(2005,0,1,0,0,0,0),
"new Date(2005,0,1,0,0,0,0)",
[PST_JAN_1_2005,2005,0,1,6,8,0,0,0,2005,0,1,6,0,0,0,0] );
addNewTestCase( new Date(2004,11,31,16,0,0,0),
"new Date(2004,11,31,16,0,0,0)",
[UTC_JAN_1_2005,2005,0,1,6,0,0,0,0,2004,11,31,5,16,0,0,0] );
*/
/*
This test case is incorrect. Need to fix the DaylightSavings functions in
shell.js for this to work properly.
// Daylight Savings Time
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
addNewTestCase( new Date(1998,3,5,1,59,59,999),
"new Date(1998,3,5,1,59,59,999)",
[DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] );
addNewTestCase( new Date(1998,3,5,2,0,0,0),
"new Date(1998,3,5,2,0,0,0)",
[DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]);
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addNewTestCase ( new Date(1998,9,25,1,59,59,999),
"new Date(1998,9,25,1,59,59,999)",
[DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] );
addNewTestCase ( new Date(1998,9,25,2,0,0,0),
"new Date(1998,9,25,2,0,0,0)",
[DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] );
*/
}
function addNewTestCase( DateCase, DateString, ResultArray ) {
DateCase = DateCase;
item = testcases.length;
testcases[item++] = new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() );
testcases[item++] = new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() );
testcases[item++] = new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() );
testcases[item++] = new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() );
testcases[item++] = new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() );
testcases[item++] = new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() );
testcases[item++] = new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() );
testcases[item++] = new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() );
}
function test() {
for( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = " +
testcases[tc].actual );
}
stopTest();
return testcases;
}

View File

@@ -1,202 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.3.1.js
ECMA Section: 15.9.3.1 new Date (year, month, date, hours, minutes, seconds, ms)
Description: The [[Prototype]] property of the newly constructed
object is set to the original Date prototype object,
the one that is the initial value of Date.prototype.
The [[Class]] property of the newly constructed object
is set as follows:
1. Call ToNumber(year)
2. Call ToNumber(month)
3. Call ToNumber(date)
4. Call ToNumber(hours)
5. Call ToNumber(minutes)
6. Call ToNumber(seconds)
7. Call ToNumber(ms)
8. If Result(1)is NaN and 0 <= ToInteger(Result(1)) <=
99, Result(8) is 1900+ToInteger(Result(1)); otherwise,
Result(8) is Result(1)
9. Compute MakeDay(Result(8), Result(2), Result(3)
10. Compute MakeTime(Result(4), Result(5), Result(6),
Result(7)
11. Compute MakeDate(Result(9), Result(10))
12. Set the [[Value]] property of the newly constructed
object to TimeClip(UTC(Result(11))).
This tests the returned value of a newly constructed
Date object.
Author: christine@netscape.com
Date: 7 july 1997
*/
var TIME = 0;
var UTC_YEAR = 1;
var UTC_MONTH = 2;
var UTC_DATE = 3;
var UTC_DAY = 4;
var UTC_HOURS = 5;
var UTC_MINUTES = 6;
var UTC_SECONDS = 7;
var UTC_MS = 8;
var YEAR = 9;
var MONTH = 10;
var DATE = 11;
var DAY = 12;
var HOURS = 13;
var MINUTES = 14;
var SECONDS = 15;
var MS = 16;
// for TCMS, the testcases array must be global.
var SECTION = "15.9.3.1";
var TITLE = "Date( year, month, date, hours, minutes, seconds )";
writeHeaderToLog( SECTION+" " +TITLE );
var testcases = new Array();
getTestCases();
// all tests must call a function that returns an array of TestCase object
test();
function getTestCases( ) {
// Dates around 1900
addNewTestCase( new Date(1899,11,31,16,0,0),
"new Date(1899,11,31,16,0,0)",
[-2208988800000,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
addNewTestCase( new Date(1899,11,31,15,59,59),
"new Date(1899,11,31,15,59,59)",
[-2208988801000,1899,11,31,0,23,59,59,0,1899,11,31,0,15,59,59,0] );
addNewTestCase( new Date(1900,0,1,0,0,0),
"new Date(1900,0,1,0,0,0)",
[-2208960000000,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
addNewTestCase( new Date(1900,0,1,0,0,1),
"new Date(1900,0,1,0,0,1)",
[-2208959999000,1900,0,1,1,8,0,1,0,1900,0,1,1,0,0,1,0] );
/*
var UTC_FEB_29_2000 = TIME_2000 + msPerDay*31 + msPerDay*28;
var PST_FEB_29_2000 = UTC_FEB_29_2000 + 8*msPerHour;
// Dates around Feb 29, 2000
addNewTestCase( new Date(2000,1,28,16,0,0,0),
"new Date(2000,1,28,16,0,0,0)",
[UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0,0] );
addNewTestCase( new Date(2000,1,29,0,0,0,0),
"new Date(2000,1,29,0,0,0,0)",
[PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
addNewTestCase( new Date(2000,1,29,24,0,0,0),
"new Date(2000,1,29,24,0,0,0)",
[PST_FEB_29_2000+msPerDay,2000,2,1,3,8,0,0,0,2000,2,1,3,0,0,0,0] );
// Dates around Jan 1, 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) +
TimeInYear(2002)+ TimeInYear(2003) + TimeInYear(2004);
var PST_JAN_1_2005 = UTC_JAN_1_2005 + 8*msPerHour;
addNewTestCase( new Date(2005,0,1,0,0,0,0),
"new Date(2005,0,1,0,0,0,0)",
[PST_JAN_1_2005,2005,0,1,6,8,0,0,0,2005,0,1,6,0,0,0,0] );
addNewTestCase( new Date(2004,11,31,16,0,0,0),
"new Date(2004,11,31,16,0,0,0)",
[UTC_JAN_1_2005,2005,0,1,6,0,0,0,0,2004,11,31,5,16,0,0,0] );
*/
/*
This test case is incorrect. Need to fix the DaylightSavings functions in
shell.js for this to work properly.
// Daylight Savings Time
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
addNewTestCase( new Date(1998,3,5,1,59,59,999),
"new Date(1998,3,5,1,59,59,999)",
[DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] );
addNewTestCase( new Date(1998,3,5,2,0,0,0),
"new Date(1998,3,5,2,0,0,0)",
[DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]);
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addNewTestCase ( new Date(1998,9,25,1,59,59,999),
"new Date(1998,9,25,1,59,59,999)",
[DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] );
addNewTestCase ( new Date(1998,9,25,2,0,0,0),
"new Date(1998,9,25,2,0,0,0)",
[DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] );
*/
}
function addNewTestCase( DateCase, DateString, ResultArray ) {
DateCase = DateCase;
item = testcases.length;
testcases[item++] = new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() );
testcases[item++] = new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() );
testcases[item++] = new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() );
testcases[item++] = new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() );
testcases[item++] = new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() );
testcases[item++] = new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() );
testcases[item++] = new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() );
testcases[item++] = new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() );
}
function test() {
for( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = " +
testcases[tc].actual );
}
stopTest();
return testcases;
}

View File

@@ -1,185 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.3.1.js
ECMA Section: 15.9.3.1 new Date (year, month, date, hours, minutes, seconds, ms)
Description: The [[Prototype]] property of the newly constructed
object is set to the original Date prototype object,
the one that is the initial value of Date.prototype.
The [[Class]] property of the newly constructed object
is set as follows:
1. Call ToNumber(year)
2. Call ToNumber(month)
3. Call ToNumber(date)
4. Call ToNumber(hours)
5. Call ToNumber(minutes)
6. Call ToNumber(seconds)
7. Call ToNumber(ms)
8. If Result(1)is NaN and 0 <= ToInteger(Result(1)) <=
99, Result(8) is 1900+ToInteger(Result(1)); otherwise,
Result(8) is Result(1)
9. Compute MakeDay(Result(8), Result(2), Result(3)
10. Compute MakeTime(Result(4), Result(5), Result(6),
Result(7)
11. Compute MakeDate(Result(9), Result(10))
12. Set the [[Value]] property of the newly constructed
object to TimeClip(UTC(Result(11))).
This tests the returned value of a newly constructed
Date object.
Author: christine@netscape.com
Date: 7 july 1997
*/
var TIME = 0;
var UTC_YEAR = 1;
var UTC_MONTH = 2;
var UTC_DATE = 3;
var UTC_DAY = 4;
var UTC_HOURS = 5;
var UTC_MINUTES = 6;
var UTC_SECONDS = 7;
var UTC_MS = 8;
var YEAR = 9;
var MONTH = 10;
var DATE = 11;
var DAY = 12;
var HOURS = 13;
var MINUTES = 14;
var SECONDS = 15;
var MS = 16;
// for TCMS, the testcases array must be global.
var SECTION = "15.9.3.1";
var TITLE = "Date( year, month, date, hours, minutes, seconds )";
writeHeaderToLog( SECTION+" " +TITLE );
var testcases = new Array();
getTestCases();
// all tests must call a function that returns an array of TestCase object
test();
function getTestCases( ) {
var UTC_FEB_29_2000 = TIME_2000 + msPerDay*31 + msPerDay*28;
var PST_FEB_29_2000 = UTC_FEB_29_2000 + 8*msPerHour;
// Dates around Feb 29, 2000
addNewTestCase( new Date(2000,1,28,16,0,0,0),
"new Date(2000,1,28,16,0,0,0)",
[UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0,0] );
addNewTestCase( new Date(2000,1,29,0,0,0,0),
"new Date(2000,1,29,0,0,0,0)",
[PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
addNewTestCase( new Date(2000,1,29,24,0,0,0),
"new Date(2000,1,29,24,0,0,0)",
[PST_FEB_29_2000+msPerDay,2000,2,1,3,8,0,0,0,2000,2,1,3,0,0,0,0] );
/*
// Dates around Jan 1, 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) +
TimeInYear(2002)+ TimeInYear(2003) + TimeInYear(2004);
var PST_JAN_1_2005 = UTC_JAN_1_2005 + 8*msPerHour;
addNewTestCase( new Date(2005,0,1,0,0,0,0),
"new Date(2005,0,1,0,0,0,0)",
[PST_JAN_1_2005,2005,0,1,6,8,0,0,0,2005,0,1,6,0,0,0,0] );
addNewTestCase( new Date(2004,11,31,16,0,0,0),
"new Date(2004,11,31,16,0,0,0)",
[UTC_JAN_1_2005,2005,0,1,6,0,0,0,0,2004,11,31,5,16,0,0,0] );
*/
/*
This test case is incorrect. Need to fix the DaylightSavings functions in
shell.js for this to work properly.
// Daylight Savings Time
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
addNewTestCase( new Date(1998,3,5,1,59,59,999),
"new Date(1998,3,5,1,59,59,999)",
[DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] );
addNewTestCase( new Date(1998,3,5,2,0,0,0),
"new Date(1998,3,5,2,0,0,0)",
[DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]);
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addNewTestCase ( new Date(1998,9,25,1,59,59,999),
"new Date(1998,9,25,1,59,59,999)",
[DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] );
addNewTestCase ( new Date(1998,9,25,2,0,0,0),
"new Date(1998,9,25,2,0,0,0)",
[DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] );
*/
}
function addNewTestCase( DateCase, DateString, ResultArray ) {
DateCase = DateCase;
item = testcases.length;
testcases[item++] = new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() );
testcases[item++] = new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() );
testcases[item++] = new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() );
testcases[item++] = new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() );
testcases[item++] = new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() );
testcases[item++] = new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() );
testcases[item++] = new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() );
testcases[item++] = new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() );
}
function test() {
for( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = " +
testcases[tc].actual );
}
stopTest();
return testcases;
}

View File

@@ -1,167 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.3.1.js
ECMA Section: 15.9.3.1 new Date (year, month, date, hours, minutes, seconds, ms)
Description: The [[Prototype]] property of the newly constructed
object is set to the original Date prototype object,
the one that is the initial value of Date.prototype.
The [[Class]] property of the newly constructed object
is set as follows:
1. Call ToNumber(year)
2. Call ToNumber(month)
3. Call ToNumber(date)
4. Call ToNumber(hours)
5. Call ToNumber(minutes)
6. Call ToNumber(seconds)
7. Call ToNumber(ms)
8. If Result(1)is NaN and 0 <= ToInteger(Result(1)) <=
99, Result(8) is 1900+ToInteger(Result(1)); otherwise,
Result(8) is Result(1)
9. Compute MakeDay(Result(8), Result(2), Result(3)
10. Compute MakeTime(Result(4), Result(5), Result(6),
Result(7)
11. Compute MakeDate(Result(9), Result(10))
12. Set the [[Value]] property of the newly constructed
object to TimeClip(UTC(Result(11))).
This tests the returned value of a newly constructed
Date object.
Author: christine@netscape.com
Date: 7 july 1997
*/
var TIME = 0;
var UTC_YEAR = 1;
var UTC_MONTH = 2;
var UTC_DATE = 3;
var UTC_DAY = 4;
var UTC_HOURS = 5;
var UTC_MINUTES = 6;
var UTC_SECONDS = 7;
var UTC_MS = 8;
var YEAR = 9;
var MONTH = 10;
var DATE = 11;
var DAY = 12;
var HOURS = 13;
var MINUTES = 14;
var SECONDS = 15;
var MS = 16;
// for TCMS, the testcases array must be global.
var SECTION = "15.9.3.1";
var TITLE = "Date( year, month, date, hours, minutes, seconds )";
writeHeaderToLog( SECTION+" " +TITLE );
var testcases = new Array();
getTestCases();
// all tests must call a function that returns an array of TestCase object
test();
function getTestCases( ) {
// Dates around Jan 1, 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) +
TimeInYear(2002)+ TimeInYear(2003) + TimeInYear(2004);
var PST_JAN_1_2005 = UTC_JAN_1_2005 + 8*msPerHour;
addNewTestCase( new Date(2005,0,1,0,0,0,0),
"new Date(2005,0,1,0,0,0,0)",
[PST_JAN_1_2005,2005,0,1,6,8,0,0,0,2005,0,1,6,0,0,0,0] );
addNewTestCase( new Date(2004,11,31,16,0,0,0),
"new Date(2004,11,31,16,0,0,0)",
[UTC_JAN_1_2005,2005,0,1,6,0,0,0,0,2004,11,31,5,16,0,0,0] );
/*
This test case is incorrect. Need to fix the DaylightSavings functions in
shell.js for this to work properly.
// Daylight Savings Time
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
addNewTestCase( new Date(1998,3,5,1,59,59,999),
"new Date(1998,3,5,1,59,59,999)",
[DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] );
addNewTestCase( new Date(1998,3,5,2,0,0,0),
"new Date(1998,3,5,2,0,0,0)",
[DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]);
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addNewTestCase ( new Date(1998,9,25,1,59,59,999),
"new Date(1998,9,25,1,59,59,999)",
[DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] );
addNewTestCase ( new Date(1998,9,25,2,0,0,0),
"new Date(1998,9,25,2,0,0,0)",
[DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] );
*/
}
function addNewTestCase( DateCase, DateString, ResultArray ) {
DateCase = DateCase;
item = testcases.length;
testcases[item++] = new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() );
testcases[item++] = new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() );
testcases[item++] = new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() );
testcases[item++] = new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() );
testcases[item++] = new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() );
testcases[item++] = new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() );
testcases[item++] = new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() );
testcases[item++] = new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() );
}
function test() {
for( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = " +
testcases[tc].actual );
}
stopTest();
return testcases;
}

View File

@@ -1,294 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.3.8.js
ECMA Section: 15.9.3.8 The Date Constructor
new Date( value )
Description: The [[Prototype]] property of the newly constructed
object is set to the original Date prototype object,
the one that is the initial valiue of Date.prototype.
The [[Class]] property of the newly constructed object is
set to "Date".
The [[Value]] property of the newly constructed object is
set as follows:
1. Call ToPrimitive(value)
2. If Type( Result(1) ) is String, then go to step 5.
3. Let V be ToNumber( Result(1) ).
4. Set the [[Value]] property of the newly constructed
object to TimeClip(V) and return.
5. Parse Result(1) as a date, in exactly the same manner
as for the parse method. Let V be the time value for
this date.
6. Go to step 4.
Author: christine@netscape.com
Date: 28 october 1997
Version: 9706
*/
var VERSION = "ECMA_1";
startTest();
var SECTION = "15.9.3.8";
var TYPEOF = "object";
var TIME = 0;
var UTC_YEAR = 1;
var UTC_MONTH = 2;
var UTC_DATE = 3;
var UTC_DAY = 4;
var UTC_HOURS = 5;
var UTC_MINUTES = 6;
var UTC_SECONDS = 7;
var UTC_MS = 8;
var YEAR = 9;
var MONTH = 10;
var DATE = 11;
var DAY = 12;
var HOURS = 13;
var MINUTES = 14;
var SECONDS = 15;
var MS = 16;
// for TCMS, the testcases array must be global.
var tc= 0;
var TITLE = "Date constructor: new Date( value )";
var SECTION = "15.9.3.8";
var VERSION = "ECMA_1";
startTest();
writeHeaderToLog( SECTION +" " + TITLE );
testcases = new Array();
getTestCases();
// all tests must call a function that returns a boolean value
test();
function getTestCases( ) {
var TZ_ADJUST = -TZ_DIFF * msPerHour;
// Dates around 1970
addNewTestCase( new Date(0),
"new Date(0)",
[0,1970,0,1,4,0,0,0,0,1969,11,31,3,16,0,0,0] );
addNewTestCase( new Date(1),
"new Date(1)",
[1,1970,0,1,4,0,0,0,1,1969,11,31,3,16,0,0,1] );
addNewTestCase( new Date(true),
"new Date(true)",
[1,1970,0,1,4,0,0,0,1,1969,11,31,3,16,0,0,1] );
addNewTestCase( new Date(false),
"new Date(false)",
[0,1970,0,1,4,0,0,0,0,1969,11,31,3,16,0,0,0] );
addNewTestCase( new Date( (new Date(0)).toString() ),
"new Date(\""+ (new Date(0)).toString()+"\" )",
[0,1970,0,1,4,0,0,0,0,1969,11,31,3,16,0,0,0] );
/*
// addNewTestCase( "new Date(\""+ (new Date(0)).toLocaleString()+"\")", [0,1970,0,1,4,0,0,0,0,1969,11,31,3,16,0,0,0] );
addNewTestCase( new Date((new Date(0)).toUTCString()),
"new Date(\""+ (new Date(0)).toUTCString()+"\" )",
[0,1970,0,1,4,0,0,0,0,1969,11,31,3,16,0,0,0] );
addNewTestCase( new Date((new Date(1)).toString()),
"new Date(\""+ (new Date(1)).toString()+"\" )",
[0,1970,0,1,4,0,0,0,0,1969,11,31,3,16,0,0,0] );
addNewTestCase( new Date( TZ_ADJUST ),
"new Date(" + TZ_ADJUST+")",
[TZ_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] );
addNewTestCase( new Date((new Date(TZ_ADJUST)).toString()),
"new Date(\""+ (new Date(TZ_ADJUST)).toString()+"\")",
[TZ_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] );
// addNewTestCase( "new Date(\""+ (new Date(TZ_ADJUST)).toLocaleString()+"\")",[TZ_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] );
addNewTestCase( new Date( (new Date(TZ_ADJUST)).toUTCString() ),
"new Date(\""+ (new Date(TZ_ADJUST)).toUTCString()+"\")",
[TZ_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] );
// Dates around 2000
addNewTestCase( new Date(TIME_2000+TZ_ADJUST),
"new Date(" +(TIME_2000+TZ_ADJUST)+")",
[TIME_2000+TZ_ADJUST,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] );
addNewTestCase( new Date(TIME_2000),
"new Date(" +TIME_2000+")",
[TIME_2000,2000,0,1,6,0,0,0,0,1999,11,31,5,16,0,0,0] );
addNewTestCase( new Date( (new Date(TIME_2000+TZ_ADJUST)).toString()),
"new Date(\"" +(new Date(TIME_2000+TZ_ADJUST)).toString()+"\")",
[TIME_2000+TZ_ADJUST,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] );
addNewTestCase( new Date((new Date(TIME_2000)).toString()),
"new Date(\"" +(new Date(TIME_2000)).toString()+"\")",
[TIME_2000,2000,0,1,6,0,0,0,0,1999,11,31,5,16,0,0,0] );
// addNewTestCase( "new Date(\"" +(new Date(TIME_2000+TZ_ADJUST)).toLocaleString()+"\")", [TIME_2000+TZ_ADJUST,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] );
// addNewTestCase( "new Date(\"" +(new Date(TIME_2000)).toLocaleString()+"\")", [TIME_2000,2000,0,1,6,0,0,0,0,1999,11,31,5,16,0,0,0] );
addNewTestCase( new Date( (new Date(TIME_2000+TZ_ADJUST)).toUTCString()),
"new Date(\"" +(new Date(TIME_2000+TZ_ADJUST)).toUTCString()+"\")",
[TIME_2000+TZ_ADJUST,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] );
addNewTestCase( new Date( (new Date(TIME_2000)).toUTCString()),
"new Date(\"" +(new Date(TIME_2000)).toUTCString()+"\")",
[TIME_2000,2000,0,1,6,0,0,0,0,1999,11,31,5,16,0,0,0] );
// Dates around Feb 29, 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerDay;
var PST_FEB_29_2000 = UTC_FEB_29_2000 + TZ_ADJUST;
addNewTestCase( new Date(UTC_FEB_29_2000),
"new Date("+UTC_FEB_29_2000+")",
[UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] );
addNewTestCase( new Date(PST_FEB_29_2000),
"new Date("+PST_FEB_29_2000+")",
[PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
addNewTestCase( new Date( (new Date(UTC_FEB_29_2000)).toString() ),
"new Date(\""+(new Date(UTC_FEB_29_2000)).toString()+"\")",
[UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] );
addNewTestCase( new Date( (new Date(PST_FEB_29_2000)).toString() ),
"new Date(\""+(new Date(PST_FEB_29_2000)).toString()+"\")",
[PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
// Parsing toLocaleString() is not guaranteed by ECMA.
// addNewTestCase( "new Date(\""+(new Date(UTC_FEB_29_2000)).toLocaleString()+"\")", [UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] );
// addNewTestCase( "new Date(\""+(new Date(PST_FEB_29_2000)).toLocaleString()+"\")", [PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
addNewTestCase( new Date( (new Date(UTC_FEB_29_2000)).toGMTString() ),
"new Date(\""+(new Date(UTC_FEB_29_2000)).toGMTString()+"\")",
[UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] );
addNewTestCase( new Date( (new Date(PST_FEB_29_2000)).toGMTString() ),
"new Date(\""+(new Date(PST_FEB_29_2000)).toGMTString()+"\")",
[PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
// Dates around 1900
var PST_1900 = TIME_1900 + 8*msPerHour;
addNewTestCase( new Date( TIME_1900 ),
"new Date("+TIME_1900+")",
[TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
addNewTestCase( new Date(PST_1900),
"new Date("+PST_1900+")",
[ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
addNewTestCase( new Date( (new Date(TIME_1900)).toString() ),
"new Date(\""+(new Date(TIME_1900)).toString()+"\")",
[TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
addNewTestCase( new Date( (new Date(PST_1900)).toString() ),
"new Date(\""+(new Date(PST_1900 )).toString()+"\")",
[ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
addNewTestCase( new Date( (new Date(TIME_1900)).toUTCString() ),
"new Date(\""+(new Date(TIME_1900)).toUTCString()+"\")",
[TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
addNewTestCase( new Date( (new Date(PST_1900)).toUTCString() ),
"new Date(\""+(new Date(PST_1900 )).toUTCString()+"\")",
[ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
// addNewTestCase( "new Date(\""+(new Date(TIME_1900)).toLocaleString()+"\")", [TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
// addNewTestCase( "new Date(\""+(new Date(PST_1900 )).toLocaleString()+"\")", [ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
*/
/*
This test case is incorrect. Need to fix the DaylightSavings functions in
shell.js for this to work properly.
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
addNewTestCase( new Date(DST_START_1998-1),
"new Date("+(DST_START_1998-1)+")",
[DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] );
addNewTestCase( new Date(DST_START_1998),
"new Date("+DST_START_1998+")",
[DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]);
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addNewTestCase ( new Date(DST_END_1998-1),
"new Date("+(DST_END_1998-1)+")",
[DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] );
addNewTestCase ( new Date(DST_END_1998),
"new Date("+DST_END_1998+")",
[DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] );
*/
}
function addNewTestCase( DateCase, DateString, ResultArray ) {
DateCase = DateCase;
item = testcases.length;
testcases[item++] = new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() );
testcases[item++] = new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() );
testcases[item++] = new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() );
testcases[item++] = new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() );
testcases[item++] = new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() );
testcases[item++] = new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() );
testcases[item++] = new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() );
testcases[item++] = new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() );
}
function test() {
for( tc = 0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = " +
testcases[tc].actual );
}
stopTest();
// all tests must return a boolean value
return ( testcases );
}

View File

@@ -1,270 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.3.8.js
ECMA Section: 15.9.3.8 The Date Constructor
new Date( value )
Description: The [[Prototype]] property of the newly constructed
object is set to the original Date prototype object,
the one that is the initial valiue of Date.prototype.
The [[Class]] property of the newly constructed object is
set to "Date".
The [[Value]] property of the newly constructed object is
set as follows:
1. Call ToPrimitive(value)
2. If Type( Result(1) ) is String, then go to step 5.
3. Let V be ToNumber( Result(1) ).
4. Set the [[Value]] property of the newly constructed
object to TimeClip(V) and return.
5. Parse Result(1) as a date, in exactly the same manner
as for the parse method. Let V be the time value for
this date.
6. Go to step 4.
Author: christine@netscape.com
Date: 28 october 1997
Version: 9706
*/
var VERSION = "ECMA_1";
startTest();
var SECTION = "15.9.3.8";
var TYPEOF = "object";
var TIME = 0;
var UTC_YEAR = 1;
var UTC_MONTH = 2;
var UTC_DATE = 3;
var UTC_DAY = 4;
var UTC_HOURS = 5;
var UTC_MINUTES = 6;
var UTC_SECONDS = 7;
var UTC_MS = 8;
var YEAR = 9;
var MONTH = 10;
var DATE = 11;
var DAY = 12;
var HOURS = 13;
var MINUTES = 14;
var SECONDS = 15;
var MS = 16;
// for TCMS, the testcases array must be global.
var tc= 0;
var TITLE = "Date constructor: new Date( value )";
var SECTION = "15.9.3.8";
var VERSION = "ECMA_1";
startTest();
writeHeaderToLog( SECTION +" " + TITLE );
testcases = new Array();
getTestCases();
// all tests must call a function that returns a boolean value
test();
function getTestCases( ) {
var TZ_ADJUST = -TZ_DIFF * msPerHour;
addNewTestCase( new Date((new Date(0)).toUTCString()),
"new Date(\""+ (new Date(0)).toUTCString()+"\" )",
[0,1970,0,1,4,0,0,0,0,1969,11,31,3,16,0,0,0] );
addNewTestCase( new Date((new Date(1)).toString()),
"new Date(\""+ (new Date(1)).toString()+"\" )",
[0,1970,0,1,4,0,0,0,0,1969,11,31,3,16,0,0,0] );
addNewTestCase( new Date( TZ_ADJUST ),
"new Date(" + TZ_ADJUST+")",
[TZ_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] );
addNewTestCase( new Date((new Date(TZ_ADJUST)).toString()),
"new Date(\""+ (new Date(TZ_ADJUST)).toString()+"\")",
[TZ_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] );
addNewTestCase( new Date( (new Date(TZ_ADJUST)).toUTCString() ),
"new Date(\""+ (new Date(TZ_ADJUST)).toUTCString()+"\")",
[TZ_ADJUST,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] );
/*
// Dates around 2000
addNewTestCase( new Date(TIME_2000+TZ_ADJUST),
"new Date(" +(TIME_2000+TZ_ADJUST)+")",
[TIME_2000+TZ_ADJUST,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] );
addNewTestCase( new Date(TIME_2000),
"new Date(" +TIME_2000+")",
[TIME_2000,2000,0,1,6,0,0,0,0,1999,11,31,5,16,0,0,0] );
addNewTestCase( new Date( (new Date(TIME_2000+TZ_ADJUST)).toString()),
"new Date(\"" +(new Date(TIME_2000+TZ_ADJUST)).toString()+"\")",
[TIME_2000+TZ_ADJUST,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] );
addNewTestCase( new Date((new Date(TIME_2000)).toString()),
"new Date(\"" +(new Date(TIME_2000)).toString()+"\")",
[TIME_2000,2000,0,1,6,0,0,0,0,1999,11,31,5,16,0,0,0] );
// addNewTestCase( "new Date(\"" +(new Date(TIME_2000+TZ_ADJUST)).toLocaleString()+"\")", [TIME_2000+TZ_ADJUST,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] );
// addNewTestCase( "new Date(\"" +(new Date(TIME_2000)).toLocaleString()+"\")", [TIME_2000,2000,0,1,6,0,0,0,0,1999,11,31,5,16,0,0,0] );
addNewTestCase( new Date( (new Date(TIME_2000+TZ_ADJUST)).toUTCString()),
"new Date(\"" +(new Date(TIME_2000+TZ_ADJUST)).toUTCString()+"\")",
[TIME_2000+TZ_ADJUST,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] );
addNewTestCase( new Date( (new Date(TIME_2000)).toUTCString()),
"new Date(\"" +(new Date(TIME_2000)).toUTCString()+"\")",
[TIME_2000,2000,0,1,6,0,0,0,0,1999,11,31,5,16,0,0,0] );
// Dates around Feb 29, 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerDay;
var PST_FEB_29_2000 = UTC_FEB_29_2000 + TZ_ADJUST;
addNewTestCase( new Date(UTC_FEB_29_2000),
"new Date("+UTC_FEB_29_2000+")",
[UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] );
addNewTestCase( new Date(PST_FEB_29_2000),
"new Date("+PST_FEB_29_2000+")",
[PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
addNewTestCase( new Date( (new Date(UTC_FEB_29_2000)).toString() ),
"new Date(\""+(new Date(UTC_FEB_29_2000)).toString()+"\")",
[UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] );
addNewTestCase( new Date( (new Date(PST_FEB_29_2000)).toString() ),
"new Date(\""+(new Date(PST_FEB_29_2000)).toString()+"\")",
[PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
// Parsing toLocaleString() is not guaranteed by ECMA.
// addNewTestCase( "new Date(\""+(new Date(UTC_FEB_29_2000)).toLocaleString()+"\")", [UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] );
// addNewTestCase( "new Date(\""+(new Date(PST_FEB_29_2000)).toLocaleString()+"\")", [PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
addNewTestCase( new Date( (new Date(UTC_FEB_29_2000)).toGMTString() ),
"new Date(\""+(new Date(UTC_FEB_29_2000)).toGMTString()+"\")",
[UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] );
addNewTestCase( new Date( (new Date(PST_FEB_29_2000)).toGMTString() ),
"new Date(\""+(new Date(PST_FEB_29_2000)).toGMTString()+"\")",
[PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
// Dates around 1900
var PST_1900 = TIME_1900 + 8*msPerHour;
addNewTestCase( new Date( TIME_1900 ),
"new Date("+TIME_1900+")",
[TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
addNewTestCase( new Date(PST_1900),
"new Date("+PST_1900+")",
[ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
addNewTestCase( new Date( (new Date(TIME_1900)).toString() ),
"new Date(\""+(new Date(TIME_1900)).toString()+"\")",
[TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
addNewTestCase( new Date( (new Date(PST_1900)).toString() ),
"new Date(\""+(new Date(PST_1900 )).toString()+"\")",
[ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
addNewTestCase( new Date( (new Date(TIME_1900)).toUTCString() ),
"new Date(\""+(new Date(TIME_1900)).toUTCString()+"\")",
[TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
addNewTestCase( new Date( (new Date(PST_1900)).toUTCString() ),
"new Date(\""+(new Date(PST_1900 )).toUTCString()+"\")",
[ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
// addNewTestCase( "new Date(\""+(new Date(TIME_1900)).toLocaleString()+"\")", [TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
// addNewTestCase( "new Date(\""+(new Date(PST_1900 )).toLocaleString()+"\")", [ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
*/
/*
This test case is incorrect. Need to fix the DaylightSavings functions in
shell.js for this to work properly.
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
addNewTestCase( new Date(DST_START_1998-1),
"new Date("+(DST_START_1998-1)+")",
[DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] );
addNewTestCase( new Date(DST_START_1998),
"new Date("+DST_START_1998+")",
[DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]);
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addNewTestCase ( new Date(DST_END_1998-1),
"new Date("+(DST_END_1998-1)+")",
[DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] );
addNewTestCase ( new Date(DST_END_1998),
"new Date("+DST_END_1998+")",
[DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] );
*/
}
function addNewTestCase( DateCase, DateString, ResultArray ) {
DateCase = DateCase;
item = testcases.length;
testcases[item++] = new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() );
testcases[item++] = new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() );
testcases[item++] = new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() );
testcases[item++] = new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() );
testcases[item++] = new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() );
testcases[item++] = new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() );
testcases[item++] = new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() );
testcases[item++] = new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() );
}
function test() {
for( tc = 0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = " +
testcases[tc].actual );
}
stopTest();
// all tests must return a boolean value
return ( testcases );
}

View File

@@ -1,248 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.3.8.js
ECMA Section: 15.9.3.8 The Date Constructor
new Date( value )
Description: The [[Prototype]] property of the newly constructed
object is set to the original Date prototype object,
the one that is the initial valiue of Date.prototype.
The [[Class]] property of the newly constructed object is
set to "Date".
The [[Value]] property of the newly constructed object is
set as follows:
1. Call ToPrimitive(value)
2. If Type( Result(1) ) is String, then go to step 5.
3. Let V be ToNumber( Result(1) ).
4. Set the [[Value]] property of the newly constructed
object to TimeClip(V) and return.
5. Parse Result(1) as a date, in exactly the same manner
as for the parse method. Let V be the time value for
this date.
6. Go to step 4.
Author: christine@netscape.com
Date: 28 october 1997
Version: 9706
*/
var VERSION = "ECMA_1";
startTest();
var SECTION = "15.9.3.8";
var TYPEOF = "object";
var TIME = 0;
var UTC_YEAR = 1;
var UTC_MONTH = 2;
var UTC_DATE = 3;
var UTC_DAY = 4;
var UTC_HOURS = 5;
var UTC_MINUTES = 6;
var UTC_SECONDS = 7;
var UTC_MS = 8;
var YEAR = 9;
var MONTH = 10;
var DATE = 11;
var DAY = 12;
var HOURS = 13;
var MINUTES = 14;
var SECONDS = 15;
var MS = 16;
// for TCMS, the testcases array must be global.
var tc= 0;
var TITLE = "Date constructor: new Date( value )";
var SECTION = "15.9.3.8";
var VERSION = "ECMA_1";
startTest();
writeHeaderToLog( SECTION +" " + TITLE );
testcases = new Array();
getTestCases();
// all tests must call a function that returns a boolean value
test();
function getTestCases( ) {
var TZ_ADJUST = -TZ_DIFF * msPerHour;
// Dates around 2000
addNewTestCase( new Date(TIME_2000+TZ_ADJUST),
"new Date(" +(TIME_2000+TZ_ADJUST)+")",
[TIME_2000+TZ_ADJUST,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] );
addNewTestCase( new Date(TIME_2000),
"new Date(" +TIME_2000+")",
[TIME_2000,2000,0,1,6,0,0,0,0,1999,11,31,5,16,0,0,0] );
addNewTestCase( new Date( (new Date(TIME_2000+TZ_ADJUST)).toString()),
"new Date(\"" +(new Date(TIME_2000+TZ_ADJUST)).toString()+"\")",
[TIME_2000+TZ_ADJUST,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] );
addNewTestCase( new Date((new Date(TIME_2000)).toString()),
"new Date(\"" +(new Date(TIME_2000)).toString()+"\")",
[TIME_2000,2000,0,1,6,0,0,0,0,1999,11,31,5,16,0,0,0] );
addNewTestCase( new Date( (new Date(TIME_2000+TZ_ADJUST)).toUTCString()),
"new Date(\"" +(new Date(TIME_2000+TZ_ADJUST)).toUTCString()+"\")",
[TIME_2000+TZ_ADJUST,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] );
addNewTestCase( new Date( (new Date(TIME_2000)).toUTCString()),
"new Date(\"" +(new Date(TIME_2000)).toUTCString()+"\")",
[TIME_2000,2000,0,1,6,0,0,0,0,1999,11,31,5,16,0,0,0] );
/*
// Dates around Feb 29, 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerDay;
var PST_FEB_29_2000 = UTC_FEB_29_2000 + TZ_ADJUST;
addNewTestCase( new Date(UTC_FEB_29_2000),
"new Date("+UTC_FEB_29_2000+")",
[UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] );
addNewTestCase( new Date(PST_FEB_29_2000),
"new Date("+PST_FEB_29_2000+")",
[PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
addNewTestCase( new Date( (new Date(UTC_FEB_29_2000)).toString() ),
"new Date(\""+(new Date(UTC_FEB_29_2000)).toString()+"\")",
[UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] );
addNewTestCase( new Date( (new Date(PST_FEB_29_2000)).toString() ),
"new Date(\""+(new Date(PST_FEB_29_2000)).toString()+"\")",
[PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
// Parsing toLocaleString() is not guaranteed by ECMA.
// addNewTestCase( "new Date(\""+(new Date(UTC_FEB_29_2000)).toLocaleString()+"\")", [UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] );
// addNewTestCase( "new Date(\""+(new Date(PST_FEB_29_2000)).toLocaleString()+"\")", [PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
addNewTestCase( new Date( (new Date(UTC_FEB_29_2000)).toGMTString() ),
"new Date(\""+(new Date(UTC_FEB_29_2000)).toGMTString()+"\")",
[UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] );
addNewTestCase( new Date( (new Date(PST_FEB_29_2000)).toGMTString() ),
"new Date(\""+(new Date(PST_FEB_29_2000)).toGMTString()+"\")",
[PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
// Dates around 1900
var PST_1900 = TIME_1900 + 8*msPerHour;
addNewTestCase( new Date( TIME_1900 ),
"new Date("+TIME_1900+")",
[TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
addNewTestCase( new Date(PST_1900),
"new Date("+PST_1900+")",
[ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
addNewTestCase( new Date( (new Date(TIME_1900)).toString() ),
"new Date(\""+(new Date(TIME_1900)).toString()+"\")",
[TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
addNewTestCase( new Date( (new Date(PST_1900)).toString() ),
"new Date(\""+(new Date(PST_1900 )).toString()+"\")",
[ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
addNewTestCase( new Date( (new Date(TIME_1900)).toUTCString() ),
"new Date(\""+(new Date(TIME_1900)).toUTCString()+"\")",
[TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
addNewTestCase( new Date( (new Date(PST_1900)).toUTCString() ),
"new Date(\""+(new Date(PST_1900 )).toUTCString()+"\")",
[ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
// addNewTestCase( "new Date(\""+(new Date(TIME_1900)).toLocaleString()+"\")", [TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
// addNewTestCase( "new Date(\""+(new Date(PST_1900 )).toLocaleString()+"\")", [ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
*/
/*
This test case is incorrect. Need to fix the DaylightSavings functions in
shell.js for this to work properly.
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
addNewTestCase( new Date(DST_START_1998-1),
"new Date("+(DST_START_1998-1)+")",
[DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] );
addNewTestCase( new Date(DST_START_1998),
"new Date("+DST_START_1998+")",
[DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]);
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addNewTestCase ( new Date(DST_END_1998-1),
"new Date("+(DST_END_1998-1)+")",
[DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] );
addNewTestCase ( new Date(DST_END_1998),
"new Date("+DST_END_1998+")",
[DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] );
*/
}
function addNewTestCase( DateCase, DateString, ResultArray ) {
DateCase = DateCase;
item = testcases.length;
testcases[item++] = new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() );
testcases[item++] = new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() );
testcases[item++] = new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() );
testcases[item++] = new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() );
testcases[item++] = new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() );
testcases[item++] = new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() );
testcases[item++] = new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() );
testcases[item++] = new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() );
}
function test() {
for( tc = 0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = " +
testcases[tc].actual );
}
stopTest();
// all tests must return a boolean value
return ( testcases );
}

View File

@@ -1,217 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.3.8.js
ECMA Section: 15.9.3.8 The Date Constructor
new Date( value )
Description: The [[Prototype]] property of the newly constructed
object is set to the original Date prototype object,
the one that is the initial valiue of Date.prototype.
The [[Class]] property of the newly constructed object is
set to "Date".
The [[Value]] property of the newly constructed object is
set as follows:
1. Call ToPrimitive(value)
2. If Type( Result(1) ) is String, then go to step 5.
3. Let V be ToNumber( Result(1) ).
4. Set the [[Value]] property of the newly constructed
object to TimeClip(V) and return.
5. Parse Result(1) as a date, in exactly the same manner
as for the parse method. Let V be the time value for
this date.
6. Go to step 4.
Author: christine@netscape.com
Date: 28 october 1997
Version: 9706
*/
var VERSION = "ECMA_1";
startTest();
var SECTION = "15.9.3.8";
var TYPEOF = "object";
var TIME = 0;
var UTC_YEAR = 1;
var UTC_MONTH = 2;
var UTC_DATE = 3;
var UTC_DAY = 4;
var UTC_HOURS = 5;
var UTC_MINUTES = 6;
var UTC_SECONDS = 7;
var UTC_MS = 8;
var YEAR = 9;
var MONTH = 10;
var DATE = 11;
var DAY = 12;
var HOURS = 13;
var MINUTES = 14;
var SECONDS = 15;
var MS = 16;
// for TCMS, the testcases array must be global.
var tc= 0;
var TITLE = "Date constructor: new Date( value )";
var SECTION = "15.9.3.8";
var VERSION = "ECMA_1";
startTest();
writeHeaderToLog( SECTION +" " + TITLE );
testcases = new Array();
getTestCases();
// all tests must call a function that returns a boolean value
test();
function getTestCases( ) {
var TZ_ADJUST = -TZ_DIFF * msPerHour;
// Dates around Feb 29, 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerDay;
var PST_FEB_29_2000 = UTC_FEB_29_2000 + TZ_ADJUST;
addNewTestCase( new Date(UTC_FEB_29_2000),
"new Date("+UTC_FEB_29_2000+")",
[UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] );
addNewTestCase( new Date(PST_FEB_29_2000),
"new Date("+PST_FEB_29_2000+")",
[PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
addNewTestCase( new Date( (new Date(UTC_FEB_29_2000)).toString() ),
"new Date(\""+(new Date(UTC_FEB_29_2000)).toString()+"\")",
[UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] );
addNewTestCase( new Date( (new Date(PST_FEB_29_2000)).toString() ),
"new Date(\""+(new Date(PST_FEB_29_2000)).toString()+"\")",
[PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
addNewTestCase( new Date( (new Date(UTC_FEB_29_2000)).toGMTString() ),
"new Date(\""+(new Date(UTC_FEB_29_2000)).toGMTString()+"\")",
[UTC_FEB_29_2000,2000,1,29,2,0,0,0,0,2000,1,28,1,16,0,0,0] );
addNewTestCase( new Date( (new Date(PST_FEB_29_2000)).toGMTString() ),
"new Date(\""+(new Date(PST_FEB_29_2000)).toGMTString()+"\")",
[PST_FEB_29_2000,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] );
/*
// Dates around 1900
var PST_1900 = TIME_1900 + 8*msPerHour;
addNewTestCase( new Date( TIME_1900 ),
"new Date("+TIME_1900+")",
[TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
addNewTestCase( new Date(PST_1900),
"new Date("+PST_1900+")",
[ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
addNewTestCase( new Date( (new Date(TIME_1900)).toString() ),
"new Date(\""+(new Date(TIME_1900)).toString()+"\")",
[TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
addNewTestCase( new Date( (new Date(PST_1900)).toString() ),
"new Date(\""+(new Date(PST_1900 )).toString()+"\")",
[ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
addNewTestCase( new Date( (new Date(TIME_1900)).toUTCString() ),
"new Date(\""+(new Date(TIME_1900)).toUTCString()+"\")",
[TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
addNewTestCase( new Date( (new Date(PST_1900)).toUTCString() ),
"new Date(\""+(new Date(PST_1900 )).toUTCString()+"\")",
[ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
// addNewTestCase( "new Date(\""+(new Date(TIME_1900)).toLocaleString()+"\")", [TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
// addNewTestCase( "new Date(\""+(new Date(PST_1900 )).toLocaleString()+"\")", [ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
*/
/*
This test case is incorrect. Need to fix the DaylightSavings functions in
shell.js for this to work properly.
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
addNewTestCase( new Date(DST_START_1998-1),
"new Date("+(DST_START_1998-1)+")",
[DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] );
addNewTestCase( new Date(DST_START_1998),
"new Date("+DST_START_1998+")",
[DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]);
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addNewTestCase ( new Date(DST_END_1998-1),
"new Date("+(DST_END_1998-1)+")",
[DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] );
addNewTestCase ( new Date(DST_END_1998),
"new Date("+DST_END_1998+")",
[DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] );
*/
}
function addNewTestCase( DateCase, DateString, ResultArray ) {
DateCase = DateCase;
item = testcases.length;
testcases[item++] = new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() );
testcases[item++] = new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() );
testcases[item++] = new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() );
testcases[item++] = new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() );
testcases[item++] = new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() );
testcases[item++] = new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() );
testcases[item++] = new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() );
testcases[item++] = new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() );
}
function test() {
for( tc = 0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = " +
testcases[tc].actual );
}
stopTest();
// all tests must return a boolean value
return ( testcases );
}

View File

@@ -1,184 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.3.8.js
ECMA Section: 15.9.3.8 The Date Constructor
new Date( value )
Description: The [[Prototype]] property of the newly constructed
object is set to the original Date prototype object,
the one that is the initial valiue of Date.prototype.
The [[Class]] property of the newly constructed object is
set to "Date".
The [[Value]] property of the newly constructed object is
set as follows:
1. Call ToPrimitive(value)
2. If Type( Result(1) ) is String, then go to step 5.
3. Let V be ToNumber( Result(1) ).
4. Set the [[Value]] property of the newly constructed
object to TimeClip(V) and return.
5. Parse Result(1) as a date, in exactly the same manner
as for the parse method. Let V be the time value for
this date.
6. Go to step 4.
Author: christine@netscape.com
Date: 28 october 1997
Version: 9706
*/
var VERSION = "ECMA_1";
startTest();
var SECTION = "15.9.3.8";
var TYPEOF = "object";
var TIME = 0;
var UTC_YEAR = 1;
var UTC_MONTH = 2;
var UTC_DATE = 3;
var UTC_DAY = 4;
var UTC_HOURS = 5;
var UTC_MINUTES = 6;
var UTC_SECONDS = 7;
var UTC_MS = 8;
var YEAR = 9;
var MONTH = 10;
var DATE = 11;
var DAY = 12;
var HOURS = 13;
var MINUTES = 14;
var SECONDS = 15;
var MS = 16;
// for TCMS, the testcases array must be global.
var tc= 0;
var TITLE = "Date constructor: new Date( value )";
var SECTION = "15.9.3.8";
var VERSION = "ECMA_1";
startTest();
writeHeaderToLog( SECTION +" " + TITLE );
testcases = new Array();
getTestCases();
// all tests must call a function that returns a boolean value
test();
function getTestCases( ) {
var TZ_ADJUST = -TZ_DIFF * msPerHour;
// Dates around 1900
var PST_1900 = TIME_1900 + 8*msPerHour;
addNewTestCase( new Date( TIME_1900 ),
"new Date("+TIME_1900+")",
[TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
addNewTestCase( new Date(PST_1900),
"new Date("+PST_1900+")",
[ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
addNewTestCase( new Date( (new Date(TIME_1900)).toString() ),
"new Date(\""+(new Date(TIME_1900)).toString()+"\")",
[TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
addNewTestCase( new Date( (new Date(PST_1900)).toString() ),
"new Date(\""+(new Date(PST_1900 )).toString()+"\")",
[ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
addNewTestCase( new Date( (new Date(TIME_1900)).toUTCString() ),
"new Date(\""+(new Date(TIME_1900)).toUTCString()+"\")",
[TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
addNewTestCase( new Date( (new Date(PST_1900)).toUTCString() ),
"new Date(\""+(new Date(PST_1900 )).toUTCString()+"\")",
[ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
/*
This test case is incorrect. Need to fix the DaylightSavings functions in
shell.js for this to work properly.
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
addNewTestCase( new Date(DST_START_1998-1),
"new Date("+(DST_START_1998-1)+")",
[DST_START_1998-1,1998,3,5,0,9,59,59,999,1998,3,5,0,1,59,59,999] );
addNewTestCase( new Date(DST_START_1998),
"new Date("+DST_START_1998+")",
[DST_START_1998,1998,3,5,0,10,0,0,0,1998,3,5,0,3,0,0,0]);
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addNewTestCase ( new Date(DST_END_1998-1),
"new Date("+(DST_END_1998-1)+")",
[DST_END_1998-1,1998,9,25,0,8,59,59,999,1998,9,25,0,1,59,59,999] );
addNewTestCase ( new Date(DST_END_1998),
"new Date("+DST_END_1998+")",
[DST_END_1998,1998,9,25,0,9,0,0,0,1998,9,25,0,1,0,0,0] );
*/
}
function addNewTestCase( DateCase, DateString, ResultArray ) {
DateCase = DateCase;
item = testcases.length;
testcases[item++] = new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() );
testcases[item++] = new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() );
testcases[item++] = new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() );
testcases[item++] = new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() );
testcases[item++] = new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() );
testcases[item++] = new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() );
testcases[item++] = new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() );
testcases[item++] = new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() );
}
function test() {
for( tc = 0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = " +
testcases[tc].actual );
}
stopTest();
// all tests must return a boolean value
return ( testcases );
}

View File

@@ -1,59 +0,0 @@
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/**
* File Name:
* Reference: http://bugzilla.mozilla.org/show_bug.cgi?id=4088
* Description: Date parsing gets 12:30 AM wrong.
* New behavior:
* js> d = new Date('1/1/1999 13:30 AM')
* Invalid Date
* js> d = new Date('1/1/1999 13:30 PM')
* Invalid Date
* js> d = new Date('1/1/1999 12:30 AM')
* Fri Jan 01 00:30:00 GMT-0800 (PST) 1999
* js> d = new Date('1/1/1999 12:30 PM')
* Fri Jan 01 12:30:00 GMT-0800 (PST) 1999
* Author: christine@netscape.com
*/
var SECTION = "15.9.4.2-1"; // provide a document reference (ie, ECMA section)
var VERSION = "ECMA"; // Version of JavaScript or ECMA
var TITLE = "Regression Test for Date.parse"; // Provide ECMA section title or a description
var BUGNUMBER = "http://bugzilla.mozilla.org/show_bug.cgi?id=4088"; // Provide URL to bugsplat or bugzilla report
startTest(); // leave this alone
AddTestCase( "new Date('1/1/1999 12:30 AM').toString()",
new Date(1999,0,1,0,30).toString(),
new Date('1/1/1999 12:30 AM').toString() );
AddTestCase( "new Date('1/1/1999 12:30 PM').toString()",
new Date( 1999,0,1,12,30 ).toString(),
new Date('1/1/1999 12:30 PM').toString() );
AddTestCase( "new Date('1/1/1999 13:30 AM')",
"Invalid Date",
new Date('1/1/1999 13:30 AM').toString() );
AddTestCase( "new Date('1/1/1999 13:30 PM')",
"Invalid Date",
new Date('1/1/1999 13:30 PM').toString() );
test(); // leave this alone. this executes the test cases and
// displays results.

View File

@@ -1,210 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.4.2.js
ECMA Section: 15.9.4.2 Date.parse()
Description: The parse() function applies the to ToString() operator
to its argument and interprets the resulting string as
a date. It returns a number, the UTC time value
corresponding to the date.
The string may be interpreted as a local time, a UTC
time, or a time in some other time zone, depending on
the contents of the string.
(need to test strings containing stuff with the time
zone specified, and verify that parse() returns the
correct GMT time)
so for any Date object x, all of these things should
be equal:
value tested in function:
x.valueOf() test_value()
Date.parse(x.toString()) test_tostring()
Date.parse(x.toGMTString()) test_togmt()
Date.parse(x.toLocaleString()) is not required to
produce the same number value as the preceeding three
expressions. in general the value produced by
Date.parse is implementation dependent when given any
string value that could not be produced in that
implementation by the toString or toGMTString method.
value tested in function:
Date.parse( x.toLocaleString()) test_tolocale()
Author: christine@netscape.com
Date: 10 july 1997
*/
var VERSION = "ECMA_1";
startTest();
var SECTION = "15.9.4.2";
var TITLE = "Date.parse()";
var TIME = 0;
var UTC_YEAR = 1;
var UTC_MONTH = 2;
var UTC_DATE = 3;
var UTC_DAY = 4;
var UTC_HOURS = 5;
var UTC_MINUTES = 6;
var UTC_SECONDS = 7;
var UTC_MS = 8;
var YEAR = 9;
var MONTH = 10;
var DATE = 11;
var DAY = 12;
var HOURS = 13;
var MINUTES = 14;
var SECONDS = 15;
var MS = 16;
var TYPEOF = "object";
// for TCMS, the testcases array must be global.
writeHeaderToLog("15.9.4.2 Date.parse()" );
var tc= 0;
testcases = new Array();
getTestCases();
// all tests must call a function that returns an array of TestCase objects.
test();
function getTestCases() {
// Dates around 1970
addNewTestCase( new Date(0),
"new Date(0)",
[0,1970,0,1,4,0,0,0,0,1969,11,31,3,16,0,0,0] );
addNewTestCase( new Date(-1),
"new Date(-1)",
[-1,1969,11,31,3,23,59,59,999,1969,11,31,3,15,59,59,999] );
addNewTestCase( new Date(28799999),
"new Date(28799999)",
[28799999,1970,0,1,4,7,59,59,999,1969,11,31,3,23,59,59,999] );
addNewTestCase( new Date(28800000),
"new Date(28800000)",
[28800000,1970,0,1,4,8,0,0,0,1970,0,1,4,0,0,0,0] );
// Dates around 2000
addNewTestCase( new Date(946684799999),
"new Date(946684799999)",
[946684799999,1999,11,31,5,23,59,59,999,1999,11,31,5,15,59,59,999] );
addNewTestCase( new Date(946713599999),
"new Date(946713599999)",
[946713599999,2000,0,1,6,7,59,59,999,1999,11,31,5,23,59,59,999] );
addNewTestCase( new Date(946684800000),
"new Date(946684800000)",
[946684800000,2000,0,1,6,0,0,0,0,1999,11,31,5, 16,0,0,0] );
addNewTestCase( new Date(946713600000),
"new Date(946713600000)",
[946713600000,2000,0,1,6,8,0,0,0,2000,0,1,6,0,0,0,0] );
// Dates around 1900
addNewTestCase( new Date(-2208988800000),
"new Date(-2208988800000)",
[-2208988800000,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
addNewTestCase( new Date(-2208988800001),
"new Date(-2208988800001)",
[-2208988800001,1899,11,31,0,23,59,59,999,1899,11,31,0,15,59,59,999] );
addNewTestCase( new Date(-2208960000001),
"new Date(-2208960000001)",
[-2208960000001,1900,0,1,1,7,59,59,0,1899,11,31,0,23,59,59,999] );
addNewTestCase( new Date(-2208960000000),
"new Date(-2208960000000)",
[-2208960000000,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
addNewTestCase( new Date(-2208959999999),
"new Date(-2208959999999)",
[-2208959999999,1900,0,1,1,8,0,0,1,1900,0,1,1,0,0,0,1] );
// Dates around Feb 29, 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerDay;
var PST_FEB_29_2000 = UTC_FEB_29_2000 + 8*msPerHour;
addNewTestCase( new Date(UTC_FEB_29_2000),
"new Date(" + UTC_FEB_29_2000 +")",
[UTC_FEB_29_2000,2000,0,1,6,0,0,0,0,1999,11,31,5,16,0,0,0] );
addNewTestCase( new Date(PST_FEB_29_2000),
"new Date(" + PST_FEB_29_2000 +")",
[PST_FEB_29_2000,2000,0,1,6,8.0,0,0,2000,0,1,6,0,0,0,0]);
// Dates around Jan 1 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) +
TimeInYear(2002) + TimeInYear(2003) + TimeInYear(2004);
var PST_JAN_1_2005 = UTC_JAN_1_2005 + 8*msPerHour;
addNewTestCase( new Date(UTC_JAN_1_2005),
"new Date("+ UTC_JAN_1_2005 +")",
[UTC_JAN_1_2005,2005,0,1,6,0,0,0,0,2004,11,31,5,16,0,0,0] );
addNewTestCase( new Date(PST_JAN_1_2005),
"new Date("+ PST_JAN_1_2005 +")",
[PST_JAN_1_2005,2005,0,1,6,8,0,0,0,2005,0,1,6,0,0,0,0] );
}
function addNewTestCase( DateCase, DateString, ResultArray ) {
DateCase = DateCase;
item = testcases.length;
testcases[item++] = new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() );
testcases[item++] = new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() );
testcases[item++] = new TestCase( SECTION, "Date.parse(" + DateCase.toString() +")", Math.floor(ResultArray[TIME]/1000)*1000, Date.parse(DateCase.toString()) );
testcases[item++] = new TestCase( SECTION, "Date.parse(" + DateCase.toGMTString() +")", Math.floor(ResultArray[TIME]/1000)*1000, Date.parse(DateCase.toGMTString()) );
/*
testcases[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() z inutes() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() );
// testcases[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() );
testcases[item++] = new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() );
testcases[item++] = new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() );
testcases[item++] = new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() );
testcases[item++] = new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() );
testcases[item++] = new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() );
testcases[item++] = new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() );
// testcases[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() );
*/
}
function test() {
for( tc = 0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = " +
testcases[tc].actual );
}
stopTest();
// all tests must return an array of TestCase objects
return ( testcases );
}

View File

@@ -1,207 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
var testcases = new Array();
var SECTION = "15.9.4.3";
var TITLE = "Date.UTC( year, month, date, hours, minutes, seconds, ms )";
var TZ_DIFF = 8;
getTestCases();
test();
function MyDate() {
this.year = 0;
this.month = 0;
this.date = 0;
this.hours = 0;
this.minutes = 0;
this.seconds = 0;
this.ms = 0;
}
function utc( year, month, date, hours, minutes, seconds, ms ) {
d = new MyDate();
d.year = Number(year);
if (month)
d.month = Number(month);
if (date)
d.date = Number(date);
if (hours)
d.hours = Number(hours);
if (minutes)
d.minutes = Number(minutes);
if (seconds)
d.seconds = Number(seconds);
if (ms)
d.ms = Number(ms);
if ( isNaN(d.year) && 0 <= ToInteger(d.year) && d.year <= 99 ) {
d.year = 1900 + ToInteger(d.year);
}
if (isNaN(month) || isNaN(year) || isNaN(date) || isNaN(hours) ||
isNaN(minutes) || isNaN(seconds) || isNaN(ms) ) {
d.year = Number.NaN;
d.month = Number.NaN;
d.date = Number.NaN;
d.hours = Number.NaN;
d.minutes = Number.NaN;
d.seconds = Number.NaN;
d.ms = Number.NaN;
d.value = Number.NaN;
d.time = Number.NaN;
d.day =Number.NaN;
return d;
}
d.day = MakeDay( d.year, d.month, d.date );
d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms );
d.value = (TimeClip( MakeDate(d.day,d.time)));
return d;
}
function UTCTime( t ) {
sign = ( t < 0 ) ? -1 : 1;
return ( (t +(TZ_DIFF*msPerHour)) );
}
function getTestCases() {
// Dates around 1970
addNewTestCase( Date.UTC( 1970,0,1,0,0,0,0),
"Date.UTC( 1970,0,1,0,0,0,0)",
utc(1970,0,1,0,0,0,0) );
addNewTestCase( Date.UTC( 1969,11,31,23,59,59,999),
"Date.UTC( 1969,11,31,23,59,59,999)",
utc(1969,11,31,23,59,59,999) );
addNewTestCase( Date.UTC( 1972,1,29,23,59,59,999),
"Date.UTC( 1972,1,29,23,59,59,999)",
utc(1972,1,29,23,59,59,999) );
addNewTestCase( Date.UTC( 1972,2,1,23,59,59,999),
"Date.UTC( 1972,2,1,23,59,59,999)",
utc(1972,2,1,23,59,59,999) );
addNewTestCase( Date.UTC( 1968,1,29,23,59,59,999),
"Date.UTC( 1968,1,29,23,59,59,999)",
utc(1968,1,29,23,59,59,999) );
addNewTestCase( Date.UTC( 1968,2,1,23,59,59,999),
"Date.UTC( 1968,2,1,23,59,59,999)",
utc(1968,2,1,23,59,59,999) );
addNewTestCase( Date.UTC( 1969,0,1,0,0,0,0),
"Date.UTC( 1969,0,1,0,0,0,0)",
utc(1969,0,1,0,0,0,0) );
addNewTestCase( Date.UTC( 1969,11,31,23,59,59,1000),
"Date.UTC( 1969,11,31,23,59,59,1000)",
utc(1970,0,1,0,0,0,0) );
addNewTestCase( Date.UTC( 1969,Number.NaN,31,23,59,59,999),
"Date.UTC( 1969,Number.NaN,31,23,59,59,999)",
utc(1969,Number.NaN,31,23,59,59,999) );
// Dates around 2000
addNewTestCase( Date.UTC( 1999,11,31,23,59,59,999),
"Date.UTC( 1999,11,31,23,59,59,999)",
utc(1999,11,31,23,59,59,999) );
addNewTestCase( Date.UTC( 2000,0,1,0,0,0,0),
"Date.UTC( 2000,0,1,0,0,0,0)",
utc(2000,0,1,0,0,0,0) );
// Dates around 1900
addNewTestCase( Date.UTC( 1899,11,31,23,59,59,999),
"Date.UTC( 1899,11,31,23,59,59,999)",
utc(1899,11,31,23,59,59,999) );
addNewTestCase( Date.UTC( 1900,0,1,0,0,0,0),
"Date.UTC( 1900,0,1,0,0,0,0)",
utc(1900,0,1,0,0,0,0) );
addNewTestCase( Date.UTC( 1973,0,1,0,0,0,0),
"Date.UTC( 1973,0,1,0,0,0,0)",
utc(1973,0,1,0,0,0,0) );
addNewTestCase( Date.UTC( 1776,6,4,12,36,13,111),
"Date.UTC( 1776,6,4,12,36,13,111)",
utc(1776,6,4,12,36,13,111) );
addNewTestCase( Date.UTC( 2525,9,18,15,30,1,123),
"Date.UTC( 2525,9,18,15,30,1,123)",
utc(2525,9,18,15,30,1,123) );
// Dates around 29 Feb 2000
addNewTestCase( Date.UTC( 2000,1,29,0,0,0,0 ),
"Date.UTC( 2000,1,29,0,0,0,0 )",
utc(2000,1,29,0,0,0,0) );
addNewTestCase( Date.UTC( 2000,1,29,8,0,0,0 ),
"Date.UTC( 2000,1,29,8,0,0,0 )",
utc(2000,1,29,8,0,0,0) );
// Dates around 1 Jan 2005
addNewTestCase( Date.UTC( 2005,0,1,0,0,0,0 ),
"Date.UTC( 2005,0,1,0,0,0,0 )",
utc(2005,0,1,0,0,0,0) );
addNewTestCase( Date.UTC( 2004,11,31,16,0,0,0 ),
"Date.UTC( 2004,11,31,16,0,0,0 )",
utc(2004,11,31,16,0,0,0) );
}
function addNewTestCase( DateCase, DateString, ExpectDate) {
DateCase = DateCase;
item = testcases.length;
// fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year;
testcases[item++] = new TestCase( SECTION, DateString, ExpectDate.value, DateCase );
testcases[item++] = new TestCase( SECTION, DateString, ExpectDate.value, DateCase );
/*
testcases[item++] = new TestCase( SECTION, DateString+".getUTCFullYear()", ExpectDate.year, DateCase.getUTCFullYear() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMonth()", ExpectDate.month, DateCase.getUTCMonth() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCDate()", ExpectDate.date, DateCase.getUTCDate() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCDay()", ExpectDate.day, DateCase.getUTCDay() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCHours()", ExpectDate.hours, DateCase.getUTCHours() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMinutes()", ExpectDate.minutes,DateCase.getUTCMinutes() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCSeconds()", ExpectDate.seconds,DateCase.getUTCSeconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getUTCMilliseconds()", ExpectDate.ms, DateCase.getUTCMilliseconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getFullYear()", ExpectDate.year, DateCase.getFullYear() );
testcases[item++] = new TestCase( SECTION, DateString+".getMonth()", ExpectDate.month, DateCase.getMonth() );
testcases[item++] = new TestCase( SECTION, DateString+".getDate()", ExpectDate.date, DateCase.getDate() );
// testcases[item++] = new TestCase( SECTION, DateString+".getDay()", ExpectDate.day, DateCase.getDay() );
testcases[item++] = new TestCase( SECTION, DateString+".getHours()", ExpectDate.hours, DateCase.getHours() );
testcases[item++] = new TestCase( SECTION, DateString+".getMinutes()", ExpectDate.minutes, DateCase.getMinutes() );
testcases[item++] = new TestCase( SECTION, DateString+".getSeconds()", ExpectDate.seconds, DateCase.getSeconds() );
testcases[item++] = new TestCase( SECTION, DateString+".getMilliseconds()", ExpectDate.ms, DateCase.getMilliseconds() );
*/
}
function test() {
for( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = " +
testcases[tc].actual );
}
stopTest();
return testcases;
}

View File

@@ -1,56 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.5.1.js
ECMA Section: 15.9.5.1 Date.prototype.constructor
Description:
The initial value of Date.prototype.constructor is the built-in Date
constructor.
Author: christine@netscape.com
Date: 12 november 1997
*/
var SECTION = "15.9.5.1";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Date.prototype.constructor";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = new Array();
testcases[tc++] = new TestCase( SECTION,
"Date.prototype.constructor == Date",
true,
Date.prototype.constructor == Date );
test();
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,112 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.5.10.js
ECMA Section: 15.9.5.10
Description: Date.prototype.getDate
1.Let t be this time value.
2.If t is NaN, return NaN.
3.Return DateFromTime(LocalTime(t)).
Author: christine@netscape.com
Date: 12 november 1997
*/
var SECTION = "15.9.5.10";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Date.prototype.getDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = new Array();
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
// some daylight savings time cases
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addTestCase( now );
/*
addTestCase( time );
addTestCase( TIME_1970 );
addTestCase( TIME_1900 );
addTestCase( TIME_2000 );
addTestCase( UTC_FEB_29_2000 );
addTestCase( UTC_JAN_1_2005 );
addTestCase( DST_START_1998 );
addTestCase( DST_START_1998-1 );
addTestCase( DST_START_1998+1 );
addTestCase( DST_END_1998 );
addTestCase( DST_END_1998-1 );
addTestCase( DST_END_1998+1 );
*/
testcases[tc++] = new TestCase( SECTION,
"(new Date(NaN)).getDate()",
NaN,
(new Date(NaN)).getDate() );
testcases[tc++] = new TestCase( SECTION,
"Date.prototype.getDate.length",
0,
Date.prototype.getDate.length );
test();
function addTestCase( t ) {
for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) {
t += d;
testcases[tc++] = new TestCase( SECTION,
"(new Date("+t+")).getDate()",
DateFromTime(LocalTime(t)),
(new Date(t)).getDate() );
}
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,103 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.5.10.js
ECMA Section: 15.9.5.10
Description: Date.prototype.getDate
1.Let t be this time value.
2.If t is NaN, return NaN.
3.Return DateFromTime(LocalTime(t)).
Author: christine@netscape.com
Date: 12 november 1997
*/
var SECTION = "15.9.5.10";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Date.prototype.getDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = new Array();
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
// some daylight savings time cases
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addTestCase( DST_START_1998+1 );
/*
addTestCase( DST_END_1998 );
addTestCase( DST_END_1998-1 );
addTestCase( DST_END_1998+1 );
*/
testcases[tc++] = new TestCase( SECTION,
"(new Date(NaN)).getDate()",
NaN,
(new Date(NaN)).getDate() );
testcases[tc++] = new TestCase( SECTION,
"Date.prototype.getDate.length",
0,
Date.prototype.getDate.length );
test();
function addTestCase( t ) {
for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) {
t += d;
testcases[tc++] = new TestCase( SECTION,
"(new Date("+t+")).getDate()",
DateFromTime(LocalTime(t)),
(new Date(t)).getDate() );
}
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,102 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.5.10.js
ECMA Section: 15.9.5.10
Description: Date.prototype.getDate
1.Let t be this time value.
2.If t is NaN, return NaN.
3.Return DateFromTime(LocalTime(t)).
Author: christine@netscape.com
Date: 12 november 1997
*/
var SECTION = "15.9.5.10";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Date.prototype.getDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = new Array();
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
// some daylight savings time cases
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addTestCase( DST_END_1998 );
/*
addTestCase( DST_END_1998-1 );
addTestCase( DST_END_1998+1 );
*/
testcases[tc++] = new TestCase( SECTION,
"(new Date(NaN)).getDate()",
NaN,
(new Date(NaN)).getDate() );
testcases[tc++] = new TestCase( SECTION,
"Date.prototype.getDate.length",
0,
Date.prototype.getDate.length );
test();
function addTestCase( t ) {
for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) {
t += d;
testcases[tc++] = new TestCase( SECTION,
"(new Date("+t+")).getDate()",
DateFromTime(LocalTime(t)),
(new Date(t)).getDate() );
}
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,101 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.5.10.js
ECMA Section: 15.9.5.10
Description: Date.prototype.getDate
1.Let t be this time value.
2.If t is NaN, return NaN.
3.Return DateFromTime(LocalTime(t)).
Author: christine@netscape.com
Date: 12 november 1997
*/
var SECTION = "15.9.5.10";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Date.prototype.getDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = new Array();
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
// some daylight savings time cases
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addTestCase( DST_END_1998-1 );
/*
addTestCase( DST_END_1998+1 );
*/
testcases[tc++] = new TestCase( SECTION,
"(new Date(NaN)).getDate()",
NaN,
(new Date(NaN)).getDate() );
testcases[tc++] = new TestCase( SECTION,
"Date.prototype.getDate.length",
0,
Date.prototype.getDate.length );
test();
function addTestCase( t ) {
for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) {
t += d;
testcases[tc++] = new TestCase( SECTION,
"(new Date("+t+")).getDate()",
DateFromTime(LocalTime(t)),
(new Date(t)).getDate() );
}
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,98 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.5.10.js
ECMA Section: 15.9.5.10
Description: Date.prototype.getDate
1.Let t be this time value.
2.If t is NaN, return NaN.
3.Return DateFromTime(LocalTime(t)).
Author: christine@netscape.com
Date: 12 november 1997
*/
var SECTION = "15.9.5.10";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Date.prototype.getDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = new Array();
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
// some daylight savings time cases
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addTestCase( DST_END_1998+1 );
testcases[tc++] = new TestCase( SECTION,
"(new Date(NaN)).getDate()",
NaN,
(new Date(NaN)).getDate() );
testcases[tc++] = new TestCase( SECTION,
"Date.prototype.getDate.length",
0,
Date.prototype.getDate.length );
test();
function addTestCase( t ) {
for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) {
t += d;
testcases[tc++] = new TestCase( SECTION,
"(new Date("+t+")).getDate()",
DateFromTime(LocalTime(t)),
(new Date(t)).getDate() );
}
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,111 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.5.10.js
ECMA Section: 15.9.5.10
Description: Date.prototype.getDate
1.Let t be this time value.
2.If t is NaN, return NaN.
3.Return DateFromTime(LocalTime(t)).
Author: christine@netscape.com
Date: 12 november 1997
*/
var SECTION = "15.9.5.10";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Date.prototype.getDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = new Array();
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
// some daylight savings time cases
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addTestCase( time );
/*
addTestCase( TIME_1970 );
addTestCase( TIME_1900 );
addTestCase( TIME_2000 );
addTestCase( UTC_FEB_29_2000 );
addTestCase( UTC_JAN_1_2005 );
addTestCase( DST_START_1998 );
addTestCase( DST_START_1998-1 );
addTestCase( DST_START_1998+1 );
addTestCase( DST_END_1998 );
addTestCase( DST_END_1998-1 );
addTestCase( DST_END_1998+1 );
*/
testcases[tc++] = new TestCase( SECTION,
"(new Date(NaN)).getDate()",
NaN,
(new Date(NaN)).getDate() );
testcases[tc++] = new TestCase( SECTION,
"Date.prototype.getDate.length",
0,
Date.prototype.getDate.length );
test();
function addTestCase( t ) {
for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) {
t += d;
testcases[tc++] = new TestCase( SECTION,
"(new Date("+t+")).getDate()",
DateFromTime(LocalTime(t)),
(new Date(t)).getDate() );
}
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,110 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.5.10.js
ECMA Section: 15.9.5.10
Description: Date.prototype.getDate
1.Let t be this time value.
2.If t is NaN, return NaN.
3.Return DateFromTime(LocalTime(t)).
Author: christine@netscape.com
Date: 12 november 1997
*/
var SECTION = "15.9.5.10";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Date.prototype.getDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = new Array();
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
// some daylight savings time cases
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addTestCase( TIME_1970 );
/*
addTestCase( TIME_1900 );
addTestCase( TIME_2000 );
addTestCase( UTC_FEB_29_2000 );
addTestCase( UTC_JAN_1_2005 );
addTestCase( DST_START_1998 );
addTestCase( DST_START_1998-1 );
addTestCase( DST_START_1998+1 );
addTestCase( DST_END_1998 );
addTestCase( DST_END_1998-1 );
addTestCase( DST_END_1998+1 );
*/
testcases[tc++] = new TestCase( SECTION,
"(new Date(NaN)).getDate()",
NaN,
(new Date(NaN)).getDate() );
testcases[tc++] = new TestCase( SECTION,
"Date.prototype.getDate.length",
0,
Date.prototype.getDate.length );
test();
function addTestCase( t ) {
for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) {
t += d;
testcases[tc++] = new TestCase( SECTION,
"(new Date("+t+")).getDate()",
DateFromTime(LocalTime(t)),
(new Date(t)).getDate() );
}
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,108 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.5.10.js
ECMA Section: 15.9.5.10
Description: Date.prototype.getDate
1.Let t be this time value.
2.If t is NaN, return NaN.
3.Return DateFromTime(LocalTime(t)).
Author: christine@netscape.com
Date: 12 november 1997
*/
var SECTION = "15.9.5.10";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Date.prototype.getDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = new Array();
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
// some daylight savings time cases
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addTestCase( TIME_1900 );
/*
addTestCase( UTC_FEB_29_2000 );
addTestCase( UTC_JAN_1_2005 );
addTestCase( DST_START_1998 );
addTestCase( DST_START_1998-1 );
addTestCase( DST_START_1998+1 );
addTestCase( DST_END_1998 );
addTestCase( DST_END_1998-1 );
addTestCase( DST_END_1998+1 );
*/
testcases[tc++] = new TestCase( SECTION,
"(new Date(NaN)).getDate()",
NaN,
(new Date(NaN)).getDate() );
testcases[tc++] = new TestCase( SECTION,
"Date.prototype.getDate.length",
0,
Date.prototype.getDate.length );
test();
function addTestCase( t ) {
for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) {
t += d;
testcases[tc++] = new TestCase( SECTION,
"(new Date("+t+")).getDate()",
DateFromTime(LocalTime(t)),
(new Date(t)).getDate() );
}
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,108 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.5.10.js
ECMA Section: 15.9.5.10
Description: Date.prototype.getDate
1.Let t be this time value.
2.If t is NaN, return NaN.
3.Return DateFromTime(LocalTime(t)).
Author: christine@netscape.com
Date: 12 november 1997
*/
var SECTION = "15.9.5.10";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Date.prototype.getDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = new Array();
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
// some daylight savings time cases
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addTestCase( TIME_2000 );
/*
addTestCase( UTC_FEB_29_2000 );
addTestCase( UTC_JAN_1_2005 );
addTestCase( DST_START_1998 );
addTestCase( DST_START_1998-1 );
addTestCase( DST_START_1998+1 );
addTestCase( DST_END_1998 );
addTestCase( DST_END_1998-1 );
addTestCase( DST_END_1998+1 );
*/
testcases[tc++] = new TestCase( SECTION,
"(new Date(NaN)).getDate()",
NaN,
(new Date(NaN)).getDate() );
testcases[tc++] = new TestCase( SECTION,
"Date.prototype.getDate.length",
0,
Date.prototype.getDate.length );
test();
function addTestCase( t ) {
for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) {
t += d;
testcases[tc++] = new TestCase( SECTION,
"(new Date("+t+")).getDate()",
DateFromTime(LocalTime(t)),
(new Date(t)).getDate() );
}
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,107 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.5.10.js
ECMA Section: 15.9.5.10
Description: Date.prototype.getDate
1.Let t be this time value.
2.If t is NaN, return NaN.
3.Return DateFromTime(LocalTime(t)).
Author: christine@netscape.com
Date: 12 november 1997
*/
var SECTION = "15.9.5.10";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Date.prototype.getDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = new Array();
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
// some daylight savings time cases
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addTestCase( UTC_FEB_29_2000 );
/*
addTestCase( UTC_JAN_1_2005 );
addTestCase( DST_START_1998 );
addTestCase( DST_START_1998-1 );
addTestCase( DST_START_1998+1 );
addTestCase( DST_END_1998 );
addTestCase( DST_END_1998-1 );
addTestCase( DST_END_1998+1 );
*/
testcases[tc++] = new TestCase( SECTION,
"(new Date(NaN)).getDate()",
NaN,
(new Date(NaN)).getDate() );
testcases[tc++] = new TestCase( SECTION,
"Date.prototype.getDate.length",
0,
Date.prototype.getDate.length );
test();
function addTestCase( t ) {
for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) {
t += d;
testcases[tc++] = new TestCase( SECTION,
"(new Date("+t+")).getDate()",
DateFromTime(LocalTime(t)),
(new Date(t)).getDate() );
}
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,106 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.5.10.js
ECMA Section: 15.9.5.10
Description: Date.prototype.getDate
1.Let t be this time value.
2.If t is NaN, return NaN.
3.Return DateFromTime(LocalTime(t)).
Author: christine@netscape.com
Date: 12 november 1997
*/
var SECTION = "15.9.5.10";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Date.prototype.getDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = new Array();
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
// some daylight savings time cases
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addTestCase( UTC_JAN_1_2005 );
/*
addTestCase( DST_START_1998 );
addTestCase( DST_START_1998-1 );
addTestCase( DST_START_1998+1 );
addTestCase( DST_END_1998 );
addTestCase( DST_END_1998-1 );
addTestCase( DST_END_1998+1 );
*/
testcases[tc++] = new TestCase( SECTION,
"(new Date(NaN)).getDate()",
NaN,
(new Date(NaN)).getDate() );
testcases[tc++] = new TestCase( SECTION,
"Date.prototype.getDate.length",
0,
Date.prototype.getDate.length );
test();
function addTestCase( t ) {
for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) {
t += d;
testcases[tc++] = new TestCase( SECTION,
"(new Date("+t+")).getDate()",
DateFromTime(LocalTime(t)),
(new Date(t)).getDate() );
}
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,105 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.5.10.js
ECMA Section: 15.9.5.10
Description: Date.prototype.getDate
1.Let t be this time value.
2.If t is NaN, return NaN.
3.Return DateFromTime(LocalTime(t)).
Author: christine@netscape.com
Date: 12 november 1997
*/
var SECTION = "15.9.5.10";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Date.prototype.getDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = new Array();
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
// some daylight savings time cases
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addTestCase( DST_START_1998 );
/*
addTestCase( DST_START_1998-1 );
addTestCase( DST_START_1998+1 );
addTestCase( DST_END_1998 );
addTestCase( DST_END_1998-1 );
addTestCase( DST_END_1998+1 );
*/
testcases[tc++] = new TestCase( SECTION,
"(new Date(NaN)).getDate()",
NaN,
(new Date(NaN)).getDate() );
testcases[tc++] = new TestCase( SECTION,
"Date.prototype.getDate.length",
0,
Date.prototype.getDate.length );
test();
function addTestCase( t ) {
for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) {
t += d;
testcases[tc++] = new TestCase( SECTION,
"(new Date("+t+")).getDate()",
DateFromTime(LocalTime(t)),
(new Date(t)).getDate() );
}
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,104 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.5.10.js
ECMA Section: 15.9.5.10
Description: Date.prototype.getDate
1.Let t be this time value.
2.If t is NaN, return NaN.
3.Return DateFromTime(LocalTime(t)).
Author: christine@netscape.com
Date: 12 november 1997
*/
var SECTION = "15.9.5.10";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Date.prototype.getDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = new Array();
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
// get time for 29 feb 2000
var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerHour;
// get time for 1 jan 2005
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
// some daylight savings time cases
var DST_START_1998 = UTC( GetFirstSundayInApril(TimeFromYear(1998)) + 2*msPerHour )
var DST_END_1998 = UTC( GetLastSundayInOctober(TimeFromYear(1998)) + 2*msPerHour );
addTestCase( DST_START_1998-1 );
/*
addTestCase( DST_START_1998+1 );
addTestCase( DST_END_1998 );
addTestCase( DST_END_1998-1 );
addTestCase( DST_END_1998+1 );
*/
testcases[tc++] = new TestCase( SECTION,
"(new Date(NaN)).getDate()",
NaN,
(new Date(NaN)).getDate() );
testcases[tc++] = new TestCase( SECTION,
"Date.prototype.getDate.length",
0,
Date.prototype.getDate.length );
test();
function addTestCase( t ) {
for ( d = 0; d < TimeInMonth(MonthFromTime(t)); d+= msPerDay ) {
t += d;
testcases[tc++] = new TestCase( SECTION,
"(new Date("+t+")).getDate()",
DateFromTime(LocalTime(t)),
(new Date(t)).getDate() );
}
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,96 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.5.11.js
ECMA Section: 15.9.5.11
Description: Date.prototype.getUTCDate
1.Let t be this time value.
2.If t is NaN, return NaN.
1.Return DateFromTime(t).
Author: christine@netscape.com
Date: 12 november 1997
*/
var SECTION = "15.9.5.11";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Date.prototype.getUTCDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = new Array();
var TZ_ADJUST = TZ_DIFF * msPerHour;
// get the current time
var now = (new Date()).valueOf();
addTestCase( now );
test()
function addTestCase( t ) {
for ( var m = 0; m < 11; m++ ) {
t += TimeInMonth(m);
for ( var d = 0; d < TimeInMonth( m ); d += 7*msPerDay ) {
t += d;
testcases[tc++] = new TestCase( SECTION,
"(new Date("+t+")).getUTCDate()",
DateFromTime((t)),
(new Date(t)).getUTCDate() );
/*
testcases[tc++] = new TestCase( SECTION,
"(new Date("+(t+1)+")).getUTCDate()",
DateFromTime((t+1)),
(new Date(t+1)).getUTCDate() );
testcases[tc++] = new TestCase( SECTION,
"(new Date("+(t-1)+")).getUTCDate()",
DateFromTime((t-1)),
(new Date(t-1)).getUTCDate() );
testcases[tc++] = new TestCase( SECTION,
"(new Date("+(t-TZ_ADJUST)+")).getUTCDate()",
DateFromTime((t-TZ_ADJUST)),
(new Date(t-TZ_ADJUST)).getUTCDate() );
testcases[tc++] = new TestCase( SECTION,
"(new Date("+(t+TZ_ADJUST)+")).getUTCDate()",
DateFromTime((t+TZ_ADJUST)),
(new Date(t+TZ_ADJUST)).getUTCDate() );
*/
}
}
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,97 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.5.11
ECMA Section: 15.9.5.11
Description: Date.prototype.getUTCDate
1.Let t be this time value.
2.If t is NaN, return NaN.
1.Return DateFromTime(t).
Author: christine@netscape.com
Date: 12 november 1997
*/
var SECTION = "15.9.5.11";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Date.prototype.getUTCDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = new Array();
var TZ_ADJUST = TZ_DIFF * msPerHour;
// calculate time for year 0
for ( var time = 0, year = 1969; year >= 0; year-- ) {
time -= TimeInYear(year);
}
addTestCase( time );
test();
function addTestCase( t ) {
for ( var m = 0; m < 11; m++ ) {
t += TimeInMonth(m);
for ( var d = 0; d < TimeInMonth( m ); d += 7*msPerDay ) {
t += d;
testcases[tc++] = new TestCase( SECTION,
"(new Date("+t+")).getUTCDate()",
DateFromTime((t)),
(new Date(t)).getUTCDate() );
/*
testcases[tc++] = new TestCase( SECTION,
"(new Date("+(t+1)+")).getUTCDate()",
DateFromTime((t+1)),
(new Date(t+1)).getUTCDate() );
testcases[tc++] = new TestCase( SECTION,
"(new Date("+(t-1)+")).getUTCDate()",
DateFromTime((t-1)),
(new Date(t-1)).getUTCDate() );
testcases[tc++] = new TestCase( SECTION,
"(new Date("+(t-TZ_ADJUST)+")).getUTCDate()",
DateFromTime((t-TZ_ADJUST)),
(new Date(t-TZ_ADJUST)).getUTCDate() );
testcases[tc++] = new TestCase( SECTION,
"(new Date("+(t+TZ_ADJUST)+")).getUTCDate()",
DateFromTime((t+TZ_ADJUST)),
(new Date(t+TZ_ADJUST)).getUTCDate() );
*/
}
}
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,92 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.5.11.js
ECMA Section: 15.9.5.11
Description: Date.prototype.getUTCDate
1.Let t be this time value.
2.If t is NaN, return NaN.
1.Return DateFromTime(t).
Author: christine@netscape.com
Date: 12 november 1997
*/
var SECTION = "15.9.5.11";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Date.prototype.getUTCDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = new Array();
var TZ_ADJUST = TZ_DIFF * msPerHour;
addTestCase( TIME_1970 );
test();
function addTestCase( t ) {
for ( var m = 0; m < 11; m++ ) {
t += TimeInMonth(m);
for ( var d = 0; d < TimeInMonth( m ); d += 7*msPerDay ) {
t += d;
testcases[tc++] = new TestCase( SECTION,
"(new Date("+t+")).getUTCDate()",
DateFromTime((t)),
(new Date(t)).getUTCDate() );
/*
testcases[tc++] = new TestCase( SECTION,
"(new Date("+(t+1)+")).getUTCDate()",
DateFromTime((t+1)),
(new Date(t+1)).getUTCDate() );
testcases[tc++] = new TestCase( SECTION,
"(new Date("+(t-1)+")).getUTCDate()",
DateFromTime((t-1)),
(new Date(t-1)).getUTCDate() );
testcases[tc++] = new TestCase( SECTION,
"(new Date("+(t-TZ_ADJUST)+")).getUTCDate()",
DateFromTime((t-TZ_ADJUST)),
(new Date(t-TZ_ADJUST)).getUTCDate() );
testcases[tc++] = new TestCase( SECTION,
"(new Date("+(t+TZ_ADJUST)+")).getUTCDate()",
DateFromTime((t+TZ_ADJUST)),
(new Date(t+TZ_ADJUST)).getUTCDate() );
*/
}
}
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,92 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.5.11.js
ECMA Section: 15.9.5.11
Description: Date.prototype.getUTCDate
1.Let t be this time value.
2.If t is NaN, return NaN.
1.Return DateFromTime(t).
Author: christine@netscape.com
Date: 12 november 1997
*/
var SECTION = "15.9.5.11";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Date.prototype.getUTCDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = new Array();
var TZ_ADJUST = TZ_DIFF * msPerHour;
addTestCase( TIME_1900 );
test();
function addTestCase( t ) {
for ( var m = 0; m < 11; m++ ) {
t += TimeInMonth(m);
for ( var d = 0; d < TimeInMonth( m ); d += 7* msPerDay ) {
t += d;
testcases[tc++] = new TestCase( SECTION,
"(new Date("+t+")).getUTCDate()",
DateFromTime((t)),
(new Date(t)).getUTCDate() );
/*
testcases[tc++] = new TestCase( SECTION,
"(new Date("+(t+1)+")).getUTCDate()",
DateFromTime((t+1)),
(new Date(t+1)).getUTCDate() );
testcases[tc++] = new TestCase( SECTION,
"(new Date("+(t-1)+")).getUTCDate()",
DateFromTime((t-1)),
(new Date(t-1)).getUTCDate() );
testcases[tc++] = new TestCase( SECTION,
"(new Date("+(t-TZ_ADJUST)+")).getUTCDate()",
DateFromTime((t-TZ_ADJUST)),
(new Date(t-TZ_ADJUST)).getUTCDate() );
testcases[tc++] = new TestCase( SECTION,
"(new Date("+(t+TZ_ADJUST)+")).getUTCDate()",
DateFromTime((t+TZ_ADJUST)),
(new Date(t+TZ_ADJUST)).getUTCDate() );
*/
}
}
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,92 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.5.11.js
ECMA Section: 15.9.5.11
Description: Date.prototype.getUTCDate
1.Let t be this time value.
2.If t is NaN, return NaN.
1.Return DateFromTime(t).
Author: christine@netscape.com
Date: 12 november 1997
*/
var SECTION = "15.9.5.11";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Date.prototype.getUTCDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = new Array();
var TZ_ADJUST = TZ_DIFF * msPerHour;
addTestCase( TIME_2000 );
test();
function addTestCase( t ) {
for ( var m = 0; m < 11; m++ ) {
t += TimeInMonth(m);
for ( var d = 0; d < TimeInMonth( m ); d += 7*msPerDay ) {
t += d;
testcases[tc++] = new TestCase( SECTION,
"(new Date("+t+")).getUTCDate()",
DateFromTime((t)),
(new Date(t)).getUTCDate() );
/*
testcases[tc++] = new TestCase( SECTION,
"(new Date("+(t+1)+")).getUTCDate()",
DateFromTime((t+1)),
(new Date(t+1)).getUTCDate() );
testcases[tc++] = new TestCase( SECTION,
"(new Date("+(t-1)+")).getUTCDate()",
DateFromTime((t-1)),
(new Date(t-1)).getUTCDate() );
testcases[tc++] = new TestCase( SECTION,
"(new Date("+(t-TZ_ADJUST)+")).getUTCDate()",
DateFromTime((t-TZ_ADJUST)),
(new Date(t-TZ_ADJUST)).getUTCDate() );
testcases[tc++] = new TestCase( SECTION,
"(new Date("+(t+TZ_ADJUST)+")).getUTCDate()",
DateFromTime((t+TZ_ADJUST)),
(new Date(t+TZ_ADJUST)).getUTCDate() );
*/
}
}
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,93 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.5.11.js
ECMA Section: 15.9.5.11
Description: Date.prototype.getUTCDate
1.Let t be this time value.
2.If t is NaN, return NaN.
1.Return DateFromTime(t).
Author: christine@netscape.com
Date: 12 november 1997
*/
var SECTION = "15.9.5.11";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Date.prototype.getUTCDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = new Array();
var TZ_ADJUST = TZ_DIFF * msPerHour;
var UTC_FEB_29_2000 = TIME_2000 + ( 30 * msPerDay ) + ( 29 * msPerDay );
addTestCase( UTC_FEB_29_2000 );
test();
function addTestCase( t ) {
for ( var m = 0; m < 11; m++ ) {
t += TimeInMonth(m);
for ( var d = 0; d < TimeInMonth( m ); d += 7*msPerDay ) {
t += d;
testcases[tc++] = new TestCase( SECTION,
"(new Date("+t+")).getUTCDate()",
DateFromTime((t)),
(new Date(t)).getUTCDate() );
/*
testcases[tc++] = new TestCase( SECTION,
"(new Date("+(t+1)+")).getUTCDate()",
DateFromTime((t+1)),
(new Date(t+1)).getUTCDate() );
testcases[tc++] = new TestCase( SECTION,
"(new Date("+(t-1)+")).getUTCDate()",
DateFromTime((t-1)),
(new Date(t-1)).getUTCDate() );
testcases[tc++] = new TestCase( SECTION,
"(new Date("+(t-TZ_ADJUST)+")).getUTCDate()",
DateFromTime((t-TZ_ADJUST)),
(new Date(t-TZ_ADJUST)).getUTCDate() );
testcases[tc++] = new TestCase( SECTION,
"(new Date("+(t+TZ_ADJUST)+")).getUTCDate()",
DateFromTime((t+TZ_ADJUST)),
(new Date(t+TZ_ADJUST)).getUTCDate() );
*/
}
}
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

View File

@@ -1,95 +0,0 @@
/* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*
*/
/**
File Name: 15.9.5.11.js
ECMA Section: 15.9.5.11
Description: Date.prototype.getUTCDate
1.Let t be this time value.
2.If t is NaN, return NaN.
1.Return DateFromTime(t).
Author: christine@netscape.com
Date: 12 november 1997
*/
var SECTION = "15.9.5.11";
var VERSION = "ECMA_1";
startTest();
var TITLE = "Date.prototype.getUTCDate()";
writeHeaderToLog( SECTION + " "+ TITLE);
var testcases = new Array();
var TZ_ADJUST = TZ_DIFF * msPerHour;
var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000)+TimeInYear(2001)+
TimeInYear(2002)+TimeInYear(2003)+TimeInYear(2004);
addTestCase( UTC_JAN_1_2005 );
test();
function addTestCase( t ) {
for ( var m = 0; m < 11; m++ ) {
t += TimeInMonth(m);
for ( var d = 0; d < TimeInMonth( m ); d += 7*msPerDay ) {
t += d;
testcases[tc++] = new TestCase( SECTION,
"(new Date("+t+")).getUTCDate()",
DateFromTime((t)),
(new Date(t)).getUTCDate() );
/*
testcases[tc++] = new TestCase( SECTION,
"(new Date("+(t+1)+")).getUTCDate()",
DateFromTime((t+1)),
(new Date(t+1)).getUTCDate() );
testcases[tc++] = new TestCase( SECTION,
"(new Date("+(t-1)+")).getUTCDate()",
DateFromTime((t-1)),
(new Date(t-1)).getUTCDate() );
testcases[tc++] = new TestCase( SECTION,
"(new Date("+(t-TZ_ADJUST)+")).getUTCDate()",
DateFromTime((t-TZ_ADJUST)),
(new Date(t-TZ_ADJUST)).getUTCDate() );
testcases[tc++] = new TestCase( SECTION,
"(new Date("+(t+TZ_ADJUST)+")).getUTCDate()",
DateFromTime((t+TZ_ADJUST)),
(new Date(t+TZ_ADJUST)).getUTCDate() );
*/
}
}
}
function test() {
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}

Some files were not shown because too many files have changed in this diff Show More