From b855240b782395f94315f43ea3e7e182299fac48 Mon Sep 17 00:00:00 2001 From: Matthew Vogt Date: Thu, 16 Feb 2012 14:43:03 +1000 Subject: Rename QDeclarative symbols to QQuick and QQml Symbols beginning with QDeclarative are already exported by the quick1 module. Users can apply the bin/rename-qtdeclarative-symbols.sh script to modify client code using the previous names of the renamed symbols. Task-number: QTBUG-23737 Change-Id: Ifaa482663767634931e8711a8e9bf6e404859e66 Reviewed-by: Martin Jones --- tests/auto/declarative/animation/animation.pro | 7 - .../qabstractanimationjob.pro | 5 - .../tst_qabstractanimationjob.cpp | 229 - .../qanimationgroupjob/qanimationgroupjob.pro | 5 - .../qanimationgroupjob/tst_qanimationgroupjob.cpp | 310 - .../qparallelanimationgroupjob.pro | 5 - .../tst_qparallelanimationgroupjob.cpp | 931 -- .../qpauseanimationjob/qpauseanimationjob.pro | 5 - .../qpauseanimationjob/tst_qpauseanimationjob.cpp | 470 - .../qsequentialanimationgroupjob.pro | 5 - .../tst_qsequentialanimationgroupjob.cpp | 1617 ---- tests/auto/declarative/debugger/debugger.pro | 16 - .../debugger/qdebugmessageservice/data/test.qml | 51 - .../qdebugmessageservice/qdebugmessageservice.pro | 21 - .../tst_qdebugmessageservice.cpp | 242 - .../qdeclarativedebugclient.pro | 11 - .../tst_qdeclarativedebugclient.cpp | 197 - .../data/breakpointRelocation.qml | 53 - .../qdeclarativedebugjs/data/changeBreakpoint.qml | 60 - .../qdeclarativedebugjs/data/condition.qml | 54 - .../qdeclarativedebugjs/data/createComponent.qml | 54 - .../qdeclarativedebugjs/data/exception.qml | 51 - .../qdeclarativedebugjs/data/loadjsfile.qml | 48 - .../qdeclarativedebugjs/data/oncompleted.qml | 53 - .../qdeclarativedebugjs/data/stepAction.qml | 57 - .../debugger/qdeclarativedebugjs/data/test.js | 53 - .../debugger/qdeclarativedebugjs/data/test.qml | 54 - .../debugger/qdeclarativedebugjs/data/timer.qml | 52 - .../qdeclarativedebugjs/qdeclarativedebugjs.pro | 29 - .../tst_qdeclarativedebugjs.cpp | 1790 ---- .../qdeclarativedebugservice.pro | 11 - .../tst_qdeclarativedebugservice.cpp | 216 - .../qdeclarativeenginedebug.pro | 11 - .../tst_qdeclarativeenginedebug.cpp | 1235 --- .../debugger/qdeclarativeinspector/app/app.pro | 9 - .../debugger/qdeclarativeinspector/app/main.cpp | 71 - .../qdeclarativeinspector/app/qtquick2.qml | 5 - .../qdeclarativeinspector.pro | 3 - .../tst_qdeclarativeinspector.cpp | 186 - .../tst_qdeclarativeinspector.pro | 12 - .../qdeclarativeprofilerservice/data/exit.qml | 9 - .../qdeclarativeprofilerservice/data/test.qml | 5 - .../qdeclarativeprofilerservice.pro | 15 - .../tst_qdeclarativeprofilerservice.cpp | 310 - .../debugger/qpacketprotocol/qpacketprotocol.pro | 10 - .../qpacketprotocol/tst_qpacketprotocol.cpp | 263 - .../debugger/qv8profilerservice/data/console.qml | 14 - .../debugger/qv8profilerservice/data/exit.qml | 11 - .../debugger/qv8profilerservice/data/test.qml | 5 - .../qv8profilerservice/qv8profilerservice.pro | 16 - .../qv8profilerservice/tst_qv8profilerservice.cpp | 280 - .../auto/declarative/debugger/shared/debugutil.cpp | 190 - .../auto/declarative/debugger/shared/debugutil_p.h | 127 - tests/auto/declarative/declarative.pro | 55 - .../auto/declarative/parserstress/parserstress.pro | 12 - .../parserstress/tests/ecma/Array/15.4-1.js | 135 - .../parserstress/tests/ecma/Array/15.4-2.js | 114 - .../parserstress/tests/ecma/Array/15.4.1.1.js | 111 - .../parserstress/tests/ecma/Array/15.4.1.2.js | 162 - .../parserstress/tests/ecma/Array/15.4.1.3.js | 84 - .../parserstress/tests/ecma/Array/15.4.1.js | 132 - .../parserstress/tests/ecma/Array/15.4.2.1-1.js | 112 - .../parserstress/tests/ecma/Array/15.4.2.1-2.js | 101 - .../parserstress/tests/ecma/Array/15.4.2.1-3.js | 137 - .../parserstress/tests/ecma/Array/15.4.2.2-1.js | 183 - .../parserstress/tests/ecma/Array/15.4.2.2-2.js | 118 - .../parserstress/tests/ecma/Array/15.4.2.3.js | 101 - .../parserstress/tests/ecma/Array/15.4.3.1-2.js | 81 - .../parserstress/tests/ecma/Array/15.4.3.2.js | 62 - .../parserstress/tests/ecma/Array/15.4.4.1.js | 63 - .../parserstress/tests/ecma/Array/15.4.4.2.js | 120 - .../parserstress/tests/ecma/Array/15.4.4.3-1.js | 163 - .../parserstress/tests/ecma/Array/15.4.4.4-1.js | 294 - .../parserstress/tests/ecma/Array/15.4.4.4-2.js | 169 - .../parserstress/tests/ecma/Array/15.4.4.5-1.js | 225 - .../parserstress/tests/ecma/Array/15.4.4.5-2.js | 227 - .../parserstress/tests/ecma/Array/15.4.4.5-3.js | 182 - .../parserstress/tests/ecma/Array/15.4.4.js | 74 - .../parserstress/tests/ecma/Array/15.4.5.1-1.js | 170 - .../parserstress/tests/ecma/Array/15.4.5.1-2.js | 152 - .../parserstress/tests/ecma/Array/15.4.5.2-1.js | 86 - .../parserstress/tests/ecma/Array/15.4.5.2-2.js | 127 - .../parserstress/tests/ecma/Array/browser.js | 0 .../parserstress/tests/ecma/Array/shell.js | 1 - .../parserstress/tests/ecma/Boolean/15.6.1.js | 96 - .../parserstress/tests/ecma/Boolean/15.6.2.js | 161 - .../parserstress/tests/ecma/Boolean/15.6.3.1-1.js | 72 - .../parserstress/tests/ecma/Boolean/15.6.3.1-2.js | 71 - .../parserstress/tests/ecma/Boolean/15.6.3.1-3.js | 71 - .../parserstress/tests/ecma/Boolean/15.6.3.1-4.js | 75 - .../parserstress/tests/ecma/Boolean/15.6.3.1.js | 69 - .../parserstress/tests/ecma/Boolean/15.6.4-1.js | 72 - .../parserstress/tests/ecma/Boolean/15.6.4.1.js | 62 - .../parserstress/tests/ecma/Boolean/15.6.4.2-1.js | 97 - .../parserstress/tests/ecma/Boolean/15.6.4.2-2.js | 73 - .../parserstress/tests/ecma/Boolean/15.6.4.2-3.js | 65 - .../tests/ecma/Boolean/15.6.4.2-4-n.js | 69 - .../parserstress/tests/ecma/Boolean/15.6.4.3-1.js | 88 - .../parserstress/tests/ecma/Boolean/15.6.4.3-2.js | 67 - .../parserstress/tests/ecma/Boolean/15.6.4.3-3.js | 66 - .../tests/ecma/Boolean/15.6.4.3-4-n.js | 69 - .../parserstress/tests/ecma/Boolean/15.6.4.3.js | 83 - .../parserstress/tests/ecma/Boolean/15.6.4.js | 80 - .../parserstress/tests/ecma/Boolean/browser.js | 0 .../parserstress/tests/ecma/Boolean/shell.js | 1 - .../parserstress/tests/ecma/Date/15.9.1.1-1.js | 96 - .../parserstress/tests/ecma/Date/15.9.1.1-2.js | 91 - .../parserstress/tests/ecma/Date/15.9.1.13-1.js | 79 - .../parserstress/tests/ecma/Date/15.9.2.1.js | 104 - .../parserstress/tests/ecma/Date/15.9.2.2-1.js | 69 - .../parserstress/tests/ecma/Date/15.9.2.2-2.js | 69 - .../parserstress/tests/ecma/Date/15.9.2.2-3.js | 69 - .../parserstress/tests/ecma/Date/15.9.2.2-4.js | 68 - .../parserstress/tests/ecma/Date/15.9.2.2-5.js | 68 - .../parserstress/tests/ecma/Date/15.9.2.2-6.js | 67 - .../parserstress/tests/ecma/Date/15.9.3.1-1.js | 239 - .../parserstress/tests/ecma/Date/15.9.3.1-2.js | 152 - .../parserstress/tests/ecma/Date/15.9.3.1-3.js | 141 - .../parserstress/tests/ecma/Date/15.9.3.1-4.js | 151 - .../parserstress/tests/ecma/Date/15.9.3.1-5.js | 140 - .../parserstress/tests/ecma/Date/15.9.3.2-1.js | 151 - .../parserstress/tests/ecma/Date/15.9.3.2-2.js | 142 - .../parserstress/tests/ecma/Date/15.9.3.2-3.js | 146 - .../parserstress/tests/ecma/Date/15.9.3.2-4.js | 143 - .../parserstress/tests/ecma/Date/15.9.3.2-5.js | 140 - .../parserstress/tests/ecma/Date/15.9.3.8-1.js | 155 - .../parserstress/tests/ecma/Date/15.9.3.8-2.js | 153 - .../parserstress/tests/ecma/Date/15.9.3.8-3.js | 160 - .../parserstress/tests/ecma/Date/15.9.3.8-4.js | 161 - .../parserstress/tests/ecma/Date/15.9.3.8-5.js | 161 - .../parserstress/tests/ecma/Date/15.9.4.2-1.js | 81 - .../parserstress/tests/ecma/Date/15.9.4.2.js | 191 - .../parserstress/tests/ecma/Date/15.9.4.3.js | 186 - .../parserstress/tests/ecma/Date/15.9.5.1.js | 63 - .../parserstress/tests/ecma/Date/15.9.5.10-1.js | 85 - .../parserstress/tests/ecma/Date/15.9.5.10-10.js | 89 - .../parserstress/tests/ecma/Date/15.9.5.10-11.js | 89 - .../parserstress/tests/ecma/Date/15.9.5.10-12.js | 89 - .../parserstress/tests/ecma/Date/15.9.5.10-13.js | 89 - .../parserstress/tests/ecma/Date/15.9.5.10-2.js | 87 - .../parserstress/tests/ecma/Date/15.9.5.10-3.js | 85 - .../parserstress/tests/ecma/Date/15.9.5.10-4.js | 85 - .../parserstress/tests/ecma/Date/15.9.5.10-5.js | 85 - .../parserstress/tests/ecma/Date/15.9.5.10-6.js | 85 - .../parserstress/tests/ecma/Date/15.9.5.10-7.js | 85 - .../parserstress/tests/ecma/Date/15.9.5.10-8.js | 89 - .../parserstress/tests/ecma/Date/15.9.5.10-9.js | 89 - .../parserstress/tests/ecma/Date/15.9.5.11-1.js | 76 - .../parserstress/tests/ecma/Date/15.9.5.11-2.js | 76 - .../parserstress/tests/ecma/Date/15.9.5.11-3.js | 76 - .../parserstress/tests/ecma/Date/15.9.5.11-4.js | 76 - .../parserstress/tests/ecma/Date/15.9.5.11-5.js | 76 - .../parserstress/tests/ecma/Date/15.9.5.11-6.js | 76 - .../parserstress/tests/ecma/Date/15.9.5.11-7.js | 76 - .../parserstress/tests/ecma/Date/15.9.5.12-1.js | 77 - .../parserstress/tests/ecma/Date/15.9.5.12-2.js | 77 - .../parserstress/tests/ecma/Date/15.9.5.12-3.js | 77 - .../parserstress/tests/ecma/Date/15.9.5.12-4.js | 77 - .../parserstress/tests/ecma/Date/15.9.5.12-5.js | 77 - .../parserstress/tests/ecma/Date/15.9.5.12-6.js | 77 - .../parserstress/tests/ecma/Date/15.9.5.12-7.js | 77 - .../parserstress/tests/ecma/Date/15.9.5.12-8.js | 71 - .../parserstress/tests/ecma/Date/15.9.5.13-1.js | 79 - .../parserstress/tests/ecma/Date/15.9.5.13-2.js | 76 - .../parserstress/tests/ecma/Date/15.9.5.13-3.js | 77 - .../parserstress/tests/ecma/Date/15.9.5.13-4.js | 77 - .../parserstress/tests/ecma/Date/15.9.5.13-5.js | 77 - .../parserstress/tests/ecma/Date/15.9.5.13-6.js | 77 - .../parserstress/tests/ecma/Date/15.9.5.13-7.js | 76 - .../parserstress/tests/ecma/Date/15.9.5.13-8.js | 71 - .../parserstress/tests/ecma/Date/15.9.5.14.js | 87 - .../parserstress/tests/ecma/Date/15.9.5.15.js | 88 - .../parserstress/tests/ecma/Date/15.9.5.16.js | 87 - .../parserstress/tests/ecma/Date/15.9.5.17.js | 88 - .../parserstress/tests/ecma/Date/15.9.5.18.js | 88 - .../parserstress/tests/ecma/Date/15.9.5.19.js | 88 - .../parserstress/tests/ecma/Date/15.9.5.2-1.js | 151 - .../parserstress/tests/ecma/Date/15.9.5.2-2-n.js | 84 - .../parserstress/tests/ecma/Date/15.9.5.2.js | 151 - .../parserstress/tests/ecma/Date/15.9.5.20.js | 88 - .../parserstress/tests/ecma/Date/15.9.5.21-1.js | 70 - .../parserstress/tests/ecma/Date/15.9.5.21-2.js | 70 - .../parserstress/tests/ecma/Date/15.9.5.21-3.js | 70 - .../parserstress/tests/ecma/Date/15.9.5.21-4.js | 70 - .../parserstress/tests/ecma/Date/15.9.5.21-5.js | 70 - .../parserstress/tests/ecma/Date/15.9.5.21-6.js | 70 - .../parserstress/tests/ecma/Date/15.9.5.21-7.js | 70 - .../parserstress/tests/ecma/Date/15.9.5.21-8.js | 71 - .../parserstress/tests/ecma/Date/15.9.5.22-1.js | 89 - .../parserstress/tests/ecma/Date/15.9.5.22-2.js | 74 - .../parserstress/tests/ecma/Date/15.9.5.22-3.js | 74 - .../parserstress/tests/ecma/Date/15.9.5.22-4.js | 74 - .../parserstress/tests/ecma/Date/15.9.5.22-5.js | 74 - .../parserstress/tests/ecma/Date/15.9.5.22-6.js | 74 - .../parserstress/tests/ecma/Date/15.9.5.22-7.js | 74 - .../parserstress/tests/ecma/Date/15.9.5.22-8.js | 72 - .../parserstress/tests/ecma/Date/15.9.5.23-1.js | 139 - .../parserstress/tests/ecma/Date/15.9.5.23-10.js | 139 - .../parserstress/tests/ecma/Date/15.9.5.23-11.js | 140 - .../parserstress/tests/ecma/Date/15.9.5.23-12.js | 137 - .../parserstress/tests/ecma/Date/15.9.5.23-13.js | 137 - .../parserstress/tests/ecma/Date/15.9.5.23-14.js | 137 - .../parserstress/tests/ecma/Date/15.9.5.23-15.js | 137 - .../parserstress/tests/ecma/Date/15.9.5.23-16.js | 137 - .../parserstress/tests/ecma/Date/15.9.5.23-17.js | 137 - .../parserstress/tests/ecma/Date/15.9.5.23-18.js | 137 - .../parserstress/tests/ecma/Date/15.9.5.23-2.js | 109 - .../parserstress/tests/ecma/Date/15.9.5.23-3-n.js | 79 - .../parserstress/tests/ecma/Date/15.9.5.23-4.js | 112 - .../parserstress/tests/ecma/Date/15.9.5.23-5.js | 113 - .../parserstress/tests/ecma/Date/15.9.5.23-6.js | 112 - .../parserstress/tests/ecma/Date/15.9.5.23-7.js | 113 - .../parserstress/tests/ecma/Date/15.9.5.23-8.js | 103 - .../parserstress/tests/ecma/Date/15.9.5.23-9.js | 103 - .../parserstress/tests/ecma/Date/15.9.5.24-1.js | 134 - .../parserstress/tests/ecma/Date/15.9.5.24-2.js | 134 - .../parserstress/tests/ecma/Date/15.9.5.24-3.js | 134 - .../parserstress/tests/ecma/Date/15.9.5.24-4.js | 134 - .../parserstress/tests/ecma/Date/15.9.5.24-5.js | 134 - .../parserstress/tests/ecma/Date/15.9.5.24-6.js | 134 - .../parserstress/tests/ecma/Date/15.9.5.24-7.js | 134 - .../parserstress/tests/ecma/Date/15.9.5.24-8.js | 133 - .../parserstress/tests/ecma/Date/15.9.5.25-1.js | 174 - .../parserstress/tests/ecma/Date/15.9.5.26-1.js | 183 - .../parserstress/tests/ecma/Date/15.9.5.27-1.js | 183 - .../parserstress/tests/ecma/Date/15.9.5.28-1.js | 196 - .../parserstress/tests/ecma/Date/15.9.5.29-1.js | 191 - .../parserstress/tests/ecma/Date/15.9.5.3-1-n.js | 80 - .../parserstress/tests/ecma/Date/15.9.5.3-2.js | 104 - .../parserstress/tests/ecma/Date/15.9.5.30-1.js | 192 - .../parserstress/tests/ecma/Date/15.9.5.31-1.js | 221 - .../parserstress/tests/ecma/Date/15.9.5.32-1.js | 141 - .../parserstress/tests/ecma/Date/15.9.5.33-1.js | 145 - .../parserstress/tests/ecma/Date/15.9.5.34-1.js | 182 - .../parserstress/tests/ecma/Date/15.9.5.35-1.js | 139 - .../parserstress/tests/ecma/Date/15.9.5.36-1.js | 165 - .../parserstress/tests/ecma/Date/15.9.5.36-2.js | 164 - .../parserstress/tests/ecma/Date/15.9.5.36-3.js | 163 - .../parserstress/tests/ecma/Date/15.9.5.36-4.js | 163 - .../parserstress/tests/ecma/Date/15.9.5.36-5.js | 163 - .../parserstress/tests/ecma/Date/15.9.5.36-6.js | 163 - .../parserstress/tests/ecma/Date/15.9.5.36-7.js | 163 - .../parserstress/tests/ecma/Date/15.9.5.37-1.js | 173 - .../parserstress/tests/ecma/Date/15.9.5.37-2.js | 161 - .../parserstress/tests/ecma/Date/15.9.5.37-3.js | 164 - .../parserstress/tests/ecma/Date/15.9.5.37-4.js | 163 - .../parserstress/tests/ecma/Date/15.9.5.37-5.js | 159 - .../parserstress/tests/ecma/Date/15.9.5.4-1.js | 93 - .../parserstress/tests/ecma/Date/15.9.5.4-2-n.js | 76 - .../parserstress/tests/ecma/Date/15.9.5.5.js | 112 - .../parserstress/tests/ecma/Date/15.9.5.6.js | 104 - .../parserstress/tests/ecma/Date/15.9.5.7.js | 105 - .../parserstress/tests/ecma/Date/15.9.5.8.js | 113 - .../parserstress/tests/ecma/Date/15.9.5.9.js | 113 - .../parserstress/tests/ecma/Date/15.9.5.js | 83 - .../parserstress/tests/ecma/Date/browser.js | 0 .../parserstress/tests/ecma/Date/shell.js | 1 - .../tests/ecma/ExecutionContexts/10.1.3-1.js | 107 - .../tests/ecma/ExecutionContexts/10.1.3-2.js | 73 - .../tests/ecma/ExecutionContexts/10.1.3.js | 170 - .../tests/ecma/ExecutionContexts/10.1.4-1.js | 111 - .../tests/ecma/ExecutionContexts/10.1.4-10.js | 105 - .../tests/ecma/ExecutionContexts/10.1.4-2.js | 113 - .../tests/ecma/ExecutionContexts/10.1.4-3.js | 111 - .../tests/ecma/ExecutionContexts/10.1.4-4.js | 113 - .../tests/ecma/ExecutionContexts/10.1.4-5.js | 112 - .../tests/ecma/ExecutionContexts/10.1.4-6.js | 100 - .../tests/ecma/ExecutionContexts/10.1.4-7.js | 112 - .../tests/ecma/ExecutionContexts/10.1.4-8.js | 113 - .../tests/ecma/ExecutionContexts/10.1.5-1.js | 118 - .../tests/ecma/ExecutionContexts/10.1.5-2.js | 100 - .../tests/ecma/ExecutionContexts/10.1.5-3.js | 130 - .../tests/ecma/ExecutionContexts/10.1.5-4.js | 91 - .../tests/ecma/ExecutionContexts/10.1.8-2.js | 120 - .../tests/ecma/ExecutionContexts/10.1.8-3.js | 66 - .../tests/ecma/ExecutionContexts/10.2.1.js | 85 - .../tests/ecma/ExecutionContexts/10.2.2-1.js | 122 - .../tests/ecma/ExecutionContexts/10.2.2-2.js | 133 - .../tests/ecma/ExecutionContexts/10.2.3-1.js | 86 - .../tests/ecma/ExecutionContexts/10.2.3-2.js | 92 - .../tests/ecma/ExecutionContexts/browser.js | 0 .../tests/ecma/ExecutionContexts/shell.js | 1 - .../parserstress/tests/ecma/Expressions/11.1.1.js | 137 - .../parserstress/tests/ecma/Expressions/11.10-1.js | 270 - .../parserstress/tests/ecma/Expressions/11.10-2.js | 269 - .../parserstress/tests/ecma/Expressions/11.10-3.js | 268 - .../parserstress/tests/ecma/Expressions/11.12-1.js | 110 - .../tests/ecma/Expressions/11.12-2-n.js | 74 - .../parserstress/tests/ecma/Expressions/11.12-3.js | 71 - .../parserstress/tests/ecma/Expressions/11.12-4.js | 71 - .../parserstress/tests/ecma/Expressions/11.13.1.js | 72 - .../tests/ecma/Expressions/11.13.2-1.js | 231 - .../tests/ecma/Expressions/11.13.2-2.js | 253 - .../tests/ecma/Expressions/11.13.2-3.js | 300 - .../tests/ecma/Expressions/11.13.2-4.js | 137 - .../tests/ecma/Expressions/11.13.2-5.js | 137 - .../parserstress/tests/ecma/Expressions/11.13.js | 86 - .../parserstress/tests/ecma/Expressions/11.14-1.js | 73 - .../tests/ecma/Expressions/11.2.1-1.js | 272 - .../tests/ecma/Expressions/11.2.1-2.js | 128 - .../tests/ecma/Expressions/11.2.1-3-n.js | 128 - .../tests/ecma/Expressions/11.2.1-4-n.js | 128 - .../tests/ecma/Expressions/11.2.1-5.js | 128 - .../tests/ecma/Expressions/11.2.2-1-n.js | 104 - .../tests/ecma/Expressions/11.2.2-1.js | 100 - .../tests/ecma/Expressions/11.2.2-10-n.js | 102 - .../tests/ecma/Expressions/11.2.2-11.js | 104 - .../tests/ecma/Expressions/11.2.2-2-n.js | 104 - .../tests/ecma/Expressions/11.2.2-3-n.js | 100 - .../tests/ecma/Expressions/11.2.2-4-n.js | 104 - .../tests/ecma/Expressions/11.2.2-5-n.js | 104 - .../tests/ecma/Expressions/11.2.2-6-n.js | 103 - .../tests/ecma/Expressions/11.2.2-7-n.js | 104 - .../tests/ecma/Expressions/11.2.2-8-n.js | 104 - .../tests/ecma/Expressions/11.2.2-9-n.js | 104 - .../tests/ecma/Expressions/11.2.3-1.js | 125 - .../tests/ecma/Expressions/11.2.3-2-n.js | 94 - .../tests/ecma/Expressions/11.2.3-3-n.js | 91 - .../tests/ecma/Expressions/11.2.3-4-n.js | 91 - .../tests/ecma/Expressions/11.2.3-5.js | 85 - .../parserstress/tests/ecma/Expressions/11.3.1.js | 153 - .../parserstress/tests/ecma/Expressions/11.3.2.js | 153 - .../parserstress/tests/ecma/Expressions/11.4.1.js | 92 - .../parserstress/tests/ecma/Expressions/11.4.2.js | 83 - .../parserstress/tests/ecma/Expressions/11.4.3.js | 111 - .../parserstress/tests/ecma/Expressions/11.4.4.js | 156 - .../parserstress/tests/ecma/Expressions/11.4.5.js | 154 - .../parserstress/tests/ecma/Expressions/11.4.6.js | 299 - .../tests/ecma/Expressions/11.4.7-01.js | 299 - .../tests/ecma/Expressions/11.4.7-02.js | 87 - .../parserstress/tests/ecma/Expressions/11.4.8.js | 215 - .../parserstress/tests/ecma/Expressions/11.4.9.js | 94 - .../parserstress/tests/ecma/Expressions/11.5.1.js | 115 - .../parserstress/tests/ecma/Expressions/11.5.2.js | 154 - .../parserstress/tests/ecma/Expressions/11.5.3.js | 161 - .../tests/ecma/Expressions/11.6.1-1.js | 160 - .../tests/ecma/Expressions/11.6.1-2.js | 164 - .../tests/ecma/Expressions/11.6.1-3.js | 150 - .../tests/ecma/Expressions/11.6.2-1.js | 165 - .../parserstress/tests/ecma/Expressions/11.6.3.js | 115 - .../parserstress/tests/ecma/Expressions/11.7.1.js | 228 - .../parserstress/tests/ecma/Expressions/11.7.2.js | 246 - .../parserstress/tests/ecma/Expressions/11.7.3.js | 230 - .../parserstress/tests/ecma/Expressions/11.8.1.js | 121 - .../parserstress/tests/ecma/Expressions/11.8.2.js | 121 - .../parserstress/tests/ecma/Expressions/11.8.3.js | 120 - .../parserstress/tests/ecma/Expressions/11.8.4.js | 121 - .../parserstress/tests/ecma/Expressions/11.9.1.js | 159 - .../parserstress/tests/ecma/Expressions/11.9.2.js | 159 - .../parserstress/tests/ecma/Expressions/11.9.3.js | 159 - .../parserstress/tests/ecma/Expressions/browser.js | 0 .../parserstress/tests/ecma/Expressions/shell.js | 1 - .../tests/ecma/FunctionObjects/15.3.1.1-1.js | 136 - .../tests/ecma/FunctionObjects/15.3.1.1-2.js | 183 - .../tests/ecma/FunctionObjects/15.3.1.1-3.js | 99 - .../tests/ecma/FunctionObjects/15.3.2.1-1.js | 132 - .../tests/ecma/FunctionObjects/15.3.2.1-2.js | 107 - .../tests/ecma/FunctionObjects/15.3.2.1-3.js | 95 - .../tests/ecma/FunctionObjects/15.3.3.1-2.js | 70 - .../tests/ecma/FunctionObjects/15.3.3.1-3.js | 79 - .../tests/ecma/FunctionObjects/15.3.3.1-4.js | 70 - .../tests/ecma/FunctionObjects/15.3.3.2.js | 62 - .../tests/ecma/FunctionObjects/15.3.4-1.js | 94 - .../tests/ecma/FunctionObjects/15.3.4.1.js | 61 - .../tests/ecma/FunctionObjects/15.3.4.js | 81 - .../tests/ecma/FunctionObjects/15.3.5-1.js | 117 - .../tests/ecma/FunctionObjects/15.3.5-2.js | 90 - .../tests/ecma/FunctionObjects/15.3.5.1.js | 83 - .../tests/ecma/FunctionObjects/15.3.5.3.js | 72 - .../tests/ecma/FunctionObjects/browser.js | 0 .../tests/ecma/FunctionObjects/shell.js | 1 - .../tests/ecma/GlobalObject/15.1-1-n.js | 70 - .../tests/ecma/GlobalObject/15.1-2-n.js | 67 - .../tests/ecma/GlobalObject/15.1.1.1.js | 63 - .../tests/ecma/GlobalObject/15.1.1.2.js | 62 - .../tests/ecma/GlobalObject/15.1.2.1-2.js | 66 - .../tests/ecma/GlobalObject/15.1.2.2-1.js | 410 - .../tests/ecma/GlobalObject/15.1.2.2-2.js | 238 - .../tests/ecma/GlobalObject/15.1.2.3-1.js | 441 - .../tests/ecma/GlobalObject/15.1.2.3-2.js | 291 - .../tests/ecma/GlobalObject/15.1.2.4.js | 205 - .../tests/ecma/GlobalObject/15.1.2.5-1.js | 206 - .../tests/ecma/GlobalObject/15.1.2.5-2.js | 183 - .../tests/ecma/GlobalObject/15.1.2.5-3.js | 207 - .../tests/ecma/GlobalObject/15.1.2.6.js | 125 - .../tests/ecma/GlobalObject/15.1.2.7.js | 130 - .../tests/ecma/GlobalObject/browser.js | 0 .../parserstress/tests/ecma/GlobalObject/shell.js | 1 - .../tests/ecma/LexicalConventions/7.1-1.js | 82 - .../tests/ecma/LexicalConventions/7.1-2.js | 73 - .../tests/ecma/LexicalConventions/7.1-3.js | 89 - .../tests/ecma/LexicalConventions/7.2-1.js | 73 - .../tests/ecma/LexicalConventions/7.2-2-n.js | 74 - .../tests/ecma/LexicalConventions/7.2-3-n.js | 74 - .../tests/ecma/LexicalConventions/7.2-4-n.js | 73 - .../tests/ecma/LexicalConventions/7.2-5-n.js | 72 - .../tests/ecma/LexicalConventions/7.2-6.js | 68 - .../tests/ecma/LexicalConventions/7.3-1.js | 92 - .../tests/ecma/LexicalConventions/7.3-10.js | 65 - .../tests/ecma/LexicalConventions/7.3-11.js | 66 - .../tests/ecma/LexicalConventions/7.3-12.js | 64 - .../tests/ecma/LexicalConventions/7.3-13-n.js | 66 - .../tests/ecma/LexicalConventions/7.3-2.js | 65 - .../tests/ecma/LexicalConventions/7.3-3.js | 65 - .../tests/ecma/LexicalConventions/7.3-4.js | 65 - .../tests/ecma/LexicalConventions/7.3-5.js | 65 - .../tests/ecma/LexicalConventions/7.3-6.js | 65 - .../tests/ecma/LexicalConventions/7.3-7.js | 66 - .../tests/ecma/LexicalConventions/7.3-8.js | 65 - .../tests/ecma/LexicalConventions/7.3-9.js | 65 - .../tests/ecma/LexicalConventions/7.4.1-1-n.js | 71 - .../tests/ecma/LexicalConventions/7.4.1-2-n.js | 71 - .../tests/ecma/LexicalConventions/7.4.1-3-n.js | 69 - .../tests/ecma/LexicalConventions/7.4.2-1-n.js | 77 - .../tests/ecma/LexicalConventions/7.4.2-10-n.js | 77 - .../tests/ecma/LexicalConventions/7.4.2-11-n.js | 77 - .../tests/ecma/LexicalConventions/7.4.2-12-n.js | 77 - .../tests/ecma/LexicalConventions/7.4.2-13-n.js | 77 - .../tests/ecma/LexicalConventions/7.4.2-14-n.js | 77 - .../tests/ecma/LexicalConventions/7.4.2-15-n.js | 77 - .../tests/ecma/LexicalConventions/7.4.2-16-n.js | 77 - .../tests/ecma/LexicalConventions/7.4.2-2-n.js | 77 - .../tests/ecma/LexicalConventions/7.4.2-3-n.js | 77 - .../tests/ecma/LexicalConventions/7.4.2-4-n.js | 77 - .../tests/ecma/LexicalConventions/7.4.2-5-n.js | 77 - .../tests/ecma/LexicalConventions/7.4.2-6-n.js | 77 - .../tests/ecma/LexicalConventions/7.4.2-7-n.js | 75 - .../tests/ecma/LexicalConventions/7.4.2-8-n.js | 76 - .../tests/ecma/LexicalConventions/7.4.2-9-n.js | 77 - .../tests/ecma/LexicalConventions/7.4.3-1-n.js | 71 - .../tests/ecma/LexicalConventions/7.4.3-10-n.js | 71 - .../tests/ecma/LexicalConventions/7.4.3-11-n.js | 71 - .../tests/ecma/LexicalConventions/7.4.3-12-n.js | 71 - .../tests/ecma/LexicalConventions/7.4.3-13-n.js | 71 - .../tests/ecma/LexicalConventions/7.4.3-14-n.js | 97 - .../tests/ecma/LexicalConventions/7.4.3-15-n.js | 97 - .../tests/ecma/LexicalConventions/7.4.3-16-n.js | 88 - .../tests/ecma/LexicalConventions/7.4.3-2-n.js | 71 - .../tests/ecma/LexicalConventions/7.4.3-3-n.js | 71 - .../tests/ecma/LexicalConventions/7.4.3-4-n.js | 96 - .../tests/ecma/LexicalConventions/7.4.3-5-n.js | 71 - .../tests/ecma/LexicalConventions/7.4.3-6-n.js | 71 - .../tests/ecma/LexicalConventions/7.4.3-7-n.js | 97 - .../tests/ecma/LexicalConventions/7.4.3-8-n.js | 71 - .../tests/ecma/LexicalConventions/7.4.3-9-n.js | 98 - .../tests/ecma/LexicalConventions/7.5-1.js | 62 - .../tests/ecma/LexicalConventions/7.5-10-n.js | 64 - .../tests/ecma/LexicalConventions/7.5-2-n.js | 64 - .../tests/ecma/LexicalConventions/7.5-3-n.js | 64 - .../tests/ecma/LexicalConventions/7.5-4-n.js | 64 - .../tests/ecma/LexicalConventions/7.5-5-n.js | 64 - .../tests/ecma/LexicalConventions/7.5-6.js | 61 - .../tests/ecma/LexicalConventions/7.5-7.js | 61 - .../tests/ecma/LexicalConventions/7.5-8-n.js | 64 - .../tests/ecma/LexicalConventions/7.5-9-n.js | 64 - .../tests/ecma/LexicalConventions/7.6.js | 313 - .../tests/ecma/LexicalConventions/7.7.1.js | 64 - .../tests/ecma/LexicalConventions/7.7.2.js | 71 - .../tests/ecma/LexicalConventions/7.7.3-1.js | 198 - .../tests/ecma/LexicalConventions/7.7.3-2.js | 93 - .../tests/ecma/LexicalConventions/7.7.3.js | 331 - .../tests/ecma/LexicalConventions/7.7.4.js | 269 - .../tests/ecma/LexicalConventions/7.8.2-n.js | 63 - .../tests/ecma/LexicalConventions/browser.js | 0 .../tests/ecma/LexicalConventions/shell.js | 1 - .../parserstress/tests/ecma/Math/15.8-2-n.js | 82 - .../parserstress/tests/ecma/Math/15.8-3-n.js | 81 - .../parserstress/tests/ecma/Math/15.8.1.1-1.js | 64 - .../parserstress/tests/ecma/Math/15.8.1.1-2.js | 69 - .../parserstress/tests/ecma/Math/15.8.1.2-1.js | 64 - .../parserstress/tests/ecma/Math/15.8.1.2-2.js | 70 - .../parserstress/tests/ecma/Math/15.8.1.3-1.js | 65 - .../parserstress/tests/ecma/Math/15.8.1.3-2.js | 72 - .../parserstress/tests/ecma/Math/15.8.1.4-1.js | 65 - .../parserstress/tests/ecma/Math/15.8.1.4-2.js | 69 - .../parserstress/tests/ecma/Math/15.8.1.5-1.js | 66 - .../parserstress/tests/ecma/Math/15.8.1.5-2.js | 70 - .../parserstress/tests/ecma/Math/15.8.1.6-1.js | 65 - .../parserstress/tests/ecma/Math/15.8.1.6-2.js | 70 - .../parserstress/tests/ecma/Math/15.8.1.7-1.js | 65 - .../parserstress/tests/ecma/Math/15.8.1.7-2.js | 70 - .../parserstress/tests/ecma/Math/15.8.1.8-1.js | 65 - .../parserstress/tests/ecma/Math/15.8.1.8-2.js | 69 - .../parserstress/tests/ecma/Math/15.8.1.8-3.js | 63 - .../parserstress/tests/ecma/Math/15.8.1.js | 149 - .../parserstress/tests/ecma/Math/15.8.2.1.js | 226 - .../parserstress/tests/ecma/Math/15.8.2.10.js | 153 - .../parserstress/tests/ecma/Math/15.8.2.11.js | 200 - .../parserstress/tests/ecma/Math/15.8.2.12.js | 177 - .../parserstress/tests/ecma/Math/15.8.2.13.js | 385 - .../parserstress/tests/ecma/Math/15.8.2.14.js | 79 - .../parserstress/tests/ecma/Math/15.8.2.15.js | 202 - .../parserstress/tests/ecma/Math/15.8.2.16.js | 132 - .../parserstress/tests/ecma/Math/15.8.2.17.js | 217 - .../parserstress/tests/ecma/Math/15.8.2.18.js | 165 - .../parserstress/tests/ecma/Math/15.8.2.2.js | 151 - .../parserstress/tests/ecma/Math/15.8.2.3.js | 158 - .../parserstress/tests/ecma/Math/15.8.2.4.js | 156 - .../parserstress/tests/ecma/Math/15.8.2.5.js | 244 - .../parserstress/tests/ecma/Math/15.8.2.6.js | 232 - .../parserstress/tests/ecma/Math/15.8.2.7.js | 283 - .../parserstress/tests/ecma/Math/15.8.2.8.js | 134 - .../parserstress/tests/ecma/Math/15.8.2.9.js | 191 - .../parserstress/tests/ecma/Math/browser.js | 0 .../parserstress/tests/ecma/Math/shell.js | 1 - .../tests/ecma/NativeObjects/browser.js | 0 .../parserstress/tests/ecma/NativeObjects/shell.js | 1 - .../parserstress/tests/ecma/Number/15.7.1.js | 88 - .../parserstress/tests/ecma/Number/15.7.2.js | 168 - .../parserstress/tests/ecma/Number/15.7.3.1-1.js | 71 - .../parserstress/tests/ecma/Number/15.7.3.1-2.js | 71 - .../parserstress/tests/ecma/Number/15.7.3.1-3.js | 67 - .../parserstress/tests/ecma/Number/15.7.3.2-1.js | 65 - .../parserstress/tests/ecma/Number/15.7.3.2-2.js | 70 - .../parserstress/tests/ecma/Number/15.7.3.2-3.js | 67 - .../parserstress/tests/ecma/Number/15.7.3.2-4.js | 64 - .../parserstress/tests/ecma/Number/15.7.3.3-1.js | 68 - .../parserstress/tests/ecma/Number/15.7.3.3-2.js | 73 - .../parserstress/tests/ecma/Number/15.7.3.3-3.js | 64 - .../parserstress/tests/ecma/Number/15.7.3.3-4.js | 66 - .../parserstress/tests/ecma/Number/15.7.3.4-1.js | 66 - .../parserstress/tests/ecma/Number/15.7.3.4-2.js | 71 - .../parserstress/tests/ecma/Number/15.7.3.4-3.js | 65 - .../parserstress/tests/ecma/Number/15.7.3.4-4.js | 66 - .../parserstress/tests/ecma/Number/15.7.3.5-1.js | 64 - .../parserstress/tests/ecma/Number/15.7.3.5-2.js | 70 - .../parserstress/tests/ecma/Number/15.7.3.5-3.js | 65 - .../parserstress/tests/ecma/Number/15.7.3.5-4.js | 66 - .../parserstress/tests/ecma/Number/15.7.3.6-1.js | 65 - .../parserstress/tests/ecma/Number/15.7.3.6-2.js | 69 - .../parserstress/tests/ecma/Number/15.7.3.6-3.js | 65 - .../parserstress/tests/ecma/Number/15.7.3.6-4.js | 66 - .../parserstress/tests/ecma/Number/15.7.3.js | 69 - .../parserstress/tests/ecma/Number/15.7.4-1.js | 60 - .../parserstress/tests/ecma/Number/15.7.4.1.js | 62 - .../parserstress/tests/ecma/Number/15.7.4.2-1.js | 111 - .../parserstress/tests/ecma/Number/15.7.4.2-2-n.js | 76 - .../parserstress/tests/ecma/Number/15.7.4.2-3-n.js | 73 - .../parserstress/tests/ecma/Number/15.7.4.2-4.js | 70 - .../parserstress/tests/ecma/Number/15.7.4.3-1.js | 97 - .../parserstress/tests/ecma/Number/15.7.4.3-2.js | 65 - .../parserstress/tests/ecma/Number/15.7.4.3-3-n.js | 72 - .../parserstress/tests/ecma/Number/browser.js | 0 .../parserstress/tests/ecma/Number/shell.js | 1 - .../tests/ecma/ObjectObjects/15.2.1.1.js | 146 - .../tests/ecma/ObjectObjects/15.2.1.2.js | 81 - .../tests/ecma/ObjectObjects/15.2.2.1.js | 138 - .../tests/ecma/ObjectObjects/15.2.2.2.js | 74 - .../tests/ecma/ObjectObjects/15.2.3-1.js | 64 - .../tests/ecma/ObjectObjects/15.2.3.1-1.js | 69 - .../tests/ecma/ObjectObjects/15.2.3.1-2.js | 70 - .../tests/ecma/ObjectObjects/15.2.3.1-3.js | 70 - .../tests/ecma/ObjectObjects/15.2.3.1-4.js | 70 - .../tests/ecma/ObjectObjects/15.2.3.js | 67 - .../tests/ecma/ObjectObjects/15.2.4.1.js | 64 - .../tests/ecma/ObjectObjects/15.2.4.2.js | 130 - .../tests/ecma/ObjectObjects/15.2.4.3.js | 117 - .../tests/ecma/ObjectObjects/browser.js | 0 .../parserstress/tests/ecma/ObjectObjects/shell.js | 1 - .../declarative/parserstress/tests/ecma/README | 1 - .../parserstress/tests/ecma/SourceText/6-1.js | 128 - .../parserstress/tests/ecma/SourceText/6-2.js | 131 - .../parserstress/tests/ecma/SourceText/browser.js | 0 .../parserstress/tests/ecma/SourceText/shell.js | 1 - .../parserstress/tests/ecma/Statements/12.10-1.js | 151 - .../parserstress/tests/ecma/Statements/12.10.js | 61 - .../parserstress/tests/ecma/Statements/12.2-1.js | 74 - .../parserstress/tests/ecma/Statements/12.5-1.js | 102 - .../parserstress/tests/ecma/Statements/12.5-2.js | 99 - .../parserstress/tests/ecma/Statements/12.6.1-1.js | 74 - .../parserstress/tests/ecma/Statements/12.6.2-1.js | 75 - .../parserstress/tests/ecma/Statements/12.6.2-2.js | 76 - .../parserstress/tests/ecma/Statements/12.6.2-3.js | 72 - .../parserstress/tests/ecma/Statements/12.6.2-4.js | 72 - .../parserstress/tests/ecma/Statements/12.6.2-5.js | 73 - .../parserstress/tests/ecma/Statements/12.6.2-6.js | 75 - .../parserstress/tests/ecma/Statements/12.6.2-7.js | 73 - .../parserstress/tests/ecma/Statements/12.6.2-8.js | 71 - .../tests/ecma/Statements/12.6.2-9-n.js | 76 - .../parserstress/tests/ecma/Statements/12.6.3-1.js | 63 - .../tests/ecma/Statements/12.6.3-10.js | 115 - .../tests/ecma/Statements/12.6.3-11.js | 98 - .../tests/ecma/Statements/12.6.3-12.js | 103 - .../tests/ecma/Statements/12.6.3-19.js | 117 - .../parserstress/tests/ecma/Statements/12.6.3-2.js | 63 - .../parserstress/tests/ecma/Statements/12.6.3-3.js | 73 - .../parserstress/tests/ecma/Statements/12.6.3-4.js | 202 - .../tests/ecma/Statements/12.6.3-5-n.js | 110 - .../tests/ecma/Statements/12.6.3-6-n.js | 109 - .../tests/ecma/Statements/12.6.3-7-n.js | 110 - .../tests/ecma/Statements/12.6.3-8-n.js | 110 - .../tests/ecma/Statements/12.6.3-9-n.js | 109 - .../parserstress/tests/ecma/Statements/12.7-1-n.js | 64 - .../parserstress/tests/ecma/Statements/12.8-1-n.js | 67 - .../parserstress/tests/ecma/Statements/12.9-1-n.js | 63 - .../parserstress/tests/ecma/Statements/browser.js | 0 .../parserstress/tests/ecma/Statements/shell.js | 1 - .../parserstress/tests/ecma/String/15.5.1.js | 134 - .../parserstress/tests/ecma/String/15.5.2.js | 110 - .../parserstress/tests/ecma/String/15.5.3.1-1.js | 71 - .../parserstress/tests/ecma/String/15.5.3.1-2.js | 69 - .../parserstress/tests/ecma/String/15.5.3.1-3.js | 66 - .../parserstress/tests/ecma/String/15.5.3.1-4.js | 66 - .../parserstress/tests/ecma/String/15.5.3.2-1.js | 190 - .../parserstress/tests/ecma/String/15.5.3.2-2.js | 77 - .../parserstress/tests/ecma/String/15.5.3.2-3.js | 121 - .../parserstress/tests/ecma/String/15.5.3.js | 66 - .../parserstress/tests/ecma/String/15.5.4.1.js | 63 - .../parserstress/tests/ecma/String/15.5.4.10-1.js | 217 - .../parserstress/tests/ecma/String/15.5.4.11-1.js | 518 -- .../parserstress/tests/ecma/String/15.5.4.11-2.js | 515 -- .../parserstress/tests/ecma/String/15.5.4.11-3.js | 514 -- .../parserstress/tests/ecma/String/15.5.4.11-4.js | 507 -- .../parserstress/tests/ecma/String/15.5.4.11-5.js | 520 -- .../parserstress/tests/ecma/String/15.5.4.11-6.js | 516 -- .../parserstress/tests/ecma/String/15.5.4.12-1.js | 520 -- .../parserstress/tests/ecma/String/15.5.4.12-2.js | 518 -- .../parserstress/tests/ecma/String/15.5.4.12-3.js | 559 -- .../parserstress/tests/ecma/String/15.5.4.12-4.js | 515 -- .../parserstress/tests/ecma/String/15.5.4.12-5.js | 515 -- .../parserstress/tests/ecma/String/15.5.4.2-1.js | 72 - .../parserstress/tests/ecma/String/15.5.4.2-2-n.js | 73 - .../parserstress/tests/ecma/String/15.5.4.2-3.js | 83 - .../parserstress/tests/ecma/String/15.5.4.2.js | 87 - .../parserstress/tests/ecma/String/15.5.4.3-1.js | 72 - .../parserstress/tests/ecma/String/15.5.4.3-2.js | 90 - .../parserstress/tests/ecma/String/15.5.4.3-3-n.js | 72 - .../parserstress/tests/ecma/String/15.5.4.4-1.js | 92 - .../parserstress/tests/ecma/String/15.5.4.4-2.js | 136 - .../parserstress/tests/ecma/String/15.5.4.4-3.js | 112 - .../parserstress/tests/ecma/String/15.5.4.4-4.js | 124 - .../parserstress/tests/ecma/String/15.5.4.5-1.js | 87 - .../parserstress/tests/ecma/String/15.5.4.5-2.js | 121 - .../parserstress/tests/ecma/String/15.5.4.5-3.js | 131 - .../parserstress/tests/ecma/String/15.5.4.5-4.js | 75 - .../parserstress/tests/ecma/String/15.5.4.5-5.js | 106 - .../parserstress/tests/ecma/String/15.5.4.6-1.js | 155 - .../parserstress/tests/ecma/String/15.5.4.6-2.js | 259 - .../parserstress/tests/ecma/String/15.5.4.7-1.js | 219 - .../parserstress/tests/ecma/String/15.5.4.7-2.js | 217 - .../parserstress/tests/ecma/String/15.5.4.8-1.js | 232 - .../parserstress/tests/ecma/String/15.5.4.8-2.js | 247 - .../parserstress/tests/ecma/String/15.5.4.8-3.js | 204 - .../parserstress/tests/ecma/String/15.5.4.9-1.js | 202 - .../parserstress/tests/ecma/String/15.5.4.js | 108 - .../parserstress/tests/ecma/String/15.5.5.1.js | 88 - .../parserstress/tests/ecma/String/browser.js | 0 .../parserstress/tests/ecma/String/shell.js | 1 - .../parserstress/tests/ecma/TypeConversion/9.2.js | 138 - .../tests/ecma/TypeConversion/9.3-1.js | 100 - .../tests/ecma/TypeConversion/9.3.1-1.js | 323 - .../tests/ecma/TypeConversion/9.3.1-2.js | 87 - .../tests/ecma/TypeConversion/9.3.1-3.js | 743 -- .../parserstress/tests/ecma/TypeConversion/9.3.js | 87 - .../tests/ecma/TypeConversion/9.4-1.js | 112 - .../tests/ecma/TypeConversion/9.4-2.js | 112 - .../tests/ecma/TypeConversion/9.5-2.js | 173 - .../parserstress/tests/ecma/TypeConversion/9.6.js | 140 - .../parserstress/tests/ecma/TypeConversion/9.7.js | 160 - .../tests/ecma/TypeConversion/9.8.1.js | 167 - .../tests/ecma/TypeConversion/9.9-1.js | 119 - .../tests/ecma/TypeConversion/browser.js | 0 .../tests/ecma/TypeConversion/shell.js | 1 - .../parserstress/tests/ecma/Types/8.1.js | 75 - .../parserstress/tests/ecma/Types/8.4.js | 130 - .../parserstress/tests/ecma/Types/8.6.2.1-1.js | 78 - .../parserstress/tests/ecma/Types/browser.js | 0 .../parserstress/tests/ecma/Types/shell.js | 1 - .../declarative/parserstress/tests/ecma/browser.js | 62 - .../parserstress/tests/ecma/extensions/10.1.4-9.js | 110 - .../parserstress/tests/ecma/extensions/10.1.6.js | 127 - .../parserstress/tests/ecma/extensions/10.1.8-1.js | 135 - .../parserstress/tests/ecma/extensions/11.6.1-1.js | 145 - .../parserstress/tests/ecma/extensions/11.6.1-2.js | 136 - .../parserstress/tests/ecma/extensions/11.6.1-3.js | 137 - .../parserstress/tests/ecma/extensions/11.6.2-1.js | 124 - .../parserstress/tests/ecma/extensions/15-1.js | 94 - .../parserstress/tests/ecma/extensions/15-2.js | 77 - .../tests/ecma/extensions/15.1.2.1-1.js | 88 - .../parserstress/tests/ecma/extensions/15.2.1.1.js | 82 - .../parserstress/tests/ecma/extensions/15.2.3-1.js | 64 - .../parserstress/tests/ecma/extensions/15.2.4.js | 66 - .../tests/ecma/extensions/15.3.1.1-1.js | 82 - .../tests/ecma/extensions/15.3.1.1-2.js | 82 - .../tests/ecma/extensions/15.3.2.1-1.js | 72 - .../tests/ecma/extensions/15.3.2.1-2.js | 72 - .../tests/ecma/extensions/15.3.3.1-1.js | 67 - .../parserstress/tests/ecma/extensions/15.4.3.js | 63 - .../parserstress/tests/ecma/extensions/15.5.3.js | 66 - .../parserstress/tests/ecma/extensions/15.5.4.2.js | 59 - .../tests/ecma/extensions/15.5.4.4-4.js | 107 - .../tests/ecma/extensions/15.5.4.5-6.js | 94 - .../tests/ecma/extensions/15.5.4.7-3.js | 161 - .../tests/ecma/extensions/15.6.3.1-5.js | 58 - .../parserstress/tests/ecma/extensions/15.6.3.js | 65 - .../parserstress/tests/ecma/extensions/15.6.4-2.js | 66 - .../parserstress/tests/ecma/extensions/15.7.3.js | 69 - .../parserstress/tests/ecma/extensions/15.7.4.js | 90 - .../parserstress/tests/ecma/extensions/15.8-1.js | 84 - .../parserstress/tests/ecma/extensions/15.9.5.js | 76 - .../tests/ecma/extensions/8.6.2.1-1.js | 98 - .../parserstress/tests/ecma/extensions/9.9-1.js | 102 - .../parserstress/tests/ecma/extensions/browser.js | 0 .../parserstress/tests/ecma/extensions/shell.js | 1 - .../declarative/parserstress/tests/ecma/jsref.js | 634 -- .../declarative/parserstress/tests/ecma/shell.js | 577 -- .../parserstress/tests/ecma/template.js | 70 - .../tests/ecma_2/Exceptions/boolean-001.js | 80 - .../tests/ecma_2/Exceptions/boolean-002.js | 84 - .../tests/ecma_2/Exceptions/browser.js | 0 .../tests/ecma_2/Exceptions/date-001.js | 93 - .../tests/ecma_2/Exceptions/date-002.js | 87 - .../tests/ecma_2/Exceptions/date-003.js | 89 - .../tests/ecma_2/Exceptions/date-004.js | 83 - .../tests/ecma_2/Exceptions/exception-001.js | 78 - .../tests/ecma_2/Exceptions/exception-002.js | 78 - .../tests/ecma_2/Exceptions/exception-003.js | 82 - .../tests/ecma_2/Exceptions/exception-004.js | 78 - .../tests/ecma_2/Exceptions/exception-005.js | 78 - .../tests/ecma_2/Exceptions/exception-006.js | 89 - .../tests/ecma_2/Exceptions/exception-007.js | 90 - .../tests/ecma_2/Exceptions/exception-008.js | 77 - .../tests/ecma_2/Exceptions/exception-009.js | 86 - .../tests/ecma_2/Exceptions/exception-010-n.js | 61 - .../tests/ecma_2/Exceptions/exception-011-n.js | 62 - .../tests/ecma_2/Exceptions/expression-001.js | 83 - .../tests/ecma_2/Exceptions/expression-002.js | 93 - .../tests/ecma_2/Exceptions/expression-003.js | 88 - .../tests/ecma_2/Exceptions/expression-004.js | 82 - .../tests/ecma_2/Exceptions/expression-005.js | 74 - .../tests/ecma_2/Exceptions/expression-006.js | 79 - .../tests/ecma_2/Exceptions/expression-007.js | 77 - .../tests/ecma_2/Exceptions/expression-008.js | 74 - .../tests/ecma_2/Exceptions/expression-009.js | 75 - .../tests/ecma_2/Exceptions/expression-010.js | 76 - .../tests/ecma_2/Exceptions/expression-011.js | 76 - .../tests/ecma_2/Exceptions/expression-012.js | 77 - .../tests/ecma_2/Exceptions/expression-013.js | 77 - .../tests/ecma_2/Exceptions/expression-014.js | 79 - .../tests/ecma_2/Exceptions/expression-015.js | 73 - .../tests/ecma_2/Exceptions/expression-016.js | 73 - .../tests/ecma_2/Exceptions/expression-017.js | 73 - .../tests/ecma_2/Exceptions/expression-019.js | 77 - .../tests/ecma_2/Exceptions/function-001.js | 86 - .../tests/ecma_2/Exceptions/global-001.js | 78 - .../tests/ecma_2/Exceptions/global-002.js | 78 - .../tests/ecma_2/Exceptions/lexical-001.js | 85 - .../tests/ecma_2/Exceptions/lexical-002.js | 85 - .../tests/ecma_2/Exceptions/lexical-003.js | 76 - .../tests/ecma_2/Exceptions/lexical-004.js | 85 - .../tests/ecma_2/Exceptions/lexical-005.js | 85 - .../tests/ecma_2/Exceptions/lexical-006.js | 91 - .../tests/ecma_2/Exceptions/lexical-007.js | 84 - .../tests/ecma_2/Exceptions/lexical-008.js | 86 - .../tests/ecma_2/Exceptions/lexical-009.js | 86 - .../tests/ecma_2/Exceptions/lexical-010.js | 84 - .../tests/ecma_2/Exceptions/lexical-011.js | 95 - .../tests/ecma_2/Exceptions/lexical-012.js | 86 - .../tests/ecma_2/Exceptions/lexical-013.js | 86 - .../tests/ecma_2/Exceptions/lexical-014.js | 95 - .../tests/ecma_2/Exceptions/lexical-015.js | 86 - .../tests/ecma_2/Exceptions/lexical-016.js | 95 - .../tests/ecma_2/Exceptions/lexical-017.js | 87 - .../tests/ecma_2/Exceptions/lexical-018.js | 86 - .../tests/ecma_2/Exceptions/lexical-019.js | 86 - .../tests/ecma_2/Exceptions/lexical-020.js | 86 - .../tests/ecma_2/Exceptions/lexical-021.js | 95 - .../tests/ecma_2/Exceptions/lexical-022.js | 86 - .../tests/ecma_2/Exceptions/lexical-023.js | 85 - .../tests/ecma_2/Exceptions/lexical-024.js | 92 - .../tests/ecma_2/Exceptions/lexical-025.js | 92 - .../tests/ecma_2/Exceptions/lexical-026.js | 92 - .../tests/ecma_2/Exceptions/lexical-027.js | 94 - .../tests/ecma_2/Exceptions/lexical-028.js | 92 - .../tests/ecma_2/Exceptions/lexical-029.js | 92 - .../tests/ecma_2/Exceptions/lexical-030.js | 92 - .../tests/ecma_2/Exceptions/lexical-031.js | 92 - .../tests/ecma_2/Exceptions/lexical-032.js | 92 - .../tests/ecma_2/Exceptions/lexical-033.js | 92 - .../tests/ecma_2/Exceptions/lexical-034.js | 91 - .../tests/ecma_2/Exceptions/lexical-035.js | 92 - .../tests/ecma_2/Exceptions/lexical-036.js | 92 - .../tests/ecma_2/Exceptions/lexical-037.js | 92 - .../tests/ecma_2/Exceptions/lexical-038.js | 92 - .../tests/ecma_2/Exceptions/lexical-039.js | 79 - .../tests/ecma_2/Exceptions/lexical-040.js | 79 - .../tests/ecma_2/Exceptions/lexical-041.js | 81 - .../tests/ecma_2/Exceptions/lexical-042.js | 82 - .../tests/ecma_2/Exceptions/lexical-047.js | 83 - .../tests/ecma_2/Exceptions/lexical-048.js | 77 - .../tests/ecma_2/Exceptions/lexical-049.js | 82 - .../tests/ecma_2/Exceptions/lexical-050.js | 78 - .../tests/ecma_2/Exceptions/lexical-051.js | 78 - .../tests/ecma_2/Exceptions/lexical-052.js | 80 - .../tests/ecma_2/Exceptions/lexical-053.js | 78 - .../tests/ecma_2/Exceptions/lexical-054.js | 79 - .../tests/ecma_2/Exceptions/number-001.js | 86 - .../tests/ecma_2/Exceptions/number-002.js | 81 - .../tests/ecma_2/Exceptions/number-003.js | 83 - .../parserstress/tests/ecma_2/Exceptions/shell.js | 1 - .../tests/ecma_2/Exceptions/statement-001.js | 80 - .../tests/ecma_2/Exceptions/statement-002.js | 102 - .../tests/ecma_2/Exceptions/statement-003.js | 113 - .../tests/ecma_2/Exceptions/statement-004.js | 85 - .../tests/ecma_2/Exceptions/statement-005.js | 84 - .../tests/ecma_2/Exceptions/statement-006.js | 84 - .../tests/ecma_2/Exceptions/statement-007.js | 75 - .../tests/ecma_2/Exceptions/statement-008.js | 75 - .../tests/ecma_2/Exceptions/statement-009.js | 74 - .../tests/ecma_2/Exceptions/string-001.js | 86 - .../tests/ecma_2/Exceptions/string-002.js | 85 - .../tests/ecma_2/Expressions/StrictEquality-001.js | 106 - .../tests/ecma_2/Expressions/browser.js | 0 .../parserstress/tests/ecma_2/Expressions/shell.js | 1 - .../tests/ecma_2/FunctionObjects/apply-001-n.js | 65 - .../tests/ecma_2/FunctionObjects/browser.js | 0 .../tests/ecma_2/FunctionObjects/call-1.js | 75 - .../tests/ecma_2/FunctionObjects/shell.js | 1 - .../tests/ecma_2/LexicalConventions/browser.js | 0 .../ecma_2/LexicalConventions/keywords-001.js | 81 - .../LexicalConventions/regexp-literals-001.js | 77 - .../LexicalConventions/regexp-literals-002.js | 61 - .../tests/ecma_2/LexicalConventions/shell.js | 1 - .../declarative/parserstress/tests/ecma_2/README | 1 - .../parserstress/tests/ecma_2/RegExp/browser.js | 0 .../tests/ecma_2/RegExp/constructor-001.js | 99 - .../parserstress/tests/ecma_2/RegExp/exec-001.js | 73 - .../parserstress/tests/ecma_2/RegExp/exec-002.js | 221 - .../tests/ecma_2/RegExp/function-001.js | 99 - .../parserstress/tests/ecma_2/RegExp/hex-001.js | 102 - .../tests/ecma_2/RegExp/multiline-001.js | 101 - .../parserstress/tests/ecma_2/RegExp/octal-001.js | 111 - .../parserstress/tests/ecma_2/RegExp/octal-002.js | 126 - .../parserstress/tests/ecma_2/RegExp/octal-003.js | 120 - .../tests/ecma_2/RegExp/properties-001.js | 124 - .../tests/ecma_2/RegExp/properties-002.js | 162 - .../tests/ecma_2/RegExp/regexp-enumerate-001.js | 121 - .../tests/ecma_2/RegExp/regress-001.js | 78 - .../parserstress/tests/ecma_2/RegExp/shell.js | 1 - .../tests/ecma_2/RegExp/unicode-001.js | 92 - .../tests/ecma_2/Statements/browser.js | 0 .../tests/ecma_2/Statements/dowhile-001.js | 77 - .../tests/ecma_2/Statements/dowhile-002.js | 104 - .../tests/ecma_2/Statements/dowhile-003.js | 96 - .../tests/ecma_2/Statements/dowhile-004.js | 100 - .../tests/ecma_2/Statements/dowhile-005.js | 106 - .../tests/ecma_2/Statements/dowhile-006.js | 122 - .../tests/ecma_2/Statements/dowhile-007.js | 130 - .../tests/ecma_2/Statements/forin-001.js | 330 - .../tests/ecma_2/Statements/forin-002.js | 109 - .../parserstress/tests/ecma_2/Statements/if-001.js | 75 - .../tests/ecma_2/Statements/label-001.js | 75 - .../tests/ecma_2/Statements/label-002.js | 89 - .../parserstress/tests/ecma_2/Statements/shell.js | 1 - .../tests/ecma_2/Statements/switch-001.js | 98 - .../tests/ecma_2/Statements/switch-002.js | 96 - .../tests/ecma_2/Statements/switch-003.js | 90 - .../tests/ecma_2/Statements/switch-004.js | 127 - .../tests/ecma_2/Statements/try-001.js | 118 - .../tests/ecma_2/Statements/try-003.js | 115 - .../tests/ecma_2/Statements/try-004.js | 87 - .../tests/ecma_2/Statements/try-005.js | 90 - .../tests/ecma_2/Statements/try-006.js | 120 - .../tests/ecma_2/Statements/try-007.js | 125 - .../tests/ecma_2/Statements/try-008.js | 92 - .../tests/ecma_2/Statements/try-009.js | 99 - .../tests/ecma_2/Statements/try-010.js | 106 - .../tests/ecma_2/Statements/try-012.js | 128 - .../tests/ecma_2/Statements/while-001.js | 75 - .../tests/ecma_2/Statements/while-002.js | 119 - .../tests/ecma_2/Statements/while-003.js | 120 - .../tests/ecma_2/Statements/while-004.js | 250 - .../parserstress/tests/ecma_2/String/browser.js | 0 .../parserstress/tests/ecma_2/String/match-001.js | 139 - .../parserstress/tests/ecma_2/String/match-002.js | 207 - .../parserstress/tests/ecma_2/String/match-003.js | 165 - .../parserstress/tests/ecma_2/String/match-004.js | 206 - .../tests/ecma_2/String/replace-001.js | 99 - .../parserstress/tests/ecma_2/String/shell.js | 1 - .../parserstress/tests/ecma_2/String/split-001.js | 145 - .../parserstress/tests/ecma_2/String/split-002.js | 303 - .../parserstress/tests/ecma_2/String/split-003.js | 156 - .../parserstress/tests/ecma_2/browser.js | 37 - .../tests/ecma_2/extensions/browser.js | 0 .../tests/ecma_2/extensions/constructor-001.js | 74 - .../tests/ecma_2/extensions/function-001.js | 74 - .../tests/ecma_2/extensions/instanceof-001.js | 144 - .../tests/ecma_2/extensions/instanceof-002.js | 160 - .../tests/ecma_2/extensions/instanceof-003-n.js | 121 - .../tests/ecma_2/extensions/instanceof-004-n.js | 121 - .../tests/ecma_2/extensions/instanceof-005-n.js | 122 - .../tests/ecma_2/extensions/instanceof-006.js | 119 - .../parserstress/tests/ecma_2/extensions/shell.js | 1 - .../tests/ecma_2/instanceof/browser.js | 0 .../tests/ecma_2/instanceof/instanceof-001.js | 67 - .../tests/ecma_2/instanceof/instanceof-002.js | 84 - .../tests/ecma_2/instanceof/instanceof-003.js | 98 - .../tests/ecma_2/instanceof/regress-7635.js | 88 - .../parserstress/tests/ecma_2/instanceof/shell.js | 1 - .../declarative/parserstress/tests/ecma_2/jsref.js | 591 -- .../declarative/parserstress/tests/ecma_2/shell.js | 51 - .../parserstress/tests/ecma_2/template.js | 57 - .../tests/ecma_3/Array/15.4.4.11-01.js | 61 - .../parserstress/tests/ecma_3/Array/15.4.4.3-1.js | 88 - .../tests/ecma_3/Array/15.4.4.4-001.js | 153 - .../parserstress/tests/ecma_3/Array/15.4.5.1-01.js | 93 - .../parserstress/tests/ecma_3/Array/browser.js | 0 .../tests/ecma_3/Array/regress-101488.js | 172 - .../tests/ecma_3/Array/regress-130451.js | 219 - .../tests/ecma_3/Array/regress-322135-01.js | 73 - .../tests/ecma_3/Array/regress-322135-02.js | 65 - .../tests/ecma_3/Array/regress-322135-03.js | 73 - .../tests/ecma_3/Array/regress-322135-04.js | 71 - .../tests/ecma_3/Array/regress-387501.js | 94 - .../tests/ecma_3/Array/regress-421325.js | 67 - .../tests/ecma_3/Array/regress-430717.js | 65 - .../parserstress/tests/ecma_3/Array/shell.js | 1 - .../parserstress/tests/ecma_3/Date/15.9.1.2-01.js | 62 - .../parserstress/tests/ecma_3/Date/15.9.3.2-1.js | 91 - .../parserstress/tests/ecma_3/Date/15.9.4.3.js | 233 - .../parserstress/tests/ecma_3/Date/15.9.5.3.js | 152 - .../parserstress/tests/ecma_3/Date/15.9.5.4.js | 185 - .../parserstress/tests/ecma_3/Date/15.9.5.5-02.js | 88 - .../parserstress/tests/ecma_3/Date/15.9.5.5.js | 144 - .../parserstress/tests/ecma_3/Date/15.9.5.6.js | 153 - .../parserstress/tests/ecma_3/Date/15.9.5.7.js | 142 - .../parserstress/tests/ecma_3/Date/browser.js | 37 - .../parserstress/tests/ecma_3/Date/shell.js | 564 -- .../tests/ecma_3/Exceptions/15.11.1.1.js | 137 - .../tests/ecma_3/Exceptions/15.11.4.4-1.js | 174 - .../tests/ecma_3/Exceptions/15.11.7.6-001.js | 130 - .../tests/ecma_3/Exceptions/15.11.7.6-002.js | 132 - .../tests/ecma_3/Exceptions/15.11.7.6-003.js | 132 - .../tests/ecma_3/Exceptions/binding-001.js | 128 - .../tests/ecma_3/Exceptions/browser.js | 0 .../tests/ecma_3/Exceptions/regress-181654.js | 155 - .../tests/ecma_3/Exceptions/regress-181914.js | 194 - .../tests/ecma_3/Exceptions/regress-58946.js | 71 - .../tests/ecma_3/Exceptions/regress-95101.js | 118 - .../parserstress/tests/ecma_3/Exceptions/shell.js | 1 - .../tests/ecma_3/ExecutionContexts/10.1.3-1.js | 201 - .../tests/ecma_3/ExecutionContexts/10.1.3-2.js | 70 - .../tests/ecma_3/ExecutionContexts/10.1.3.js | 73 - .../tests/ecma_3/ExecutionContexts/10.1.4-1.js | 85 - .../tests/ecma_3/ExecutionContexts/10.6.1-01.js | 136 - .../tests/ecma_3/ExecutionContexts/browser.js | 0 .../ecma_3/ExecutionContexts/regress-23346.js | 71 - .../ecma_3/ExecutionContexts/regress-448595-01.js | 91 - .../tests/ecma_3/ExecutionContexts/shell.js | 1 - .../tests/ecma_3/Expressions/11.10-01.js | 76 - .../tests/ecma_3/Expressions/11.10-02.js | 76 - .../tests/ecma_3/Expressions/11.10-03.js | 76 - .../tests/ecma_3/Expressions/11.6.1-1.js | 176 - .../tests/ecma_3/Expressions/11.7.1-01.js | 76 - .../tests/ecma_3/Expressions/11.7.2-01.js | 76 - .../tests/ecma_3/Expressions/11.7.3-01.js | 76 - .../tests/ecma_3/Expressions/11.9.6-1.js | 213 - .../tests/ecma_3/Expressions/browser.js | 0 .../parserstress/tests/ecma_3/Expressions/shell.js | 1 - .../parserstress/tests/ecma_3/FunExpr/browser.js | 0 .../parserstress/tests/ecma_3/FunExpr/fe-001-n.js | 58 - .../parserstress/tests/ecma_3/FunExpr/fe-001.js | 57 - .../parserstress/tests/ecma_3/FunExpr/fe-002.js | 61 - .../parserstress/tests/ecma_3/FunExpr/shell.js | 1 - .../tests/ecma_3/Function/15.3.4.3-1.js | 210 - .../tests/ecma_3/Function/15.3.4.4-1.js | 185 - .../tests/ecma_3/Function/arguments-001.js | 169 - .../tests/ecma_3/Function/arguments-002.js | 73 - .../parserstress/tests/ecma_3/Function/browser.js | 0 .../parserstress/tests/ecma_3/Function/call-001.js | 153 - .../tests/ecma_3/Function/regress-131964.js | 196 - .../tests/ecma_3/Function/regress-137181.js | 113 - .../tests/ecma_3/Function/regress-193555.js | 136 - .../tests/ecma_3/Function/regress-313570.js | 63 - .../tests/ecma_3/Function/regress-49286.js | 137 - .../tests/ecma_3/Function/regress-58274.js | 226 - .../tests/ecma_3/Function/regress-85880.js | 173 - .../tests/ecma_3/Function/regress-94506.js | 163 - .../tests/ecma_3/Function/regress-97921.js | 152 - .../tests/ecma_3/Function/scope-001.js | 265 - .../tests/ecma_3/Function/scope-002.js | 245 - .../parserstress/tests/ecma_3/Function/shell.js | 1 - .../tests/ecma_3/LexicalConventions/7.9.1.js | 157 - .../tests/ecma_3/LexicalConventions/browser.js | 0 .../tests/ecma_3/LexicalConventions/shell.js | 1 - .../tests/ecma_3/Number/15.7.4.2-01.js | 77 - .../tests/ecma_3/Number/15.7.4.3-01.js | 69 - .../tests/ecma_3/Number/15.7.4.3-02.js | 53 - .../parserstress/tests/ecma_3/Number/15.7.4.5-1.js | 145 - .../parserstress/tests/ecma_3/Number/15.7.4.6-1.js | 134 - .../parserstress/tests/ecma_3/Number/15.7.4.7-1.js | 139 - .../parserstress/tests/ecma_3/Number/15.7.4.7-2.js | 72 - .../parserstress/tests/ecma_3/Number/browser.js | 0 .../tests/ecma_3/Number/regress-442242-01.js | 62 - .../parserstress/tests/ecma_3/Number/shell.js | 1 - .../tests/ecma_3/NumberFormatting/browser.js | 0 .../tests/ecma_3/NumberFormatting/shell.js | 1 - .../tests/ecma_3/NumberFormatting/tostring-001.js | 60 - .../parserstress/tests/ecma_3/Object/8.6.1-01.js | 113 - .../tests/ecma_3/Object/8.6.2.6-001.js | 113 - .../parserstress/tests/ecma_3/Object/browser.js | 7 - .../parserstress/tests/ecma_3/Object/class-001.js | 156 - .../parserstress/tests/ecma_3/Object/class-002.js | 146 - .../parserstress/tests/ecma_3/Object/class-003.js | 139 - .../parserstress/tests/ecma_3/Object/class-004.js | 139 - .../parserstress/tests/ecma_3/Object/class-005.js | 124 - .../tests/ecma_3/Object/regress-361274.js | 66 - .../tests/ecma_3/Object/regress-385393-07.js | 67 - .../tests/ecma_3/Object/regress-72773.js | 97 - .../tests/ecma_3/Object/regress-79129-001.js | 80 - .../parserstress/tests/ecma_3/Object/shell.js | 105 - .../tests/ecma_3/Operators/11.13.1-001.js | 152 - .../tests/ecma_3/Operators/11.13.1-002.js | 57 - .../tests/ecma_3/Operators/11.4.1-001.js | 120 - .../tests/ecma_3/Operators/11.4.1-002.js | 72 - .../parserstress/tests/ecma_3/Operators/browser.js | 0 .../tests/ecma_3/Operators/order-01.js | 108 - .../parserstress/tests/ecma_3/Operators/shell.js | 1 - .../declarative/parserstress/tests/ecma_3/README | 1 - .../parserstress/tests/ecma_3/RegExp/15.10.2-1.js | 181 - .../parserstress/tests/ecma_3/RegExp/15.10.2.12.js | 63 - .../tests/ecma_3/RegExp/15.10.3.1-1.js | 136 - .../tests/ecma_3/RegExp/15.10.3.1-2.js | 144 - .../tests/ecma_3/RegExp/15.10.4.1-1.js | 127 - .../tests/ecma_3/RegExp/15.10.4.1-2.js | 133 - .../tests/ecma_3/RegExp/15.10.4.1-3.js | 139 - .../tests/ecma_3/RegExp/15.10.4.1-4.js | 146 - .../tests/ecma_3/RegExp/15.10.4.1-5-n.js | 139 - .../tests/ecma_3/RegExp/15.10.6.2-1.js | 140 - .../tests/ecma_3/RegExp/15.10.6.2-2.js | 367 - .../parserstress/tests/ecma_3/RegExp/browser.js | 0 .../parserstress/tests/ecma_3/RegExp/octal-001.js | 136 - .../parserstress/tests/ecma_3/RegExp/octal-002.js | 218 - .../tests/ecma_3/RegExp/perlstress-001.js | 3230 ------- .../tests/ecma_3/RegExp/perlstress-002.js | 1842 ---- .../tests/ecma_3/RegExp/regress-100199.js | 307 - .../tests/ecma_3/RegExp/regress-105972.js | 157 - .../tests/ecma_3/RegExp/regress-119909.js | 92 - .../tests/ecma_3/RegExp/regress-122076.js | 110 - .../tests/ecma_3/RegExp/regress-123437.js | 112 - .../tests/ecma_3/RegExp/regress-165353.js | 122 - .../tests/ecma_3/RegExp/regress-169497.js | 105 - .../tests/ecma_3/RegExp/regress-169534.js | 95 - .../tests/ecma_3/RegExp/regress-187133.js | 142 - .../tests/ecma_3/RegExp/regress-188206.js | 219 - .../tests/ecma_3/RegExp/regress-191479.js | 198 - .../tests/ecma_3/RegExp/regress-202564.js | 101 - .../tests/ecma_3/RegExp/regress-209067.js | 1106 --- .../tests/ecma_3/RegExp/regress-209919.js | 174 - .../tests/ecma_3/RegExp/regress-216591.js | 117 - .../tests/ecma_3/RegExp/regress-220367-001.js | 104 - .../tests/ecma_3/RegExp/regress-223273.js | 279 - .../tests/ecma_3/RegExp/regress-223535.js | 133 - .../tests/ecma_3/RegExp/regress-224676.js | 232 - .../tests/ecma_3/RegExp/regress-225289.js | 176 - .../tests/ecma_3/RegExp/regress-225343.js | 125 - .../tests/ecma_3/RegExp/regress-24712.js | 59 - .../tests/ecma_3/RegExp/regress-285219.js | 51 - .../tests/ecma_3/RegExp/regress-28686.js | 57 - .../tests/ecma_3/RegExp/regress-289669.js | 88 - .../tests/ecma_3/RegExp/regress-307456.js | 54 - .../tests/ecma_3/RegExp/regress-309840.js | 58 - .../tests/ecma_3/RegExp/regress-311414.js | 101 - .../tests/ecma_3/RegExp/regress-312351.js | 50 - .../tests/ecma_3/RegExp/regress-31316.js | 96 - .../tests/ecma_3/RegExp/regress-330684.js | 53 - .../tests/ecma_3/RegExp/regress-334158.js | 58 - .../tests/ecma_3/RegExp/regress-346090.js | 63 - .../tests/ecma_3/RegExp/regress-367888.js | 62 - .../tests/ecma_3/RegExp/regress-375642.js | 61 - .../tests/ecma_3/RegExp/regress-375711.js | 118 - .../tests/ecma_3/RegExp/regress-375715-01-n.js | 63 - .../tests/ecma_3/RegExp/regress-375715-02.js | 60 - .../tests/ecma_3/RegExp/regress-375715-03.js | 60 - .../tests/ecma_3/RegExp/regress-375715-04.js | 68 - .../tests/ecma_3/RegExp/regress-57572.js | 150 - .../tests/ecma_3/RegExp/regress-57631.js | 152 - .../tests/ecma_3/RegExp/regress-67773.js | 211 - .../tests/ecma_3/RegExp/regress-72964.js | 121 - .../tests/ecma_3/RegExp/regress-76683.js | 114 - .../tests/ecma_3/RegExp/regress-78156.js | 123 - .../tests/ecma_3/RegExp/regress-85721.js | 276 - .../tests/ecma_3/RegExp/regress-87231.js | 145 - .../tests/ecma_3/RegExp/regress-98306.js | 99 - .../parserstress/tests/ecma_3/RegExp/shell.js | 266 - .../parserstress/tests/ecma_3/Regress/browser.js | 0 .../tests/ecma_3/Regress/regress-385393-04.js | 66 - .../tests/ecma_3/Regress/regress-419152.js | 90 - .../tests/ecma_3/Regress/regress-420087.js | 64 - .../tests/ecma_3/Regress/regress-420610.js | 50 - .../tests/ecma_3/Regress/regress-441477-01.js | 73 - .../parserstress/tests/ecma_3/Regress/shell.js | 1 - .../parserstress/tests/ecma_3/Statements/12.6.3.js | 80 - .../tests/ecma_3/Statements/browser.js | 0 .../tests/ecma_3/Statements/regress-121744.js | 217 - .../tests/ecma_3/Statements/regress-131348.js | 184 - .../tests/ecma_3/Statements/regress-157509.js | 111 - .../tests/ecma_3/Statements/regress-194364.js | 152 - .../tests/ecma_3/Statements/regress-226517.js | 112 - .../tests/ecma_3/Statements/regress-302439.js | 1368 --- .../tests/ecma_3/Statements/regress-324650.js | 5461 ------------ .../tests/ecma_3/Statements/regress-74474-001.js | 139 - .../tests/ecma_3/Statements/regress-74474-002.js | 9097 ------------------- .../tests/ecma_3/Statements/regress-74474-003.js | 9099 -------------------- .../tests/ecma_3/Statements/regress-83532-001.js | 71 - .../tests/ecma_3/Statements/regress-83532-002.js | 74 - .../parserstress/tests/ecma_3/Statements/shell.js | 1 - .../tests/ecma_3/Statements/switch-001.js | 143 - .../parserstress/tests/ecma_3/String/15.5.4.11.js | 532 -- .../parserstress/tests/ecma_3/String/15.5.4.14.js | 50 - .../parserstress/tests/ecma_3/String/browser.js | 0 .../tests/ecma_3/String/regress-104375.js | 116 - .../tests/ecma_3/String/regress-189898.js | 157 - .../tests/ecma_3/String/regress-304376.js | 68 - .../tests/ecma_3/String/regress-313567.js | 56 - .../tests/ecma_3/String/regress-392378.js | 77 - .../tests/ecma_3/String/regress-83293.js | 216 - .../parserstress/tests/ecma_3/String/shell.js | 1 - .../parserstress/tests/ecma_3/Unicode/browser.js | 0 .../tests/ecma_3/Unicode/regress-352044-01.js | 72 - .../tests/ecma_3/Unicode/regress-352044-02-n.js | 72 - .../parserstress/tests/ecma_3/Unicode/shell.js | 1 - .../parserstress/tests/ecma_3/Unicode/uc-001-n.js | 62 - .../parserstress/tests/ecma_3/Unicode/uc-001.js | 56 - .../parserstress/tests/ecma_3/Unicode/uc-002-n.js | 55 - .../parserstress/tests/ecma_3/Unicode/uc-002.js | 60 - .../parserstress/tests/ecma_3/Unicode/uc-003.js | 71 - .../parserstress/tests/ecma_3/Unicode/uc-004.js | 65 - .../parserstress/tests/ecma_3/Unicode/uc-005.js | 276 - .../parserstress/tests/ecma_3/browser.js | 36 - .../tests/ecma_3/extensions/10.1.3-2.js | 162 - .../parserstress/tests/ecma_3/extensions/7.9.1.js | 83 - .../tests/ecma_3/extensions/browser.js | 0 .../tests/ecma_3/extensions/regress-103087.js | 178 - .../tests/ecma_3/extensions/regress-188206-01.js | 108 - .../tests/ecma_3/extensions/regress-188206-02.js | 158 - .../tests/ecma_3/extensions/regress-220367-002.js | 112 - .../tests/ecma_3/extensions/regress-228087.js | 352 - .../tests/ecma_3/extensions/regress-274152.js | 83 - .../tests/ecma_3/extensions/regress-320854.js | 53 - .../tests/ecma_3/extensions/regress-327170.js | 58 - .../tests/ecma_3/extensions/regress-368516.js | 78 - .../tests/ecma_3/extensions/regress-385393-03.js | 63 - .../tests/ecma_3/extensions/regress-429248.js | 67 - .../tests/ecma_3/extensions/regress-430740.js | 72 - .../parserstress/tests/ecma_3/extensions/shell.js | 266 - .../declarative/parserstress/tests/ecma_3/shell.js | 40 - .../parserstress/tests/ecma_3/template.js | 59 - tests/auto/declarative/parserstress/tests/shell.js | 886 -- .../declarative/parserstress/tst_parserstress.cpp | 154 - .../qdeclarativebinding/data/deletedObject.qml | 24 - .../qdeclarativebinding/data/restoreBinding.qml | 26 - .../data/restoreBindingWithLoop.qml | 23 - .../qdeclarativebinding/data/test-binding.qml | 16 - .../qdeclarativebinding/data/test-binding2.qml | 16 - .../qdeclarativebinding/qdeclarativebinding.pro | 15 - .../tst_qdeclarativebinding.cpp | 197 - .../qdeclarativechangeset.pro | 9 - .../tst_qdeclarativechangeset.cpp | 812 -- .../qdeclarativecomponent/data/createObject.qml | 13 - .../data/createObjectWithScript.qml | 43 - .../qdeclarativecomponent/data/incubateObject.qml | 36 - .../qdeclarativecomponent.pro | 15 - .../tst_qdeclarativecomponent.cpp | 186 - .../data/connection-targetchange.qml | 25 - .../data/connection-unknownsignals-ignored.qml | 8 - .../data/connection-unknownsignals-notarget.qml | 7 - .../data/connection-unknownsignals-parent.qml | 7 - .../data/connection-unknownsignals.qml | 7 - .../qdeclarativeconnection/data/error-object.qml | 7 - .../qdeclarativeconnection/data/error-property.qml | 5 - .../data/error-property2.qml | 5 - .../qdeclarativeconnection/data/error-syntax.qml | 9 - .../data/moduleapi-target.qml | 22 - .../data/test-connection.qml | 10 - .../data/test-connection2.qml | 3 - .../data/test-connection3.qml | 3 - .../qdeclarativeconnection/data/trimming.qml | 10 - .../qdeclarativeconnection.pro | 15 - .../tst_qdeclarativeconnection.cpp | 292 - .../qdeclarativeconsole/data/assert.qml | 62 - .../qdeclarativeconsole/data/exception.qml | 58 - .../qdeclarativeconsole/data/logging.qml | 90 - .../qdeclarativeconsole/data/profiling.qml | 51 - .../qdeclarativeconsole/data/tracing.qml | 56 - .../qdeclarativeconsole/qdeclarativeconsole.pro | 15 - .../tst_qdeclarativeconsole.cpp | 170 - .../qdeclarativecontext/data/Object_22535.qml | 8 - .../data/RefreshExpressionsType.qml | 5 - .../qdeclarativecontext/data/qtbug_22535.qml | 10 - .../data/refreshExpressions.qml | 6 - .../data/refreshExpressionsRootContext.qml | 6 - .../qdeclarativecontext/qdeclarativecontext.pro | 15 - .../tst_qdeclarativecontext.cpp | 652 -- .../qdeclarativecpputils/qdeclarativecpputils.pro | 9 - .../tst_qdeclarativecpputils.cpp | 106 - .../data/AliasBindingsAssignCorrectlyType.qml | 9 - .../data/AliasBindingsOverrideTargetType.qml | 14 - .../data/AliasBindingsOverrideTargetType3.qml | 9 - .../data/AliasToCompositeElementType1.qml | 6 - .../data/AliasToCompositeElementType2.qml | 5 - .../data/ConstantsOverrideBindings.qml | 12 - .../qdeclarativeecmascript/data/CustomObject.qml | 5 - .../data/ElementAssignType.qml | 5 - .../qdeclarativeecmascript/data/MethodsObject.qml | 6 - .../data/NestedTypeTransientErrors.qml | 11 - .../data/PropertyVarBaseItem.qml | 5 - .../data/PropertyVarCircularComponent.qml | 23 - .../data/PropertyVarCircularComponent2.qml | 26 - .../data/PropertyVarCircularComponent3.qml | 16 - .../data/PropertyVarCircularComponent4.qml | 28 - .../data/PropertyVarCircularComponent5.qml | 7 - .../data/PropertyVarInheritanceComponent.qml | 22 - .../data/PropertyVarOwnershipComponent.qml | 37 - .../data/ScarceResourceSignalComponentVar.qml | 9 - .../data/ScarceResourceSignalComponentVariant.qml | 9 - .../data/ScarceResourceVarComponent.qml | 13 - .../qdeclarativeecmascript/data/Scope6Nested.qml | 7 - .../qdeclarativeecmascript/data/ScopeObject.qml | 12 - .../data/SequenceConversionComponent.qml | 7 - .../data/SpuriousWarning.qml | 5 - .../data/TypeForDynamicCreation.qml | 2 - .../data/aliasBindingsAssignCorrectly.qml | 59 - .../data/aliasBindingsOverrideTarget.2.qml | 29 - .../data/aliasBindingsOverrideTarget.3.qml | 24 - .../data/aliasBindingsOverrideTarget.qml | 28 - .../data/aliasPropertyAndBinding.qml | 14 - .../data/aliasToCompositeElement.qml | 6 - .../data/aliasWritesOverrideBindings.2.qml | 29 - .../data/aliasWritesOverrideBindings.3.qml | 23 - .../data/aliasWritesOverrideBindings.qml | 23 - .../data/aliasreset/AliasPropertyComponent.qml | 17 - .../data/aliasreset/aliasPropertyReset.1.qml | 23 - .../data/aliasreset/aliasPropertyReset.2.qml | 23 - .../data/aliasreset/aliasPropertyReset.3.qml | 31 - .../data/aliasreset/aliasPropertyReset.4.qml | 26 - .../data/aliasreset/aliasPropertyReset.5.qml | 14 - .../data/aliasreset/aliasPropertyReset.error.1.qml | 18 - .../data/assignBasicTypes.2.qml | 26 - .../data/assignBasicTypes.qml | 29 - .../data/assignSequenceTypes.1.qml | 11 - .../data/assignSequenceTypes.2.qml | 11 - .../data/assignSequenceTypes.3.qml | 9 - .../data/assignSequenceTypes.4.qml | 13 - .../data/assignSequenceTypes.5.qml | 13 - .../data/assignSequenceTypes.6.qml | 11 - .../data/assignSequenceTypes.7.qml | 42 - .../data/attachedProperty.2.qml | 22 - .../data/attachedProperty.qml | 11 - .../data/attachedPropertyScope.qml | 9 - .../data/automaticSemicolon.qml | 11 - .../qdeclarativeecmascript/data/bindingLoop.qml | 14 - .../qdeclarativeecmascript/data/blank.js | 0 .../data/boolPropertiesEvaluateAsBool.1.qml | 5 - .../data/boolPropertiesEvaluateAsBool.2.qml | 5 - .../data/booleanConversion.qml | 28 - .../qdeclarativeecmascript/data/bug.1.qml | 10 - .../data/canAssignNullToQObject.1.qml | 9 - .../data/canAssignNullToQObject.2.qml | 11 - .../changeslots/propertyChangeSlotErrors.1.qml | 12 - .../changeslots/propertyChangeSlotErrors.2.qml | 12 - .../changeslots/propertyChangeSlotErrors.3.qml | 12 - .../changeslots/propertyChangeSlotErrors.4.qml | 12 - .../data/changeslots/propertyChangeSlots.qml | 27 - .../qdeclarativeecmascript/data/compiled.qml | 48 - .../data/compositePropertyType.qml | 8 - .../data/constantsOverrideBindings.1.qml | 8 - .../data/constantsOverrideBindings.2.qml | 11 - .../data/constantsOverrideBindings.3.qml | 7 - .../data/constantsOverrideBindings.4.qml | 11 - .../data/declarativeHasOwnProperty.qml | 72 - .../data/declarativeToString.qml | 11 - .../data/deferredProperties.qml | 10 - .../data/deferredPropertiesErrors.qml | 10 - .../qdeclarativeecmascript/data/deleteLater.qml | 14 - .../data/deleteWhileBindingRunning.qml | 5 - .../qdeclarativeecmascript/data/deletedEngine.qml | 11 - .../qdeclarativeecmascript/data/deletedObject.qml | 25 - .../qdeclarativeecmascript/data/doubleEvaluate.qml | 6 - .../data/dynamicCreation.helper.qml | 6 - .../data/dynamicCreation.qml | 27 - .../data/dynamicCreationOwnership.qml | 20 - .../data/dynamicDeletion.2.qml | 21 - .../data/dynamicDeletion.qml | 20 - .../qdeclarativeecmascript/data/dynamicString.qml | 16 - .../qdeclarativeecmascript/data/elementAssign.qml | 10 - .../qdeclarativeecmascript/data/enums.1.qml | 20 - .../qdeclarativeecmascript/data/enums.2.qml | 8 - .../qdeclarativeecmascript/data/eval.qml | 27 - .../qdeclarativeecmascript/data/exception.js | 1 - .../data/exceptionClearsOnReeval.qml | 6 - .../data/exceptionProducesWarning.qml | 8 - .../data/exceptionProducesWarning2.qml | 7 - .../data/extendedObjectPropertyLookup.qml | 8 - .../data/extendedObjectPropertyLookup2.qml | 14 - .../data/extensionObjects.qml | 19 - .../data/extensionObjectsPropertyOverride.qml | 7 - .../qdeclarativeecmascript/data/forInLoop.qml | 13 - .../qdeclarativeecmascript/data/function.qml | 23 - .../data/functionAssignment.1.qml | 5 - .../data/functionAssignment.2.qml | 73 - .../data/functionAssignment.js | 17 - .../qdeclarativeecmascript/data/functionErrors.qml | 10 - .../data/handleReferenceManagement.handle.1.qml | 21 - .../data/handleReferenceManagement.handle.2.qml | 22 - .../data/handleReferenceManagement.object.1.qml | 27 - .../data/handleReferenceManagement.object.2.qml | 28 - .../data/idShortcutInvalidates.1.qml | 13 - .../data/idShortcutInvalidates.qml | 12 - .../qdeclarativeecmascript/data/importScope.1.js | 1 - .../qdeclarativeecmascript/data/importScope.2.js | 3 - .../qdeclarativeecmascript/data/importScope.qml | 7 - .../declarative/qdeclarativeecmascript/data/in.qml | 7 - .../qdeclarativeecmascript/data/include.js | 8 - .../qdeclarativeecmascript/data/include.qml | 23 - .../data/include_callback.js | 11 - .../data/include_callback.qml | 15 - .../qdeclarativeecmascript/data/include_pragma.qml | 11 - .../data/include_pragma_inner.js | 5 - .../data/include_pragma_outer.js | 6 - .../qdeclarativeecmascript/data/include_remote.js | 26 - .../qdeclarativeecmascript/data/include_remote.qml | 21 - .../data/include_remote_missing.js | 13 - .../data/include_remote_missing.qml | 12 - .../qdeclarativeecmascript/data/include_shared.js | 12 - .../qdeclarativeecmascript/data/include_shared.qml | 22 - .../data/invokableObjectArg.qml | 9 - .../data/invokableObjectRet.qml | 11 - .../qdeclarativeecmascript/data/js/include2.js | 4 - .../qdeclarativeecmascript/data/js/include3.js | 3 - .../qdeclarativeecmascript/data/jsObject.qml | 12 - .../data/jsimport/SpecialRectangleOne.qml | 9 - .../data/jsimport/SpecialRectangleTwo.qml | 9 - .../data/jsimport/importFive.js | 3 - .../data/jsimport/importFour.js | 9 - .../data/jsimport/importOne.js | 13 - .../data/jsimport/importPragmaLibrary.js | 9 - .../jsimport/importPragmaLibraryWithImports.js | 9 - .../importPragmaLibraryWithPragmaLibraryImports.js | 11 - .../data/jsimport/importThree.js | 9 - .../data/jsimport/importTwo.js | 10 - .../data/jsimport/importWithNoImports.js | 11 - .../data/jsimport/testImport.qml | 14 - .../data/jsimport/testImportPragmaLibrary.qml | 20 - .../testImportPragmaLibraryWithImports.qml | 7 - ...ImportPragmaLibraryWithPragmaLibraryImports.qml | 7 - .../data/jsimport/testImportScoping.qml | 11 - .../data/jsimport/testModuleImport.js | 8 - .../data/jsimport/testScriptImport.js | 11 - .../data/jsimportfail/failFive.qml | 11 - .../data/jsimportfail/failFour.qml | 7 - .../data/jsimportfail/failOne.qml | 7 - .../data/jsimportfail/failThree.qml | 8 - .../data/jsimportfail/failTwo.qml | 7 - .../data/jsimportfail/importOne.js | 7 - .../data/jsimportfail/importPragmaLibrary.js | 11 - .../data/jsimportfail/importWithImports.js | 13 - .../data/jsimportfail/testImportPragmaLibrary.qml | 8 - .../data/jsimportfail/testModuleImport.js | 8 - .../data/jsimportfail/testScriptImport.js | 11 - .../data/libraryScriptAssert.js | 6 - .../data/libraryScriptAssert.qml | 7 - .../qdeclarativeecmascript/data/listAssignment.qml | 20 - .../qdeclarativeecmascript/data/listProperties.qml | 24 - .../qdeclarativeecmascript/data/listToVariant.qml | 5 - .../data/metaobjectRevision.qml | 7 - .../data/metaobjectRevision2.qml | 9 - .../data/metaobjectRevision3.qml | 8 - .../data/metaobjectRevision4.qml | 14 - .../data/metaobjectRevisionErrors.qml | 14 - .../data/metaobjectRevisionErrors2.qml | 24 - .../data/metaobjectRevisionErrors3.qml | 36 - .../qdeclarativeecmascript/data/methods.1.qml | 6 - .../qdeclarativeecmascript/data/methods.2.qml | 6 - .../qdeclarativeecmascript/data/methods.3.qml | 7 - .../qdeclarativeecmascript/data/methods.4.qml | 11 - .../qdeclarativeecmascript/data/methods.5.qml | 9 - .../data/moduleapi/moduleApiMajorVersionFail.qml | 10 - .../data/moduleapi/moduleApiMinorVersionFail.qml | 10 - .../data/moduleapi/qobjectModuleApi.qml | 21 - .../data/moduleapi/qobjectModuleApiCaching.qml | 10 - .../data/moduleapi/qobjectModuleApiEnums.qml | 8 - .../data/moduleapi/qobjectModuleApiWriting.qml | 26 - .../data/moduleapi/scriptModuleApi.qml | 6 - .../data/moduleapi/scriptModuleApiCaching.qml | 6 - .../data/moduleapi/scriptModuleApiWriting.qml | 32 - .../data/multiEngineObject.qml | 5 - .../data/noSpuriousWarningsAtShutdown.2.qml | 10 - .../data/noSpuriousWarningsAtShutdown.qml | 9 - .../data/nonExistentAttachedObject.qml | 5 - .../qdeclarativeecmascript/data/nonNotifyable.qml | 6 - .../qdeclarativeecmascript/data/nonscriptable.qml | 19 - .../data/nullObjectBinding.qml | 8 - .../data/numberAssignment.qml | 18 - .../data/objectConversion.qml | 16 - .../qdeclarativeecmascript/data/objectName.qml | 8 - .../data/objectsCompareAsEqual.qml | 15 - .../data/objectsPassThroughSignals.qml | 18 - .../data/outerBindingOverridesInnerBinding.qml | 15 - .../qdeclarativeecmascript/data/ownership.qml | 5 - .../data/propertyAssignmentErrors.qml | 29 - .../data/propertySplicing.qml | 10 - .../qdeclarativeecmascript/data/propertyVar.1.qml | 22 - .../qdeclarativeecmascript/data/propertyVar.10.qml | 8 - .../qdeclarativeecmascript/data/propertyVar.2.qml | 24 - .../qdeclarativeecmascript/data/propertyVar.3.qml | 19 - .../qdeclarativeecmascript/data/propertyVar.4.qml | 18 - .../qdeclarativeecmascript/data/propertyVar.5.qml | 18 - .../qdeclarativeecmascript/data/propertyVar.6.qml | 27 - .../qdeclarativeecmascript/data/propertyVar.7.qml | 18 - .../qdeclarativeecmascript/data/propertyVar.8.qml | 12 - .../qdeclarativeecmascript/data/propertyVar.9.qml | 19 - .../data/propertyVar.circular.2.qml | 26 - .../data/propertyVar.circular.qml | 44 - .../data/propertyVar.inherit.qml | 34 - .../data/propertyVar.reparent.qml | 27 - .../qdeclarativeecmascript/data/propertyVarCpp.qml | 17 - .../data/propertyVarImplicitOwnership.qml | 26 - .../data/propertyVarOwnership.2.qml | 24 - .../data/propertyVarOwnership.3.qml | 31 - .../data/propertyVarOwnership.3.type.qml | 5 - .../data/propertyVarOwnership.4.qml | 25 - .../data/propertyVarOwnership.4.type1.qml | 23 - .../data/propertyVarOwnership.4.type2.qml | 6 - .../data/propertyVarOwnership.qml | 22 - .../data/qlistqobjectMethods.qml | 6 - .../qobjectConnectionListExceptionHandling.qml | 24 - .../data/qobjectDerivedArgument.qml | 17 - .../qdeclarativeecmascript/data/qtbug_10696.qml | 26 - .../qdeclarativeecmascript/data/qtbug_11600.js | 1 - .../qdeclarativeecmascript/data/qtbug_11600.qml | 8 - .../qdeclarativeecmascript/data/qtbug_11606.qml | 12 - .../qdeclarativeecmascript/data/qtbug_20344.qml | 6 - .../qdeclarativeecmascript/data/qtbug_21580.qml | 22 - .../qdeclarativeecmascript/data/qtbug_21864.js | 2 - .../qdeclarativeecmascript/data/qtbug_21864.qml | 6 - .../qdeclarativeecmascript/data/qtbug_22464.qml | 15 - .../qdeclarativeecmascript/data/qtbug_22679.qml | 14 - .../qdeclarativeecmascript/data/qtbug_22843.js | 5 - .../data/qtbug_22843.library.js | 5 - .../data/qtbug_22843.library.qml | 6 - .../qdeclarativeecmascript/data/qtbug_22843.qml | 6 - .../qdeclarativeecmascript/data/qtbug_9792.qml | 5 - .../data/qtcreatorbug_1289.qml | 13 - .../data/readonlyDeclaration.qml | 45 - .../qdeclarativeecmascript/data/realToInt.qml | 11 - .../qdeclarativeecmascript/data/regExp.2.qml | 7 - .../qdeclarativeecmascript/data/regExp.qml | 7 - .../qdeclarativeecmascript/data/remote_file.js | 2 - .../data/rewriteMultiLineStrings.qml | 35 - .../data/scarceResourceCopy.var.qml | 14 - .../data/scarceResourceCopy.variant.qml | 15 - .../data/scarceResourceCopyFromJs.var.qml | 14 - .../data/scarceResourceCopyFromJs.variant.qml | 15 - .../data/scarceResourceCopyImport.var.js | 25 - .../data/scarceResourceCopyImport.var.qml | 18 - .../data/scarceResourceCopyImport.variant.js | 25 - .../data/scarceResourceCopyImport.variant.qml | 18 - .../data/scarceResourceCopyImportDifferent.var.js | 19 - .../data/scarceResourceCopyImportDifferent.var.qml | 22 - .../data/scarceResourceCopyImportFail.var.js | 19 - .../data/scarceResourceCopyImportFail.var.qml | 7 - .../data/scarceResourceCopyImportFail.variant.js | 19 - .../data/scarceResourceCopyImportFail.variant.qml | 8 - .../data/scarceResourceCopyImportNoBinding.var.js | 15 - .../data/scarceResourceCopyImportNoBinding.var.qml | 12 - .../scarceResourceCopyImportNoBinding.variant.js | 15 - .../scarceResourceCopyImportNoBinding.variant.qml | 12 - .../data/scarceResourceCopyNoBinding.var.qml | 14 - .../data/scarceResourceCopyNoBinding.variant.qml | 14 - .../data/scarceResourceDestroyedCopy.var.qml | 13 - .../data/scarceResourceDestroyedCopy.variant.qml | 14 - .../data/scarceResourceFunction.var.qml | 23 - .../data/scarceResourceFunction.variant.qml | 23 - .../data/scarceResourceFunctionFail.var.qml | 23 - .../data/scarceResourceFunctionFail.variant.qml | 23 - ...scarceResourceMultipleDifferentNoBinding.var.js | 14 - ...carceResourceMultipleDifferentNoBinding.var.qml | 14 - .../scarceResourceMultipleSameNoBinding.var.js | 15 - .../scarceResourceMultipleSameNoBinding.var.qml | 14 - .../scarceResourceMultipleSameWithBinding.var.qml | 12 - .../data/scarceResourceObjectGc.var.qml | 30 - .../data/scarceResourceSignal.var.qml | 29 - .../data/scarceResourceSignal.variant.qml | 29 - .../data/scarceResourceTest.var.js | 48 - .../data/scarceResourceTest.var.qml | 14 - .../data/scarceResourceTest.variant.js | 48 - .../data/scarceResourceTest.variant.qml | 14 - .../data/scarceResourceTestMultiple.var.qml | 16 - .../data/scarceResourceTestMultiple.variant.qml | 15 - .../data/scarceResourceTestPreserve.var.qml | 15 - .../data/scarceResourceTestPreserve.variant.qml | 15 - .../qdeclarativeecmascript/data/scope.2.qml | 40 - .../qdeclarativeecmascript/data/scope.3.qml | 13 - .../qdeclarativeecmascript/data/scope.4.qml | 12 - .../qdeclarativeecmascript/data/scope.5.qml | 27 - .../qdeclarativeecmascript/data/scope.6.qml | 10 - .../qdeclarativeecmascript/data/scope.qml | 44 - .../qdeclarativeecmascript/data/scriptConnect.1.js | 4 - .../data/scriptConnect.1.qml | 10 - .../qdeclarativeecmascript/data/scriptConnect.2.js | 5 - .../data/scriptConnect.2.qml | 16 - .../data/scriptConnect.3.qml | 15 - .../data/scriptConnect.4.qml | 12 - .../data/scriptConnect.5.qml | 11 - .../qdeclarativeecmascript/data/scriptConnect.6.js | 3 - .../data/scriptConnect.6.qml | 15 - .../data/scriptDisconnect.1.js | 6 - .../data/scriptDisconnect.1.qml | 13 - .../data/scriptDisconnect.2.qml | 14 - .../data/scriptDisconnect.3.qml | 14 - .../data/scriptDisconnect.4.qml | 13 - .../qdeclarativeecmascript/data/scriptErrors.js | 4 - .../qdeclarativeecmascript/data/scriptErrors.qml | 18 - .../data/selfDeletingBinding.2.qml | 17 - .../data/selfDeletingBinding.qml | 18 - .../data/sequenceConversion.array.qml | 193 - .../data/sequenceConversion.bindings.error.qml | 19 - .../data/sequenceConversion.bindings.qml | 28 - .../data/sequenceConversion.copy.qml | 160 - .../data/sequenceConversion.indexes.qml | 89 - .../data/sequenceConversion.read.error.qml | 21 - .../data/sequenceConversion.read.qml | 105 - .../data/sequenceConversion.threads.qml | 74 - .../data/sequenceConversion.write.error.qml | 18 - .../data/sequenceConversion.write.qml | 109 - .../data/sharedAttachedObject.qml | 16 - .../qdeclarativeecmascript/data/shutdownErrors.qml | 13 - .../data/signalAssignment.1.qml | 5 - .../data/signalAssignment.2.qml | 5 - .../qdeclarativeecmascript/data/signalHandlers.qml | 60 - .../data/signalParameterTypes.qml | 18 - .../data/signalTriggeredBindings.qml | 20 - .../data/signalWithJSValueInVariant.qml | 12 - .../data/signalWithQJSValue.qml | 14 - .../data/signalWithUnknownTypes.qml | 5 - .../qdeclarativeecmascript/data/strictlyEquals.qml | 17 - .../qdeclarativeecmascript/data/stringArg.qml | 49 - .../data/switchStatement.1.qml | 33 - .../data/switchStatement.2.qml | 33 - .../data/switchStatement.3.qml | 33 - .../data/switchStatement.4.qml | 31 - .../data/switchStatement.5.qml | 12 - .../data/switchStatement.6.qml | 13 - .../qdeclarativeecmascript/data/threadScript.js | 4 - .../data/transientErrors.2.qml | 14 - .../data/transientErrors.qml | 10 - .../qdeclarativeecmascript/data/tryStatement.1.qml | 13 - .../qdeclarativeecmascript/data/tryStatement.2.qml | 11 - .../qdeclarativeecmascript/data/tryStatement.3.qml | 13 - .../qdeclarativeecmascript/data/tryStatement.4.qml | 12 - .../qdeclarativeecmascript/data/typeOf.js | 25 - .../qdeclarativeecmascript/data/typeOf.qml | 26 - .../data/unaryExpression.qml | 9 - .../data/undefinedResetsProperty.2.qml | 10 - .../data/undefinedResetsProperty.qml | 7 - .../data/urlListProperty.qml | 41 - .../qdeclarativeecmascript/data/urlProperty.1.qml | 10 - .../qdeclarativeecmascript/data/urlProperty.2.qml | 10 - .../data/v8bindingException.qml | 21 - .../data/v8functionException.qml | 15 - .../data/valueTypeFunctions.qml | 6 - .../data/variantsAssignedUndefined.qml | 9 - .../data/withStatement.1.qml | 14 - .../data/writeAttachedProperty.qml | 6 - .../data/writeRemovesBinding.qml | 46 - .../qdeclarativeecmascript.pro | 22 - .../qdeclarativeecmascript/testtypes.cpp | 210 - .../declarative/qdeclarativeecmascript/testtypes.h | 1311 --- .../tst_qdeclarativeecmascript.cpp | 6062 ------------- .../qdeclarativeengine/qdeclarativeengine.pro | 9 - .../qdeclarativeengine/tst_qdeclarativeengine.cpp | 365 - .../declarative/qdeclarativeerror/data/test.txt | 3 - .../qdeclarativeerror/qdeclarativeerror.pro | 15 - .../qdeclarativeerror/tst_qdeclarativeerror.cpp | 243 - .../qdeclarativeexpression/data/scriptString.qml | 9 - .../qdeclarativeexpression.pro | 15 - .../tst_qdeclarativeexpression.cpp | 121 - .../qdeclarativefolderlistmodel/data/basic.qml | 5 - .../qdeclarativefolderlistmodel/data/dummy.qml | 1 - .../data/resetFiltering.qml | 5 - .../data/resetfiltering/innerdir/test2.txt | 1 - .../data/resetfiltering/test.txt | 1 - .../qdeclarativefolderlistmodel.pro | 14 - .../tst_qdeclarativefolderlistmodel.cpp | 179 - .../qdeclarativeimageprovider.pro | 9 - .../tst_qdeclarativeimageprovider.cpp | 424 - .../data/AsynchronousIfNestedType.qml | 7 - .../data/asynchronousIfNested.1.qml | 5 - .../data/asynchronousIfNested.2.qml | 6 - .../data/asynchronousIfNested.3.qml | 5 - .../data/chainInCompletion.qml | 5 - .../data/chainedAsynchronousIfNested.qml | 5 - .../qdeclarativeincubator/data/clear.qml | 8 - .../data/clearDuringCompletion.qml | 6 - .../qdeclarativeincubator/data/contextDelete.qml | 5 - .../qdeclarativeincubator/data/forceCompletion.qml | 9 - .../qdeclarativeincubator/data/nestedComponent.js | 1 - .../qdeclarativeincubator/data/nestedComponent.qml | 10 - .../data/noIncubationController.qml | 5 - .../data/objectDeleted.errors.txt | 1 - .../qdeclarativeincubator/data/objectDeleted.qml | 8 - .../data/recursiveClear.1.qml | 9 - .../data/recursiveClear.2.qml | 8 - .../qdeclarativeincubator/data/selfDelete.qml | 5 - .../qdeclarativeincubator/data/setInitialState.qml | 17 - .../data/statusChanged.nested.qml | 12 - .../qdeclarativeincubator/data/statusChanged.qml | 5 - .../qdeclarativeincubator.pro | 18 - .../qdeclarativeincubator/testtypes.cpp | 137 - .../declarative/qdeclarativeincubator/testtypes.h | 125 - .../tst_qdeclarativeincubator.cpp | 1030 --- .../qdeclarativeinfo/data/NestedComponent.qml | 23 - .../qdeclarativeinfo/data/NestedObject.qml | 8 - .../qdeclarativeinfo/data/nestedQmlObject.qml | 8 - .../qdeclarativeinfo/data/qmlObject.qml | 8 - .../qdeclarativeinfo/qdeclarativeinfo.pro | 14 - .../qdeclarativeinfo/tst_qdeclarativeinfo.cpp | 221 - .../qdeclarativeinstruction.pro | 8 - .../tst_qdeclarativeinstruction.cpp | 678 -- .../qdeclarativelanguage/data/Alias.qml | 8 - .../qdeclarativelanguage/data/Alias2.qml | 9 - .../qdeclarativelanguage/data/Alias3.qml | 12 - .../qdeclarativelanguage/data/Alias4.qml | 5 - .../data/AliasPropertyChangeSignalsType.qml | 20 - .../data/ComponentComposite.qml | 5 - .../qdeclarativelanguage/data/CompositeType.qml | 4 - .../qdeclarativelanguage/data/CompositeType2.qml | 5 - .../qdeclarativelanguage/data/CompositeType3.qml | 5 - .../qdeclarativelanguage/data/CompositeType4.qml | 6 - .../data/DontDoubleCallClassBeginItem.qml | 4 - .../data/DynamicPropertiesNestedType.qml | 6 - .../qdeclarativelanguage/data/HelperAlias.qml | 9 - .../declarative/qdeclarativelanguage/data/I18n.qml | 6 - .../qdeclarativelanguage/data/I18nType30.qml | 5 - .../data/InlineAssignmentsOverrideBindingsType.qml | 7 - .../InlineAssignmentsOverrideBindingsType2.qml | 5 - .../qdeclarativelanguage/data/LocalLast.qml | 2 - .../qdeclarativelanguage/data/MyComponent.qml | 6 - .../data/MyCompositeValueSource.qml | 6 - .../data/MyContainerComponent.qml | 5 - .../qdeclarativelanguage/data/NestedAlias.qml | 14 - .../data/NestedComponentRoot.qml | 6 - .../qdeclarativelanguage/data/NestedErrorsType.qml | 5 - .../qdeclarativelanguage/data/OnCompletedType.qml | 8 - .../data/OnDestructionType.qml | 8 - .../qdeclarativelanguage/data/ReadOnlyType.qml | 5 - .../qdeclarativelanguage/data/alias.1.qml | 8 - .../qdeclarativelanguage/data/alias.10.qml | 8 - .../qdeclarativelanguage/data/alias.11.qml | 8 - .../qdeclarativelanguage/data/alias.2.qml | 8 - .../qdeclarativelanguage/data/alias.3.qml | 10 - .../qdeclarativelanguage/data/alias.4.qml | 6 - .../qdeclarativelanguage/data/alias.5.qml | 13 - .../qdeclarativelanguage/data/alias.6.qml | 8 - .../qdeclarativelanguage/data/alias.7.qml | 14 - .../qdeclarativelanguage/data/alias.8.qml | 9 - .../qdeclarativelanguage/data/alias.9.qml | 9 - .../data/aliasPropertiesAndSignals.qml | 14 - .../data/aliasPropertyChangeSignals.2.qml | 10 - .../data/aliasPropertyChangeSignals.qml | 16 - .../data/allowedRevisionOverloads.qml | 6 - .../qdeclarativelanguage/data/assignBasicTypes.qml | 28 - .../data/assignCompositeToType.qml | 18 - .../data/assignLiteralSignalProperty.qml | 4 - .../data/assignLiteralToVar.qml | 32 - .../data/assignLiteralToVariant.qml | 17 - .../data/assignObjectToSignal.qml | 4 - .../data/assignObjectToVariant.qml | 7 - .../data/assignQmlComponent.qml | 4 - .../qdeclarativelanguage/data/assignSignal.qml | 5 - .../data/assignToNamespace.errors.txt | 1 - .../data/assignToNamespace.qml | 5 - .../data/assignTypeExtremes.qml | 5 - .../data/assignValueToSignal.errors.txt | 1 - .../data/assignValueToSignal.qml | 6 - .../data/attachedProperties.qml | 8 - .../data/autoComponentCreation.qml | 4 - .../data/autoNotifyConnection.qml | 6 - .../data/component.1.errors.txt | 1 - .../qdeclarativelanguage/data/component.1.qml | 4 - .../data/component.2.errors.txt | 1 - .../qdeclarativelanguage/data/component.2.qml | 9 - .../data/component.3.errors.txt | 1 - .../qdeclarativelanguage/data/component.3.qml | 9 - .../data/component.4.errors.txt | 1 - .../qdeclarativelanguage/data/component.4.qml | 6 - .../data/component.5.errors.txt | 1 - .../qdeclarativelanguage/data/component.5.qml | 6 - .../data/component.6.errors.txt | 1 - .../qdeclarativelanguage/data/component.6.qml | 6 - .../data/component.7.errors.txt | 1 - .../qdeclarativelanguage/data/component.7.qml | 7 - .../data/component.8.errors.txt | 1 - .../qdeclarativelanguage/data/component.8.qml | 7 - .../data/component.9.errors.txt | 1 - .../qdeclarativelanguage/data/component.9.qml | 7 - .../data/componentCompositeType.qml | 8 - .../qdeclarativelanguage/data/cppnamespace.2.qml | 5 - .../qdeclarativelanguage/data/cppnamespace.qml | 4 - .../qdeclarativelanguage/data/crash2.qml | 5 - .../qdeclarativelanguage/data/customOnProperty.qml | 7 - .../data/customParserIdNotAllowed.errors.txt | 1 - .../data/customParserIdNotAllowed.qml | 5 - .../data/customParserTypes.qml | 5 - .../data/customVariantTypes.qml | 4 - .../data/declaredPropertyValues.qml | 8 - .../data/defaultGrouped.errors.txt | 1 - .../qdeclarativelanguage/data/defaultGrouped.qml | 10 - .../data/defaultPropertyListOrder.qml | 29 - .../data/destroyedSignal.errors.txt | 1 - .../qdeclarativelanguage/data/destroyedSignal.qml | 5 - .../data/disallowedRevisionOverloads.errors.txt | 1 - .../data/disallowedRevisionOverloads.qml | 7 - .../data/dontDoubleCallClassBegin.qml | 5 - .../data/doubleSignal.errors.txt | 1 - .../qdeclarativelanguage/data/doubleSignal.qml | 7 - .../data/duplicateIDs.errors.txt | 1 - .../qdeclarativelanguage/data/duplicateIDs.qml | 6 - .../data/dynamicMeta.1.errors.txt | 1 - .../qdeclarativelanguage/data/dynamicMeta.1.qml | 6 - .../data/dynamicMeta.2.errors.txt | 1 - .../qdeclarativelanguage/data/dynamicMeta.2.qml | 6 - .../data/dynamicMeta.3.errors.txt | 1 - .../qdeclarativelanguage/data/dynamicMeta.3.qml | 6 - .../data/dynamicMeta.4.errors.txt | 1 - .../qdeclarativelanguage/data/dynamicMeta.4.qml | 6 - .../data/dynamicMeta.5.errors.txt | 1 - .../qdeclarativelanguage/data/dynamicMeta.5.qml | 5 - .../qdeclarativelanguage/data/dynamicObject.1.qml | 8 - .../data/dynamicObjectProperties.2.qml | 11 - .../data/dynamicObjectProperties.qml | 13 - .../data/dynamicProperties.qml | 13 - .../data/dynamicPropertiesNested.qml | 9 - .../data/dynamicSignalsAndSlots.qml | 10 - .../qdeclarativelanguage/data/empty.errors.txt | 2 - .../qdeclarativelanguage/data/empty.qml | 0 .../data/emptySignal.errors.txt | 1 - .../qdeclarativelanguage/data/emptySignal.qml | 7 - .../qdeclarativelanguage/data/enumTypes.errors.txt | 1 - .../qdeclarativelanguage/data/enumTypes.qml | 4 - .../data/failingComponent.errors.txt | 1 - .../data/failingComponentTest.qml | 4 - .../data/fakeDotProperty.errors.txt | 1 - .../qdeclarativelanguage/data/fakeDotProperty.qml | 4 - .../data/finalOverride.errors.txt | 1 - .../qdeclarativelanguage/data/finalOverride.qml | 4 - .../data/i18nDeclaredPropertyNames.qml | 6 - .../data/i18nDeclaredPropertyUse.qml | 3 - .../qdeclarativelanguage/data/i18nNameSpace.qml | 5 - .../qdeclarativelanguage/data/i18nScript.qml | 9 - .../qdeclarativelanguage/data/i18nStrings.qml | 5 - .../qdeclarativelanguage/data/i18nType.qml | 1 - .../qdeclarativelanguage/data/idProperty.qml | 8 - .../data/importFile.errors.txt | 1 - .../qdeclarativelanguage/data/importFile.qml | 3 - .../data/importIncorrectCase.qml | 5 - .../data/importJs.1.errors.txt | 0 .../qdeclarativelanguage/data/importJs.1.qml | 12 - .../data/importJs.10.errors.txt | 0 .../qdeclarativelanguage/data/importJs.10.qml | 16 - .../data/importJs.2.errors.txt | 0 .../qdeclarativelanguage/data/importJs.2.qml | 12 - .../data/importJs.3.errors.txt | 0 .../qdeclarativelanguage/data/importJs.3.qml | 16 - .../data/importJs.4.errors.txt | 0 .../qdeclarativelanguage/data/importJs.4.qml | 15 - .../data/importJs.5.errors.txt | 1 - .../qdeclarativelanguage/data/importJs.5.qml | 6 - .../data/importJs.6.errors.txt | 1 - .../qdeclarativelanguage/data/importJs.6.qml | 13 - .../data/importJs.7.errors.txt | 1 - .../qdeclarativelanguage/data/importJs.7.qml | 13 - .../data/importJs.8.errors.txt | 0 .../qdeclarativelanguage/data/importJs.8.qml | 15 - .../data/importJs.9.errors.txt | 0 .../qdeclarativelanguage/data/importJs.9.qml | 19 - .../data/importNamespaceConflict.errors.txt | 1 - .../data/importNamespaceConflict.qml | 4 - .../data/importNewerVersion.errors.txt | 1 - .../data/importNewerVersion.qml | 3 - .../data/importNonExist.errors.txt | 1 - .../qdeclarativelanguage/data/importNonExist.qml | 5 - .../data/importNonExistOlder.errors.txt | 1 - .../data/importNonExistOlder.qml | 3 - .../data/importVersionMissingBuiltIn.errors.txt | 1 - .../data/importVersionMissingBuiltIn.qml | 7 - .../data/importVersionMissingInstalled.errors.txt | 1 - .../data/importVersionMissingInstalled.qml | 3 - .../data/importscript.1.errors.txt | 1 - .../qdeclarativelanguage/data/importscript.1.qml | 3 - .../data/incorrectCase.errors.insensitive.txt | 2 - .../data/incorrectCase.errors.sensitive.txt | 1 - .../qdeclarativelanguage/data/incorrectCase.qml | 4 - .../data/incorrectCaseType.qml | 4 - .../data/inlineAssignmentsOverrideBindings.qml | 6 - .../data/inlineQmlComponents.qml | 10 - .../data/insertedSemicolon.1.errors.txt | 1 - .../data/insertedSemicolon.1.qml | 10 - .../data/interfaceProperty.qml | 5 - .../qdeclarativelanguage/data/interfaceQList.qml | 7 - .../data/invalidAlias.1.errors.txt | 1 - .../qdeclarativelanguage/data/invalidAlias.1.qml | 5 - .../data/invalidAlias.10.errors.txt | 1 - .../qdeclarativelanguage/data/invalidAlias.10.qml | 6 - .../data/invalidAlias.2.errors.txt | 1 - .../qdeclarativelanguage/data/invalidAlias.2.qml | 6 - .../data/invalidAlias.3.errors.txt | 1 - .../qdeclarativelanguage/data/invalidAlias.3.qml | 6 - .../data/invalidAlias.4.errors.txt | 1 - .../qdeclarativelanguage/data/invalidAlias.4.qml | 7 - .../data/invalidAlias.5.errors.txt | 1 - .../qdeclarativelanguage/data/invalidAlias.5.qml | 7 - .../data/invalidAlias.6.errors.txt | 1 - .../qdeclarativelanguage/data/invalidAlias.6.qml | 7 - .../data/invalidAlias.7.errors.txt | 1 - .../qdeclarativelanguage/data/invalidAlias.7.qml | 6 - .../data/invalidAlias.8.errors.txt | 1 - .../qdeclarativelanguage/data/invalidAlias.8.qml | 7 - .../data/invalidAlias.9.errors.txt | 1 - .../qdeclarativelanguage/data/invalidAlias.9.qml | 6 - .../data/invalidAttachedProperty.1.errors.txt | 1 - .../data/invalidAttachedProperty.1.qml | 7 - .../data/invalidAttachedProperty.10.errors.txt | 1 - .../data/invalidAttachedProperty.10.qml | 6 - .../data/invalidAttachedProperty.11.errors.txt | 1 - .../data/invalidAttachedProperty.11.qml | 7 - .../data/invalidAttachedProperty.12.errors.txt | 1 - .../data/invalidAttachedProperty.12.qml | 6 - .../data/invalidAttachedProperty.13.errors.txt | 1 - .../data/invalidAttachedProperty.13.qml | 8 - .../data/invalidAttachedProperty.2.errors.txt | 1 - .../data/invalidAttachedProperty.2.qml | 6 - .../data/invalidAttachedProperty.3.errors.txt | 1 - .../data/invalidAttachedProperty.3.qml | 8 - .../data/invalidAttachedProperty.4.errors.txt | 1 - .../data/invalidAttachedProperty.4.qml | 7 - .../data/invalidAttachedProperty.5.errors.txt | 1 - .../data/invalidAttachedProperty.5.qml | 7 - .../data/invalidAttachedProperty.6.errors.txt | 1 - .../data/invalidAttachedProperty.6.qml | 7 - .../data/invalidAttachedProperty.7.errors.txt | 1 - .../data/invalidAttachedProperty.7.qml | 6 - .../data/invalidAttachedProperty.8.errors.txt | 1 - .../data/invalidAttachedProperty.8.qml | 6 - .../data/invalidAttachedProperty.9.errors.txt | 1 - .../data/invalidAttachedProperty.9.qml | 7 - .../data/invalidGroupedProperty.1.errors.txt | 1 - .../data/invalidGroupedProperty.1.qml | 6 - .../data/invalidGroupedProperty.10.errors.txt | 1 - .../data/invalidGroupedProperty.10.qml | 7 - .../data/invalidGroupedProperty.2.errors.txt | 1 - .../data/invalidGroupedProperty.2.qml | 7 - .../data/invalidGroupedProperty.3.errors.txt | 1 - .../data/invalidGroupedProperty.3.qml | 5 - .../data/invalidGroupedProperty.4.errors.txt | 1 - .../data/invalidGroupedProperty.4.qml | 5 - .../data/invalidGroupedProperty.5.errors.txt | 1 - .../data/invalidGroupedProperty.5.qml | 5 - .../data/invalidGroupedProperty.6.errors.txt | 1 - .../data/invalidGroupedProperty.6.qml | 6 - .../data/invalidGroupedProperty.7.errors.txt | 1 - .../data/invalidGroupedProperty.7.qml | 5 - .../data/invalidGroupedProperty.8.errors.txt | 1 - .../data/invalidGroupedProperty.8.qml | 6 - .../data/invalidGroupedProperty.9.errors.txt | 1 - .../data/invalidGroupedProperty.9.qml | 6 - .../data/invalidID.2.errors.txt | 2 - .../qdeclarativelanguage/data/invalidID.2.qml | 5 - .../data/invalidID.3.errors.txt | 1 - .../qdeclarativelanguage/data/invalidID.3.qml | 5 - .../data/invalidID.4.errors.txt | 1 - .../qdeclarativelanguage/data/invalidID.4.qml | 6 - .../data/invalidID.5.errors.txt | 1 - .../qdeclarativelanguage/data/invalidID.5.qml | 6 - .../data/invalidID.6.errors.txt | 1 - .../qdeclarativelanguage/data/invalidID.6.qml | 5 - .../data/invalidID.7.errors.txt | 1 - .../qdeclarativelanguage/data/invalidID.7.qml | 5 - .../data/invalidID.8.errors.txt | 1 - .../qdeclarativelanguage/data/invalidID.8.qml | 5 - .../data/invalidID.9.errors.txt | 1 - .../qdeclarativelanguage/data/invalidID.9.qml | 5 - .../qdeclarativelanguage/data/invalidID.errors.txt | 1 - .../qdeclarativelanguage/data/invalidID.qml | 4 - .../data/invalidImportID.errors.txt | 1 - .../qdeclarativelanguage/data/invalidImportID.qml | 4 - .../qdeclarativelanguage/data/invalidOn.errors.txt | 1 - .../qdeclarativelanguage/data/invalidOn.qml | 4 - .../data/invalidProperty.errors.txt | 1 - .../qdeclarativelanguage/data/invalidProperty.qml | 5 - .../data/invalidRoot.1.errors.txt | 1 - .../qdeclarativelanguage/data/invalidRoot.1.qml | 2 - .../data/invalidRoot.2.errors.txt | 1 - .../qdeclarativelanguage/data/invalidRoot.2.qml | 2 - .../data/invalidRoot.3.errors.txt | 1 - .../qdeclarativelanguage/data/invalidRoot.3.qml | 4 - .../data/invalidRoot.4.errors.txt | 1 - .../qdeclarativelanguage/data/invalidRoot.4.qml | 4 - .../data/invalidTypeName.1.errors.txt | 1 - .../data/invalidTypeName.1.qml | 2 - .../data/invalidTypeName.2.errors.txt | 1 - .../data/invalidTypeName.2.qml | 5 - .../data/invalidTypeName.3.errors.txt | 1 - .../data/invalidTypeName.3.qml | 7 - .../data/invalidTypeName.4.errors.txt | 1 - .../data/invalidTypeName.4.qml | 4 - .../lib/com/nokia/PureJsModule.1.6/FirstAPI.1.6.js | 5 - .../lib/com/nokia/PureJsModule.1.6/FirstAPI.js | 5 - .../lib/com/nokia/PureJsModule.1.6/SecondAPI.js | 5 - .../data/lib/com/nokia/PureJsModule.1.6/qmldir | 3 - .../data/lib/com/nokia/PureJsModule/FirstAPI.js | 5 - .../data/lib/com/nokia/PureJsModule/SecondAPI.js | 5 - .../data/lib/com/nokia/PureJsModule/qmldir | 2 - .../com/nokia/VersionedOnlyJsModule.9.0/SomeAPI.js | 5 - .../lib/com/nokia/VersionedOnlyJsModule.9.0/qmldir | 1 - .../lib/com/nokia/installedtest/InstalledTest.qml | 2 - .../lib/com/nokia/installedtest/InstalledTest2.qml | 2 - .../data/lib/com/nokia/installedtest/LocalLast.qml | 2 - .../lib/com/nokia/installedtest/PrivateType.qml | 2 - .../data/lib/com/nokia/installedtest/qmldir | 4 - .../lib/com/nokia/installedtest0/InstalledTest.qml | 2 - .../com/nokia/installedtest0/InstalledTest2.qml | 2 - .../data/lib/com/nokia/installedtest0/qmldir | 2 - .../data/listAssignment.1.errors.txt | 1 - .../qdeclarativelanguage/data/listAssignment.1.qml | 6 - .../data/listAssignment.2.errors.txt | 2 - .../qdeclarativelanguage/data/listAssignment.2.qml | 4 - .../data/listAssignment.3.errors.txt | 1 - .../qdeclarativelanguage/data/listAssignment.3.qml | 6 - .../data/listItemDeleteSelf.qml | 38 - .../qdeclarativelanguage/data/listProperties.qml | 9 - .../data/majorVersionIsolation.errors.txt | 1 - .../data/majorVersionIsolation.qml | 4 - .../data/metaobjectRevision.1.errors.txt | 1 - .../data/metaobjectRevision.1.qml | 9 - .../data/metaobjectRevision.2.errors.txt | 1 - .../data/metaobjectRevision.2.qml | 7 - .../data/metaobjectRevision.3.errors.txt | 1 - .../data/metaobjectRevision.3.qml | 10 - .../qdeclarativelanguage/data/method.1.errors.txt | 1 - .../qdeclarativelanguage/data/method.1.qml | 5 - .../data/missingObject.errors.txt | 1 - .../qdeclarativelanguage/data/missingObject.qml | 1 - .../data/missingSignal.errors.txt | 1 - .../qdeclarativelanguage/data/missingSignal.qml | 5 - .../data/missingValueTypeProperty.errors.txt | 1 - .../data/missingValueTypeProperty.qml | 5 - .../data/multiSet.1.errors.txt | 1 - .../qdeclarativelanguage/data/multiSet.1.qml | 7 - .../data/multiSet.10.errors.txt | 1 - .../qdeclarativelanguage/data/multiSet.10.qml | 6 - .../data/multiSet.11.errors.txt | 1 - .../qdeclarativelanguage/data/multiSet.11.qml | 6 - .../data/multiSet.2.errors.txt | 1 - .../qdeclarativelanguage/data/multiSet.2.qml | 7 - .../data/multiSet.3.errors.txt | 1 - .../qdeclarativelanguage/data/multiSet.3.qml | 7 - .../data/multiSet.4.errors.txt | 1 - .../qdeclarativelanguage/data/multiSet.4.qml | 7 - .../data/multiSet.5.errors.txt | 1 - .../qdeclarativelanguage/data/multiSet.5.qml | 6 - .../data/multiSet.6.errors.txt | 1 - .../qdeclarativelanguage/data/multiSet.6.qml | 7 - .../data/multiSet.7.errors.txt | 1 - .../qdeclarativelanguage/data/multiSet.7.qml | 7 - .../data/multiSet.8.errors.txt | 1 - .../qdeclarativelanguage/data/multiSet.8.qml | 8 - .../data/multiSet.9.errors.txt | 1 - .../qdeclarativelanguage/data/multiSet.9.qml | 6 - .../data/nestedComponentRoots.qml | 4 - .../data/nestedErrors.errors.txt | 2 - .../qdeclarativelanguage/data/nestedErrors.qml | 6 - .../data/noCreation.errors.txt | 1 - .../qdeclarativelanguage/data/noCreation.qml | 4 - .../data/nonScriptableProperty.errors.txt | 1 - .../data/nonScriptableProperty.qml | 5 - .../data/nonexistantProperty.1.errors.txt | 1 - .../data/nonexistantProperty.1.qml | 2 - .../data/nonexistantProperty.2.errors.txt | 1 - .../data/nonexistantProperty.2.qml | 4 - .../data/nonexistantProperty.3.errors.txt | 1 - .../data/nonexistantProperty.3.qml | 4 - .../data/nonexistantProperty.4.errors.txt | 1 - .../data/nonexistantProperty.4.qml | 4 - .../data/nonexistantProperty.5.errors.txt | 1 - .../data/nonexistantProperty.5.qml | 4 - .../data/nonexistantProperty.6.errors.txt | 1 - .../data/nonexistantProperty.6.qml | 4 - .../data/notAvailable.errors.txt | 1 - .../qdeclarativelanguage/data/notAvailable.qml | 4 - .../data/nullDotProperty.errors.txt | 1 - .../qdeclarativelanguage/data/nullDotProperty.qml | 4 - .../data/objectValueTypeProperty.errors.txt | 1 - .../data/objectValueTypeProperty.qml | 6 - .../qdeclarativelanguage/data/onCompleted.qml | 17 - .../qdeclarativelanguage/data/onDestruction.qml | 17 - .../data/property.1.errors.txt | 1 - .../qdeclarativelanguage/data/property.1.qml | 5 - .../data/property.2.errors.txt | 1 - .../qdeclarativelanguage/data/property.2.qml | 6 - .../data/property.3.errors.txt | 1 - .../qdeclarativelanguage/data/property.3.qml | 7 - .../data/property.4.errors.txt | 1 - .../qdeclarativelanguage/data/property.4.qml | 5 - .../data/property.6.errors.txt | 1 - .../qdeclarativelanguage/data/property.6.qml | 6 - .../data/property.7.errors.txt | 1 - .../qdeclarativelanguage/data/property.7.qml | 5 - .../qdeclarativelanguage/data/propertyInit.1.qml | 5 - .../qdeclarativelanguage/data/propertyInit.2.qml | 6 - .../data/propertyValueSource.2.qml | 5 - .../data/propertyValueSource.qml | 4 - .../data/qmlAttachedPropertiesObjectMethod.1.qml | 5 - .../data/qmlAttachedPropertiesObjectMethod.2.qml | 6 - .../declarative/qmllanguage/LocalInternal.qml | 3 - .../data/qtest/declarative/qmllanguage/Test.qml | 2 - .../qtest/declarative/qmllanguage/TestLocal.qml | 1 - .../qtest/declarative/qmllanguage/TestNamed.qml | 1 - .../qtest/declarative/qmllanguage/TestSubDir.qml | 2 - .../declarative/qmllanguage/UndeclaredLocal.qml | 3 - .../declarative/qmllanguage/WrongTestLocal.qml | 1 - .../declarative/qmllanguage/noqmldir/Test.qml | 2 - .../qtest/declarative/qmllanguage/pics/blue.png | Bin 84 -> 0 bytes .../data/qtest/declarative/qmllanguage/qmldir | 5 - .../declarative/qmllanguage/subdir/SubTest.qml | 3 - .../qtest/declarative/qmllanguage/subdir/qmldir | 1 - .../data/readOnly.1.errors.txt | 1 - .../qdeclarativelanguage/data/readOnly.1.qml | 4 - .../data/readOnly.2.errors.txt | 1 - .../qdeclarativelanguage/data/readOnly.2.qml | 4 - .../data/readOnly.3.errors.txt | 1 - .../qdeclarativelanguage/data/readOnly.3.qml | 8 - .../data/readOnly.4.errors.txt | 1 - .../qdeclarativelanguage/data/readOnly.4.qml | 4 - .../data/readOnly.5.errors.txt | 1 - .../qdeclarativelanguage/data/readOnly.5.qml | 3 - .../qdeclarativelanguage/data/readonly.qml | 17 - .../data/registrationOrder.qml | 4 - .../qdeclarativelanguage/data/remoteLoadCrash.qml | 3 - .../qdeclarativelanguage/data/revisions11.qml | 10 - .../data/revisionsbasesub11.qml | 16 - .../qdeclarativelanguage/data/revisionssub11.qml | 12 - .../data/rootAsQmlComponent.qml | 6 - .../data/scriptString.1.errors.txt | 1 - .../qdeclarativelanguage/data/scriptString.1.qml | 5 - .../data/scriptString.2.errors.txt | 1 - .../qdeclarativelanguage/data/scriptString.2.qml | 6 - .../qdeclarativelanguage/data/scriptString.qml | 6 - .../qdeclarativelanguage/data/scriptString2.qml | 5 - .../qdeclarativelanguage/data/scriptString3.qml | 5 - .../qdeclarativelanguage/data/scriptString4.qml | 5 - .../qdeclarativelanguage/data/signal.1.errors.txt | 1 - .../qdeclarativelanguage/data/signal.1.qml | 5 - .../qdeclarativelanguage/data/signal.2.errors.txt | 1 - .../qdeclarativelanguage/data/signal.2.qml | 6 - .../qdeclarativelanguage/data/signal.3.errors.txt | 1 - .../qdeclarativelanguage/data/signal.3.qml | 6 - .../qdeclarativelanguage/data/signal.4.errors.txt | 1 - .../qdeclarativelanguage/data/signal.4.qml | 6 - .../qdeclarativelanguage/data/simpleBindings.qml | 18 - .../qdeclarativelanguage/data/simpleContainer.qml | 5 - .../qdeclarativelanguage/data/simpleObject.qml | 2 - .../data/singularProperty.2.errors.txt | 1 - .../data/singularProperty.2.qml | 7 - .../data/singularProperty.errors.txt | 1 - .../qdeclarativelanguage/data/singularProperty.qml | 6 - .../qdeclarativelanguage/data/subdir/Test.qml | 2 - .../data/subdir/subsubdir/SubTest.qml | 2 - .../declarative/qdeclarativelanguage/data/test.js | 0 .../declarative/qdeclarativelanguage/data/test2.js | 0 .../data/unregisteredObject.errors.txt | 1 - .../data/unregisteredObject.qml | 2 - .../data/unsupportedProperty.errors.txt | 1 - .../data/unsupportedProperty.qml | 4 - .../qdeclarativelanguage/data/valueTypes.qml | 13 - .../qdeclarativelanguage/data/variantNotify.qml | 13 - .../qdeclarativelanguage/data/versionedbase.qml | 8 - .../data/wrongType.1.errors.txt | 1 - .../qdeclarativelanguage/data/wrongType.1.qml | 4 - .../data/wrongType.10.errors.txt | 1 - .../qdeclarativelanguage/data/wrongType.10.qml | 5 - .../data/wrongType.11.errors.txt | 1 - .../qdeclarativelanguage/data/wrongType.11.qml | 5 - .../data/wrongType.12.errors.txt | 1 - .../qdeclarativelanguage/data/wrongType.12.qml | 5 - .../data/wrongType.13.errors.txt | 1 - .../qdeclarativelanguage/data/wrongType.13.qml | 4 - .../data/wrongType.14.errors.txt | 1 - .../qdeclarativelanguage/data/wrongType.14.qml | 5 - .../data/wrongType.15.errors.txt | 1 - .../qdeclarativelanguage/data/wrongType.15.qml | 4 - .../data/wrongType.16.errors.txt | 1 - .../qdeclarativelanguage/data/wrongType.16.qml | 5 - .../data/wrongType.17.errors.txt | 1 - .../qdeclarativelanguage/data/wrongType.17.qml | 5 - .../data/wrongType.2.errors.txt | 1 - .../qdeclarativelanguage/data/wrongType.2.qml | 4 - .../data/wrongType.3.errors.txt | 1 - .../qdeclarativelanguage/data/wrongType.3.qml | 4 - .../data/wrongType.4.errors.txt | 1 - .../qdeclarativelanguage/data/wrongType.4.qml | 4 - .../data/wrongType.5.errors.txt | 1 - .../qdeclarativelanguage/data/wrongType.5.qml | 5 - .../data/wrongType.6.errors.txt | 1 - .../qdeclarativelanguage/data/wrongType.6.qml | 5 - .../data/wrongType.7.errors.txt | 1 - .../qdeclarativelanguage/data/wrongType.7.qml | 5 - .../data/wrongType.8.errors.txt | 1 - .../qdeclarativelanguage/data/wrongType.8.qml | 5 - .../data/wrongType.9.errors.txt | 1 - .../qdeclarativelanguage/data/wrongType.9.qml | 5 - .../qdeclarativelanguage/qdeclarativelanguage.pro | 18 - .../declarative/qdeclarativelanguage/testtypes.cpp | 88 - .../declarative/qdeclarativelanguage/testtypes.h | 823 -- .../tst_qdeclarativelanguage.cpp | 2289 ----- .../qdeclarativelistcompositor.pro | 9 - .../tst_qdeclarativelistcompositor.cpp | 1637 ---- .../qdeclarativelistmodel/data/enumerate.qml | 24 - .../qdeclarativelistmodel/data/model.qml | 26 - .../qdeclarativelistmodel/data/multipleroles.qml | 25 - .../qdeclarativelistmodel/data/script.js | 13 - .../data/setmodelcachelist.qml | 20 - .../qdeclarativelistmodel/data/signalhandlers.qml | 8 - .../data/workerremoveelement.js | 8 - .../data/workerremoveelement.qml | 33 - .../qdeclarativelistmodel/data/workerremovelist.js | 9 - .../data/workerremovelist.qml | 33 - .../qdeclarativelistmodel/data/workersync.js | 8 - .../qdeclarativelistmodel/data/workersync.qml | 32 - .../qdeclarativelistmodel.pro | 15 - .../tst_qdeclarativelistmodel.cpp | 1632 ---- .../qdeclarativelistreference/data/MyType.qml | 5 - .../qdeclarativelistreference/data/engineTypes.qml | 9 - .../data/variantToList.qml | 10 - .../qdeclarativelistreference.pro | 15 - .../tst_qdeclarativelistreference.cpp | 570 -- .../declarative/qdeclarativelocale/data/date.qml | 45 - .../qdeclarativelocale/data/functions.qml | 65 - .../qdeclarativelocale/data/localeCompare.qml | 7 - .../declarative/qdeclarativelocale/data/number.qml | 30 - .../qdeclarativelocale/data/properties.qml | 27 - .../qdeclarativelocale/qdeclarativelocale.pro | 15 - .../qdeclarativelocale/tst_qdeclarativelocale.cpp | 1183 --- .../qdeclarativemetatype/qdeclarativemetatype.pro | 7 - .../tst_qdeclarativemetatype.cpp | 202 - .../data/implicit1/implicitQmldir.errors.txt | 1 - .../qdeclarativemoduleplugin/data/implicit1/qmldir | 2 - .../data/implicit1/temptest.qml | 14 - .../data/implicit2/Test.qml | 5 - .../data/implicit2/implicitQmldir.2.errors.txt | 3 - .../qdeclarativemoduleplugin/data/implicit2/qmldir | 3 - .../data/implicit2/temptest2.qml | 8 - .../data/importsMixedQmlCppPlugin.2.qml | 21 - .../data/importsMixedQmlCppPlugin.qml | 13 - .../data/incorrectCase.qml | 4 - .../data/pluginWithQmlFile.qml | 3 - .../data/versionNotInstalled.2.errors.txt | 1 - .../data/versionNotInstalled.2.qml | 5 - .../data/versionNotInstalled.errors.txt | 1 - .../data/versionNotInstalled.qml | 6 - .../qdeclarativemoduleplugin/data/works.qml | 3 - .../qdeclarativemoduleplugin/data/works2.qml | 3 - .../qdeclarativemoduleplugin/data/works21.qml | 3 - .../nokia/AutoTestPluginWithQmlFile/MyQmlFile.qml | 3 - .../com/nokia/AutoTestPluginWithQmlFile/qmldir | 3 - .../com/nokia/AutoTestQmlMixedPluginType/Foo.qml | 5 - .../com/nokia/AutoTestQmlMixedPluginType/qmldir | 2 - .../com/nokia/AutoTestQmlPluginType.2.1/qmldir | 1 - .../com/nokia/AutoTestQmlPluginType.2/qmldir | 1 - .../imports/com/nokia/AutoTestQmlPluginType/qmldir | 1 - .../com/nokia/AutoTestQmlVersionPluginType/qmldir | 1 - .../imports/com/nokia/PureQmlModule/ComponentA.qml | 3 - .../imports/com/nokia/PureQmlModule/ComponentB.qml | 4 - .../imports/com/nokia/PureQmlModule/qmldir | 3 - .../imports/com/nokia/WrongCase/qmldir | 1 - .../plugin.2.1/plugin.2.1.pro | 7 - .../qdeclarativemoduleplugin/plugin.2.1/plugin.cpp | 84 - .../qdeclarativemoduleplugin/plugin.2/plugin.2.pro | 7 - .../qdeclarativemoduleplugin/plugin.2/plugin.cpp | 84 - .../qdeclarativemoduleplugin/plugin/plugin.cpp | 83 - .../qdeclarativemoduleplugin/plugin/plugin.pro | 7 - .../pluginMixed/plugin.cpp | 73 - .../pluginMixed/pluginMixed.pro | 7 - .../pluginVersion/plugin.cpp | 73 - .../pluginVersion/pluginVersion.pro | 7 - .../pluginWithQmlFile/plugin.cpp | 58 - .../pluginWithQmlFile/pluginWithQmlFile.pro | 7 - .../pluginWrongCase/plugin.cpp | 83 - .../pluginWrongCase/pluginWrongCase.pro | 8 - .../qdeclarativemoduleplugin.pro | 9 - .../tst_qdeclarativemoduleplugin.cpp | 353 - .../tst_qdeclarativemoduleplugin.pro | 19 - .../qdeclarativeparser/qdeclarativeparser.pro | 9 - .../qdeclarativeparser/tst_qdeclarativeparser.cpp | 210 - .../qdeclarativepixmapcache/data/dataLeak.qml | 18 - .../qdeclarativeproperty/data/NoContextTypeA.qml | 5 - .../qdeclarativeproperty/data/NoContextTypeB.qml | 5 - .../qdeclarativeproperty/data/TestType.qml | 6 - .../data/aliasPropertyBindings.qml | 19 - .../data/assignEmptyVariantMap.qml | 5 - .../data/readSynthesizedObject.qml | 9 - .../qdeclarativeproperty/qdeclarativeproperty.pro | 15 - .../tst_qdeclarativeproperty.cpp | 1721 ---- .../qdeclarativepropertycache.pro | 8 - .../tst_qdeclarativepropertycache.cpp | 281 - .../qdeclarativepropertymap.pro | 9 - .../tst_qdeclarativepropertymap.cpp | 241 - .../auto/declarative/qdeclarativeqt/data/atob.qml | 7 - .../auto/declarative/qdeclarativeqt/data/btoa.qml | 6 - .../qdeclarativeqt/data/createComponent.qml | 20 - .../qdeclarativeqt/data/createComponentData.qml | 5 - .../qdeclarativeqt/data/createComponent_lib.js | 11 - .../qdeclarativeqt/data/createComponent_lib.qml | 12 - .../qdeclarativeqt/data/createQmlObject.qml | 31 - .../declarative/qdeclarativeqt/data/darker.qml | 12 - .../qdeclarativeqt/data/dateTimeConversion.qml | 14 - .../auto/declarative/qdeclarativeqt/data/enums.qml | 9 - .../qdeclarativeqt/data/fontFamilies.qml | 6 - .../declarative/qdeclarativeqt/data/formatting.qml | 44 - .../auto/declarative/qdeclarativeqt/data/hsla.qml | 11 - .../declarative/qdeclarativeqt/data/isQtObject.qml | 14 - .../declarative/qdeclarativeqt/data/lighter.qml | 11 - tests/auto/declarative/qdeclarativeqt/data/md5.qml | 6 - .../qdeclarativeqt/data/openUrlExternally.qml | 8 - .../qdeclarativeqt/data/openUrlExternally_lib.js | 9 - .../qdeclarativeqt/data/openUrlExternally_lib.qml | 9 - .../auto/declarative/qdeclarativeqt/data/point.qml | 9 - .../auto/declarative/qdeclarativeqt/data/quit.qml | 5 - .../auto/declarative/qdeclarativeqt/data/rect.qml | 9 - .../qdeclarativeqt/data/resolvedUrl.qml | 13 - .../auto/declarative/qdeclarativeqt/data/rgba.qml | 10 - .../auto/declarative/qdeclarativeqt/data/size.qml | 11 - .../auto/declarative/qdeclarativeqt/data/tint.qml | 9 - .../declarative/qdeclarativeqt/data/vector.qml | 8 - .../declarative/qdeclarativeqt/data/vector4.qml | 8 - .../declarative/qdeclarativeqt/qdeclarativeqt.pro | 15 - .../qdeclarativeqt/tst_qdeclarativeqt.cpp | 732 -- .../qdeclarativesqldatabase/data/README | 3 - .../qdeclarativesqldatabase/data/changeversion.js | 55 - .../qdeclarativesqldatabase/data/creation-a.js | 20 - .../qdeclarativesqldatabase/data/creation.js | 15 - .../qdeclarativesqldatabase/data/error-a.js | 22 - .../qdeclarativesqldatabase/data/error-b.js | 15 - .../qdeclarativesqldatabase/data/error-creation.js | 16 - .../data/error-notransaction.js | 17 - .../data/error-outsidetransaction.js | 19 - .../data/iteration-forwardonly.js | 31 - .../qdeclarativesqldatabase/data/iteration.js | 30 - .../qdeclarativesqldatabase/data/readonly-error.js | 29 - .../qdeclarativesqldatabase/data/readonly.js | 26 - .../qdeclarativesqldatabase/data/reopen1.js | 16 - .../qdeclarativesqldatabase/data/reopen2.js | 18 - .../data/selection-bindnames.js | 28 - .../qdeclarativesqldatabase/data/selection.js | 46 - .../qdeclarativesqldatabase.pro | 15 - .../tst_qdeclarativesqldatabase.cpp | 243 - .../qdeclarativetranslation/data/idtranslation.qml | 8 - .../qdeclarativetranslation/data/qml_fr.qm | Bin 374 -> 0 bytes .../qdeclarativetranslation/data/qml_fr.ts | 43 - .../qdeclarativetranslation/data/qmlid_fr.qm | Bin 119 -> 0 bytes .../qdeclarativetranslation/data/qmlid_fr.ts | 13 - .../qdeclarativetranslation/data/translation.qml | 21 - .../qdeclarativetranslation/data/translation.qrc | 6 - .../qdeclarativetranslation.pro | 16 - .../tst_qdeclarativetranslation.cpp | 137 - .../data/BindingsSpliceCorrectlyType.qml | 7 - .../data/BindingsSpliceCorrectlyType4.qml | 7 - .../data/BindingsSpliceCorrectlyType5.qml | 7 - .../data/autoBindingRemoval.2.qml | 9 - .../data/autoBindingRemoval.3.qml | 10 - .../data/autoBindingRemoval.qml | 9 - .../data/bindingAssignment.qml | 7 - .../data/bindingConflict.qml | 8 - .../qdeclarativevaluetypes/data/bindingRead.qml | 5 - .../data/bindingVariantCopy.qml | 13 - .../data/bindingsSpliceCorrectly.1.qml | 29 - .../data/bindingsSpliceCorrectly.2.qml | 31 - .../data/bindingsSpliceCorrectly.3.qml | 36 - .../data/bindingsSpliceCorrectly.4.qml | 27 - .../data/bindingsSpliceCorrectly.5.qml | 27 - .../qdeclarativevaluetypes/data/color_compare.qml | 37 - .../qdeclarativevaluetypes/data/color_read.qml | 9 - .../qdeclarativevaluetypes/data/color_write.qml | 8 - .../qdeclarativevaluetypes/data/conflicting.1.qml | 42 - .../qdeclarativevaluetypes/data/conflicting.2.qml | 42 - .../qdeclarativevaluetypes/data/conflicting.3.qml | 42 - .../qdeclarativevaluetypes/data/deletedObject.js | 13 - .../qdeclarativevaluetypes/data/deletedObject.qml | 11 - .../qdeclarativevaluetypes/data/enums.1.qml | 6 - .../qdeclarativevaluetypes/data/enums.2.qml | 6 - .../qdeclarativevaluetypes/data/enums.3.qml | 6 - .../qdeclarativevaluetypes/data/enums.4.qml | 7 - .../qdeclarativevaluetypes/data/enums.5.qml | 10 - .../qdeclarativevaluetypes/data/font_compare.qml | 31 - .../qdeclarativevaluetypes/data/font_read.qml | 18 - .../qdeclarativevaluetypes/data/font_write.2.qml | 6 - .../qdeclarativevaluetypes/data/font_write.3.qml | 7 - .../qdeclarativevaluetypes/data/font_write.4.qml | 7 - .../qdeclarativevaluetypes/data/font_write.5.qml | 14 - .../qdeclarativevaluetypes/data/font_write.qml | 16 - .../data/matrix4x4_compare.qml | 35 - .../qdeclarativevaluetypes/data/matrix4x4_read.qml | 22 - .../data/matrix4x4_write.qml | 21 - .../qdeclarativevaluetypes/data/point_compare.qml | 22 - .../qdeclarativevaluetypes/data/point_read.qml | 7 - .../qdeclarativevaluetypes/data/point_write.qml | 6 - .../qdeclarativevaluetypes/data/pointf_compare.qml | 22 - .../qdeclarativevaluetypes/data/pointf_read.qml | 8 - .../qdeclarativevaluetypes/data/pointf_write.qml | 6 - .../data/quaternion_compare.qml | 23 - .../data/quaternion_read.qml | 10 - .../data/quaternion_write.qml | 9 - .../qdeclarativevaluetypes/data/rect_compare.qml | 25 - .../qdeclarativevaluetypes/data/rect_read.qml | 10 - .../qdeclarativevaluetypes/data/rect_write.qml | 9 - .../qdeclarativevaluetypes/data/rectf_compare.qml | 25 - .../qdeclarativevaluetypes/data/rectf_read.qml | 10 - .../qdeclarativevaluetypes/data/rectf_write.qml | 9 - .../qdeclarativevaluetypes/data/returnValues.qml | 17 - .../qdeclarativevaluetypes/data/scriptAccess.qml | 9 - .../data/scriptVariantCopy.qml | 14 - .../qdeclarativevaluetypes/data/size_compare.qml | 23 - .../qdeclarativevaluetypes/data/size_read.qml | 8 - .../qdeclarativevaluetypes/data/size_write.qml | 7 - .../qdeclarativevaluetypes/data/sizef_compare.qml | 24 - .../qdeclarativevaluetypes/data/sizef_read.qml | 9 - .../qdeclarativevaluetypes/data/sizef_write.qml | 6 - .../data/sizereadonly_read.qml | 8 - .../data/sizereadonly_writeerror.qml | 6 - .../data/sizereadonly_writeerror2.qml | 7 - .../data/sizereadonly_writeerror3.qml | 7 - .../data/sizereadonly_writeerror4.qml | 10 - .../data/staticAssignment.qml | 5 - .../data/valueInterceptors.qml | 8 - .../qdeclarativevaluetypes/data/valueSources.qml | 5 - .../qdeclarativevaluetypes/data/varAssignment.qml | 14 - .../qdeclarativevaluetypes/data/variant_read.qml | 9 - .../data/vector2d_compare.qml | 21 - .../qdeclarativevaluetypes/data/vector2d_read.qml | 8 - .../qdeclarativevaluetypes/data/vector2d_write.qml | 7 - .../data/vector3d_compare.qml | 23 - .../qdeclarativevaluetypes/data/vector3d_read.qml | 9 - .../qdeclarativevaluetypes/data/vector3d_write.qml | 8 - .../data/vector4d_compare.qml | 23 - .../qdeclarativevaluetypes/data/vector4d_read.qml | 10 - .../qdeclarativevaluetypes/data/vector4d_write.qml | 9 - .../qdeclarativevaluetypes.pro | 18 - .../qdeclarativevaluetypes/testtypes.cpp | 48 - .../declarative/qdeclarativevaluetypes/testtypes.h | 219 - .../tst_qdeclarativevaluetypes.cpp | 1306 --- .../qdeclarativeworkerscript/data/BaseWorker.qml | 24 - .../qdeclarativeworkerscript/data/Global.js | 1 - .../data/externalObjectWorker.qml | 14 - .../qdeclarativeworkerscript/data/script.js | 4 - .../data/script_error_onCall.js | 6 - .../data/script_error_onLoad.js | 5 - .../data/script_fixed_return.js | 4 - .../data/script_include.js | 5 - .../qdeclarativeworkerscript/data/script_pragma.js | 6 - .../qdeclarativeworkerscript/data/stressDispose.js | 6 - .../data/stressDispose.qml | 13 - .../qdeclarativeworkerscript/data/worker.qml | 5 - .../data/worker_error_onCall.qml | 6 - .../data/worker_error_onLoad.qml | 7 - .../data/worker_include.qml | 5 - .../data/worker_pragma.qml | 6 - .../qdeclarativeworkerscript.pro | 15 - .../tst_qdeclarativeworkerscript.cpp | 300 - .../qdeclarativexmlhttprequest/data/abort.expect | 10 - .../qdeclarativexmlhttprequest/data/abort.qml | 44 - .../qdeclarativexmlhttprequest/data/abort.reply | 3 - .../data/abort_opened.qml | 60 - .../data/abort_unsent.qml | 55 - .../qdeclarativexmlhttprequest/data/attr.qml | 78 - .../qdeclarativexmlhttprequest/data/attr.xml | 1 - .../data/callbackException.qml | 25 - .../qdeclarativexmlhttprequest/data/cdata.qml | 133 - .../qdeclarativexmlhttprequest/data/cdata.xml | 2 - .../data/constructor.qml | 14 - .../data/defaultState.qml | 30 - .../qdeclarativexmlhttprequest/data/document.qml | 56 - .../qdeclarativexmlhttprequest/data/document.xml | 3 - .../data/domExceptionCodes.qml | 60 - .../qdeclarativexmlhttprequest/data/element.qml | 145 - .../qdeclarativexmlhttprequest/data/element.xml | 1 - .../data/getAllResponseHeaders.qml | 66 - .../data/getAllResponseHeaders_args.qml | 23 - .../data/getAllResponseHeaders_sent.qml | 20 - .../data/getAllResponseHeaders_unsent.qml | 16 - .../data/getResponseHeader.expect | 7 - .../data/getResponseHeader.qml | 76 - .../data/getResponseHeader.reply | 8 - .../data/getResponseHeader_args.qml | 23 - .../data/getResponseHeader_sent.qml | 20 - .../data/getResponseHeader_unsent.qml | 16 - .../data/instanceStateValues.qml | 33 - .../data/invalidMethodUsage.qml | 148 - .../qdeclarativexmlhttprequest/data/open.qml | 54 - .../data/open_arg_count.1.qml | 18 - .../data/open_arg_count.2.qml | 18 - .../data/open_invalid_method.qml | 16 - .../data/open_network.expect | 7 - .../data/open_network.reply | 3 - .../data/open_network.wait | 0 .../qdeclarativexmlhttprequest/data/open_sync.qml | 17 - .../qdeclarativexmlhttprequest/data/open_user.qml | 54 - .../data/open_username.qml | 54 - .../data/redirectError.qml | 23 - .../data/redirectRecur.qml | 23 - .../qdeclarativexmlhttprequest/data/redirects.qml | 22 - .../data/redirecttarget.html | 1 - .../data/responseText.qml | 54 - .../data/responseXML_invalid.qml | 24 - .../data/seconddocument.html | 1 - .../data/send_alreadySent.qml | 28 - .../data/send_data.1.expect | 10 - .../data/send_data.1.qml | 22 - .../data/send_data.2.qml | 24 - .../data/send_data.3.qml | 24 - .../data/send_data.4.expect | 10 - .../data/send_data.4.qml | 24 - .../data/send_data.5.qml | 24 - .../data/send_data.6.expect | 10 - .../data/send_data.6.qml | 22 - .../data/send_data.7.qml | 24 - .../data/send_data.reply | 3 - .../data/send_ignoreData.qml | 27 - .../data/send_ignoreData.reply | 3 - .../data/send_ignoreData_DELETE.expect | 7 - .../data/send_ignoreData_GET.expect | 7 - .../data/send_ignoreData_HEAD.expect | 7 - .../data/send_unsent.qml | 16 - .../data/setRequestHeader.expect | 9 - .../data/setRequestHeader.qml | 29 - .../data/setRequestHeader.reply | 3 - .../data/setRequestHeader_args.qml | 18 - .../data/setRequestHeader_caseInsensitive.qml | 30 - .../data/setRequestHeader_illegalName.qml | 58 - .../data/setRequestHeader_sent.qml | 32 - .../data/setRequestHeader_unsent.qml | 17 - .../data/staticStateValues.qml | 24 - .../data/status.200.reply | 3 - .../data/status.400.reply | 4 - .../data/status.404.reply | 3 - .../qdeclarativexmlhttprequest/data/status.expect | 7 - .../qdeclarativexmlhttprequest/data/status.qml | 79 - .../qdeclarativexmlhttprequest/data/statusText.qml | 79 - .../data/testdocument.html | 1 - .../qdeclarativexmlhttprequest/data/text.qml | 129 - .../qdeclarativexmlhttprequest/data/text.xml | 1 - .../qdeclarativexmlhttprequest/data/utf16.html | 1 - .../qdeclarativexmlhttprequest/data/utf16.qml | 29 - .../qdeclarativexmlhttprequest/data/utf16.xml | Bin 154 -> 0 bytes .../qdeclarativexmlhttprequest.pro | 19 - .../tst_qdeclarativexmlhttprequest.cpp | 1160 --- tests/auto/declarative/qjsengine/qjsengine.pro | 13 - .../declarative/qjsengine/script/com/__init__.js | 9 - .../qjsengine/script/com/trolltech/__init__.js | 9 - .../script/com/trolltech/recursive/__init__.js | 1 - .../script/com/trolltech/syntaxerror/__init__.js | 5 - tests/auto/declarative/qjsengine/tst_qjsengine.cpp | 6353 -------------- tests/auto/declarative/qjsvalue/qjsvalue.pro | 6 - tests/auto/declarative/qjsvalue/tst_qjsvalue.cpp | 3655 -------- tests/auto/declarative/qjsvalue/tst_qjsvalue.h | 204 - .../qjsvalueiterator/qjsvalueiterator.pro | 7 - .../qjsvalueiterator/tst_qjsvalueiterator.cpp | 522 -- tests/auto/declarative/qmlmin/qmlmin.pro | 9 - tests/auto/declarative/qmlmin/tst_qmlmin.cpp | 192 - .../declarative/qmlplugindump/qmlplugindump.pro | 7 - .../qmlplugindump/tst_qmlplugindump.cpp | 117 - tests/auto/declarative/runall.sh | 100 - tests/auto/declarative/v4/data/conditionalExpr.qml | 6 - tests/auto/declarative/v4/data/doubleBoolJump.qml | 18 - tests/auto/declarative/v4/data/fetchException.qml | 6 - tests/auto/declarative/v4/data/logicalOr.2.qml | 6 - tests/auto/declarative/v4/data/logicalOr.qml | 6 - tests/auto/declarative/v4/data/nestedLogicalOr.qml | 14 - .../declarative/v4/data/nestedObjectAccess.qml | 5 - tests/auto/declarative/v4/data/nullQObject.qml | 7 - .../declarative/v4/data/qrealToIntRounding.qml | 10 - tests/auto/declarative/v4/data/qtbug_21883.qml | 5 - tests/auto/declarative/v4/data/qtbug_22816.qml | 18 - .../auto/declarative/v4/data/stringComparison.qml | 34 - .../data/subscriptionsInConditionalExpressions.qml | 11 - tests/auto/declarative/v4/data/unaryMinus.qml | 24 - tests/auto/declarative/v4/data/unaryPlus.qml | 24 - .../auto/declarative/v4/data/unnecessaryReeval.qml | 7 - tests/auto/declarative/v4/testtypes.cpp | 49 - tests/auto/declarative/v4/testtypes.h | 83 - tests/auto/declarative/v4/tst_v4.cpp | 353 - tests/auto/declarative/v4/v4.pro | 17 - 2492 files changed, 215825 deletions(-) delete mode 100644 tests/auto/declarative/animation/animation.pro delete mode 100644 tests/auto/declarative/animation/qabstractanimationjob/qabstractanimationjob.pro delete mode 100644 tests/auto/declarative/animation/qabstractanimationjob/tst_qabstractanimationjob.cpp delete mode 100644 tests/auto/declarative/animation/qanimationgroupjob/qanimationgroupjob.pro delete mode 100644 tests/auto/declarative/animation/qanimationgroupjob/tst_qanimationgroupjob.cpp delete mode 100644 tests/auto/declarative/animation/qparallelanimationgroupjob/qparallelanimationgroupjob.pro delete mode 100644 tests/auto/declarative/animation/qparallelanimationgroupjob/tst_qparallelanimationgroupjob.cpp delete mode 100644 tests/auto/declarative/animation/qpauseanimationjob/qpauseanimationjob.pro delete mode 100644 tests/auto/declarative/animation/qpauseanimationjob/tst_qpauseanimationjob.cpp delete mode 100644 tests/auto/declarative/animation/qsequentialanimationgroupjob/qsequentialanimationgroupjob.pro delete mode 100644 tests/auto/declarative/animation/qsequentialanimationgroupjob/tst_qsequentialanimationgroupjob.cpp delete mode 100644 tests/auto/declarative/debugger/debugger.pro delete mode 100644 tests/auto/declarative/debugger/qdebugmessageservice/data/test.qml delete mode 100644 tests/auto/declarative/debugger/qdebugmessageservice/qdebugmessageservice.pro delete mode 100644 tests/auto/declarative/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp delete mode 100644 tests/auto/declarative/debugger/qdeclarativedebugclient/qdeclarativedebugclient.pro delete mode 100644 tests/auto/declarative/debugger/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp delete mode 100644 tests/auto/declarative/debugger/qdeclarativedebugjs/data/breakpointRelocation.qml delete mode 100644 tests/auto/declarative/debugger/qdeclarativedebugjs/data/changeBreakpoint.qml delete mode 100644 tests/auto/declarative/debugger/qdeclarativedebugjs/data/condition.qml delete mode 100644 tests/auto/declarative/debugger/qdeclarativedebugjs/data/createComponent.qml delete mode 100644 tests/auto/declarative/debugger/qdeclarativedebugjs/data/exception.qml delete mode 100644 tests/auto/declarative/debugger/qdeclarativedebugjs/data/loadjsfile.qml delete mode 100644 tests/auto/declarative/debugger/qdeclarativedebugjs/data/oncompleted.qml delete mode 100644 tests/auto/declarative/debugger/qdeclarativedebugjs/data/stepAction.qml delete mode 100644 tests/auto/declarative/debugger/qdeclarativedebugjs/data/test.js delete mode 100644 tests/auto/declarative/debugger/qdeclarativedebugjs/data/test.qml delete mode 100644 tests/auto/declarative/debugger/qdeclarativedebugjs/data/timer.qml delete mode 100644 tests/auto/declarative/debugger/qdeclarativedebugjs/qdeclarativedebugjs.pro delete mode 100644 tests/auto/declarative/debugger/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp delete mode 100644 tests/auto/declarative/debugger/qdeclarativedebugservice/qdeclarativedebugservice.pro delete mode 100644 tests/auto/declarative/debugger/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp delete mode 100644 tests/auto/declarative/debugger/qdeclarativeenginedebug/qdeclarativeenginedebug.pro delete mode 100644 tests/auto/declarative/debugger/qdeclarativeenginedebug/tst_qdeclarativeenginedebug.cpp delete mode 100644 tests/auto/declarative/debugger/qdeclarativeinspector/app/app.pro delete mode 100644 tests/auto/declarative/debugger/qdeclarativeinspector/app/main.cpp delete mode 100644 tests/auto/declarative/debugger/qdeclarativeinspector/app/qtquick2.qml delete mode 100644 tests/auto/declarative/debugger/qdeclarativeinspector/qdeclarativeinspector.pro delete mode 100644 tests/auto/declarative/debugger/qdeclarativeinspector/tst_qdeclarativeinspector.cpp delete mode 100644 tests/auto/declarative/debugger/qdeclarativeinspector/tst_qdeclarativeinspector.pro delete mode 100644 tests/auto/declarative/debugger/qdeclarativeprofilerservice/data/exit.qml delete mode 100644 tests/auto/declarative/debugger/qdeclarativeprofilerservice/data/test.qml delete mode 100644 tests/auto/declarative/debugger/qdeclarativeprofilerservice/qdeclarativeprofilerservice.pro delete mode 100644 tests/auto/declarative/debugger/qdeclarativeprofilerservice/tst_qdeclarativeprofilerservice.cpp delete mode 100644 tests/auto/declarative/debugger/qpacketprotocol/qpacketprotocol.pro delete mode 100644 tests/auto/declarative/debugger/qpacketprotocol/tst_qpacketprotocol.cpp delete mode 100644 tests/auto/declarative/debugger/qv8profilerservice/data/console.qml delete mode 100644 tests/auto/declarative/debugger/qv8profilerservice/data/exit.qml delete mode 100644 tests/auto/declarative/debugger/qv8profilerservice/data/test.qml delete mode 100644 tests/auto/declarative/debugger/qv8profilerservice/qv8profilerservice.pro delete mode 100644 tests/auto/declarative/debugger/qv8profilerservice/tst_qv8profilerservice.cpp delete mode 100644 tests/auto/declarative/debugger/shared/debugutil.cpp delete mode 100644 tests/auto/declarative/debugger/shared/debugutil_p.h delete mode 100644 tests/auto/declarative/declarative.pro delete mode 100644 tests/auto/declarative/parserstress/parserstress.pro delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Array/15.4-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Array/15.4-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Array/15.4.1.1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Array/15.4.1.2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Array/15.4.1.3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Array/15.4.1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Array/15.4.2.1-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Array/15.4.2.1-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Array/15.4.2.1-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Array/15.4.2.2-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Array/15.4.2.2-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Array/15.4.2.3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Array/15.4.3.1-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Array/15.4.3.2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Array/15.4.4.1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Array/15.4.4.2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Array/15.4.4.3-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Array/15.4.4.4-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Array/15.4.4.4-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Array/15.4.4.5-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Array/15.4.4.5-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Array/15.4.4.5-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Array/15.4.4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Array/15.4.5.1-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Array/15.4.5.1-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Array/15.4.5.2-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Array/15.4.5.2-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Array/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Array/shell.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.3.1-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.3.1-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.3.1-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.3.1-4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.3.1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.2-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.2-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.2-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.2-4-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.3-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.3-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.3-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.3-4-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Boolean/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Boolean/shell.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.1.1-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.1.1-2.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.1.13-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.2.1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.2.2-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.2.2-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.2.2-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.2.2-4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.2.2-5.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.2.2-6.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.1-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.1-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.1-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.1-4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.1-5.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.2-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.2-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.2-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.2-4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.2-5.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.8-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.8-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.8-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.8-4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.8-5.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.4.2-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.4.2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.4.3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-10.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-11.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-12.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-13.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-5.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-6.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-7.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-8.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-9.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.11-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.11-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.11-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.11-4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.11-5.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.11-6.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.11-7.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.12-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.12-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.12-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.12-4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.12-5.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.12-6.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.12-7.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.12-8.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.13-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.13-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.13-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.13-4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.13-5.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.13-6.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.13-7.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.13-8.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.14.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.15.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.16.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.17.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.18.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.19.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.2-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.2-2-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.20.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.21-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.21-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.21-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.21-4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.21-5.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.21-6.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.21-7.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.21-8.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.22-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.22-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.22-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.22-4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.22-5.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.22-6.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.22-7.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.22-8.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-10.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-11.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-12.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-13.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-14.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-15.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-16.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-17.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-18.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-3-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-5.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-6.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-7.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-8.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-9.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.24-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.24-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.24-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.24-4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.24-5.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.24-6.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.24-7.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.24-8.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.25-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.26-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.27-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.28-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.29-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.3-1-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.3-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.30-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.31-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.32-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.33-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.34-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.35-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.36-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.36-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.36-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.36-4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.36-5.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.36-6.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.36-7.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.37-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.37-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.37-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.37-4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.37-5.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.4-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.4-2-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.5.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.6.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.7.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.8.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.9.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Date/shell.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.3-1.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.3-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.4-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.4-10.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.4-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.4-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.4-4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.4-5.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.4-6.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.4-7.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.4-8.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.5-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.5-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.5-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.5-4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.8-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.8-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.2.1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.2.2-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.2.2-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.2.3-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.2.3-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/shell.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.1.1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.10-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.10-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.10-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.12-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.12-2-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.12-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.12-4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.13.1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.13.2-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.13.2-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.13.2-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.13.2-4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.13.2-5.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.13.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.14-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.1-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.1-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.1-3-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.1-4-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.1-5.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-1-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-10-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-11.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-2-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-3-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-4-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-5-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-6-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-7-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-8-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-9-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.3-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.3-2-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.3-3-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.3-4-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.3-5.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.3.1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.3.2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.4.1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.4.2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.4.3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.4.4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.4.5.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.4.6.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.4.7-01.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.4.7-02.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.4.8.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.4.9.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.5.1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.5.2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.5.3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.6.1-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.6.1-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.6.1-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.6.2-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.6.3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.7.1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.7.2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.7.3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.8.1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.8.2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.8.3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.8.4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.9.1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.9.2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/11.9.3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Expressions/shell.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.1.1-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.1.1-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.1.1-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.2.1-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.2.1-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.2.1-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.3.1-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.3.1-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.3.1-4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.3.2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.4-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.4.1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.5-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.5-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.5.1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.5.3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/shell.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1-1-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1-2-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.1.1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.1.2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.1-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.2-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.2-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.3-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.3-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.5-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.5-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.5-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.6.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.7.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/GlobalObject/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/GlobalObject/shell.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.1-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.1-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.1-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.2-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.2-2-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.2-3-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.2-4-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.2-5-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.2-6.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-10.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-11.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-12.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-13-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-5.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-6.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-7.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-8.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-9.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.1-1-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.1-2-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.1-3-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-1-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-10-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-11-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-12-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-13-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-14-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-15-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-16-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-2-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-3-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-4-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-5-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-6-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-7-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-8-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-9-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-1-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-10-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-11-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-12-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-13-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-14-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-15-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-16-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-2-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-3-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-4-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-5-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-6-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-7-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-8-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-9-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.5-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.5-10-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.5-2-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.5-3-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.5-4-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.5-5-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.5-6.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.5-7.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.5-8-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.5-9-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.6.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.7.1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.7.2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.7.3-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.7.3-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.7.3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.7.4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.8.2-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/shell.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Math/15.8-2-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Math/15.8-3-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.1-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.1-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.2-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.2-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.3-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.3-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.4-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.4-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.5-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.5-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.6-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.6-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.7-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.7-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.8-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.8-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.8-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.10.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.11.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.12.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.13.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.14.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.15.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.16.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.17.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.18.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.5.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.6.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.7.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.8.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.9.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Math/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Math/shell.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/NativeObjects/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/NativeObjects/shell.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Number/15.7.1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Number/15.7.2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.1-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.1-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.1-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.2-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.2-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.2-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.2-4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.3-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.3-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.3-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.3-4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.4-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.4-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.4-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.4-4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.5-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.5-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.5-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.5-4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.6-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.6-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.6-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.6-4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Number/15.7.4-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Number/15.7.4.1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Number/15.7.4.2-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Number/15.7.4.2-2-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Number/15.7.4.2-3-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Number/15.7.4.2-4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Number/15.7.4.3-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Number/15.7.4.3-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Number/15.7.4.3-3-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Number/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Number/shell.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.1.1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.1.2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.2.1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.2.2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.3-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.3.1-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.3.1-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.3.1-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.3.1-4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.4.1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.4.2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.4.3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/shell.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma/README delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/SourceText/6-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/SourceText/6-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/SourceText/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/SourceText/shell.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Statements/12.10-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Statements/12.10.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Statements/12.2-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Statements/12.5-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Statements/12.5-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.1-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.2-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.2-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.2-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.2-4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.2-5.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.2-6.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.2-7.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.2-8.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.2-9-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-10.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-11.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-12.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-19.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-5-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-6-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-7-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-8-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-9-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Statements/12.7-1-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Statements/12.8-1-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Statements/12.9-1-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Statements/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Statements/shell.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.3.1-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.3.1-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.3.1-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.3.1-4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.3.2-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.3.2-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.3.2-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.10-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.11-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.11-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.11-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.11-4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.11-5.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.11-6.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.12-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.12-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.12-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.12-4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.12-5.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.2-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.2-2-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.2-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.3-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.3-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.3-3-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.4-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.4-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.4-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.4-4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.5-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.5-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.5-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.5-4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.5-5.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.6-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.6-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.7-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.7-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.8-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.8-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.8-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.9-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/15.5.5.1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/String/shell.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.3-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.3.1-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.3.1-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.3.1-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.4-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.4-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.5-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.6.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.7.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.8.1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.9-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/TypeConversion/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/TypeConversion/shell.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Types/8.1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Types/8.4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Types/8.6.2.1-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Types/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/Types/shell.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/extensions/10.1.4-9.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/extensions/10.1.6.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/extensions/10.1.8-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/extensions/11.6.1-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/extensions/11.6.1-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/extensions/11.6.1-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/extensions/11.6.2-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/extensions/15-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/extensions/15-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/extensions/15.1.2.1-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/extensions/15.2.1.1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/extensions/15.2.3-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/extensions/15.2.4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/extensions/15.3.1.1-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/extensions/15.3.1.1-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/extensions/15.3.2.1-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/extensions/15.3.2.1-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/extensions/15.3.3.1-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/extensions/15.4.3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/extensions/15.5.3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/extensions/15.5.4.2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/extensions/15.5.4.4-4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/extensions/15.5.4.5-6.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/extensions/15.5.4.7-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/extensions/15.6.3.1-5.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/extensions/15.6.3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/extensions/15.6.4-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/extensions/15.7.3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/extensions/15.7.4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/extensions/15.8-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/extensions/15.9.5.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/extensions/8.6.2.1-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/extensions/9.9-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/extensions/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/extensions/shell.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/jsref.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/shell.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma/template.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/boolean-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/boolean-002.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/date-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/date-002.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/date-003.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/date-004.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-002.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-003.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-004.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-005.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-006.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-007.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-008.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-009.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-010-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-011-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-002.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-003.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-004.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-005.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-006.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-007.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-008.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-009.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-010.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-011.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-012.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-013.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-014.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-015.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-016.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-017.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-019.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/function-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/global-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/global-002.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-002.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-003.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-004.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-005.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-006.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-007.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-008.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-009.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-010.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-011.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-012.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-013.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-014.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-015.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-016.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-017.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-018.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-019.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-020.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-021.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-022.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-023.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-024.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-025.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-026.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-027.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-028.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-029.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-030.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-031.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-032.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-033.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-034.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-035.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-036.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-037.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-038.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-039.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-040.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-041.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-042.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-047.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-048.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-049.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-050.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-051.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-052.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-053.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-054.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/number-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/number-002.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/number-003.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/shell.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/statement-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/statement-002.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/statement-003.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/statement-004.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/statement-005.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/statement-006.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/statement-007.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/statement-008.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/statement-009.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/string-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/string-002.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Expressions/StrictEquality-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Expressions/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Expressions/shell.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/FunctionObjects/apply-001-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/FunctionObjects/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/FunctionObjects/call-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/FunctionObjects/shell.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/LexicalConventions/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/LexicalConventions/keywords-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/LexicalConventions/regexp-literals-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/LexicalConventions/regexp-literals-002.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/LexicalConventions/shell.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_2/README delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/RegExp/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/RegExp/constructor-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/RegExp/exec-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/RegExp/exec-002.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/RegExp/function-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/RegExp/hex-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/RegExp/multiline-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/RegExp/octal-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/RegExp/octal-002.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/RegExp/octal-003.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/RegExp/properties-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/RegExp/properties-002.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/RegExp/regexp-enumerate-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/RegExp/regress-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/RegExp/shell.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/RegExp/unicode-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Statements/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Statements/dowhile-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Statements/dowhile-002.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Statements/dowhile-003.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Statements/dowhile-004.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Statements/dowhile-005.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Statements/dowhile-006.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Statements/dowhile-007.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Statements/forin-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Statements/forin-002.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Statements/if-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Statements/label-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Statements/label-002.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Statements/shell.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Statements/switch-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Statements/switch-002.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Statements/switch-003.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Statements/switch-004.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Statements/try-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Statements/try-003.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Statements/try-004.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Statements/try-005.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Statements/try-006.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Statements/try-007.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Statements/try-008.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Statements/try-009.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Statements/try-010.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Statements/try-012.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Statements/while-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Statements/while-002.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Statements/while-003.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/Statements/while-004.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/String/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/String/match-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/String/match-002.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/String/match-003.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/String/match-004.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/String/replace-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/String/shell.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/String/split-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/String/split-002.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/String/split-003.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/extensions/browser.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_2/extensions/constructor-001.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_2/extensions/function-001.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_2/extensions/instanceof-001.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_2/extensions/instanceof-002.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_2/extensions/instanceof-003-n.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_2/extensions/instanceof-004-n.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_2/extensions/instanceof-005-n.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_2/extensions/instanceof-006.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/extensions/shell.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/instanceof/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/instanceof/instanceof-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/instanceof/instanceof-002.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/instanceof/instanceof-003.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/instanceof/regress-7635.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/instanceof/shell.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/jsref.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/shell.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_2/template.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/Array/15.4.4.11-01.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Array/15.4.4.3-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Array/15.4.4.4-001.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/Array/15.4.5.1-01.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Array/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Array/regress-101488.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Array/regress-130451.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/Array/regress-322135-01.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/Array/regress-322135-02.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/Array/regress-322135-03.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/Array/regress-322135-04.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/Array/regress-387501.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/Array/regress-421325.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/Array/regress-430717.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Array/shell.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/Date/15.9.1.2-01.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/Date/15.9.3.2-1.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/Date/15.9.4.3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Date/15.9.5.3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Date/15.9.5.4.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/Date/15.9.5.5-02.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Date/15.9.5.5.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Date/15.9.5.6.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Date/15.9.5.7.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Date/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Date/shell.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Exceptions/15.11.1.1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Exceptions/15.11.4.4-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Exceptions/15.11.7.6-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Exceptions/15.11.7.6-002.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Exceptions/15.11.7.6-003.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Exceptions/binding-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Exceptions/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Exceptions/regress-181654.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Exceptions/regress-181914.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Exceptions/regress-58946.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Exceptions/regress-95101.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Exceptions/shell.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/ExecutionContexts/10.1.3-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/ExecutionContexts/10.1.3-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/ExecutionContexts/10.1.3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/ExecutionContexts/10.1.4-1.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/ExecutionContexts/10.6.1-01.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/ExecutionContexts/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/ExecutionContexts/regress-23346.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/ExecutionContexts/regress-448595-01.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/ExecutionContexts/shell.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/Expressions/11.10-01.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/Expressions/11.10-02.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/Expressions/11.10-03.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Expressions/11.6.1-1.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/Expressions/11.7.1-01.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/Expressions/11.7.2-01.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/Expressions/11.7.3-01.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Expressions/11.9.6-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Expressions/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Expressions/shell.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/FunExpr/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/FunExpr/fe-001-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/FunExpr/fe-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/FunExpr/fe-002.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/FunExpr/shell.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Function/15.3.4.3-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Function/15.3.4.4-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Function/arguments-001.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/Function/arguments-002.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Function/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Function/call-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Function/regress-131964.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Function/regress-137181.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Function/regress-193555.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/Function/regress-313570.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Function/regress-49286.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Function/regress-58274.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Function/regress-85880.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Function/regress-94506.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Function/regress-97921.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Function/scope-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Function/scope-002.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Function/shell.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/LexicalConventions/7.9.1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/LexicalConventions/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/LexicalConventions/shell.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Number/15.7.4.2-01.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Number/15.7.4.3-01.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Number/15.7.4.3-02.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Number/15.7.4.5-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Number/15.7.4.6-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Number/15.7.4.7-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Number/15.7.4.7-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Number/browser.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/Number/regress-442242-01.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Number/shell.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/NumberFormatting/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/NumberFormatting/shell.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/NumberFormatting/tostring-001.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/Object/8.6.1-01.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Object/8.6.2.6-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Object/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Object/class-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Object/class-002.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Object/class-003.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Object/class-004.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Object/class-005.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/Object/regress-361274.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/Object/regress-385393-07.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Object/regress-72773.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Object/regress-79129-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Object/shell.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Operators/11.13.1-001.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/Operators/11.13.1-002.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Operators/11.4.1-001.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/Operators/11.4.1-002.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Operators/browser.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/Operators/order-01.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Operators/shell.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/README delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.2-1.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.2.12.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.3.1-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.3.1-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.4.1-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.4.1-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.4.1-3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.4.1-4.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.4.1-5-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.6.2-1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.6.2-2.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/octal-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/octal-002.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/perlstress-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/perlstress-002.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-100199.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-105972.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-119909.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-122076.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-123437.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-165353.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-169497.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-169534.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-187133.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-188206.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-191479.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-202564.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-209067.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-209919.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-216591.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-220367-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-223273.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-223535.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-224676.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-225289.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-225343.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-24712.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-285219.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-28686.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-289669.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-307456.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-309840.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-311414.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-312351.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-31316.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-330684.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-334158.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-346090.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-367888.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-375642.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-375711.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-375715-01-n.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-375715-02.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-375715-03.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-375715-04.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-57572.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-57631.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-67773.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-72964.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-76683.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-78156.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-85721.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-87231.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-98306.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/RegExp/shell.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Regress/browser.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/Regress/regress-385393-04.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/Regress/regress-419152.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/Regress/regress-420087.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/Regress/regress-420610.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/Regress/regress-441477-01.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Regress/shell.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/Statements/12.6.3.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Statements/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Statements/regress-121744.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Statements/regress-131348.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Statements/regress-157509.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Statements/regress-194364.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Statements/regress-226517.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/Statements/regress-302439.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/Statements/regress-324650.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Statements/regress-74474-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Statements/regress-74474-002.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Statements/regress-74474-003.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Statements/regress-83532-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Statements/regress-83532-002.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Statements/shell.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Statements/switch-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/String/15.5.4.11.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/String/15.5.4.14.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/String/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/String/regress-104375.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/String/regress-189898.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/String/regress-304376.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/String/regress-313567.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/String/regress-392378.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/String/regress-83293.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/String/shell.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Unicode/browser.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/Unicode/regress-352044-01.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/Unicode/regress-352044-02-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Unicode/shell.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Unicode/uc-001-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Unicode/uc-001.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Unicode/uc-002-n.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Unicode/uc-002.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Unicode/uc-003.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Unicode/uc-004.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/Unicode/uc-005.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/browser.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/extensions/10.1.3-2.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/extensions/7.9.1.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/extensions/browser.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/extensions/regress-103087.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/extensions/regress-188206-01.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/extensions/regress-188206-02.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/extensions/regress-220367-002.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/extensions/regress-228087.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/extensions/regress-274152.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/extensions/regress-320854.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/extensions/regress-327170.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/extensions/regress-368516.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/extensions/regress-385393-03.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/extensions/regress-429248.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/extensions/regress-430740.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/extensions/shell.js delete mode 100644 tests/auto/declarative/parserstress/tests/ecma_3/shell.js delete mode 100755 tests/auto/declarative/parserstress/tests/ecma_3/template.js delete mode 100644 tests/auto/declarative/parserstress/tests/shell.js delete mode 100644 tests/auto/declarative/parserstress/tst_parserstress.cpp delete mode 100644 tests/auto/declarative/qdeclarativebinding/data/deletedObject.qml delete mode 100644 tests/auto/declarative/qdeclarativebinding/data/restoreBinding.qml delete mode 100644 tests/auto/declarative/qdeclarativebinding/data/restoreBindingWithLoop.qml delete mode 100644 tests/auto/declarative/qdeclarativebinding/data/test-binding.qml delete mode 100644 tests/auto/declarative/qdeclarativebinding/data/test-binding2.qml delete mode 100644 tests/auto/declarative/qdeclarativebinding/qdeclarativebinding.pro delete mode 100644 tests/auto/declarative/qdeclarativebinding/tst_qdeclarativebinding.cpp delete mode 100644 tests/auto/declarative/qdeclarativechangeset/qdeclarativechangeset.pro delete mode 100644 tests/auto/declarative/qdeclarativechangeset/tst_qdeclarativechangeset.cpp delete mode 100644 tests/auto/declarative/qdeclarativecomponent/data/createObject.qml delete mode 100644 tests/auto/declarative/qdeclarativecomponent/data/createObjectWithScript.qml delete mode 100644 tests/auto/declarative/qdeclarativecomponent/data/incubateObject.qml delete mode 100644 tests/auto/declarative/qdeclarativecomponent/qdeclarativecomponent.pro delete mode 100644 tests/auto/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp delete mode 100644 tests/auto/declarative/qdeclarativeconnection/data/connection-targetchange.qml delete mode 100644 tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-ignored.qml delete mode 100644 tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-notarget.qml delete mode 100644 tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals-parent.qml delete mode 100644 tests/auto/declarative/qdeclarativeconnection/data/connection-unknownsignals.qml delete mode 100644 tests/auto/declarative/qdeclarativeconnection/data/error-object.qml delete mode 100644 tests/auto/declarative/qdeclarativeconnection/data/error-property.qml delete mode 100644 tests/auto/declarative/qdeclarativeconnection/data/error-property2.qml delete mode 100644 tests/auto/declarative/qdeclarativeconnection/data/error-syntax.qml delete mode 100644 tests/auto/declarative/qdeclarativeconnection/data/moduleapi-target.qml delete mode 100644 tests/auto/declarative/qdeclarativeconnection/data/test-connection.qml delete mode 100644 tests/auto/declarative/qdeclarativeconnection/data/test-connection2.qml delete mode 100644 tests/auto/declarative/qdeclarativeconnection/data/test-connection3.qml delete mode 100644 tests/auto/declarative/qdeclarativeconnection/data/trimming.qml delete mode 100644 tests/auto/declarative/qdeclarativeconnection/qdeclarativeconnection.pro delete mode 100644 tests/auto/declarative/qdeclarativeconnection/tst_qdeclarativeconnection.cpp delete mode 100644 tests/auto/declarative/qdeclarativeconsole/data/assert.qml delete mode 100644 tests/auto/declarative/qdeclarativeconsole/data/exception.qml delete mode 100644 tests/auto/declarative/qdeclarativeconsole/data/logging.qml delete mode 100644 tests/auto/declarative/qdeclarativeconsole/data/profiling.qml delete mode 100644 tests/auto/declarative/qdeclarativeconsole/data/tracing.qml delete mode 100644 tests/auto/declarative/qdeclarativeconsole/qdeclarativeconsole.pro delete mode 100644 tests/auto/declarative/qdeclarativeconsole/tst_qdeclarativeconsole.cpp delete mode 100644 tests/auto/declarative/qdeclarativecontext/data/Object_22535.qml delete mode 100644 tests/auto/declarative/qdeclarativecontext/data/RefreshExpressionsType.qml delete mode 100644 tests/auto/declarative/qdeclarativecontext/data/qtbug_22535.qml delete mode 100644 tests/auto/declarative/qdeclarativecontext/data/refreshExpressions.qml delete mode 100644 tests/auto/declarative/qdeclarativecontext/data/refreshExpressionsRootContext.qml delete mode 100644 tests/auto/declarative/qdeclarativecontext/qdeclarativecontext.pro delete mode 100644 tests/auto/declarative/qdeclarativecontext/tst_qdeclarativecontext.cpp delete mode 100644 tests/auto/declarative/qdeclarativecpputils/qdeclarativecpputils.pro delete mode 100644 tests/auto/declarative/qdeclarativecpputils/tst_qdeclarativecpputils.cpp delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsAssignCorrectlyType.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsOverrideTargetType.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/AliasBindingsOverrideTargetType3.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/AliasToCompositeElementType1.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/AliasToCompositeElementType2.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/ConstantsOverrideBindings.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/CustomObject.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/ElementAssignType.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/MethodsObject.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/NestedTypeTransientErrors.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/PropertyVarBaseItem.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/PropertyVarCircularComponent.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/PropertyVarCircularComponent2.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/PropertyVarCircularComponent3.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/PropertyVarCircularComponent4.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/PropertyVarCircularComponent5.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/PropertyVarInheritanceComponent.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/PropertyVarOwnershipComponent.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/ScarceResourceSignalComponentVar.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/ScarceResourceSignalComponentVariant.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/ScarceResourceVarComponent.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/Scope6Nested.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/ScopeObject.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/SequenceConversionComponent.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/SpuriousWarning.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/TypeForDynamicCreation.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsAssignCorrectly.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.2.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.3.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/aliasBindingsOverrideTarget.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/aliasPropertyAndBinding.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/aliasToCompositeElement.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.2.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.3.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/aliasWritesOverrideBindings.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/aliasreset/AliasPropertyComponent.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/aliasreset/aliasPropertyReset.1.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/aliasreset/aliasPropertyReset.2.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/aliasreset/aliasPropertyReset.3.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/aliasreset/aliasPropertyReset.4.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/aliasreset/aliasPropertyReset.5.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/aliasreset/aliasPropertyReset.error.1.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/assignBasicTypes.2.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/assignBasicTypes.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/assignSequenceTypes.1.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/assignSequenceTypes.2.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/assignSequenceTypes.3.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/assignSequenceTypes.4.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/assignSequenceTypes.5.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/assignSequenceTypes.6.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/assignSequenceTypes.7.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/attachedProperty.2.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/attachedProperty.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/attachedPropertyScope.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/automaticSemicolon.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/bindingLoop.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/blank.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/boolPropertiesEvaluateAsBool.1.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/boolPropertiesEvaluateAsBool.2.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/booleanConversion.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/bug.1.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/canAssignNullToQObject.1.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/canAssignNullToQObject.2.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/changeslots/propertyChangeSlotErrors.1.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/changeslots/propertyChangeSlotErrors.2.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/changeslots/propertyChangeSlotErrors.3.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/changeslots/propertyChangeSlotErrors.4.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/changeslots/propertyChangeSlots.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/compiled.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/compositePropertyType.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/constantsOverrideBindings.1.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/constantsOverrideBindings.2.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/constantsOverrideBindings.3.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/constantsOverrideBindings.4.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/declarativeHasOwnProperty.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/declarativeToString.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/deferredProperties.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/deferredPropertiesErrors.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/deleteLater.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/deleteWhileBindingRunning.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/deletedEngine.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/deletedObject.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/doubleEvaluate.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/dynamicCreation.helper.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/dynamicCreation.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/dynamicCreationOwnership.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/dynamicDeletion.2.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/dynamicDeletion.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/dynamicString.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/elementAssign.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/enums.1.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/enums.2.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/eval.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/exception.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/exceptionClearsOnReeval.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/exceptionProducesWarning.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/exceptionProducesWarning2.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/extendedObjectPropertyLookup.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/extendedObjectPropertyLookup2.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/extensionObjects.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/extensionObjectsPropertyOverride.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/forInLoop.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/function.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.1.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.2.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/functionAssignment.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/functionErrors.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/handleReferenceManagement.handle.1.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/handleReferenceManagement.handle.2.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/handleReferenceManagement.object.1.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/handleReferenceManagement.object.2.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.1.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/importScope.1.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/importScope.2.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/importScope.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/in.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/include.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/include.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/include_callback.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/include_callback.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/include_pragma.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/include_pragma_inner.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/include_pragma_outer.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/include_remote.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/include_remote.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/include_remote_missing.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/include_remote_missing.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/include_shared.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/include_shared.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/invokableObjectArg.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/invokableObjectRet.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/js/include2.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/js/include3.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/jsObject.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/jsimport/SpecialRectangleOne.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/jsimport/SpecialRectangleTwo.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/jsimport/importFive.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/jsimport/importFour.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/jsimport/importOne.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/jsimport/importPragmaLibrary.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/jsimport/importPragmaLibraryWithImports.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/jsimport/importPragmaLibraryWithPragmaLibraryImports.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/jsimport/importThree.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/jsimport/importTwo.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/jsimport/importWithNoImports.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/jsimport/testImport.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/jsimport/testImportPragmaLibrary.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/jsimport/testImportPragmaLibraryWithImports.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/jsimport/testImportPragmaLibraryWithPragmaLibraryImports.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/jsimport/testImportScoping.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/jsimport/testModuleImport.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/jsimport/testScriptImport.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/failFive.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/failFour.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/failOne.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/failThree.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/failTwo.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/importOne.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/importPragmaLibrary.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/importWithImports.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/testImportPragmaLibrary.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/testModuleImport.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/testScriptImport.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/libraryScriptAssert.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/libraryScriptAssert.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/listAssignment.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/listProperties.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/listToVariant.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision2.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision3.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevision4.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors2.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/metaobjectRevisionErrors3.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/methods.1.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/methods.2.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/methods.3.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/methods.4.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/methods.5.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/moduleapi/moduleApiMajorVersionFail.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/moduleapi/moduleApiMinorVersionFail.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/moduleapi/qobjectModuleApi.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/moduleapi/qobjectModuleApiCaching.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/moduleapi/qobjectModuleApiEnums.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/moduleapi/qobjectModuleApiWriting.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/moduleapi/scriptModuleApi.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/moduleapi/scriptModuleApiCaching.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/moduleapi/scriptModuleApiWriting.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/multiEngineObject.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/noSpuriousWarningsAtShutdown.2.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/noSpuriousWarningsAtShutdown.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/nonExistentAttachedObject.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/nonNotifyable.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/nonscriptable.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/nullObjectBinding.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/numberAssignment.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/objectConversion.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/objectName.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/objectsCompareAsEqual.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/objectsPassThroughSignals.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/outerBindingOverridesInnerBinding.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/ownership.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/propertyAssignmentErrors.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/propertySplicing.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/propertyVar.1.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/propertyVar.10.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/propertyVar.2.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/propertyVar.3.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/propertyVar.4.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/propertyVar.5.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/propertyVar.6.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/propertyVar.7.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/propertyVar.8.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/propertyVar.9.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/propertyVar.circular.2.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/propertyVar.circular.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/propertyVar.inherit.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/propertyVar.reparent.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/propertyVarCpp.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/propertyVarImplicitOwnership.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/propertyVarOwnership.2.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/propertyVarOwnership.3.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/propertyVarOwnership.3.type.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/propertyVarOwnership.4.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/propertyVarOwnership.4.type1.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/propertyVarOwnership.4.type2.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/propertyVarOwnership.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/qlistqobjectMethods.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/qobjectConnectionListExceptionHandling.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/qobjectDerivedArgument.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/qtbug_10696.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11600.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11600.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11606.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/qtbug_20344.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/qtbug_21580.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/qtbug_21864.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/qtbug_21864.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/qtbug_22464.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/qtbug_22679.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/qtbug_22843.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/qtbug_22843.library.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/qtbug_22843.library.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/qtbug_22843.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/qtbug_9792.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/qtcreatorbug_1289.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/readonlyDeclaration.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/realToInt.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/regExp.2.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/regExp.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/remote_file.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/rewriteMultiLineStrings.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceCopy.var.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceCopy.variant.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceCopyFromJs.var.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceCopyFromJs.variant.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceCopyImport.var.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceCopyImport.var.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceCopyImport.variant.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceCopyImport.variant.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceCopyImportDifferent.var.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceCopyImportDifferent.var.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceCopyImportFail.var.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceCopyImportFail.var.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceCopyImportFail.variant.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceCopyImportFail.variant.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceCopyImportNoBinding.var.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceCopyImportNoBinding.var.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceCopyImportNoBinding.variant.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceCopyImportNoBinding.variant.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceCopyNoBinding.var.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceCopyNoBinding.variant.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceDestroyedCopy.var.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceDestroyedCopy.variant.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceFunction.var.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceFunction.variant.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceFunctionFail.var.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceFunctionFail.variant.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceMultipleDifferentNoBinding.var.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceMultipleDifferentNoBinding.var.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceMultipleSameNoBinding.var.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceMultipleSameNoBinding.var.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceMultipleSameWithBinding.var.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceObjectGc.var.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceSignal.var.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceSignal.variant.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceTest.var.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceTest.var.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceTest.variant.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceTest.variant.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceTestMultiple.var.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceTestMultiple.variant.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceTestPreserve.var.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scarceResourceTestPreserve.variant.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scope.2.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scope.3.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scope.4.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scope.5.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scope.6.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scope.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.1.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.1.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.2.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.2.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.3.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.4.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.5.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.6.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scriptConnect.6.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.1.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.1.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.2.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.3.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scriptDisconnect.4.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scriptErrors.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/scriptErrors.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/selfDeletingBinding.2.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/selfDeletingBinding.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/sequenceConversion.array.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/sequenceConversion.bindings.error.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/sequenceConversion.bindings.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/sequenceConversion.copy.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/sequenceConversion.indexes.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/sequenceConversion.read.error.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/sequenceConversion.read.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/sequenceConversion.threads.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/sequenceConversion.write.error.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/sequenceConversion.write.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/sharedAttachedObject.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/shutdownErrors.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/signalAssignment.1.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/signalAssignment.2.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/signalHandlers.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/signalParameterTypes.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/signalTriggeredBindings.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/signalWithJSValueInVariant.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/signalWithQJSValue.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/signalWithUnknownTypes.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/strictlyEquals.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/stringArg.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/switchStatement.1.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/switchStatement.2.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/switchStatement.3.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/switchStatement.4.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/switchStatement.5.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/switchStatement.6.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/threadScript.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.2.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/tryStatement.1.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/tryStatement.2.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/tryStatement.3.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/tryStatement.4.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/typeOf.js delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/typeOf.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/unaryExpression.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/undefinedResetsProperty.2.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/undefinedResetsProperty.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/urlListProperty.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/urlProperty.1.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/urlProperty.2.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/v8bindingException.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/v8functionException.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/valueTypeFunctions.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/variantsAssignedUndefined.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/withStatement.1.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/writeAttachedProperty.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/writeRemovesBinding.qml delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/qdeclarativeecmascript.pro delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/testtypes.cpp delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/testtypes.h delete mode 100644 tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp delete mode 100644 tests/auto/declarative/qdeclarativeengine/qdeclarativeengine.pro delete mode 100644 tests/auto/declarative/qdeclarativeengine/tst_qdeclarativeengine.cpp delete mode 100644 tests/auto/declarative/qdeclarativeerror/data/test.txt delete mode 100644 tests/auto/declarative/qdeclarativeerror/qdeclarativeerror.pro delete mode 100644 tests/auto/declarative/qdeclarativeerror/tst_qdeclarativeerror.cpp delete mode 100644 tests/auto/declarative/qdeclarativeexpression/data/scriptString.qml delete mode 100644 tests/auto/declarative/qdeclarativeexpression/qdeclarativeexpression.pro delete mode 100644 tests/auto/declarative/qdeclarativeexpression/tst_qdeclarativeexpression.cpp delete mode 100644 tests/auto/declarative/qdeclarativefolderlistmodel/data/basic.qml delete mode 100644 tests/auto/declarative/qdeclarativefolderlistmodel/data/dummy.qml delete mode 100644 tests/auto/declarative/qdeclarativefolderlistmodel/data/resetFiltering.qml delete mode 100644 tests/auto/declarative/qdeclarativefolderlistmodel/data/resetfiltering/innerdir/test2.txt delete mode 100644 tests/auto/declarative/qdeclarativefolderlistmodel/data/resetfiltering/test.txt delete mode 100644 tests/auto/declarative/qdeclarativefolderlistmodel/qdeclarativefolderlistmodel.pro delete mode 100644 tests/auto/declarative/qdeclarativefolderlistmodel/tst_qdeclarativefolderlistmodel.cpp delete mode 100644 tests/auto/declarative/qdeclarativeimageprovider/qdeclarativeimageprovider.pro delete mode 100644 tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp delete mode 100644 tests/auto/declarative/qdeclarativeincubator/data/AsynchronousIfNestedType.qml delete mode 100644 tests/auto/declarative/qdeclarativeincubator/data/asynchronousIfNested.1.qml delete mode 100644 tests/auto/declarative/qdeclarativeincubator/data/asynchronousIfNested.2.qml delete mode 100644 tests/auto/declarative/qdeclarativeincubator/data/asynchronousIfNested.3.qml delete mode 100644 tests/auto/declarative/qdeclarativeincubator/data/chainInCompletion.qml delete mode 100644 tests/auto/declarative/qdeclarativeincubator/data/chainedAsynchronousIfNested.qml delete mode 100644 tests/auto/declarative/qdeclarativeincubator/data/clear.qml delete mode 100644 tests/auto/declarative/qdeclarativeincubator/data/clearDuringCompletion.qml delete mode 100644 tests/auto/declarative/qdeclarativeincubator/data/contextDelete.qml delete mode 100644 tests/auto/declarative/qdeclarativeincubator/data/forceCompletion.qml delete mode 100644 tests/auto/declarative/qdeclarativeincubator/data/nestedComponent.js delete mode 100644 tests/auto/declarative/qdeclarativeincubator/data/nestedComponent.qml delete mode 100644 tests/auto/declarative/qdeclarativeincubator/data/noIncubationController.qml delete mode 100644 tests/auto/declarative/qdeclarativeincubator/data/objectDeleted.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativeincubator/data/objectDeleted.qml delete mode 100644 tests/auto/declarative/qdeclarativeincubator/data/recursiveClear.1.qml delete mode 100644 tests/auto/declarative/qdeclarativeincubator/data/recursiveClear.2.qml delete mode 100644 tests/auto/declarative/qdeclarativeincubator/data/selfDelete.qml delete mode 100644 tests/auto/declarative/qdeclarativeincubator/data/setInitialState.qml delete mode 100644 tests/auto/declarative/qdeclarativeincubator/data/statusChanged.nested.qml delete mode 100644 tests/auto/declarative/qdeclarativeincubator/data/statusChanged.qml delete mode 100644 tests/auto/declarative/qdeclarativeincubator/qdeclarativeincubator.pro delete mode 100644 tests/auto/declarative/qdeclarativeincubator/testtypes.cpp delete mode 100644 tests/auto/declarative/qdeclarativeincubator/testtypes.h delete mode 100644 tests/auto/declarative/qdeclarativeincubator/tst_qdeclarativeincubator.cpp delete mode 100644 tests/auto/declarative/qdeclarativeinfo/data/NestedComponent.qml delete mode 100644 tests/auto/declarative/qdeclarativeinfo/data/NestedObject.qml delete mode 100644 tests/auto/declarative/qdeclarativeinfo/data/nestedQmlObject.qml delete mode 100644 tests/auto/declarative/qdeclarativeinfo/data/qmlObject.qml delete mode 100644 tests/auto/declarative/qdeclarativeinfo/qdeclarativeinfo.pro delete mode 100644 tests/auto/declarative/qdeclarativeinfo/tst_qdeclarativeinfo.cpp delete mode 100644 tests/auto/declarative/qdeclarativeinstruction/qdeclarativeinstruction.pro delete mode 100644 tests/auto/declarative/qdeclarativeinstruction/tst_qdeclarativeinstruction.cpp delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/Alias.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/Alias2.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/Alias3.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/Alias4.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/AliasPropertyChangeSignalsType.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/ComponentComposite.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/CompositeType.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/CompositeType2.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/CompositeType3.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/CompositeType4.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/DontDoubleCallClassBeginItem.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/DynamicPropertiesNestedType.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/HelperAlias.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/I18n.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/I18nType30.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/InlineAssignmentsOverrideBindingsType.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/InlineAssignmentsOverrideBindingsType2.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/LocalLast.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/MyComponent.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/MyCompositeValueSource.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/MyContainerComponent.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/NestedAlias.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/NestedComponentRoot.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/NestedErrorsType.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/OnCompletedType.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/OnDestructionType.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/ReadOnlyType.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/alias.1.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/alias.10.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/alias.11.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/alias.2.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/alias.3.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/alias.4.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/alias.5.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/alias.6.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/alias.7.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/alias.8.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/alias.9.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/aliasPropertiesAndSignals.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/aliasPropertyChangeSignals.2.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/aliasPropertyChangeSignals.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/allowedRevisionOverloads.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/assignBasicTypes.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/assignCompositeToType.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/assignLiteralSignalProperty.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/assignLiteralToVar.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/assignLiteralToVariant.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/assignObjectToSignal.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/assignObjectToVariant.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/assignQmlComponent.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/assignSignal.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/assignToNamespace.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/assignToNamespace.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/assignTypeExtremes.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/assignValueToSignal.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/assignValueToSignal.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/attachedProperties.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/autoComponentCreation.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/autoNotifyConnection.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/component.1.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/component.1.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/component.2.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/component.2.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/component.3.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/component.3.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/component.4.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/component.4.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/component.5.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/component.5.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/component.6.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/component.6.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/component.7.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/component.7.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/component.8.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/component.8.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/component.9.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/component.9.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/componentCompositeType.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/cppnamespace.2.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/cppnamespace.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/crash2.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/customOnProperty.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/customParserIdNotAllowed.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/customParserIdNotAllowed.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/customParserTypes.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/customVariantTypes.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/declaredPropertyValues.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/defaultGrouped.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/defaultGrouped.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/defaultPropertyListOrder.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/destroyedSignal.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/destroyedSignal.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/disallowedRevisionOverloads.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/disallowedRevisionOverloads.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/dontDoubleCallClassBegin.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/doubleSignal.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/doubleSignal.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/duplicateIDs.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/duplicateIDs.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.1.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.1.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.2.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.2.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.3.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.3.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.4.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.4.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.5.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/dynamicMeta.5.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/dynamicObject.1.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/dynamicObjectProperties.2.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/dynamicObjectProperties.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/dynamicProperties.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/dynamicPropertiesNested.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/dynamicSignalsAndSlots.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/empty.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/empty.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/emptySignal.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/emptySignal.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/enumTypes.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/enumTypes.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/failingComponent.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/failingComponentTest.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/fakeDotProperty.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/fakeDotProperty.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/finalOverride.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/finalOverride.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/i18nDeclaredPropertyNames.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/i18nDeclaredPropertyUse.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/i18nNameSpace.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/i18nScript.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/i18nStrings.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/i18nType.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/idProperty.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/importFile.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/importFile.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/importIncorrectCase.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/importJs.1.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/importJs.1.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/importJs.10.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/importJs.10.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/importJs.2.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/importJs.2.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/importJs.3.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/importJs.3.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/importJs.4.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/importJs.4.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/importJs.5.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/importJs.5.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/importJs.6.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/importJs.6.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/importJs.7.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/importJs.7.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/importJs.8.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/importJs.8.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/importJs.9.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/importJs.9.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/importNamespaceConflict.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/importNamespaceConflict.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/importNewerVersion.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/importNewerVersion.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/importNonExist.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/importNonExist.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/importNonExistOlder.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/importNonExistOlder.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/importVersionMissingBuiltIn.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/importVersionMissingBuiltIn.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/importVersionMissingInstalled.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/importVersionMissingInstalled.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/importscript.1.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/importscript.1.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.errors.insensitive.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.errors.sensitive.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/incorrectCaseType.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/inlineAssignmentsOverrideBindings.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/inlineQmlComponents.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/insertedSemicolon.1.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/insertedSemicolon.1.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/interfaceProperty.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/interfaceQList.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.1.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.1.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.10.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.10.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.2.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.2.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.3.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.3.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.4.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.4.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.5.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.5.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.6.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.6.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.7.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.7.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.8.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.8.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.9.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.9.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.1.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.1.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.10.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.10.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.11.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.11.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.12.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.12.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.13.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.13.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.2.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.2.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.3.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.3.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.4.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.4.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.5.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.5.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.6.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.6.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.7.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.7.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.8.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.8.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.9.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAttachedProperty.9.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.1.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.1.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.10.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.10.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.2.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.2.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.3.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.3.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.4.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.4.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.5.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.5.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.6.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.6.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.7.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.7.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.8.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.8.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.9.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidGroupedProperty.9.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidID.2.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidID.2.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidID.3.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidID.3.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidID.4.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidID.4.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidID.5.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidID.5.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidID.6.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidID.6.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidID.7.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidID.7.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidID.8.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidID.8.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidID.9.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidID.9.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidID.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidID.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidImportID.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidImportID.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidOn.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidOn.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidProperty.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidProperty.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidRoot.1.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidRoot.1.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidRoot.2.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidRoot.2.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidRoot.3.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidRoot.3.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidRoot.4.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidRoot.4.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidTypeName.1.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidTypeName.1.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidTypeName.2.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidTypeName.2.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidTypeName.3.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidTypeName.3.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidTypeName.4.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidTypeName.4.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/PureJsModule.1.6/FirstAPI.1.6.js delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/PureJsModule.1.6/FirstAPI.js delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/PureJsModule.1.6/SecondAPI.js delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/PureJsModule.1.6/qmldir delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/PureJsModule/FirstAPI.js delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/PureJsModule/SecondAPI.js delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/PureJsModule/qmldir delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/VersionedOnlyJsModule.9.0/SomeAPI.js delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/VersionedOnlyJsModule.9.0/qmldir delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/InstalledTest.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/InstalledTest2.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/LocalLast.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/PrivateType.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/qmldir delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest0/InstalledTest.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest0/InstalledTest2.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest0/qmldir delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/listAssignment.1.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/listAssignment.1.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/listAssignment.2.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/listAssignment.2.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/listAssignment.3.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/listAssignment.3.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/listItemDeleteSelf.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/listProperties.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/majorVersionIsolation.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/majorVersionIsolation.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.1.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.1.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.2.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.2.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.3.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/metaobjectRevision.3.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/method.1.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/method.1.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/missingObject.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/missingObject.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/missingSignal.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/missingSignal.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/missingValueTypeProperty.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/missingValueTypeProperty.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/multiSet.1.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/multiSet.1.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/multiSet.10.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/multiSet.10.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/multiSet.11.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/multiSet.11.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/multiSet.2.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/multiSet.2.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/multiSet.3.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/multiSet.3.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/multiSet.4.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/multiSet.4.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/multiSet.5.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/multiSet.5.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/multiSet.6.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/multiSet.6.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/multiSet.7.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/multiSet.7.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/multiSet.8.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/multiSet.8.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/multiSet.9.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/multiSet.9.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/nestedComponentRoots.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/nestedErrors.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/nestedErrors.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/noCreation.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/noCreation.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/nonScriptableProperty.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/nonScriptableProperty.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.1.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.1.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.2.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.2.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.3.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.3.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.4.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.4.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.5.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.5.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.6.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.6.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/notAvailable.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/notAvailable.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/nullDotProperty.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/nullDotProperty.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/objectValueTypeProperty.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/objectValueTypeProperty.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/onCompleted.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/onDestruction.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/property.1.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/property.1.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/property.2.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/property.2.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/property.3.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/property.3.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/property.4.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/property.4.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/property.6.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/property.6.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/property.7.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/property.7.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/propertyInit.1.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/propertyInit.2.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/propertyValueSource.2.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/propertyValueSource.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/qmlAttachedPropertiesObjectMethod.1.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/qmlAttachedPropertiesObjectMethod.2.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/qtest/declarative/qmllanguage/LocalInternal.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/qtest/declarative/qmllanguage/Test.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/qtest/declarative/qmllanguage/TestLocal.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/qtest/declarative/qmllanguage/TestNamed.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/qtest/declarative/qmllanguage/TestSubDir.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/qtest/declarative/qmllanguage/UndeclaredLocal.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/qtest/declarative/qmllanguage/WrongTestLocal.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/qtest/declarative/qmllanguage/noqmldir/Test.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/qtest/declarative/qmllanguage/pics/blue.png delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/qtest/declarative/qmllanguage/qmldir delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/qtest/declarative/qmllanguage/subdir/SubTest.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/qtest/declarative/qmllanguage/subdir/qmldir delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/readOnly.1.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/readOnly.1.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/readOnly.2.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/readOnly.2.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/readOnly.3.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/readOnly.3.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/readOnly.4.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/readOnly.4.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/readOnly.5.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/readOnly.5.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/readonly.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/registrationOrder.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/remoteLoadCrash.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/revisions11.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/revisionsbasesub11.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/revisionssub11.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/rootAsQmlComponent.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/scriptString.1.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/scriptString.1.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/scriptString.2.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/scriptString.2.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/scriptString.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/scriptString2.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/scriptString3.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/scriptString4.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/signal.1.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/signal.1.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/signal.2.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/signal.2.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/signal.3.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/signal.3.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/signal.4.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/signal.4.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/simpleBindings.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/simpleContainer.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/simpleObject.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/singularProperty.2.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/singularProperty.2.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/singularProperty.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/singularProperty.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/subdir/Test.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/subdir/subsubdir/SubTest.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/test.js delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/test2.js delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/unregisteredObject.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/unregisteredObject.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/unsupportedProperty.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/unsupportedProperty.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/valueTypes.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/variantNotify.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/versionedbase.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/wrongType.1.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/wrongType.1.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/wrongType.10.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/wrongType.10.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/wrongType.11.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/wrongType.11.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/wrongType.12.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/wrongType.12.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/wrongType.13.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/wrongType.13.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/wrongType.14.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/wrongType.14.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/wrongType.15.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/wrongType.15.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/wrongType.16.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/wrongType.16.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/wrongType.17.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/wrongType.17.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/wrongType.2.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/wrongType.2.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/wrongType.3.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/wrongType.3.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/wrongType.4.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/wrongType.4.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/wrongType.5.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/wrongType.5.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/wrongType.6.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/wrongType.6.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/wrongType.7.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/wrongType.7.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/wrongType.8.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/wrongType.8.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/wrongType.9.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativelanguage/data/wrongType.9.qml delete mode 100644 tests/auto/declarative/qdeclarativelanguage/qdeclarativelanguage.pro delete mode 100644 tests/auto/declarative/qdeclarativelanguage/testtypes.cpp delete mode 100644 tests/auto/declarative/qdeclarativelanguage/testtypes.h delete mode 100644 tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp delete mode 100644 tests/auto/declarative/qdeclarativelistcompositor/qdeclarativelistcompositor.pro delete mode 100644 tests/auto/declarative/qdeclarativelistcompositor/tst_qdeclarativelistcompositor.cpp delete mode 100644 tests/auto/declarative/qdeclarativelistmodel/data/enumerate.qml delete mode 100644 tests/auto/declarative/qdeclarativelistmodel/data/model.qml delete mode 100644 tests/auto/declarative/qdeclarativelistmodel/data/multipleroles.qml delete mode 100644 tests/auto/declarative/qdeclarativelistmodel/data/script.js delete mode 100644 tests/auto/declarative/qdeclarativelistmodel/data/setmodelcachelist.qml delete mode 100644 tests/auto/declarative/qdeclarativelistmodel/data/signalhandlers.qml delete mode 100644 tests/auto/declarative/qdeclarativelistmodel/data/workerremoveelement.js delete mode 100644 tests/auto/declarative/qdeclarativelistmodel/data/workerremoveelement.qml delete mode 100644 tests/auto/declarative/qdeclarativelistmodel/data/workerremovelist.js delete mode 100644 tests/auto/declarative/qdeclarativelistmodel/data/workerremovelist.qml delete mode 100644 tests/auto/declarative/qdeclarativelistmodel/data/workersync.js delete mode 100644 tests/auto/declarative/qdeclarativelistmodel/data/workersync.qml delete mode 100644 tests/auto/declarative/qdeclarativelistmodel/qdeclarativelistmodel.pro delete mode 100644 tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp delete mode 100644 tests/auto/declarative/qdeclarativelistreference/data/MyType.qml delete mode 100644 tests/auto/declarative/qdeclarativelistreference/data/engineTypes.qml delete mode 100644 tests/auto/declarative/qdeclarativelistreference/data/variantToList.qml delete mode 100644 tests/auto/declarative/qdeclarativelistreference/qdeclarativelistreference.pro delete mode 100644 tests/auto/declarative/qdeclarativelistreference/tst_qdeclarativelistreference.cpp delete mode 100644 tests/auto/declarative/qdeclarativelocale/data/date.qml delete mode 100644 tests/auto/declarative/qdeclarativelocale/data/functions.qml delete mode 100644 tests/auto/declarative/qdeclarativelocale/data/localeCompare.qml delete mode 100644 tests/auto/declarative/qdeclarativelocale/data/number.qml delete mode 100644 tests/auto/declarative/qdeclarativelocale/data/properties.qml delete mode 100644 tests/auto/declarative/qdeclarativelocale/qdeclarativelocale.pro delete mode 100644 tests/auto/declarative/qdeclarativelocale/tst_qdeclarativelocale.cpp delete mode 100644 tests/auto/declarative/qdeclarativemetatype/qdeclarativemetatype.pro delete mode 100644 tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/data/implicit1/implicitQmldir.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/data/implicit1/qmldir delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/data/implicit1/temptest.qml delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/data/implicit2/Test.qml delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/data/implicit2/implicitQmldir.2.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/data/implicit2/qmldir delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/data/implicit2/temptest2.qml delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/data/importsMixedQmlCppPlugin.2.qml delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/data/importsMixedQmlCppPlugin.qml delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/data/incorrectCase.qml delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/data/pluginWithQmlFile.qml delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.2.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.2.qml delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.errors.txt delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/data/versionNotInstalled.qml delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/data/works.qml delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/data/works2.qml delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/data/works21.qml delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestPluginWithQmlFile/MyQmlFile.qml delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestPluginWithQmlFile/qmldir delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlMixedPluginType/Foo.qml delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlMixedPluginType/qmldir delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlPluginType.2.1/qmldir delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlPluginType.2/qmldir delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlPluginType/qmldir delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlVersionPluginType/qmldir delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/PureQmlModule/ComponentA.qml delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/PureQmlModule/ComponentB.qml delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/PureQmlModule/qmldir delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/WrongCase/qmldir delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/plugin.2.1/plugin.2.1.pro delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/plugin.2.1/plugin.cpp delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/plugin.2/plugin.2.pro delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/plugin.2/plugin.cpp delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.cpp delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.pro delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/pluginMixed/plugin.cpp delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/pluginMixed/pluginMixed.pro delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/pluginVersion/plugin.cpp delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/pluginVersion/pluginVersion.pro delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/pluginWithQmlFile/plugin.cpp delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/pluginWithQmlFile/pluginWithQmlFile.pro delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/pluginWrongCase/plugin.cpp delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/pluginWrongCase/pluginWrongCase.pro delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/qdeclarativemoduleplugin.pro delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp delete mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.pro delete mode 100644 tests/auto/declarative/qdeclarativeparser/qdeclarativeparser.pro delete mode 100644 tests/auto/declarative/qdeclarativeparser/tst_qdeclarativeparser.cpp delete mode 100644 tests/auto/declarative/qdeclarativepixmapcache/data/dataLeak.qml delete mode 100644 tests/auto/declarative/qdeclarativeproperty/data/NoContextTypeA.qml delete mode 100644 tests/auto/declarative/qdeclarativeproperty/data/NoContextTypeB.qml delete mode 100644 tests/auto/declarative/qdeclarativeproperty/data/TestType.qml delete mode 100644 tests/auto/declarative/qdeclarativeproperty/data/aliasPropertyBindings.qml delete mode 100644 tests/auto/declarative/qdeclarativeproperty/data/assignEmptyVariantMap.qml delete mode 100644 tests/auto/declarative/qdeclarativeproperty/data/readSynthesizedObject.qml delete mode 100644 tests/auto/declarative/qdeclarativeproperty/qdeclarativeproperty.pro delete mode 100644 tests/auto/declarative/qdeclarativeproperty/tst_qdeclarativeproperty.cpp delete mode 100644 tests/auto/declarative/qdeclarativepropertycache/qdeclarativepropertycache.pro delete mode 100644 tests/auto/declarative/qdeclarativepropertycache/tst_qdeclarativepropertycache.cpp delete mode 100644 tests/auto/declarative/qdeclarativepropertymap/qdeclarativepropertymap.pro delete mode 100644 tests/auto/declarative/qdeclarativepropertymap/tst_qdeclarativepropertymap.cpp delete mode 100644 tests/auto/declarative/qdeclarativeqt/data/atob.qml delete mode 100644 tests/auto/declarative/qdeclarativeqt/data/btoa.qml delete mode 100644 tests/auto/declarative/qdeclarativeqt/data/createComponent.qml delete mode 100644 tests/auto/declarative/qdeclarativeqt/data/createComponentData.qml delete mode 100644 tests/auto/declarative/qdeclarativeqt/data/createComponent_lib.js delete mode 100644 tests/auto/declarative/qdeclarativeqt/data/createComponent_lib.qml delete mode 100644 tests/auto/declarative/qdeclarativeqt/data/createQmlObject.qml delete mode 100644 tests/auto/declarative/qdeclarativeqt/data/darker.qml delete mode 100644 tests/auto/declarative/qdeclarativeqt/data/dateTimeConversion.qml delete mode 100644 tests/auto/declarative/qdeclarativeqt/data/enums.qml delete mode 100644 tests/auto/declarative/qdeclarativeqt/data/fontFamilies.qml delete mode 100644 tests/auto/declarative/qdeclarativeqt/data/formatting.qml delete mode 100644 tests/auto/declarative/qdeclarativeqt/data/hsla.qml delete mode 100644 tests/auto/declarative/qdeclarativeqt/data/isQtObject.qml delete mode 100644 tests/auto/declarative/qdeclarativeqt/data/lighter.qml delete mode 100644 tests/auto/declarative/qdeclarativeqt/data/md5.qml delete mode 100644 tests/auto/declarative/qdeclarativeqt/data/openUrlExternally.qml delete mode 100644 tests/auto/declarative/qdeclarativeqt/data/openUrlExternally_lib.js delete mode 100644 tests/auto/declarative/qdeclarativeqt/data/openUrlExternally_lib.qml delete mode 100644 tests/auto/declarative/qdeclarativeqt/data/point.qml delete mode 100644 tests/auto/declarative/qdeclarativeqt/data/quit.qml delete mode 100644 tests/auto/declarative/qdeclarativeqt/data/rect.qml delete mode 100644 tests/auto/declarative/qdeclarativeqt/data/resolvedUrl.qml delete mode 100644 tests/auto/declarative/qdeclarativeqt/data/rgba.qml delete mode 100644 tests/auto/declarative/qdeclarativeqt/data/size.qml delete mode 100644 tests/auto/declarative/qdeclarativeqt/data/tint.qml delete mode 100644 tests/auto/declarative/qdeclarativeqt/data/vector.qml delete mode 100644 tests/auto/declarative/qdeclarativeqt/data/vector4.qml delete mode 100644 tests/auto/declarative/qdeclarativeqt/qdeclarativeqt.pro delete mode 100644 tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp delete mode 100644 tests/auto/declarative/qdeclarativesqldatabase/data/README delete mode 100644 tests/auto/declarative/qdeclarativesqldatabase/data/changeversion.js delete mode 100644 tests/auto/declarative/qdeclarativesqldatabase/data/creation-a.js delete mode 100644 tests/auto/declarative/qdeclarativesqldatabase/data/creation.js delete mode 100644 tests/auto/declarative/qdeclarativesqldatabase/data/error-a.js delete mode 100644 tests/auto/declarative/qdeclarativesqldatabase/data/error-b.js delete mode 100644 tests/auto/declarative/qdeclarativesqldatabase/data/error-creation.js delete mode 100644 tests/auto/declarative/qdeclarativesqldatabase/data/error-notransaction.js delete mode 100644 tests/auto/declarative/qdeclarativesqldatabase/data/error-outsidetransaction.js delete mode 100644 tests/auto/declarative/qdeclarativesqldatabase/data/iteration-forwardonly.js delete mode 100644 tests/auto/declarative/qdeclarativesqldatabase/data/iteration.js delete mode 100644 tests/auto/declarative/qdeclarativesqldatabase/data/readonly-error.js delete mode 100644 tests/auto/declarative/qdeclarativesqldatabase/data/readonly.js delete mode 100644 tests/auto/declarative/qdeclarativesqldatabase/data/reopen1.js delete mode 100644 tests/auto/declarative/qdeclarativesqldatabase/data/reopen2.js delete mode 100644 tests/auto/declarative/qdeclarativesqldatabase/data/selection-bindnames.js delete mode 100644 tests/auto/declarative/qdeclarativesqldatabase/data/selection.js delete mode 100644 tests/auto/declarative/qdeclarativesqldatabase/qdeclarativesqldatabase.pro delete mode 100644 tests/auto/declarative/qdeclarativesqldatabase/tst_qdeclarativesqldatabase.cpp delete mode 100644 tests/auto/declarative/qdeclarativetranslation/data/idtranslation.qml delete mode 100644 tests/auto/declarative/qdeclarativetranslation/data/qml_fr.qm delete mode 100644 tests/auto/declarative/qdeclarativetranslation/data/qml_fr.ts delete mode 100644 tests/auto/declarative/qdeclarativetranslation/data/qmlid_fr.qm delete mode 100644 tests/auto/declarative/qdeclarativetranslation/data/qmlid_fr.ts delete mode 100644 tests/auto/declarative/qdeclarativetranslation/data/translation.qml delete mode 100644 tests/auto/declarative/qdeclarativetranslation/data/translation.qrc delete mode 100644 tests/auto/declarative/qdeclarativetranslation/qdeclarativetranslation.pro delete mode 100644 tests/auto/declarative/qdeclarativetranslation/tst_qdeclarativetranslation.cpp delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/BindingsSpliceCorrectlyType.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/BindingsSpliceCorrectlyType4.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/BindingsSpliceCorrectlyType5.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/autoBindingRemoval.2.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/autoBindingRemoval.3.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/autoBindingRemoval.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/bindingAssignment.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/bindingConflict.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/bindingRead.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/bindingVariantCopy.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.1.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.2.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.3.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.4.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/bindingsSpliceCorrectly.5.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/color_compare.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/color_read.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/color_write.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.1.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.2.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/conflicting.3.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/deletedObject.js delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/deletedObject.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/enums.1.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/enums.2.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/enums.3.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/enums.4.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/enums.5.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/font_compare.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/font_read.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/font_write.2.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/font_write.3.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/font_write.4.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/font_write.5.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/font_write.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/matrix4x4_compare.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/matrix4x4_read.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/matrix4x4_write.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/point_compare.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/point_read.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/point_write.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/pointf_compare.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/pointf_read.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/pointf_write.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/quaternion_compare.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/quaternion_read.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/quaternion_write.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/rect_compare.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/rect_read.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/rect_write.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/rectf_compare.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/rectf_read.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/rectf_write.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/returnValues.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/scriptAccess.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/scriptVariantCopy.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/size_compare.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/size_read.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/size_write.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/sizef_compare.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/sizef_read.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/sizef_write.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/sizereadonly_read.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/sizereadonly_writeerror.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/sizereadonly_writeerror2.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/sizereadonly_writeerror3.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/sizereadonly_writeerror4.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/staticAssignment.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/valueInterceptors.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/valueSources.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/varAssignment.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/variant_read.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/vector2d_compare.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/vector2d_read.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/vector2d_write.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/vector3d_compare.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/vector3d_read.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/vector3d_write.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/vector4d_compare.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/vector4d_read.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/data/vector4d_write.qml delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/qdeclarativevaluetypes.pro delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/testtypes.cpp delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/testtypes.h delete mode 100644 tests/auto/declarative/qdeclarativevaluetypes/tst_qdeclarativevaluetypes.cpp delete mode 100644 tests/auto/declarative/qdeclarativeworkerscript/data/BaseWorker.qml delete mode 100644 tests/auto/declarative/qdeclarativeworkerscript/data/Global.js delete mode 100644 tests/auto/declarative/qdeclarativeworkerscript/data/externalObjectWorker.qml delete mode 100644 tests/auto/declarative/qdeclarativeworkerscript/data/script.js delete mode 100644 tests/auto/declarative/qdeclarativeworkerscript/data/script_error_onCall.js delete mode 100644 tests/auto/declarative/qdeclarativeworkerscript/data/script_error_onLoad.js delete mode 100644 tests/auto/declarative/qdeclarativeworkerscript/data/script_fixed_return.js delete mode 100644 tests/auto/declarative/qdeclarativeworkerscript/data/script_include.js delete mode 100644 tests/auto/declarative/qdeclarativeworkerscript/data/script_pragma.js delete mode 100644 tests/auto/declarative/qdeclarativeworkerscript/data/stressDispose.js delete mode 100644 tests/auto/declarative/qdeclarativeworkerscript/data/stressDispose.qml delete mode 100644 tests/auto/declarative/qdeclarativeworkerscript/data/worker.qml delete mode 100644 tests/auto/declarative/qdeclarativeworkerscript/data/worker_error_onCall.qml delete mode 100644 tests/auto/declarative/qdeclarativeworkerscript/data/worker_error_onLoad.qml delete mode 100644 tests/auto/declarative/qdeclarativeworkerscript/data/worker_include.qml delete mode 100644 tests/auto/declarative/qdeclarativeworkerscript/data/worker_pragma.qml delete mode 100644 tests/auto/declarative/qdeclarativeworkerscript/qdeclarativeworkerscript.pro delete mode 100644 tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.expect delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/abort.reply delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_opened.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/abort_unsent.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/attr.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/attr.xml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/callbackException.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/cdata.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/cdata.xml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/constructor.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/defaultState.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/document.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/document.xml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/domExceptionCodes.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/element.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/element.xml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_args.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_sent.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/getAllResponseHeaders_unsent.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.expect delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader.reply delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_args.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_sent.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/getResponseHeader_unsent.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/instanceStateValues.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/invalidMethodUsage.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/open.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/open_arg_count.1.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/open_arg_count.2.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/open_invalid_method.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/open_network.expect delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/open_network.reply delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/open_network.wait delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/open_sync.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/open_user.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/open_username.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/redirectError.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/redirectRecur.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/redirects.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/redirecttarget.html delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/responseText.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/responseXML_invalid.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/seconddocument.html delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/send_alreadySent.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.expect delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.1.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.2.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.3.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.expect delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.4.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.5.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.expect delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.6.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.7.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/send_data.reply delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData.reply delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData_DELETE.expect delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData_GET.expect delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/send_ignoreData_HEAD.expect delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/send_unsent.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.expect delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader.reply delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_args.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_caseInsensitive.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_illegalName.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_sent.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/setRequestHeader_unsent.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/staticStateValues.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/status.200.reply delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/status.400.reply delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/status.404.reply delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/status.expect delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/status.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/statusText.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/testdocument.html delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/text.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/text.xml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/utf16.html delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/utf16.qml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/data/utf16.xml delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/qdeclarativexmlhttprequest.pro delete mode 100644 tests/auto/declarative/qdeclarativexmlhttprequest/tst_qdeclarativexmlhttprequest.cpp delete mode 100644 tests/auto/declarative/qjsengine/qjsengine.pro delete mode 100644 tests/auto/declarative/qjsengine/script/com/__init__.js delete mode 100644 tests/auto/declarative/qjsengine/script/com/trolltech/__init__.js delete mode 100644 tests/auto/declarative/qjsengine/script/com/trolltech/recursive/__init__.js delete mode 100644 tests/auto/declarative/qjsengine/script/com/trolltech/syntaxerror/__init__.js delete mode 100644 tests/auto/declarative/qjsengine/tst_qjsengine.cpp delete mode 100644 tests/auto/declarative/qjsvalue/qjsvalue.pro delete mode 100644 tests/auto/declarative/qjsvalue/tst_qjsvalue.cpp delete mode 100644 tests/auto/declarative/qjsvalue/tst_qjsvalue.h delete mode 100644 tests/auto/declarative/qjsvalueiterator/qjsvalueiterator.pro delete mode 100644 tests/auto/declarative/qjsvalueiterator/tst_qjsvalueiterator.cpp delete mode 100644 tests/auto/declarative/qmlmin/qmlmin.pro delete mode 100644 tests/auto/declarative/qmlmin/tst_qmlmin.cpp delete mode 100644 tests/auto/declarative/qmlplugindump/qmlplugindump.pro delete mode 100644 tests/auto/declarative/qmlplugindump/tst_qmlplugindump.cpp delete mode 100755 tests/auto/declarative/runall.sh delete mode 100644 tests/auto/declarative/v4/data/conditionalExpr.qml delete mode 100644 tests/auto/declarative/v4/data/doubleBoolJump.qml delete mode 100644 tests/auto/declarative/v4/data/fetchException.qml delete mode 100644 tests/auto/declarative/v4/data/logicalOr.2.qml delete mode 100644 tests/auto/declarative/v4/data/logicalOr.qml delete mode 100644 tests/auto/declarative/v4/data/nestedLogicalOr.qml delete mode 100644 tests/auto/declarative/v4/data/nestedObjectAccess.qml delete mode 100644 tests/auto/declarative/v4/data/nullQObject.qml delete mode 100644 tests/auto/declarative/v4/data/qrealToIntRounding.qml delete mode 100644 tests/auto/declarative/v4/data/qtbug_21883.qml delete mode 100644 tests/auto/declarative/v4/data/qtbug_22816.qml delete mode 100644 tests/auto/declarative/v4/data/stringComparison.qml delete mode 100644 tests/auto/declarative/v4/data/subscriptionsInConditionalExpressions.qml delete mode 100644 tests/auto/declarative/v4/data/unaryMinus.qml delete mode 100644 tests/auto/declarative/v4/data/unaryPlus.qml delete mode 100644 tests/auto/declarative/v4/data/unnecessaryReeval.qml delete mode 100644 tests/auto/declarative/v4/testtypes.cpp delete mode 100644 tests/auto/declarative/v4/testtypes.h delete mode 100644 tests/auto/declarative/v4/tst_v4.cpp delete mode 100644 tests/auto/declarative/v4/v4.pro (limited to 'tests/auto/declarative') diff --git a/tests/auto/declarative/animation/animation.pro b/tests/auto/declarative/animation/animation.pro deleted file mode 100644 index a9c0cee309..0000000000 --- a/tests/auto/declarative/animation/animation.pro +++ /dev/null @@ -1,7 +0,0 @@ -TEMPLATE=subdirs -SUBDIRS=\ - qabstractanimationjob \ - qanimationgroupjob \ - qparallelanimationgroupjob \ - qpauseanimationjob \ - qsequentialanimationgroupjob diff --git a/tests/auto/declarative/animation/qabstractanimationjob/qabstractanimationjob.pro b/tests/auto/declarative/animation/qabstractanimationjob/qabstractanimationjob.pro deleted file mode 100644 index db8649bbb9..0000000000 --- a/tests/auto/declarative/animation/qabstractanimationjob/qabstractanimationjob.pro +++ /dev/null @@ -1,5 +0,0 @@ -CONFIG += testcase parallel_test -macx:CONFIG -= app_bundle -TARGET = tst_qabstractanimationjob -QT = core-private declarative-private testlib -SOURCES = tst_qabstractanimationjob.cpp diff --git a/tests/auto/declarative/animation/qabstractanimationjob/tst_qabstractanimationjob.cpp b/tests/auto/declarative/animation/qabstractanimationjob/tst_qabstractanimationjob.cpp deleted file mode 100644 index 772605d494..0000000000 --- a/tests/auto/declarative/animation/qabstractanimationjob/tst_qabstractanimationjob.cpp +++ /dev/null @@ -1,229 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -#include -#include -#include - -class tst_QAbstractAnimationJob : public QObject -{ - Q_OBJECT -private slots: - void construction(); - void destruction(); - void currentLoop(); - void currentLoopTime(); - void currentTime(); - void direction(); - void group(); - void loopCount(); - void state(); - void totalDuration(); - void avoidJumpAtStart(); - void avoidJumpAtStartWithStop(); - void avoidJumpAtStartWithRunning(); -}; - -class TestableQAbstractAnimation : public QAbstractAnimationJob -{ -public: - TestableQAbstractAnimation() : m_duration(10) {} - virtual ~TestableQAbstractAnimation() {}; - - int duration() const { return m_duration; } - virtual void updateCurrentTime(int) {} - - void setDuration(int duration) { m_duration = duration; } -private: - int m_duration; -}; - -class DummyQAnimationGroup : public QAnimationGroupJob -{ -public: - int duration() const { return 10; } - virtual void updateCurrentTime(int) {} -}; - -void tst_QAbstractAnimationJob::construction() -{ - TestableQAbstractAnimation anim; -} - -void tst_QAbstractAnimationJob::destruction() -{ - TestableQAbstractAnimation *anim = new TestableQAbstractAnimation; - delete anim; -} - -void tst_QAbstractAnimationJob::currentLoop() -{ - TestableQAbstractAnimation anim; - QCOMPARE(anim.currentLoop(), 0); -} - -void tst_QAbstractAnimationJob::currentLoopTime() -{ - TestableQAbstractAnimation anim; - QCOMPARE(anim.currentLoopTime(), 0); -} - -void tst_QAbstractAnimationJob::currentTime() -{ - TestableQAbstractAnimation anim; - QCOMPARE(anim.currentTime(), 0); - anim.setCurrentTime(10); - QCOMPARE(anim.currentTime(), 10); -} - -void tst_QAbstractAnimationJob::direction() -{ - TestableQAbstractAnimation anim; - QCOMPARE(anim.direction(), QAbstractAnimationJob::Forward); - anim.setDirection(QAbstractAnimationJob::Backward); - QCOMPARE(anim.direction(), QAbstractAnimationJob::Backward); - anim.setDirection(QAbstractAnimationJob::Forward); - QCOMPARE(anim.direction(), QAbstractAnimationJob::Forward); -} - -void tst_QAbstractAnimationJob::group() -{ - TestableQAbstractAnimation *anim = new TestableQAbstractAnimation; - DummyQAnimationGroup group; - group.appendAnimation(anim); - QCOMPARE(anim->group(), &group); -} - -void tst_QAbstractAnimationJob::loopCount() -{ - TestableQAbstractAnimation anim; - QCOMPARE(anim.loopCount(), 1); - anim.setLoopCount(10); - QCOMPARE(anim.loopCount(), 10); -} - -void tst_QAbstractAnimationJob::state() -{ - TestableQAbstractAnimation anim; - QCOMPARE(anim.state(), QAbstractAnimationJob::Stopped); -} - -void tst_QAbstractAnimationJob::totalDuration() -{ - TestableQAbstractAnimation anim; - QCOMPARE(anim.duration(), 10); - anim.setLoopCount(5); - QCOMPARE(anim.totalDuration(), 50); -} - -void tst_QAbstractAnimationJob::avoidJumpAtStart() -{ - TestableQAbstractAnimation anim; - anim.setDuration(1000); - - /* - the timer shouldn't actually start until we hit the event loop, - so the sleep should have no effect - */ - anim.start(); - QTest::qSleep(300); - QCoreApplication::processEvents(); - QVERIFY(anim.currentTime() < 50); -} - -void tst_QAbstractAnimationJob::avoidJumpAtStartWithStop() -{ - TestableQAbstractAnimation anim; - anim.setDuration(1000); - - TestableQAbstractAnimation anim2; - anim2.setDuration(1000); - - TestableQAbstractAnimation anim3; - anim3.setDuration(1000); - - anim.start(); - QTest::qWait(300); - anim.stop(); - - /* - same test as avoidJumpAtStart, but after there is a - running animation that is stopped - */ - anim2.start(); - QTest::qSleep(300); - anim3.start(); - QCoreApplication::processEvents(); - QVERIFY(anim2.currentTime() < 50); - QVERIFY(anim3.currentTime() < 50); -} - -void tst_QAbstractAnimationJob::avoidJumpAtStartWithRunning() -{ - TestableQAbstractAnimation anim; - anim.setDuration(2000); - - TestableQAbstractAnimation anim2; - anim2.setDuration(1000); - - TestableQAbstractAnimation anim3; - anim3.setDuration(1000); - - anim.start(); - QTest::qWait(300); //make sure timer has started - - /* - same test as avoidJumpAtStart, but with an - existing running animation - */ - anim2.start(); - QTest::qSleep(300); //force large delta for next tick - anim3.start(); - QCoreApplication::processEvents(); - QVERIFY(anim2.currentTime() < 50); - QVERIFY(anim3.currentTime() < 50); -} - - -QTEST_MAIN(tst_QAbstractAnimationJob) - -#include "tst_qabstractanimationjob.moc" diff --git a/tests/auto/declarative/animation/qanimationgroupjob/qanimationgroupjob.pro b/tests/auto/declarative/animation/qanimationgroupjob/qanimationgroupjob.pro deleted file mode 100644 index b9c9d2921d..0000000000 --- a/tests/auto/declarative/animation/qanimationgroupjob/qanimationgroupjob.pro +++ /dev/null @@ -1,5 +0,0 @@ -CONFIG += testcase parallel_test -macx:CONFIG -= app_bundle -TARGET = tst_qanimationgroupjob -QT = core-private declarative-private testlib -SOURCES = tst_qanimationgroupjob.cpp diff --git a/tests/auto/declarative/animation/qanimationgroupjob/tst_qanimationgroupjob.cpp b/tests/auto/declarative/animation/qanimationgroupjob/tst_qanimationgroupjob.cpp deleted file mode 100644 index 2bb974af7d..0000000000 --- a/tests/auto/declarative/animation/qanimationgroupjob/tst_qanimationgroupjob.cpp +++ /dev/null @@ -1,310 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -#include -#include -#include - -Q_DECLARE_METATYPE(QAbstractAnimationJob::State) - -class tst_QAnimationGroupJob : public QObject -{ - Q_OBJECT -public Q_SLOTS: - void initTestCase(); - -private slots: - void construction(); - void emptyGroup(); - void setCurrentTime(); - void addChildTwice(); -}; - -void tst_QAnimationGroupJob::initTestCase() -{ - qRegisterMetaType("QAbstractAnimationJob::State"); -} - -void tst_QAnimationGroupJob::construction() -{ - QSequentialAnimationGroupJob animationgroup; -} - -class TestableGenericAnimation : public QAbstractAnimationJob -{ -public: - TestableGenericAnimation(int duration = 250) : m_duration(duration) {} - int duration() const { return m_duration; } - -private: - int m_duration; -}; - -class UncontrolledAnimation : public QObject, public QAbstractAnimationJob -{ - Q_OBJECT -public: - UncontrolledAnimation() - : id(0) - { - } - - int duration() const { return -1; /* not time driven */ } - -protected: - void timerEvent(QTimerEvent *event) - { - if (event->timerId() == id) - stop(); - } - - void updateRunning(bool running) - { - if (running) { - id = startTimer(500); - } else { - killTimer(id); - id = 0; - } - } - -private: - int id; -}; - -class StateChangeListener: public QAnimationJobChangeListener -{ -public: - virtual void animationStateChanged(QAbstractAnimationJob *, QAbstractAnimationJob::State newState, QAbstractAnimationJob::State) - { - states << newState; - } - - int count() - { - return states.count(); - } - - QList states; -}; - -void tst_QAnimationGroupJob::emptyGroup() -{ - QSequentialAnimationGroupJob group; - StateChangeListener groupStateChangedSpy; - group.addAnimationChangeListener(&groupStateChangedSpy, QAbstractAnimationJob::StateChange); - - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - group.start(); - - QCOMPARE(groupStateChangedSpy.count(), 2); - - QCOMPARE(groupStateChangedSpy.states.at(0), QAnimationGroupJob::Running); - QCOMPARE(groupStateChangedSpy.states.at(1), QAnimationGroupJob::Stopped); - - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - - QTest::ignoreMessage(QtWarningMsg, "QAbstractAnimationJob::pause: Cannot pause a stopped animation"); - group.pause(); - - QCOMPARE(groupStateChangedSpy.count(), 2); - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - - group.start(); - - QCOMPARE(groupStateChangedSpy.states.at(2), - QAnimationGroupJob::Running); - QCOMPARE(groupStateChangedSpy.states.at(3), - QAnimationGroupJob::Stopped); - - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - - group.stop(); - - QCOMPARE(groupStateChangedSpy.count(), 4); - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); -} - -void tst_QAnimationGroupJob::setCurrentTime() -{ - // was originally sequence operating on same object/property - QSequentialAnimationGroupJob *sequence = new QSequentialAnimationGroupJob(); - QAbstractAnimationJob *a1_s_o1 = new TestableGenericAnimation; - QAbstractAnimationJob *a2_s_o1 = new TestableGenericAnimation; - QAbstractAnimationJob *a3_s_o1 = new TestableGenericAnimation; - a2_s_o1->setLoopCount(3); - sequence->appendAnimation(a1_s_o1); - sequence->appendAnimation(a2_s_o1); - sequence->appendAnimation(a3_s_o1); - - // was originally sequence operating on different object/properties - QAnimationGroupJob *sequence2 = new QSequentialAnimationGroupJob(); - QAbstractAnimationJob *a1_s_o2 = new TestableGenericAnimation; - QAbstractAnimationJob *a1_s_o3 = new TestableGenericAnimation; - sequence2->appendAnimation(a1_s_o2); - sequence2->appendAnimation(a1_s_o3); - - // was originally parallel operating on different object/properties - QAnimationGroupJob *parallel = new QParallelAnimationGroupJob(); - QAbstractAnimationJob *a1_p_o1 = new TestableGenericAnimation; - QAbstractAnimationJob *a1_p_o2 = new TestableGenericAnimation; - QAbstractAnimationJob *a1_p_o3 = new TestableGenericAnimation; - a1_p_o2->setLoopCount(3); - parallel->appendAnimation(a1_p_o1); - parallel->appendAnimation(a1_p_o2); - parallel->appendAnimation(a1_p_o3); - - QAbstractAnimationJob *notTimeDriven = new UncontrolledAnimation; - QCOMPARE(notTimeDriven->totalDuration(), -1); - - QAbstractAnimationJob *loopsForever = new TestableGenericAnimation; - loopsForever->setLoopCount(-1); - QCOMPARE(loopsForever->totalDuration(), -1); - - QParallelAnimationGroupJob group; - group.appendAnimation(sequence); - group.appendAnimation(sequence2); - group.appendAnimation(parallel); - group.appendAnimation(notTimeDriven); - group.appendAnimation(loopsForever); - - // Current time = 1 - group.setCurrentTime(1); - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE(sequence->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a1_s_o1->state(), QAnimationGroupJob::Stopped); - QCOMPARE(sequence2->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a1_s_o2->state(), QAnimationGroupJob::Stopped); - QCOMPARE(parallel->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a1_p_o1->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a1_p_o2->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a1_p_o3->state(), QAnimationGroupJob::Stopped); - QCOMPARE(notTimeDriven->state(), QAnimationGroupJob::Stopped); - QCOMPARE(loopsForever->state(), QAnimationGroupJob::Stopped); - - QCOMPARE(group.currentLoopTime(), 1); - QCOMPARE(sequence->currentLoopTime(), 1); - QCOMPARE(a1_s_o1->currentLoopTime(), 1); - QCOMPARE(a2_s_o1->currentLoopTime(), 0); - QCOMPARE(a3_s_o1->currentLoopTime(), 0); - QCOMPARE(a1_s_o2->currentLoopTime(), 1); - QCOMPARE(a1_s_o3->currentLoopTime(), 0); - QCOMPARE(a1_p_o1->currentLoopTime(), 1); - QCOMPARE(a1_p_o2->currentLoopTime(), 1); - QCOMPARE(a1_p_o3->currentLoopTime(), 1); - QCOMPARE(notTimeDriven->currentLoopTime(), 1); - QCOMPARE(loopsForever->currentLoopTime(), 1); - - // Current time = 250 - group.setCurrentTime(250); - QCOMPARE(group.currentLoopTime(), 250); - QCOMPARE(sequence->currentLoopTime(), 250); - QCOMPARE(a1_s_o1->currentLoopTime(), 250); - QCOMPARE(a2_s_o1->currentLoopTime(), 0); - QCOMPARE(a3_s_o1->currentLoopTime(), 0); - QCOMPARE(a1_s_o2->currentLoopTime(), 250); - QCOMPARE(a1_s_o3->currentLoopTime(), 0); - QCOMPARE(a1_p_o1->currentLoopTime(), 250); - QCOMPARE(a1_p_o2->currentLoopTime(), 0); - QCOMPARE(a1_p_o2->currentLoop(), 1); - QCOMPARE(a1_p_o3->currentLoopTime(), 250); - QCOMPARE(notTimeDriven->currentLoopTime(), 250); - QCOMPARE(loopsForever->currentLoopTime(), 0); - QCOMPARE(loopsForever->currentLoop(), 1); - QCOMPARE(sequence->currentAnimation(), a2_s_o1); - - // Current time = 251 - group.setCurrentTime(251); - QCOMPARE(group.currentLoopTime(), 251); - QCOMPARE(sequence->currentLoopTime(), 251); - QCOMPARE(a1_s_o1->currentLoopTime(), 250); - QCOMPARE(a2_s_o1->currentLoopTime(), 1); - QCOMPARE(a2_s_o1->currentLoop(), 0); - QCOMPARE(a3_s_o1->currentLoopTime(), 0); - QCOMPARE(sequence2->currentLoopTime(), 251); - QCOMPARE(a1_s_o2->currentLoopTime(), 250); - QCOMPARE(a1_s_o3->currentLoopTime(), 1); - QCOMPARE(a1_p_o1->currentLoopTime(), 250); - QCOMPARE(a1_p_o2->currentLoopTime(), 1); - QCOMPARE(a1_p_o2->currentLoop(), 1); - QCOMPARE(a1_p_o3->currentLoopTime(), 250); - QCOMPARE(notTimeDriven->currentLoopTime(), 251); - QCOMPARE(loopsForever->currentLoopTime(), 1); - QCOMPARE(sequence->currentAnimation(), a2_s_o1); -} - -void tst_QAnimationGroupJob::addChildTwice() -{ - QAbstractAnimationJob *subGroup; - QAbstractAnimationJob *subGroup2; - QAnimationGroupJob *parent = new QSequentialAnimationGroupJob(); - - subGroup = new QAbstractAnimationJob; - parent->appendAnimation(subGroup); - parent->appendAnimation(subGroup); - QVERIFY(parent->firstChild() && !parent->firstChild()->nextSibling()); - - parent->clear(); - - QVERIFY(!parent->firstChild()); - - // adding the same item twice to a group will remove the item from its current position - // and append it to the end - subGroup = new QAbstractAnimationJob; - parent->appendAnimation(subGroup); - subGroup2 = new QAbstractAnimationJob; - parent->appendAnimation(subGroup2); - - QCOMPARE(parent->firstChild(), subGroup); - QCOMPARE(parent->lastChild(), subGroup2); - - parent->appendAnimation(subGroup); - - QCOMPARE(parent->firstChild(), subGroup2); - QCOMPARE(parent->lastChild(), subGroup); - - delete parent; -} - -QTEST_MAIN(tst_QAnimationGroupJob) -#include "tst_qanimationgroupjob.moc" diff --git a/tests/auto/declarative/animation/qparallelanimationgroupjob/qparallelanimationgroupjob.pro b/tests/auto/declarative/animation/qparallelanimationgroupjob/qparallelanimationgroupjob.pro deleted file mode 100644 index 332fa4554b..0000000000 --- a/tests/auto/declarative/animation/qparallelanimationgroupjob/qparallelanimationgroupjob.pro +++ /dev/null @@ -1,5 +0,0 @@ -CONFIG += testcase -macx:CONFIG -= app_bundle -TARGET = tst_qparallelanimationgroupjob -QT = core-private gui declarative-private testlib -SOURCES = tst_qparallelanimationgroupjob.cpp diff --git a/tests/auto/declarative/animation/qparallelanimationgroupjob/tst_qparallelanimationgroupjob.cpp b/tests/auto/declarative/animation/qparallelanimationgroupjob/tst_qparallelanimationgroupjob.cpp deleted file mode 100644 index ef24182115..0000000000 --- a/tests/auto/declarative/animation/qparallelanimationgroupjob/tst_qparallelanimationgroupjob.cpp +++ /dev/null @@ -1,931 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -#include - -Q_DECLARE_METATYPE(QAbstractAnimationJob::State) - -class tst_QParallelAnimationGroupJob : public QObject -{ - Q_OBJECT -public Q_SLOTS: - void initTestCase(); - -private slots: - void construction(); - void setCurrentTime(); - void stateChanged(); - void clearGroup(); - void propagateGroupUpdateToChildren(); - void updateChildrenWithRunningGroup(); - void deleteChildrenWithRunningGroup(); - void startChildrenWithStoppedGroup(); - void stopGroupWithRunningChild(); - void startGroupWithRunningChild(); - void zeroDurationAnimation(); - void stopUncontrolledAnimations(); - void loopCount_data(); - void loopCount(); - void addAndRemoveDuration(); - void pauseResume(); - - void crashWhenRemovingUncontrolledAnimation(); -}; - -void tst_QParallelAnimationGroupJob::initTestCase() -{ - qRegisterMetaType("QAbstractAnimationJob::State"); -#if defined(Q_OS_MAC) || defined(Q_OS_WINCE) - // give the mac/wince app start event queue time to clear - QTest::qWait(1000); -#endif -} - -void tst_QParallelAnimationGroupJob::construction() -{ - QParallelAnimationGroupJob animationgroup; -} - -class TestAnimation : public QAbstractAnimationJob -{ -public: - TestAnimation(int duration = 250) : m_duration(duration) {} - int duration() const { return m_duration; } - -private: - int m_duration; -}; - -class UncontrolledAnimation : public QObject, public QAbstractAnimationJob -{ - Q_OBJECT -public: - UncontrolledAnimation() - : id(0) - { - } - - int duration() const { return -1; /* not time driven */ } - -protected: - void timerEvent(QTimerEvent *event) - { - if (event->timerId() == id) - stop(); - } - - void updateRunning(bool running) - { - if (running) { - id = startTimer(500); - } else { - killTimer(id); - id = 0; - } - } - -private: - int id; -}; - -class StateChangeListener: public QAnimationJobChangeListener -{ -public: - virtual void animationStateChanged(QAbstractAnimationJob *, QAbstractAnimationJob::State newState, QAbstractAnimationJob::State) - { - states << newState; - } - - void clear() { states.clear(); } - int count() { return states.count(); } - - QList states; -}; - -class FinishedListener: public QAnimationJobChangeListener -{ -public: - FinishedListener() : m_count(0) {} - - virtual void animationFinished(QAbstractAnimationJob *) { ++m_count; } - void clear() { m_count = 0; } - int count() { return m_count; } - -private: - int m_count; -}; - -void tst_QParallelAnimationGroupJob::setCurrentTime() -{ - // originally was parallel operating on different object/properties - QAnimationGroupJob *parallel = new QParallelAnimationGroupJob(); - TestAnimation *a1_p_o1 = new TestAnimation; - TestAnimation *a1_p_o2 = new TestAnimation; - TestAnimation *a1_p_o3 = new TestAnimation; - a1_p_o2->setLoopCount(3); - parallel->appendAnimation(a1_p_o1); - parallel->appendAnimation(a1_p_o2); - parallel->appendAnimation(a1_p_o3); - - UncontrolledAnimation *notTimeDriven = new UncontrolledAnimation; - QCOMPARE(notTimeDriven->totalDuration(), -1); - - TestAnimation *loopsForever = new TestAnimation; - loopsForever->setLoopCount(-1); - QCOMPARE(loopsForever->totalDuration(), -1); - - QParallelAnimationGroupJob group; - group.appendAnimation(parallel); - group.appendAnimation(notTimeDriven); - group.appendAnimation(loopsForever); - - // Current time = 1 - group.setCurrentTime(1); - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE(parallel->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a1_p_o1->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a1_p_o2->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a1_p_o3->state(), QAnimationGroupJob::Stopped); - QCOMPARE(notTimeDriven->state(), QAnimationGroupJob::Stopped); - QCOMPARE(loopsForever->state(), QAnimationGroupJob::Stopped); - - QCOMPARE(group.currentLoopTime(), 1); - QCOMPARE(a1_p_o1->currentLoopTime(), 1); - QCOMPARE(a1_p_o2->currentLoopTime(), 1); - QCOMPARE(a1_p_o3->currentLoopTime(), 1); - QCOMPARE(notTimeDriven->currentLoopTime(), 1); - QCOMPARE(loopsForever->currentLoopTime(), 1); - - // Current time = 250 - group.setCurrentTime(250); - QCOMPARE(group.currentLoopTime(), 250); - QCOMPARE(a1_p_o1->currentLoopTime(), 250); - QCOMPARE(a1_p_o2->currentLoopTime(), 0); - QCOMPARE(a1_p_o2->currentLoop(), 1); - QCOMPARE(a1_p_o3->currentLoopTime(), 250); - QCOMPARE(notTimeDriven->currentLoopTime(), 250); - QCOMPARE(loopsForever->currentLoopTime(), 0); - QCOMPARE(loopsForever->currentLoop(), 1); - - // Current time = 251 - group.setCurrentTime(251); - QCOMPARE(group.currentLoopTime(), 251); - QCOMPARE(a1_p_o1->currentLoopTime(), 250); - QCOMPARE(a1_p_o2->currentLoopTime(), 1); - QCOMPARE(a1_p_o2->currentLoop(), 1); - QCOMPARE(a1_p_o3->currentLoopTime(), 250); - QCOMPARE(notTimeDriven->currentLoopTime(), 251); - QCOMPARE(loopsForever->currentLoopTime(), 1); -} - -void tst_QParallelAnimationGroupJob::stateChanged() -{ - //this ensures that the correct animations are started when starting the group - TestAnimation *anim1 = new TestAnimation(1000); - TestAnimation *anim2 = new TestAnimation(2000); - TestAnimation *anim3 = new TestAnimation(3000); - TestAnimation *anim4 = new TestAnimation(3000); - - QParallelAnimationGroupJob group; - group.appendAnimation(anim1); - group.appendAnimation(anim2); - group.appendAnimation(anim3); - group.appendAnimation(anim4); - - StateChangeListener spy1; - anim1->addAnimationChangeListener(&spy1, QAbstractAnimationJob::StateChange); - StateChangeListener spy2; - anim2->addAnimationChangeListener(&spy2, QAbstractAnimationJob::StateChange); - StateChangeListener spy3; - anim3->addAnimationChangeListener(&spy3, QAbstractAnimationJob::StateChange); - StateChangeListener spy4; - anim4->addAnimationChangeListener(&spy4, QAbstractAnimationJob::StateChange); - - //first; let's start forward - group.start(); - //all the animations should be started - QCOMPARE(spy1.count(), 1); - QCOMPARE(spy1.states.last(), TestAnimation::Running); - QCOMPARE(spy2.count(), 1); - QCOMPARE(spy2.states.last(), TestAnimation::Running); - QCOMPARE(spy3.count(), 1); - QCOMPARE(spy3.states.last(), TestAnimation::Running); - QCOMPARE(spy4.count(), 1); - QCOMPARE(spy4.states.last(), TestAnimation::Running); - - group.setCurrentTime(1500); //anim1 should be finished - QCOMPARE(group.state(), QAnimationGroupJob::Running); - QCOMPARE(spy1.count(), 2); - QCOMPARE(spy1.states.last(), TestAnimation::Stopped); - QCOMPARE(spy2.count(), 1); //no change - QCOMPARE(spy3.count(), 1); //no change - QCOMPARE(spy4.count(), 1); //no change - - group.setCurrentTime(2500); //anim2 should be finished - QCOMPARE(group.state(), QAnimationGroupJob::Running); - QCOMPARE(spy1.count(), 2); //no change - QCOMPARE(spy2.count(), 2); - QCOMPARE(spy2.states.last(), TestAnimation::Stopped); - QCOMPARE(spy3.count(), 1); //no change - QCOMPARE(spy4.count(), 1); //no change - - group.setCurrentTime(3500); //everything should be finished - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE(spy1.count(), 2); //no change - QCOMPARE(spy2.count(), 2); //no change - QCOMPARE(spy3.count(), 2); - QCOMPARE(spy3.states.last(), TestAnimation::Stopped); - QCOMPARE(spy4.count(), 2); - QCOMPARE(spy4.states.last(), TestAnimation::Stopped); - - //cleanup - spy1.clear(); - spy2.clear(); - spy3.clear(); - spy4.clear(); - - //now let's try to reverse that - group.setDirection(QAbstractAnimationJob::Backward); - group.start(); - - //only anim3 and anim4 should be started - QCOMPARE(group.state(), QAnimationGroupJob::Running); - QCOMPARE(spy1.count(), 0); - QCOMPARE(spy2.count(), 0); - QCOMPARE(spy3.count(), 1); - QCOMPARE(spy3.states.last(), TestAnimation::Running); - QCOMPARE(spy4.count(), 1); - QCOMPARE(spy4.states.last(), TestAnimation::Running); - - group.setCurrentTime(1500); //anim2 should be started - QCOMPARE(group.state(), QAnimationGroupJob::Running); - QCOMPARE(spy1.count(), 0); //no change - QCOMPARE(spy2.count(), 1); - QCOMPARE(spy2.states.last(), TestAnimation::Running); - QCOMPARE(spy3.count(), 1); //no change - QCOMPARE(spy4.count(), 1); //no change - - group.setCurrentTime(500); //anim1 is finally also started - QCOMPARE(group.state(), QAnimationGroupJob::Running); - QCOMPARE(spy1.count(), 1); - QCOMPARE(spy1.states.last(), TestAnimation::Running); - QCOMPARE(spy2.count(), 1); //no change - QCOMPARE(spy3.count(), 1); //no change - QCOMPARE(spy4.count(), 1); //no change - - group.setCurrentTime(0); //everything should be stopped - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE(spy1.count(), 2); - QCOMPARE(spy1.states.last(), TestAnimation::Stopped); - QCOMPARE(spy2.count(), 2); - QCOMPARE(spy2.states.last(), TestAnimation::Stopped); - QCOMPARE(spy3.count(), 2); - QCOMPARE(spy3.states.last(), TestAnimation::Stopped); - QCOMPARE(spy4.count(), 2); - QCOMPARE(spy4.states.last(), TestAnimation::Stopped); -} - -void tst_QParallelAnimationGroupJob::clearGroup() -{ - QParallelAnimationGroupJob group; - static const int animationCount = 10; - - for (int i = 0; i < animationCount; ++i) { - group.appendAnimation(new QParallelAnimationGroupJob); - } - - int count = 0; - for (QAbstractAnimationJob *anim = group.firstChild(); anim; anim = anim->nextSibling()) - ++count; - QCOMPARE(count, animationCount); - - group.clear(); - - QVERIFY(!group.firstChild() && !group.lastChild()); - QCOMPARE(group.currentLoopTime(), 0); -} - -void tst_QParallelAnimationGroupJob::propagateGroupUpdateToChildren() -{ - // this test verifies if group state changes are updating its children correctly - QParallelAnimationGroupJob group; - - TestAnimation anim1(100); - TestAnimation anim2(200); - - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim1.state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim2.state(), QAnimationGroupJob::Stopped); - - group.appendAnimation(&anim1); - group.appendAnimation(&anim2); - - group.start(); - - QCOMPARE(group.state(), QAnimationGroupJob::Running); - QCOMPARE(anim1.state(), QAnimationGroupJob::Running); - QCOMPARE(anim2.state(), QAnimationGroupJob::Running); - - group.pause(); - - QCOMPARE(group.state(), QAnimationGroupJob::Paused); - QCOMPARE(anim1.state(), QAnimationGroupJob::Paused); - QCOMPARE(anim2.state(), QAnimationGroupJob::Paused); - - group.stop(); - - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim1.state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim2.state(), QAnimationGroupJob::Stopped); -} - -void tst_QParallelAnimationGroupJob::updateChildrenWithRunningGroup() -{ - // assert that its possible to modify a child's state directly while their group is running - QParallelAnimationGroupJob group; - - TestAnimation anim(200); - - StateChangeListener groupStateChangedSpy; - group.addAnimationChangeListener(&groupStateChangedSpy, QAbstractAnimationJob::StateChange); - StateChangeListener childStateChangedSpy; - anim.addAnimationChangeListener(&childStateChangedSpy, QAbstractAnimationJob::StateChange); - - QCOMPARE(groupStateChangedSpy.count(), 0); - QCOMPARE(childStateChangedSpy.count(), 0); - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim.state(), QAnimationGroupJob::Stopped); - - group.appendAnimation(&anim); - - group.start(); - - QCOMPARE(group.state(), QAnimationGroupJob::Running); - QCOMPARE(anim.state(), QAnimationGroupJob::Running); - - QCOMPARE(groupStateChangedSpy.count(), 1); - QCOMPARE(childStateChangedSpy.count(), 1); - - QCOMPARE(groupStateChangedSpy.states.at(0), QAnimationGroupJob::Running); - QCOMPARE(childStateChangedSpy.states.at(0), QAnimationGroupJob::Running); - - // starting directly a running child will not have any effect - anim.start(); - - QCOMPARE(groupStateChangedSpy.count(), 1); - QCOMPARE(childStateChangedSpy.count(), 1); - - anim.pause(); - - QCOMPARE(group.state(), QAnimationGroupJob::Running); - QCOMPARE(anim.state(), QAnimationGroupJob::Paused); - - // in the animation stops directly, the group will still be running - anim.stop(); - - QCOMPARE(group.state(), QAnimationGroupJob::Running); - QCOMPARE(anim.state(), QAnimationGroupJob::Stopped); - - //cleanup - group.removeAnimationChangeListener(&groupStateChangedSpy, QAbstractAnimationJob::StateChange); - anim.removeAnimationChangeListener(&childStateChangedSpy, QAbstractAnimationJob::StateChange); -} - -void tst_QParallelAnimationGroupJob::deleteChildrenWithRunningGroup() -{ - // test if children can be activated when their group is stopped - QParallelAnimationGroupJob group; - - TestAnimation *anim1 = new TestAnimation(200); - group.appendAnimation(anim1); - - QCOMPARE(group.duration(), anim1->duration()); - - group.start(); - QCOMPARE(group.state(), QAnimationGroupJob::Running); - QCOMPARE(anim1->state(), QAnimationGroupJob::Running); - - QTest::qWait(80); - QVERIFY(group.currentLoopTime() > 0); - - delete anim1; - QVERIFY(!group.firstChild()); - QCOMPARE(group.duration(), 0); - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE(group.currentLoopTime(), 0); //that's the invariant -} - -void tst_QParallelAnimationGroupJob::startChildrenWithStoppedGroup() -{ - // test if children can be activated when their group is stopped - QParallelAnimationGroupJob group; - - TestAnimation anim1(200); - TestAnimation anim2(200); - - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim1.state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim2.state(), QAnimationGroupJob::Stopped); - - group.appendAnimation(&anim1); - group.appendAnimation(&anim2); - - group.stop(); - - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim1.state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim2.state(), QAnimationGroupJob::Stopped); - - anim1.start(); - anim2.start(); - anim2.pause(); - - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim1.state(), QAnimationGroupJob::Running); - QCOMPARE(anim2.state(), QAnimationGroupJob::Paused); -} - -void tst_QParallelAnimationGroupJob::stopGroupWithRunningChild() -{ - // children that started independently will not be affected by a group stop - QParallelAnimationGroupJob group; - - TestAnimation anim1(200); - TestAnimation anim2(200); - - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim1.state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim2.state(), QAnimationGroupJob::Stopped); - - group.appendAnimation(&anim1); - group.appendAnimation(&anim2); - - anim1.start(); - anim2.start(); - anim2.pause(); - - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim1.state(), QAnimationGroupJob::Running); - QCOMPARE(anim2.state(), QAnimationGroupJob::Paused); - - group.stop(); - - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim1.state(), QAnimationGroupJob::Running); - QCOMPARE(anim2.state(), QAnimationGroupJob::Paused); - - anim1.stop(); - anim2.stop(); - - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim1.state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim2.state(), QAnimationGroupJob::Stopped); -} - -void tst_QParallelAnimationGroupJob::startGroupWithRunningChild() -{ - // as the group has precedence over its children, starting a group will restart all the children - QParallelAnimationGroupJob group; - - TestAnimation anim1(200); - TestAnimation anim2(200); - - StateChangeListener stateChangedSpy1; - anim1.addAnimationChangeListener(&stateChangedSpy1, QAbstractAnimationJob::StateChange); - StateChangeListener stateChangedSpy2; - anim2.addAnimationChangeListener(&stateChangedSpy2, QAbstractAnimationJob::StateChange); - - QCOMPARE(stateChangedSpy1.count(), 0); - QCOMPARE(stateChangedSpy2.count(), 0); - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim1.state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim2.state(), QAnimationGroupJob::Stopped); - - group.appendAnimation(&anim1); - group.appendAnimation(&anim2); - - anim1.start(); - anim2.start(); - anim2.pause(); - - QCOMPARE(stateChangedSpy1.states.at(0), QAnimationGroupJob::Running); - QCOMPARE(stateChangedSpy2.states.at(0), QAnimationGroupJob::Running); - QCOMPARE(stateChangedSpy2.states.at(1), QAnimationGroupJob::Paused); - - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim1.state(), QAnimationGroupJob::Running); - QCOMPARE(anim2.state(), QAnimationGroupJob::Paused); - - group.start(); - - QCOMPARE(stateChangedSpy1.count(), 3); - QCOMPARE(stateChangedSpy1.states.at(1), QAnimationGroupJob::Stopped); - QCOMPARE(stateChangedSpy1.states.at(2), QAnimationGroupJob::Running); - - QCOMPARE(stateChangedSpy2.count(), 4); - QCOMPARE(stateChangedSpy2.states.at(2), QAnimationGroupJob::Stopped); - QCOMPARE(stateChangedSpy2.states.at(3), QAnimationGroupJob::Running); - - QCOMPARE(group.state(), QAnimationGroupJob::Running); - QCOMPARE(anim1.state(), QAnimationGroupJob::Running); - QCOMPARE(anim2.state(), QAnimationGroupJob::Running); - - //cleanup - anim1.removeAnimationChangeListener(&stateChangedSpy1, QAbstractAnimationJob::StateChange); - anim2.removeAnimationChangeListener(&stateChangedSpy2, QAbstractAnimationJob::StateChange); -} - -void tst_QParallelAnimationGroupJob::zeroDurationAnimation() -{ - QParallelAnimationGroupJob group; - - TestAnimation anim1(0); - TestAnimation anim2(100); - TestAnimation anim3(10); - - StateChangeListener stateChangedSpy1; - anim1.addAnimationChangeListener(&stateChangedSpy1, QAbstractAnimationJob::StateChange); - FinishedListener finishedSpy1; - anim1.addAnimationChangeListener(&finishedSpy1, QAbstractAnimationJob::Completion); - - StateChangeListener stateChangedSpy2; - anim2.addAnimationChangeListener(&stateChangedSpy2, QAbstractAnimationJob::StateChange); - FinishedListener finishedSpy2; - anim2.addAnimationChangeListener(&finishedSpy2, QAbstractAnimationJob::Completion); - - StateChangeListener stateChangedSpy3; - anim3.addAnimationChangeListener(&stateChangedSpy3, QAbstractAnimationJob::StateChange); - FinishedListener finishedSpy3; - anim3.addAnimationChangeListener(&finishedSpy3, QAbstractAnimationJob::Completion); - - group.appendAnimation(&anim1); - group.appendAnimation(&anim2); - group.appendAnimation(&anim3); - QCOMPARE(stateChangedSpy1.count(), 0); - group.start(); - QCOMPARE(stateChangedSpy1.count(), 2); - QCOMPARE(finishedSpy1.count(), 1); - QCOMPARE(stateChangedSpy1.states.at(0), QAnimationGroupJob::Running); - QCOMPARE(stateChangedSpy1.states.at(1), QAnimationGroupJob::Stopped); - - QCOMPARE(stateChangedSpy2.count(), 1); - QCOMPARE(finishedSpy2.count(), 0); - QCOMPARE(stateChangedSpy1.states.at(0), QAnimationGroupJob::Running); - - QCOMPARE(stateChangedSpy3.count(), 1); - QCOMPARE(finishedSpy3.count(), 0); - QCOMPARE(stateChangedSpy3.states.at(0), QAnimationGroupJob::Running); - - QCOMPARE(anim1.state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim2.state(), QAnimationGroupJob::Running); - QCOMPARE(anim3.state(), QAnimationGroupJob::Running); - QCOMPARE(group.state(), QAnimationGroupJob::Running); - - group.stop(); - group.setLoopCount(4); - stateChangedSpy1.clear(); - stateChangedSpy2.clear(); - stateChangedSpy3.clear(); - - group.start(); - QCOMPARE(stateChangedSpy1.count(), 2); - QCOMPARE(stateChangedSpy2.count(), 1); - QCOMPARE(stateChangedSpy3.count(), 1); - group.setCurrentTime(50); - QCOMPARE(stateChangedSpy1.count(), 2); - QCOMPARE(stateChangedSpy2.count(), 1); - QCOMPARE(stateChangedSpy3.count(), 2); - group.setCurrentTime(150); - QCOMPARE(stateChangedSpy1.count(), 4); - QCOMPARE(stateChangedSpy2.count(), 3); - QCOMPARE(stateChangedSpy3.count(), 4); - group.setCurrentTime(50); - QCOMPARE(stateChangedSpy1.count(), 6); - QCOMPARE(stateChangedSpy2.count(), 5); - QCOMPARE(stateChangedSpy3.count(), 6); - - //cleanup - anim1.removeAnimationChangeListener(&stateChangedSpy1, QAbstractAnimationJob::StateChange); - anim1.removeAnimationChangeListener(&finishedSpy1, QAbstractAnimationJob::Completion); - anim2.removeAnimationChangeListener(&stateChangedSpy2, QAbstractAnimationJob::StateChange); - anim2.removeAnimationChangeListener(&finishedSpy2, QAbstractAnimationJob::Completion); - anim3.removeAnimationChangeListener(&stateChangedSpy3, QAbstractAnimationJob::StateChange); - anim3.removeAnimationChangeListener(&finishedSpy3, QAbstractAnimationJob::Completion); -} - -void tst_QParallelAnimationGroupJob::stopUncontrolledAnimations() -{ - QParallelAnimationGroupJob group; - - TestAnimation anim1(0); - - UncontrolledAnimation notTimeDriven; - QCOMPARE(notTimeDriven.totalDuration(), -1); - - TestAnimation loopsForever(100); - loopsForever.setLoopCount(-1); - - StateChangeListener stateChangedSpy; - anim1.addAnimationChangeListener(&stateChangedSpy, QAbstractAnimationJob::StateChange); - - group.appendAnimation(&anim1); - group.appendAnimation(¬TimeDriven); - group.appendAnimation(&loopsForever); - - group.start(); - - QCOMPARE(stateChangedSpy.count(), 2); - QCOMPARE(stateChangedSpy.states.at(0), QAnimationGroupJob::Running); - QCOMPARE(stateChangedSpy.states.at(1), QAnimationGroupJob::Stopped); - - QCOMPARE(group.state(), QAnimationGroupJob::Running); - QCOMPARE(notTimeDriven.state(), QAnimationGroupJob::Running); - QCOMPARE(loopsForever.state(), QAnimationGroupJob::Running); - QCOMPARE(anim1.state(), QAnimationGroupJob::Stopped); - - notTimeDriven.stop(); - - QCOMPARE(group.state(), QAnimationGroupJob::Running); - QCOMPARE(notTimeDriven.state(), QAnimationGroupJob::Stopped); - QCOMPARE(loopsForever.state(), QAnimationGroupJob::Running); - - loopsForever.stop(); - - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE(notTimeDriven.state(), QAnimationGroupJob::Stopped); - QCOMPARE(loopsForever.state(), QAnimationGroupJob::Stopped); -} - -struct AnimState { - AnimState(int time = -1) : time(time), state(-1) {} - AnimState(int time, int state) : time(time), state(state) {} - int time; - int state; -}; - -#define Running QAbstractAnimationJob::Running -#define Stopped QAbstractAnimationJob::Stopped - -Q_DECLARE_METATYPE(AnimState) -void tst_QParallelAnimationGroupJob::loopCount_data() -{ - QTest::addColumn("directionBackward"); - QTest::addColumn("setLoopCount"); - QTest::addColumn("initialGroupTime"); - QTest::addColumn("currentGroupTime"); - QTest::addColumn("expected1"); - QTest::addColumn("expected2"); - QTest::addColumn("expected3"); - - // D U R A T I O N - // 100 60*2 0 - // direction = Forward - QTest::newRow("50") << false << 3 << 0 << 50 << AnimState( 50, Running) << AnimState( 50, Running) << AnimState( 0, Stopped); - QTest::newRow("100") << false << 3 << 0 << 100 << AnimState(100 ) << AnimState( 40, Running) << AnimState( 0, Stopped); - QTest::newRow("110") << false << 3 << 0 << 110 << AnimState(100, Stopped) << AnimState( 50, Running) << AnimState( 0, Stopped); - QTest::newRow("120") << false << 3 << 0 << 120 << AnimState( 0, Running) << AnimState( 0, Running) << AnimState( 0, Stopped); - - QTest::newRow("170") << false << 3 << 0 << 170 << AnimState( 50, Running) << AnimState( 50, Running) << AnimState( 0, Stopped); - QTest::newRow("220") << false << 3 << 0 << 220 << AnimState(100 ) << AnimState( 40, Running) << AnimState( 0, Stopped); - QTest::newRow("230") << false << 3 << 0 << 230 << AnimState(100, Stopped) << AnimState( 50, Running) << AnimState( 0, Stopped); - QTest::newRow("240") << false << 3 << 0 << 240 << AnimState( 0, Running) << AnimState( 0, Running) << AnimState( 0, Stopped); - - QTest::newRow("290") << false << 3 << 0 << 290 << AnimState( 50, Running) << AnimState( 50, Running) << AnimState( 0, Stopped); - QTest::newRow("340") << false << 3 << 0 << 340 << AnimState(100 ) << AnimState( 40, Running) << AnimState( 0, Stopped); - QTest::newRow("350") << false << 3 << 0 << 350 << AnimState(100, Stopped) << AnimState( 50, Running) << AnimState( 0, Stopped); - QTest::newRow("360") << false << 3 << 0 << 360 << AnimState(100, Stopped) << AnimState( 60 ) << AnimState( 0, Stopped); - - QTest::newRow("410") << false << 3 << 0 << 410 << AnimState(100, Stopped) << AnimState( 60, Stopped) << AnimState( 0, Stopped); - QTest::newRow("460") << false << 3 << 0 << 460 << AnimState(100, Stopped) << AnimState( 60, Stopped) << AnimState( 0, Stopped); - QTest::newRow("470") << false << 3 << 0 << 470 << AnimState(100, Stopped) << AnimState( 60, Stopped) << AnimState( 0, Stopped); - QTest::newRow("480") << false << 3 << 0 << 480 << AnimState(100, Stopped) << AnimState( 60, Stopped) << AnimState( 0, Stopped); - - // direction = Forward, rewind - QTest::newRow("120-110") << false << 3 << 120 << 110 << AnimState( 0, Stopped) << AnimState( 50, Running) << AnimState( 0, Stopped); - QTest::newRow("120-50") << false << 3 << 120 << 50 << AnimState( 50, Running) << AnimState( 50, Running) << AnimState( 0, Stopped); - QTest::newRow("120-0") << false << 3 << 120 << 0 << AnimState( 0, Running) << AnimState( 0, Running) << AnimState( 0, Stopped); - QTest::newRow("300-110") << false << 3 << 300 << 110 << AnimState( 0, Stopped) << AnimState( 50, Running) << AnimState( 0, Stopped); - QTest::newRow("300-50") << false << 3 << 300 << 50 << AnimState( 50, Running) << AnimState( 50, Running) << AnimState( 0, Stopped); - QTest::newRow("300-0") << false << 3 << 300 << 0 << AnimState( 0, Running) << AnimState( 0, Running) << AnimState( 0, Stopped); - QTest::newRow("115-105") << false << 3 << 115 << 105 << AnimState( 42, Stopped) << AnimState( 45, Running) << AnimState( 0, Stopped); - - // direction = Backward - QTest::newRow("b120-120") << true << 3 << 120 << 120 << AnimState( 42, Stopped) << AnimState( 60, Running) << AnimState( 0, Stopped); - QTest::newRow("b120-110") << true << 3 << 120 << 110 << AnimState( 42, Stopped) << AnimState( 50, Running) << AnimState( 0, Stopped); - QTest::newRow("b120-100") << true << 3 << 120 << 100 << AnimState(100, Running) << AnimState( 40, Running) << AnimState( 0, Stopped); - QTest::newRow("b120-50") << true << 3 << 120 << 50 << AnimState( 50, Running) << AnimState( 50, Running) << AnimState( 0, Stopped); - QTest::newRow("b120-0") << true << 3 << 120 << 0 << AnimState( 0, Stopped) << AnimState( 0, Stopped) << AnimState( 0, Stopped); - QTest::newRow("b360-170") << true << 3 << 360 << 170 << AnimState( 50, Running) << AnimState( 50, Running) << AnimState( 0, Stopped); - QTest::newRow("b360-220") << true << 3 << 360 << 220 << AnimState(100, Running) << AnimState( 40, Running) << AnimState( 0, Stopped); - QTest::newRow("b360-210") << true << 3 << 360 << 210 << AnimState( 90, Running) << AnimState( 30, Running) << AnimState( 0, Stopped); - QTest::newRow("b360-120") << true << 3 << 360 << 120 << AnimState( 0, Stopped) << AnimState( 60, Running) << AnimState( 0, Stopped); - - // rewind, direction = Backward - QTest::newRow("b50-110") << true << 3 << 50 << 110 << AnimState(100, Stopped) << AnimState( 50, Running) << AnimState( 0, Stopped); - QTest::newRow("b50-120") << true << 3 << 50 << 120 << AnimState(100, Stopped) << AnimState( 60, Running) << AnimState( 0, Stopped); - QTest::newRow("b50-140") << true << 3 << 50 << 140 << AnimState( 20, Running) << AnimState( 20, Running) << AnimState( 0, Stopped); - QTest::newRow("b50-240") << true << 3 << 50 << 240 << AnimState(100, Stopped) << AnimState( 60, Running) << AnimState( 0, Stopped); - QTest::newRow("b50-260") << true << 3 << 50 << 260 << AnimState( 20, Running) << AnimState( 20, Running) << AnimState( 0, Stopped); - QTest::newRow("b50-350") << true << 3 << 50 << 350 << AnimState(100, Stopped) << AnimState( 50, Running) << AnimState( 0, Stopped); - - // infinite looping - QTest::newRow("inf1220") << false << -1 << 0 << 1220 << AnimState( 20, Running) << AnimState( 20, Running) << AnimState( 0, Stopped); - QTest::newRow("inf1310") << false << -1 << 0 << 1310 << AnimState( 100, Stopped) << AnimState( 50, Running) << AnimState( 0, Stopped); - // infinite looping, direction = Backward (will only loop once) - QTest::newRow("b.inf120-120") << true << -1 << 120 << 120 << AnimState( 42, Stopped) << AnimState( 60, Running) << AnimState( 0, Stopped); - QTest::newRow("b.inf120-20") << true << -1 << 120 << 20 << AnimState( 20, Running) << AnimState( 20, Running) << AnimState( 0, Stopped); - QTest::newRow("b.inf120-110") << true << -1 << 120 << 110 << AnimState( 42, Stopped) << AnimState( 50, Running) << AnimState( 0, Stopped); - - -} - -void tst_QParallelAnimationGroupJob::loopCount() -{ - QFETCH(bool, directionBackward); - QFETCH(int, setLoopCount); - QFETCH(int, initialGroupTime); - QFETCH(int, currentGroupTime); - QFETCH(AnimState, expected1); - QFETCH(AnimState, expected2); - QFETCH(AnimState, expected3); - - QParallelAnimationGroupJob group; - - TestAnimation anim1(100); - TestAnimation anim2(60); //total 120 - anim2.setLoopCount(2); - TestAnimation anim3(0); - - group.appendAnimation(&anim1); - group.appendAnimation(&anim2); - group.appendAnimation(&anim3); - - group.setLoopCount(setLoopCount); - if (initialGroupTime >= 0) - group.setCurrentTime(initialGroupTime); - if (directionBackward) - group.setDirection(QAbstractAnimationJob::Backward); - - group.start(); - if (initialGroupTime >= 0) - group.setCurrentTime(initialGroupTime); - - anim1.setCurrentTime(42); // 42 is "untouched" - anim2.setCurrentTime(42); - - group.setCurrentTime(currentGroupTime); - - QCOMPARE(anim1.currentLoopTime(), expected1.time); - QCOMPARE(anim2.currentLoopTime(), expected2.time); - QCOMPARE(anim3.currentLoopTime(), expected3.time); - - if (expected1.state >=0) - QCOMPARE(int(anim1.state()), expected1.state); - if (expected2.state >=0) - QCOMPARE(int(anim2.state()), expected2.state); - if (expected3.state >=0) - QCOMPARE(int(anim3.state()), expected3.state); - -} - -void tst_QParallelAnimationGroupJob::addAndRemoveDuration() -{ - QParallelAnimationGroupJob group; - QCOMPARE(group.duration(), 0); - TestAnimation *test = new TestAnimation(250); // 0, duration = 250; - group.appendAnimation(test); - QCOMPARE(test->group(), static_cast(&group)); - QCOMPARE(test->duration(), 250); - QCOMPARE(group.duration(), 250); - - TestAnimation *test2 = new TestAnimation(750); // 1 - group.appendAnimation(test2); - QCOMPARE(test2->group(), static_cast(&group)); - QCOMPARE(group.duration(), 750); - - TestAnimation *test3 = new TestAnimation(500); // 2 - group.appendAnimation(test3); - QCOMPARE(test3->group(), static_cast(&group)); - QCOMPARE(group.duration(), 750); - - group.removeAnimation(test2); // remove the one with duration = 750 - delete test2; - QCOMPARE(group.duration(), 500); - - group.removeAnimation(test3); // remove the one with duration = 500 - delete test3; - QCOMPARE(group.duration(), 250); - - group.removeAnimation(test); // remove the last one (with duration = 250) - QCOMPARE(test->group(), static_cast(0)); - QCOMPARE(group.duration(), 0); - delete test; -} - -void tst_QParallelAnimationGroupJob::pauseResume() -{ - QParallelAnimationGroupJob group; - TestAnimation *anim = new TestAnimation(250); // 0, duration = 250; - group.appendAnimation(anim); - StateChangeListener spy; - anim->addAnimationChangeListener(&spy, QAbstractAnimationJob::StateChange); - QCOMPARE(group.duration(), 250); - group.start(); - QTest::qWait(100); - QCOMPARE(group.state(), QAnimationGroupJob::Running); - QCOMPARE(anim->state(), QAnimationGroupJob::Running); - QCOMPARE(spy.count(), 1); - spy.clear(); - const int currentTime = group.currentLoopTime(); - QCOMPARE(anim->currentLoopTime(), currentTime); - - group.pause(); - QCOMPARE(group.state(), QAnimationGroupJob::Paused); - QCOMPARE(group.currentLoopTime(), currentTime); - QCOMPARE(anim->state(), QAnimationGroupJob::Paused); - QCOMPARE(anim->currentLoopTime(), currentTime); - QCOMPARE(spy.count(), 1); - spy.clear(); - - group.resume(); - QCOMPARE(group.state(), QAnimationGroupJob::Running); - QCOMPARE(group.currentLoopTime(), currentTime); - QCOMPARE(anim->state(), QAnimationGroupJob::Running); - QCOMPARE(anim->currentLoopTime(), currentTime); - QCOMPARE(spy.count(), 1); - - group.stop(); - spy.clear(); - group.appendAnimation(new TestAnimation(500)); - group.start(); - QCOMPARE(spy.count(), 1); //the animation should have been started - QCOMPARE(spy.states.at(0), TestAnimation::Running); - group.setCurrentTime(250); //end of first animation - QCOMPARE(spy.count(), 2); //the animation should have been stopped - QCOMPARE(spy.states.at(1), TestAnimation::Stopped); - group.pause(); - QCOMPARE(spy.count(), 2); //this shouldn't have changed - group.resume(); - QCOMPARE(spy.count(), 2); //this shouldn't have changed -} - -// This is a regression test for QTBUG-8910, where a crash occurred when the -// last animation was removed from a group. -void tst_QParallelAnimationGroupJob::crashWhenRemovingUncontrolledAnimation() -{ - QParallelAnimationGroupJob group; - TestAnimation *anim = new TestAnimation; - anim->setLoopCount(-1); - TestAnimation *anim2 = new TestAnimation; - anim2->setLoopCount(-1); - group.appendAnimation(anim); - group.appendAnimation(anim2); - group.start(); - delete anim; - // it would crash here because the internals of the group would still have a reference to anim - delete anim2; -} - - -QTEST_MAIN(tst_QParallelAnimationGroupJob) -#include "tst_qparallelanimationgroupjob.moc" diff --git a/tests/auto/declarative/animation/qpauseanimationjob/qpauseanimationjob.pro b/tests/auto/declarative/animation/qpauseanimationjob/qpauseanimationjob.pro deleted file mode 100644 index d2b48a6c74..0000000000 --- a/tests/auto/declarative/animation/qpauseanimationjob/qpauseanimationjob.pro +++ /dev/null @@ -1,5 +0,0 @@ -CONFIG += testcase -macx:CONFIG -= app_bundle -TARGET = tst_qpauseanimationjob -QT = core-private gui-private declarative-private testlib -SOURCES = tst_qpauseanimationjob.cpp diff --git a/tests/auto/declarative/animation/qpauseanimationjob/tst_qpauseanimationjob.cpp b/tests/auto/declarative/animation/qpauseanimationjob/tst_qpauseanimationjob.cpp deleted file mode 100644 index 97be325017..0000000000 --- a/tests/auto/declarative/animation/qpauseanimationjob/tst_qpauseanimationjob.cpp +++ /dev/null @@ -1,470 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -#include -#include -#include - -#ifdef Q_OS_WIN -static const char winTimerError[] = "On windows, consistent timing is not working properly due to bad timer resolution"; -#endif - -class TestablePauseAnimation : public QPauseAnimationJob -{ -public: - TestablePauseAnimation() - : m_updateCurrentTimeCount(0) - { - } - - TestablePauseAnimation(int duration) - : QPauseAnimationJob(duration), m_updateCurrentTimeCount(0) - { - } - - int m_updateCurrentTimeCount; -protected: - void updateCurrentTime(int currentTime) - { - QPauseAnimationJob::updateCurrentTime(currentTime); - ++m_updateCurrentTimeCount; - } -}; - -class TestableGenericAnimation : public QAbstractAnimationJob -{ -public: - TestableGenericAnimation(int duration = 250) : m_duration(duration) {} - int duration() const { return m_duration; } - -private: - int m_duration; -}; - -class EnableConsistentTiming -{ -public: - EnableConsistentTiming() - { - QUnifiedTimer *timer = QUnifiedTimer::instance(); - timer->setConsistentTiming(true); - } - ~EnableConsistentTiming() - { - QUnifiedTimer *timer = QUnifiedTimer::instance(); - timer->setConsistentTiming(false); - } -}; - -class tst_QPauseAnimationJob : public QObject -{ - Q_OBJECT -public Q_SLOTS: - void initTestCase(); - -private slots: - void changeDirectionWhileRunning(); - void noTimerUpdates_data(); - void noTimerUpdates(); - void multiplePauseAnimations(); - void pauseAndPropertyAnimations(); - void pauseResume(); - void sequentialPauseGroup(); - void sequentialGroupWithPause(); - void multipleSequentialGroups(); - void zeroDuration(); -}; - -void tst_QPauseAnimationJob::initTestCase() -{ -// qRegisterMetaType("QAbstractAnimationJob::State"); -} - -void tst_QPauseAnimationJob::changeDirectionWhileRunning() -{ - EnableConsistentTiming enabled; - - TestablePauseAnimation animation; - animation.setDuration(400); - animation.start(); - QTest::qWait(100); - QVERIFY(animation.state() == QAbstractAnimationJob::Running); - animation.setDirection(QAbstractAnimationJob::Backward); - QTest::qWait(animation.totalDuration() + 50); - QVERIFY(animation.state() == QAbstractAnimationJob::Stopped); -} - -void tst_QPauseAnimationJob::noTimerUpdates_data() -{ - QTest::addColumn("duration"); - QTest::addColumn("loopCount"); - - QTest::newRow("0") << 200 << 1; - QTest::newRow("1") << 160 << 1; - QTest::newRow("2") << 160 << 2; - QTest::newRow("3") << 200 << 3; -} - -void tst_QPauseAnimationJob::noTimerUpdates() -{ - EnableConsistentTiming enabled; - - QFETCH(int, duration); - QFETCH(int, loopCount); - - TestablePauseAnimation animation; - animation.setDuration(duration); - animation.setLoopCount(loopCount); - animation.start(); - QTest::qWait(animation.totalDuration() + 100); - -#ifdef Q_OS_WIN - if (animation.state() != QAbstractAnimationJob::Stopped) - QEXPECT_FAIL("", winTimerError, Abort); -#endif - - QVERIFY(animation.state() == QAbstractAnimationJob::Stopped); - const int expectedLoopCount = 1 + loopCount; - -#ifdef Q_OS_WIN - if (animation.m_updateCurrentTimeCount != expectedLoopCount) - QEXPECT_FAIL("", winTimerError, Abort); -#endif - QCOMPARE(animation.m_updateCurrentTimeCount, expectedLoopCount); -} - -void tst_QPauseAnimationJob::multiplePauseAnimations() -{ - EnableConsistentTiming enabled; - - TestablePauseAnimation animation; - animation.setDuration(200); - - TestablePauseAnimation animation2; - animation2.setDuration(800); - - animation.start(); - animation2.start(); - QTest::qWait(animation.totalDuration() + 100); - -#ifdef Q_OS_WIN - if (animation.state() != QAbstractAnimationJob::Stopped) - QEXPECT_FAIL("", winTimerError, Abort); -#endif - QVERIFY(animation.state() == QAbstractAnimationJob::Stopped); - -#ifdef Q_OS_WIN - if (animation2.state() != QAbstractAnimationJob::Running) - QEXPECT_FAIL("", winTimerError, Abort); -#endif - QVERIFY(animation2.state() == QAbstractAnimationJob::Running); - -#ifdef Q_OS_WIN - if (animation.m_updateCurrentTimeCount != 2) - QEXPECT_FAIL("", winTimerError, Abort); -#endif - QCOMPARE(animation.m_updateCurrentTimeCount, 2); - -#ifdef Q_OS_WIN - if (animation2.m_updateCurrentTimeCount != 2) - QEXPECT_FAIL("", winTimerError, Abort); -#endif - QCOMPARE(animation2.m_updateCurrentTimeCount, 2); - - QTest::qWait(550); - -#ifdef Q_OS_WIN - if (animation2.state() != QAbstractAnimationJob::Stopped) - QEXPECT_FAIL("", winTimerError, Abort); -#endif - QVERIFY(animation2.state() == QAbstractAnimationJob::Stopped); - -#ifdef Q_OS_WIN - if (animation2.m_updateCurrentTimeCount != 3) - QEXPECT_FAIL("", winTimerError, Abort); -#endif - QCOMPARE(animation2.m_updateCurrentTimeCount, 3); -} - -void tst_QPauseAnimationJob::pauseAndPropertyAnimations() -{ - EnableConsistentTiming enabled; - - TestablePauseAnimation pause; - pause.setDuration(200); - - TestableGenericAnimation animation; - - pause.start(); - - QTest::qWait(100); - animation.start(); - - QVERIFY(animation.state() == QAbstractAnimationJob::Running); - QVERIFY(pause.state() == QAbstractAnimationJob::Running); - QCOMPARE(pause.m_updateCurrentTimeCount, 2); - - QTest::qWait(animation.totalDuration() + 100); - -#ifdef Q_OS_WIN - if (animation.state() != QAbstractAnimationJob::Stopped) - QEXPECT_FAIL("", winTimerError, Abort); -#endif - QVERIFY(animation.state() == QAbstractAnimationJob::Stopped); - QVERIFY(pause.state() == QAbstractAnimationJob::Stopped); - QVERIFY(pause.m_updateCurrentTimeCount > 3); -} - -void tst_QPauseAnimationJob::pauseResume() -{ - TestablePauseAnimation animation; - animation.setDuration(400); - animation.start(); - QVERIFY(animation.state() == QAbstractAnimationJob::Running); - QTest::qWait(200); - animation.pause(); - QVERIFY(animation.state() == QAbstractAnimationJob::Paused); - animation.start(); - QTest::qWait(300); - QVERIFY(animation.state() == QAbstractAnimationJob::Stopped); - -#ifdef Q_OS_WIN - if (animation.m_updateCurrentTimeCount != 3) - QEXPECT_FAIL("", winTimerError, Abort); -#endif - QCOMPARE(animation.m_updateCurrentTimeCount, 3); -} - -void tst_QPauseAnimationJob::sequentialPauseGroup() -{ - QSequentialAnimationGroupJob group; - - TestablePauseAnimation animation1(200); - group.appendAnimation(&animation1); - TestablePauseAnimation animation2(200); - group.appendAnimation(&animation2); - TestablePauseAnimation animation3(200); - group.appendAnimation(&animation3); - - group.start(); - QCOMPARE(animation1.m_updateCurrentTimeCount, 1); - QCOMPARE(animation2.m_updateCurrentTimeCount, 0); - QCOMPARE(animation3.m_updateCurrentTimeCount, 0); - - QVERIFY(group.state() == QAbstractAnimationJob::Running); - QVERIFY(animation1.state() == QAbstractAnimationJob::Running); - QVERIFY(animation2.state() == QAbstractAnimationJob::Stopped); - QVERIFY(animation3.state() == QAbstractAnimationJob::Stopped); - - group.setCurrentTime(250); - QCOMPARE(animation1.m_updateCurrentTimeCount, 2); - QCOMPARE(animation2.m_updateCurrentTimeCount, 1); - QCOMPARE(animation3.m_updateCurrentTimeCount, 0); - - QVERIFY(group.state() == QAbstractAnimationJob::Running); - QVERIFY(animation1.state() == QAbstractAnimationJob::Stopped); - QCOMPARE((QAbstractAnimationJob*)&animation2, group.currentAnimation()); - QVERIFY(animation2.state() == QAbstractAnimationJob::Running); - QVERIFY(animation3.state() == QAbstractAnimationJob::Stopped); - - group.setCurrentTime(500); - QCOMPARE(animation1.m_updateCurrentTimeCount, 2); - QCOMPARE(animation2.m_updateCurrentTimeCount, 2); - QCOMPARE(animation3.m_updateCurrentTimeCount, 1); - - QVERIFY(group.state() == QAbstractAnimationJob::Running); - QVERIFY(animation1.state() == QAbstractAnimationJob::Stopped); - QVERIFY(animation2.state() == QAbstractAnimationJob::Stopped); - QCOMPARE((QAbstractAnimationJob*)&animation3, group.currentAnimation()); - QVERIFY(animation3.state() == QAbstractAnimationJob::Running); - - group.setCurrentTime(750); - - QVERIFY(group.state() == QAbstractAnimationJob::Stopped); - QVERIFY(animation1.state() == QAbstractAnimationJob::Stopped); - QVERIFY(animation2.state() == QAbstractAnimationJob::Stopped); - QVERIFY(animation3.state() == QAbstractAnimationJob::Stopped); - - QCOMPARE(animation1.m_updateCurrentTimeCount, 2); - QCOMPARE(animation2.m_updateCurrentTimeCount, 2); - QCOMPARE(animation3.m_updateCurrentTimeCount, 2); -} - -void tst_QPauseAnimationJob::sequentialGroupWithPause() -{ - QSequentialAnimationGroupJob group; - - TestableGenericAnimation animation; - group.appendAnimation(&animation); - - TestablePauseAnimation pause; - pause.setDuration(250); - group.appendAnimation(&pause); - - group.start(); - - QVERIFY(group.state() == QAbstractAnimationJob::Running); - QVERIFY(animation.state() == QAbstractAnimationJob::Running); - QVERIFY(pause.state() == QAbstractAnimationJob::Stopped); - - group.setCurrentTime(300); - - QVERIFY(group.state() == QAbstractAnimationJob::Running); - QVERIFY(animation.state() == QAbstractAnimationJob::Stopped); - QCOMPARE((QAbstractAnimationJob*)&pause, group.currentAnimation()); - QVERIFY(pause.state() == QAbstractAnimationJob::Running); - - group.setCurrentTime(600); - - QVERIFY(group.state() == QAbstractAnimationJob::Stopped); - QVERIFY(animation.state() == QAbstractAnimationJob::Stopped); - QVERIFY(pause.state() == QAbstractAnimationJob::Stopped); - - QCOMPARE(pause.m_updateCurrentTimeCount, 2); -} - -void tst_QPauseAnimationJob::multipleSequentialGroups() -{ - EnableConsistentTiming enabled; - - QParallelAnimationGroupJob group; - group.setLoopCount(2); - - QSequentialAnimationGroupJob subgroup1; - group.appendAnimation(&subgroup1); - - TestableGenericAnimation animation(300); - subgroup1.appendAnimation(&animation); - - TestablePauseAnimation pause(200); - subgroup1.appendAnimation(&pause); - - QSequentialAnimationGroupJob subgroup2; - group.appendAnimation(&subgroup2); - - TestableGenericAnimation animation2(200); - subgroup2.appendAnimation(&animation2); - - TestablePauseAnimation pause2(250); - subgroup2.appendAnimation(&pause2); - - QSequentialAnimationGroupJob subgroup3; - group.appendAnimation(&subgroup3); - - TestablePauseAnimation pause3(400); - subgroup3.appendAnimation(&pause3); - - TestableGenericAnimation animation3(200); - subgroup3.appendAnimation(&animation3); - - QSequentialAnimationGroupJob subgroup4; - group.appendAnimation(&subgroup4); - - TestablePauseAnimation pause4(310); - subgroup4.appendAnimation(&pause4); - - TestablePauseAnimation pause5(60); - subgroup4.appendAnimation(&pause5); - - group.start(); - - QVERIFY(group.state() == QAbstractAnimationJob::Running); - QVERIFY(subgroup1.state() == QAbstractAnimationJob::Running); - QVERIFY(subgroup2.state() == QAbstractAnimationJob::Running); - QVERIFY(subgroup3.state() == QAbstractAnimationJob::Running); - QVERIFY(subgroup4.state() == QAbstractAnimationJob::Running); - - // This is a pretty long animation so it tends to get rather out of sync - // when using the consistent timer, so run for an extra half second for good - // measure... - QTest::qWait(group.totalDuration() + 500); - -#ifdef Q_OS_WIN - if (group.state() != QAbstractAnimationJob::Stopped) - QEXPECT_FAIL("", winTimerError, Abort); -#endif - QVERIFY(group.state() == QAbstractAnimationJob::Stopped); - -#ifdef Q_OS_WIN - if (subgroup1.state() != QAbstractAnimationJob::Stopped) - QEXPECT_FAIL("", winTimerError, Abort); -#endif - QVERIFY(subgroup1.state() == QAbstractAnimationJob::Stopped); - -#ifdef Q_OS_WIN - if (subgroup2.state() != QAbstractAnimationJob::Stopped) - QEXPECT_FAIL("", winTimerError, Abort); -#endif - QVERIFY(subgroup2.state() == QAbstractAnimationJob::Stopped); - -#ifdef Q_OS_WIN - if (subgroup3.state() != QAbstractAnimationJob::Stopped) - QEXPECT_FAIL("", winTimerError, Abort); -#endif - QVERIFY(subgroup3.state() == QAbstractAnimationJob::Stopped); - -#ifdef Q_OS_WIN - if (subgroup4.state() != QAbstractAnimationJob::Stopped) - QEXPECT_FAIL("", winTimerError, Abort); -#endif - QVERIFY(subgroup4.state() == QAbstractAnimationJob::Stopped); - -#ifdef Q_OS_WIN - if (pause5.m_updateCurrentTimeCount != 4) - QEXPECT_FAIL("", winTimerError, Abort); -#endif - QCOMPARE(pause5.m_updateCurrentTimeCount, 4); -} - -void tst_QPauseAnimationJob::zeroDuration() -{ - TestablePauseAnimation animation; - animation.setDuration(0); - animation.start(); - QTest::qWait(animation.totalDuration() + 100); - QVERIFY(animation.state() == QAbstractAnimationJob::Stopped); - QCOMPARE(animation.m_updateCurrentTimeCount, 1); -} - -QTEST_MAIN(tst_QPauseAnimationJob) -#include "tst_qpauseanimationjob.moc" diff --git a/tests/auto/declarative/animation/qsequentialanimationgroupjob/qsequentialanimationgroupjob.pro b/tests/auto/declarative/animation/qsequentialanimationgroupjob/qsequentialanimationgroupjob.pro deleted file mode 100644 index 914fc3ca62..0000000000 --- a/tests/auto/declarative/animation/qsequentialanimationgroupjob/qsequentialanimationgroupjob.pro +++ /dev/null @@ -1,5 +0,0 @@ -CONFIG += testcase parallel_test -macx:CONFIG -= app_bundle -TARGET = tst_qsequentialanimationgroupjob -QT = core-private declarative-private testlib -SOURCES = tst_qsequentialanimationgroupjob.cpp diff --git a/tests/auto/declarative/animation/qsequentialanimationgroupjob/tst_qsequentialanimationgroupjob.cpp b/tests/auto/declarative/animation/qsequentialanimationgroupjob/tst_qsequentialanimationgroupjob.cpp deleted file mode 100644 index d5a9b07f8f..0000000000 --- a/tests/auto/declarative/animation/qsequentialanimationgroupjob/tst_qsequentialanimationgroupjob.cpp +++ /dev/null @@ -1,1617 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include -#include -#include - -Q_DECLARE_METATYPE(QAbstractAnimationJob::State) -Q_DECLARE_METATYPE(QAbstractAnimationJob*) - -class tst_QSequentialAnimationGroupJob : public QObject -{ - Q_OBJECT -public Q_SLOTS: - void initTestCase(); - -private slots: - void construction(); - void setCurrentTime(); - void setCurrentTimeWithUncontrolledAnimation(); - void seekingForwards(); - void seekingBackwards(); - void pauseAndResume(); - void restart(); - void looping(); - void startDelay(); - void clearGroup(); - void groupWithZeroDurationAnimations(); - void propagateGroupUpdateToChildren(); - void updateChildrenWithRunningGroup(); - void deleteChildrenWithRunningGroup(); - void startChildrenWithStoppedGroup(); - void stopGroupWithRunningChild(); - void startGroupWithRunningChild(); - void zeroDurationAnimation(); - void stopUncontrolledAnimations(); - void finishWithUncontrolledAnimation(); - void addRemoveAnimation(); - void currentAnimation(); - void currentAnimationWithZeroDuration(); - void insertAnimation(); - void clear(); - void pauseResume(); -}; - -void tst_QSequentialAnimationGroupJob::initTestCase() -{ - qRegisterMetaType("QAbstractAnimationJob::State"); - qRegisterMetaType("QAbstractAnimationJob*"); -} - -void tst_QSequentialAnimationGroupJob::construction() -{ - QSequentialAnimationGroupJob animationgroup; -} - -class TestAnimation : public QAbstractAnimationJob -{ -public: - TestAnimation(int duration = 250) : m_duration(duration) {} - int duration() const { return m_duration; } - -private: - int m_duration; -}; - -class TestValueAnimation : public TestAnimation -{ -public: - TestValueAnimation(int duration = 250) - : TestAnimation(duration), start(0), end(0), value(0) {} - - void updateCurrentTime(int msecs) - { - if (msecs >= duration()) - value = end; - else - value = start + (end - start) * (qreal(msecs) / duration()); - } - - qreal start, end; - qreal value; -}; - -class UncontrolledAnimation : public QObject, public QAbstractAnimationJob -{ - Q_OBJECT -public: - int duration() const { return -1; /* not time driven */ } - -protected: - void updateCurrentTime(int currentTime) - { - if (currentTime >= 250) - stop(); - } -}; - -class StateChangeListener: public QAnimationJobChangeListener -{ -public: - virtual void animationStateChanged(QAbstractAnimationJob *, QAbstractAnimationJob::State newState, QAbstractAnimationJob::State) - { - states << newState; - } - - void clear() { states.clear(); } - int count() const { return states.count(); } - - QList states; -}; - -class FinishedListener: public QAnimationJobChangeListener -{ -public: - FinishedListener() : m_count(0) {} - - virtual void animationFinished(QAbstractAnimationJob *) { ++m_count; } - void clear() { m_count = 0; } - int count() { return m_count; } - -private: - int m_count; -}; - -void tst_QSequentialAnimationGroupJob::setCurrentTime() -{ - // sequence operating on same object/property - QAnimationGroupJob *sequence = new QSequentialAnimationGroupJob(); - TestAnimation *a1_s_o1 = new TestAnimation; - TestAnimation *a2_s_o1 = new TestAnimation; - TestAnimation *a3_s_o1 = new TestAnimation; - a2_s_o1->setLoopCount(3); - sequence->appendAnimation(a1_s_o1); - sequence->appendAnimation(a2_s_o1); - sequence->appendAnimation(a3_s_o1); - - // sequence operating on different object/properties - QAnimationGroupJob *sequence2 = new QSequentialAnimationGroupJob(); - TestAnimation *a1_s_o2 = new TestAnimation; - TestAnimation *a1_s_o3 = new TestAnimation; - sequence2->appendAnimation(a1_s_o2); - sequence2->appendAnimation(a1_s_o3); - - QSequentialAnimationGroupJob group; - group.appendAnimation(sequence); - group.appendAnimation(sequence2); - - // Current time = 1 - group.setCurrentTime(1); - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE(sequence->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a1_s_o1->state(), QAnimationGroupJob::Stopped); - QCOMPARE(sequence2->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a1_s_o2->state(), QAnimationGroupJob::Stopped); - - QCOMPARE(group.currentLoopTime(), 1); - QCOMPARE(sequence->currentLoopTime(), 1); - QCOMPARE(a1_s_o1->currentLoopTime(), 1); - QCOMPARE(a2_s_o1->currentLoopTime(), 0); - QCOMPARE(a3_s_o1->currentLoopTime(), 0); - QCOMPARE(a1_s_o2->currentLoopTime(), 0); - QCOMPARE(a1_s_o3->currentLoopTime(), 0); - - // Current time = 250 - group.setCurrentTime(250); - QCOMPARE(group.currentLoopTime(), 250); - QCOMPARE(sequence->currentLoopTime(), 250); - QCOMPARE(a1_s_o1->currentLoopTime(), 250); - QCOMPARE(a2_s_o1->currentLoopTime(), 0); - QCOMPARE(a3_s_o1->currentLoopTime(), 0); - QCOMPARE(a1_s_o2->currentLoopTime(), 0); - QCOMPARE(a1_s_o3->currentLoopTime(), 0); - - // Current time = 251 - group.setCurrentTime(251); - QCOMPARE(group.currentLoopTime(), 251); - QCOMPARE(sequence->currentLoopTime(), 251); - QCOMPARE(a1_s_o1->currentLoopTime(), 250); - QCOMPARE(a2_s_o1->currentLoopTime(), 1); - QCOMPARE(a2_s_o1->currentLoop(), 0); - QCOMPARE(a3_s_o1->currentLoopTime(), 0); - QCOMPARE(sequence2->currentLoopTime(), 0); - QCOMPARE(a1_s_o2->currentLoopTime(), 0); - QCOMPARE(a1_s_o3->currentLoopTime(), 0); - - // Current time = 750 - group.setCurrentTime(750); - QCOMPARE(group.currentLoopTime(), 750); - QCOMPARE(sequence->currentLoopTime(), 750); - QCOMPARE(a1_s_o1->currentLoopTime(), 250); - QCOMPARE(a2_s_o1->currentLoopTime(), 0); - QCOMPARE(a2_s_o1->currentLoop(), 2); - QCOMPARE(a3_s_o1->currentLoopTime(), 0); - QCOMPARE(sequence2->currentLoopTime(), 0); - QCOMPARE(a1_s_o2->currentLoopTime(), 0); - QCOMPARE(a1_s_o3->currentLoopTime(), 0); - - // Current time = 1000 - group.setCurrentTime(1000); - QCOMPARE(group.currentLoopTime(), 1000); - QCOMPARE(sequence->currentLoopTime(), 1000); - QCOMPARE(a1_s_o1->currentLoopTime(), 250); - QCOMPARE(a2_s_o1->currentLoopTime(), 250); - QCOMPARE(a2_s_o1->currentLoop(), 2); - QCOMPARE(a3_s_o1->currentLoopTime(), 0); - QCOMPARE(sequence2->currentLoopTime(), 0); - QCOMPARE(a1_s_o2->currentLoopTime(), 0); - QCOMPARE(a1_s_o3->currentLoopTime(), 0); - - // Current time = 1010 - group.setCurrentTime(1010); - QCOMPARE(group.currentLoopTime(), 1010); - QCOMPARE(sequence->currentLoopTime(), 1010); - QCOMPARE(a1_s_o1->currentLoopTime(), 250); - QCOMPARE(a2_s_o1->currentLoopTime(), 250); - QCOMPARE(a2_s_o1->currentLoop(), 2); - QCOMPARE(a3_s_o1->currentLoopTime(), 10); - QCOMPARE(sequence2->currentLoopTime(), 0); - QCOMPARE(a1_s_o2->currentLoopTime(), 0); - QCOMPARE(a1_s_o3->currentLoopTime(), 0); - - // Current time = 1250 - group.setCurrentTime(1250); - QCOMPARE(group.currentLoopTime(), 1250); - QCOMPARE(sequence->currentLoopTime(), 1250); - QCOMPARE(a1_s_o1->currentLoopTime(), 250); - QCOMPARE(a2_s_o1->currentLoopTime(), 250); - QCOMPARE(a2_s_o1->currentLoop(), 2); - QCOMPARE(a3_s_o1->currentLoopTime(), 250); - QCOMPARE(sequence2->currentLoopTime(), 0); - QCOMPARE(a1_s_o2->currentLoopTime(), 0); - QCOMPARE(a1_s_o3->currentLoopTime(), 0); - - // Current time = 1500 - group.setCurrentTime(1500); - QCOMPARE(group.currentLoopTime(), 1500); - QCOMPARE(sequence->currentLoopTime(), 1250); - QCOMPARE(a1_s_o1->currentLoopTime(), 250); - QCOMPARE(a2_s_o1->currentLoopTime(), 250); - QCOMPARE(a2_s_o1->currentLoop(), 2); - QCOMPARE(a3_s_o1->currentLoopTime(), 250); - QCOMPARE(sequence2->currentLoopTime(), 250); - QCOMPARE(a1_s_o2->currentLoopTime(), 250); - QCOMPARE(a1_s_o3->currentLoopTime(), 0); - - // Current time = 1750 - group.setCurrentTime(1750); - QCOMPARE(group.currentLoopTime(), 1750); - QCOMPARE(sequence->currentLoopTime(), 1250); - QCOMPARE(a1_s_o1->currentLoopTime(), 250); - QCOMPARE(a2_s_o1->currentLoopTime(), 250); - QCOMPARE(a2_s_o1->currentLoop(), 2); - QCOMPARE(a3_s_o1->currentLoopTime(), 250); - QCOMPARE(sequence2->currentLoopTime(), 500); - QCOMPARE(a1_s_o2->currentLoopTime(), 250); - QCOMPARE(a1_s_o3->currentLoopTime(), 250); - - // Current time = 2000 - group.setCurrentTime(2000); - QCOMPARE(group.currentLoopTime(), 1750); - QCOMPARE(sequence->currentLoopTime(), 1250); - QCOMPARE(a1_s_o1->currentLoopTime(), 250); - QCOMPARE(a2_s_o1->currentLoopTime(), 250); - QCOMPARE(a2_s_o1->currentLoop(), 2); - QCOMPARE(a3_s_o1->currentLoopTime(), 250); - QCOMPARE(sequence2->currentLoopTime(), 500); - QCOMPARE(a1_s_o2->currentLoopTime(), 250); - QCOMPARE(a1_s_o3->currentLoopTime(), 250); -} - -void tst_QSequentialAnimationGroupJob::setCurrentTimeWithUncontrolledAnimation() -{ - // sequence operating on different object/properties - QAnimationGroupJob *sequence = new QSequentialAnimationGroupJob(); - TestAnimation *a1_s_o1 = new TestAnimation; - TestAnimation *a1_s_o2 = new TestAnimation; - sequence->appendAnimation(a1_s_o1); - sequence->appendAnimation(a1_s_o2); - - UncontrolledAnimation *notTimeDriven = new UncontrolledAnimation; - QCOMPARE(notTimeDriven->totalDuration(), -1); - - TestAnimation *loopsForever = new TestAnimation; - loopsForever->setLoopCount(-1); - QCOMPARE(loopsForever->totalDuration(), -1); - - QSequentialAnimationGroupJob group; - group.appendAnimation(sequence); - group.appendAnimation(notTimeDriven); - group.appendAnimation(loopsForever); - group.start(); - group.pause(); // this allows the group to listen for the finish signal of its children - - // Current time = 1 - group.setCurrentTime(1); - QCOMPARE(group.state(), QAnimationGroupJob::Paused); - QCOMPARE(sequence->state(), QAnimationGroupJob::Paused); - QCOMPARE(a1_s_o1->state(), QAnimationGroupJob::Paused); - QCOMPARE(a1_s_o2->state(), QAnimationGroupJob::Stopped); - QCOMPARE(notTimeDriven->state(), QAnimationGroupJob::Stopped); - QCOMPARE(loopsForever->state(), QAnimationGroupJob::Stopped); - - QCOMPARE(group.currentLoopTime(), 1); - QCOMPARE(sequence->currentLoopTime(), 1); - QCOMPARE(a1_s_o1->currentLoopTime(), 1); - QCOMPARE(a1_s_o2->currentLoopTime(), 0); - QCOMPARE(notTimeDriven->currentLoopTime(), 0); - QCOMPARE(loopsForever->currentLoopTime(), 0); - - // Current time = 250 - group.setCurrentTime(250); - QCOMPARE(group.currentLoopTime(), 250); - QCOMPARE(sequence->currentLoopTime(), 250); - QCOMPARE(a1_s_o1->currentLoopTime(), 250); - QCOMPARE(a1_s_o2->currentLoopTime(), 0); - QCOMPARE(notTimeDriven->currentLoopTime(), 0); - QCOMPARE(loopsForever->currentLoopTime(), 0); - - // Current time = 500 - group.setCurrentTime(500); - QCOMPARE(group.currentLoopTime(), 500); - QCOMPARE(sequence->currentLoopTime(), 500); - QCOMPARE(a1_s_o1->currentLoopTime(), 250); - QCOMPARE(a1_s_o2->currentLoopTime(), 250); - QCOMPARE(notTimeDriven->currentLoopTime(), 0); - QCOMPARE(loopsForever->currentLoopTime(), 0); - QCOMPARE(group.currentAnimation(), static_cast(notTimeDriven)); - - // Current time = 505 - group.setCurrentTime(505); - QCOMPARE(group.currentLoopTime(), 505); - QCOMPARE(sequence->currentLoopTime(), 500); - QCOMPARE(a1_s_o1->currentLoopTime(), 250); - QCOMPARE(a1_s_o2->currentLoopTime(), 250); - QCOMPARE(notTimeDriven->currentLoopTime(), 5); - QCOMPARE(loopsForever->currentLoopTime(), 0); - QCOMPARE(group.currentAnimation(), static_cast(notTimeDriven)); - QCOMPARE(sequence->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a1_s_o1->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a1_s_o2->state(), QAnimationGroupJob::Stopped); - QCOMPARE(notTimeDriven->state(), QAnimationGroupJob::Paused); - QCOMPARE(loopsForever->state(), QAnimationGroupJob::Stopped); - - // Current time = 750 (end of notTimeDriven animation) - group.setCurrentTime(750); - QCOMPARE(group.currentLoopTime(), 750); - QCOMPARE(sequence->currentLoopTime(), 500); - QCOMPARE(a1_s_o1->currentLoopTime(), 250); - QCOMPARE(a1_s_o2->currentLoopTime(), 250); - QCOMPARE(notTimeDriven->currentLoopTime(), 250); - QCOMPARE(loopsForever->currentLoopTime(), 0); - QCOMPARE(group.currentAnimation(), loopsForever); - QCOMPARE(sequence->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a1_s_o1->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a1_s_o2->state(), QAnimationGroupJob::Stopped); - QCOMPARE(notTimeDriven->state(), QAnimationGroupJob::Stopped); - QCOMPARE(loopsForever->state(), QAnimationGroupJob::Paused); - - // Current time = 800 (as notTimeDriven was finished at 750, loopsforever should still run) - group.setCurrentTime(800); - QCOMPARE(group.currentLoopTime(), 800); - QCOMPARE(group.currentAnimation(), loopsForever); - QCOMPARE(sequence->currentLoopTime(), 500); - QCOMPARE(a1_s_o1->currentLoopTime(), 250); - QCOMPARE(a1_s_o2->currentLoopTime(), 250); - QCOMPARE(notTimeDriven->currentLoopTime(), 250); - QCOMPARE(loopsForever->currentLoopTime(), 50); - - loopsForever->stop(); // this should stop the group - - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE(sequence->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a1_s_o1->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a1_s_o2->state(), QAnimationGroupJob::Stopped); - QCOMPARE(notTimeDriven->state(), QAnimationGroupJob::Stopped); - QCOMPARE(loopsForever->state(), QAnimationGroupJob::Stopped); -} - -void tst_QSequentialAnimationGroupJob::seekingForwards() -{ - - // sequence operating on same object/property - QAnimationGroupJob *sequence = new QSequentialAnimationGroupJob; - TestAnimation *a1_s_o1 = new TestAnimation; - TestAnimation *a2_s_o1 = new TestAnimation; - TestAnimation *a3_s_o1 = new TestAnimation; - a2_s_o1->setLoopCount(3); - sequence->appendAnimation(a1_s_o1); - sequence->appendAnimation(a2_s_o1); - sequence->appendAnimation(a3_s_o1); - - // sequence operating on different object/properties - QAnimationGroupJob *sequence2 = new QSequentialAnimationGroupJob; - TestAnimation *a1_s_o2 = new TestAnimation; - TestAnimation *a1_s_o3 = new TestAnimation; - sequence2->appendAnimation(a1_s_o2); - sequence2->appendAnimation(a1_s_o3); - - QSequentialAnimationGroupJob group; - group.appendAnimation(sequence); - group.appendAnimation(sequence2); - - // Current time = 1 - group.setCurrentTime(1); - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE(sequence->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a1_s_o1->state(), QAnimationGroupJob::Stopped); - QCOMPARE(sequence2->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a1_s_o2->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a1_s_o3->state(), QAnimationGroupJob::Stopped); - - QCOMPARE(group.currentLoopTime(), 1); - QCOMPARE(sequence->currentLoopTime(), 1); - QCOMPARE(a1_s_o1->currentLoopTime(), 1); - QCOMPARE(a2_s_o1->currentLoopTime(), 0); - QCOMPARE(a3_s_o1->currentLoopTime(), 0); - QCOMPARE(sequence2->currentLoopTime(), 0); - QCOMPARE(a1_s_o2->currentLoopTime(), 0); - QCOMPARE(a1_s_o3->currentLoopTime(), 0); - - // Current time = 1500 - group.setCurrentTime(1500); - QCOMPARE(group.currentLoopTime(), 1500); - QCOMPARE(sequence->currentLoopTime(), 1250); - QCOMPARE(a1_s_o1->currentLoopTime(), 250); - QCOMPARE(a2_s_o1->currentLoopTime(), 250); - QCOMPARE(a2_s_o1->currentLoop(), 2); - QCOMPARE(a3_s_o1->currentLoopTime(), 250); - QCOMPARE(sequence2->currentLoopTime(), 250); - QCOMPARE(a1_s_o2->currentLoopTime(), 250); - QCOMPARE(a1_s_o3->currentLoopTime(), 0); - - // this will restart the group - group.start(); - group.pause(); - QCOMPARE(group.state(), QAnimationGroupJob::Paused); - QCOMPARE(sequence->state(), QAnimationGroupJob::Paused); - QCOMPARE(a1_s_o1->state(), QAnimationGroupJob::Paused); - QCOMPARE(sequence2->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a1_s_o2->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a1_s_o3->state(), QAnimationGroupJob::Stopped); - - // Current time = 1750 - group.setCurrentTime(1750); - QCOMPARE(group.currentLoopTime(), 1750); - QCOMPARE(sequence->currentLoopTime(), 1250); - QCOMPARE(a1_s_o1->currentLoopTime(), 250); - QCOMPARE(a2_s_o1->currentLoopTime(), 250); - QCOMPARE(a2_s_o1->currentLoop(), 2); - QCOMPARE(a3_s_o1->currentLoopTime(), 250); - QCOMPARE(sequence2->currentLoopTime(), 500); - QCOMPARE(a1_s_o2->currentLoopTime(), 250); - QCOMPARE(a1_s_o3->currentLoopTime(), 250); -} - -void tst_QSequentialAnimationGroupJob::seekingBackwards() -{ - // sequence operating on same object/property - QAnimationGroupJob *sequence = new QSequentialAnimationGroupJob(); - TestAnimation *a1_s_o1 = new TestAnimation; - TestAnimation *a2_s_o1 = new TestAnimation; - TestAnimation *a3_s_o1 = new TestAnimation; - a2_s_o1->setLoopCount(3); - sequence->appendAnimation(a1_s_o1); - sequence->appendAnimation(a2_s_o1); - sequence->appendAnimation(a3_s_o1); - - // sequence operating on different object/properties - QAnimationGroupJob *sequence2 = new QSequentialAnimationGroupJob(); - TestAnimation *a1_s_o2 = new TestAnimation; - TestAnimation *a1_s_o3 = new TestAnimation; - sequence2->appendAnimation(a1_s_o2); - sequence2->appendAnimation(a1_s_o3); - - QSequentialAnimationGroupJob group; - group.appendAnimation(sequence); - group.appendAnimation(sequence2); - - group.start(); - - // Current time = 1600 - group.setCurrentTime(1600); - QCOMPARE(group.currentLoopTime(), 1600); - QCOMPARE(sequence->currentLoopTime(), 1250); - QCOMPARE(a1_s_o1->currentLoopTime(), 250); - QCOMPARE(a2_s_o1->currentLoopTime(), 250); - QCOMPARE(a2_s_o1->currentLoop(), 2); - QCOMPARE(a3_s_o1->currentLoopTime(), 250); - QCOMPARE(sequence2->currentLoopTime(), 350); - QCOMPARE(a1_s_o2->currentLoopTime(), 250); - QCOMPARE(a1_s_o3->currentLoopTime(), 100); - - QCOMPARE(group.state(), QAnimationGroupJob::Running); - QCOMPARE(sequence->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a1_s_o1->state(), QAnimationGroupJob::Stopped); - QCOMPARE(sequence2->state(), QAnimationGroupJob::Running); - QCOMPARE(a1_s_o2->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a1_s_o3->state(), QAnimationGroupJob::Running); - - // Seeking backwards, current time = 1 - group.setCurrentTime(1); - QCOMPARE(group.currentLoopTime(), 1); - QCOMPARE(sequence->currentLoopTime(), 1); - QCOMPARE(a1_s_o1->currentLoopTime(), 1); - - QEXPECT_FAIL("", "rewinding in nested groups is considered as a restart from the children," - "hence they don't reset from their current animation", Continue); - QCOMPARE(a2_s_o1->currentLoopTime(), 0); - QEXPECT_FAIL("", "rewinding in nested groups is considered as a restart from the children," - "hence they don't reset from their current animation", Continue); - QCOMPARE(a2_s_o1->currentLoop(), 0); - QEXPECT_FAIL("", "rewinding in nested groups is considered as a restart from the children," - "hence they don't reset from their current animation", Continue); - QCOMPARE(a3_s_o1->currentLoopTime(), 0); - QCOMPARE(sequence2->currentLoopTime(), 0); - QCOMPARE(a1_s_o2->currentLoopTime(), 0); - QCOMPARE(a1_s_o3->currentLoopTime(), 0); - - QCOMPARE(group.state(), QAnimationGroupJob::Running); - QCOMPARE(sequence->state(), QAnimationGroupJob::Running); - QCOMPARE(a1_s_o1->state(), QAnimationGroupJob::Running); - QCOMPARE(sequence2->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a1_s_o2->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a1_s_o3->state(), QAnimationGroupJob::Stopped); - - // Current time = 2000 - group.setCurrentTime(2000); - QCOMPARE(group.currentLoopTime(), 1750); - QCOMPARE(sequence->currentLoopTime(), 1250); - QCOMPARE(a1_s_o1->currentLoopTime(), 250); - QCOMPARE(a2_s_o1->currentLoopTime(), 250); - QCOMPARE(a2_s_o1->currentLoop(), 2); - QCOMPARE(a3_s_o1->currentLoopTime(), 250); - QCOMPARE(sequence2->currentLoopTime(), 500); - QCOMPARE(a1_s_o2->currentLoopTime(), 250); - QCOMPARE(a1_s_o3->currentLoopTime(), 250); - - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE(sequence->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a1_s_o1->state(), QAnimationGroupJob::Stopped); - QCOMPARE(sequence2->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a1_s_o2->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a1_s_o3->state(), QAnimationGroupJob::Stopped); -} - -typedef QList StateList; - -static bool compareStates(const StateChangeListener& spy, const StateList &expectedStates) -{ - bool equals = true; - for (int i = 0; i < qMax(expectedStates.count(), spy.count()); ++i) { - if (i >= spy.count() || i >= expectedStates.count()) { - equals = false; - break; - } - QAbstractAnimationJob::State st = expectedStates.at(i); - QAbstractAnimationJob::State actual = spy.states.at(i); - if (equals && actual != st) { - equals = false; - break; - } - } - if (!equals) { - const char *stateStrings[] = {"Stopped", "Paused", "Running"}; - QString e,a; - for (int i = 0; i < qMax(expectedStates.count(), spy.count()); ++i) { - if (i < expectedStates.count()) { - int exp = int(expectedStates.at(i)); - if (!e.isEmpty()) - e += QLatin1String(", "); - e += QLatin1String(stateStrings[exp]); - } - if (i < spy.count()) { - QAbstractAnimationJob::State actual = spy.states.at(i); - if (!a.isEmpty()) - a += QLatin1String(", "); - if (int(actual) >= 0 && int(actual) <= 2) { - a += QLatin1String(stateStrings[int(actual)]); - } else { - a += QLatin1String("NaN"); - } - } - - } - qDebug("\n" - "expected (count == %d): %s\n" - "actual (count == %d): %s\n", expectedStates.count(), qPrintable(e), spy.count(), qPrintable(a)); - } - return equals; -} - -void tst_QSequentialAnimationGroupJob::pauseAndResume() -{ - // sequence operating on same object/property - QAnimationGroupJob *sequence = new QSequentialAnimationGroupJob(); - TestAnimation *a1_s_o1 = new TestAnimation; - TestAnimation *a2_s_o1 = new TestAnimation; - TestAnimation *a3_s_o1 = new TestAnimation; - a2_s_o1->setLoopCount(2); - sequence->appendAnimation(a1_s_o1); - sequence->appendAnimation(a2_s_o1); - sequence->appendAnimation(a3_s_o1); - sequence->setLoopCount(2); - - StateChangeListener a1StateChangedSpy; - a1_s_o1->addAnimationChangeListener(&a1StateChangedSpy, QAbstractAnimationJob::StateChange); - StateChangeListener seqStateChangedSpy; - sequence->addAnimationChangeListener(&seqStateChangedSpy, QAbstractAnimationJob::StateChange); - - QSequentialAnimationGroupJob group; - group.appendAnimation(sequence); - - group.start(); - group.pause(); - - // Current time = 1751 - group.setCurrentTime(1751); - QCOMPARE(group.currentLoopTime(), 1751); - QCOMPARE(sequence->currentLoopTime(), 751); - QCOMPARE(sequence->currentLoop(), 1); - QCOMPARE(a1_s_o1->currentLoopTime(), 250); - QCOMPARE(a2_s_o1->currentLoopTime(), 250); - QCOMPARE(a2_s_o1->currentLoop(), 1); - QCOMPARE(a3_s_o1->currentLoop(), 0); - QCOMPARE(a3_s_o1->currentLoopTime(), 1); - - QCOMPARE(group.state(), QAnimationGroupJob::Paused); - QCOMPARE(sequence->state(), QAnimationGroupJob::Paused); - QCOMPARE(a1_s_o1->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a2_s_o1->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a3_s_o1->state(), QAnimationGroupJob::Paused); - - QCOMPARE(a1StateChangedSpy.count(), 5); // Running,Paused,Stopped,Running,Stopped - QCOMPARE(seqStateChangedSpy.count(), 2); // Running,Paused - - QVERIFY(compareStates(a1StateChangedSpy, (StateList() << QAbstractAnimationJob::Running - << QAbstractAnimationJob::Paused - << QAbstractAnimationJob::Stopped - << QAbstractAnimationJob::Running - << QAbstractAnimationJob::Stopped))); - - //### is this the same test as compareStates test above? - QCOMPARE(a1StateChangedSpy.states.at(0), QAnimationGroupJob::Running); - QCOMPARE(a1StateChangedSpy.states.at(1), QAnimationGroupJob::Paused); - QCOMPARE(a1StateChangedSpy.states.at(2), QAnimationGroupJob::Stopped); - QCOMPARE(a1StateChangedSpy.states.at(3), QAnimationGroupJob::Running); - QCOMPARE(a1StateChangedSpy.states.at(4), QAnimationGroupJob::Stopped); - - QCOMPARE(seqStateChangedSpy.states.at(0), QAnimationGroupJob::Running); - QCOMPARE(seqStateChangedSpy.states.at(1), QAnimationGroupJob::Paused); - - group.resume(); - - QCOMPARE(group.state(), QAnimationGroupJob::Running); - QCOMPARE(sequence->state(), QAnimationGroupJob::Running); - QCOMPARE(a1_s_o1->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a2_s_o1->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a3_s_o1->state(), QAnimationGroupJob::Running); - - QVERIFY(group.currentLoopTime() >= 1751); - QVERIFY(sequence->currentLoopTime() >= 751); - QCOMPARE(sequence->currentLoop(), 1); - QCOMPARE(a1_s_o1->currentLoopTime(), 250); - QCOMPARE(a2_s_o1->currentLoopTime(), 250); - QCOMPARE(a2_s_o1->currentLoop(), 1); - QCOMPARE(a3_s_o1->currentLoop(), 0); - QVERIFY(a3_s_o1->currentLoopTime() >= 1); - - QCOMPARE(seqStateChangedSpy.count(), 3); // Running,Paused,Running - QCOMPARE(seqStateChangedSpy.states.at(2), QAnimationGroupJob::Running); - - group.pause(); - - QCOMPARE(group.state(), QAnimationGroupJob::Paused); - QCOMPARE(sequence->state(), QAnimationGroupJob::Paused); - QCOMPARE(a1_s_o1->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a2_s_o1->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a3_s_o1->state(), QAnimationGroupJob::Paused); - - QVERIFY(group.currentLoopTime() >= 1751); - QVERIFY(sequence->currentLoopTime() >= 751); - QCOMPARE(sequence->currentLoop(), 1); - QCOMPARE(a1_s_o1->currentLoopTime(), 250); - QCOMPARE(a2_s_o1->currentLoopTime(), 250); - QCOMPARE(a2_s_o1->currentLoop(), 1); - QCOMPARE(a3_s_o1->currentLoop(), 0); - QVERIFY(a3_s_o1->currentLoopTime() >= 1); - - QCOMPARE(seqStateChangedSpy.count(), 4); // Running,Paused,Running,Paused - QCOMPARE(seqStateChangedSpy.states.at(3), QAnimationGroupJob::Paused); - - group.stop(); - - QCOMPARE(seqStateChangedSpy.count(), 5); // Running,Paused,Running,Paused,Stopped - QCOMPARE(seqStateChangedSpy.states.at(4), QAnimationGroupJob::Stopped); -} - -void tst_QSequentialAnimationGroupJob::restart() -{ - // originally was sequence operating on same object/property - QAnimationGroupJob *sequence = new QSequentialAnimationGroupJob(); - //### no equivilant signal - //QSignalSpy seqCurrentAnimChangedSpy(sequence, SIGNAL(currentAnimationChanged(QAbstractAnimationJob*))); - - StateChangeListener seqStateChangedSpy; - sequence->addAnimationChangeListener(&seqStateChangedSpy, QAbstractAnimationJob::StateChange); - - TestAnimation *anims[3]; - StateChangeListener *animsStateChanged[3]; - - for (int i = 0; i < 3; i++) { - anims[i] = new TestAnimation(100); - animsStateChanged[i] = new StateChangeListener; - anims[i]->addAnimationChangeListener(animsStateChanged[i], QAbstractAnimationJob::StateChange); - } - - anims[1]->setLoopCount(2); - sequence->appendAnimation(anims[0]); - sequence->appendAnimation(anims[1]); - sequence->appendAnimation(anims[2]); - sequence->setLoopCount(2); - - QSequentialAnimationGroupJob group; - group.appendAnimation(sequence); - - group.start(); - - QTest::qWait(500); - - QCOMPARE(group.state(), QAnimationGroupJob::Running); - - QTest::qWait(300); - QTRY_COMPARE(group.state(), QAnimationGroupJob::Stopped); - - for (int i = 0; i < 3; i++) { - QCOMPARE(animsStateChanged[i]->count(), 4); - QCOMPARE(animsStateChanged[i]->states.at(0), QAnimationGroupJob::Running); - QCOMPARE(animsStateChanged[i]->states.at(1), QAnimationGroupJob::Stopped); - QCOMPARE(animsStateChanged[i]->states.at(2), QAnimationGroupJob::Running); - QCOMPARE(animsStateChanged[i]->states.at(3), QAnimationGroupJob::Stopped); - } - - QCOMPARE(seqStateChangedSpy.count(), 2); - QCOMPARE(seqStateChangedSpy.states.at(0), QAnimationGroupJob::Running); - QCOMPARE(seqStateChangedSpy.states.at(1), QAnimationGroupJob::Stopped); - - //QCOMPARE(seqCurrentAnimChangedSpy.count(), 6); - //for(int i=0; i(anims[i%3]), qVariantValue(seqCurrentAnimChangedSpy.at(i).at(0))); - - group.start(); - - QCOMPARE(animsStateChanged[0]->count(), 5); - QCOMPARE(animsStateChanged[1]->count(), 4); - QCOMPARE(animsStateChanged[2]->count(), 4); - QCOMPARE(seqStateChangedSpy.count(), 3); -} - -void tst_QSequentialAnimationGroupJob::looping() -{ - // originally was sequence operating on same object/property - QSequentialAnimationGroupJob *sequence = new QSequentialAnimationGroupJob(); - QAbstractAnimationJob *a1_s_o1 = new TestAnimation; - QAbstractAnimationJob *a2_s_o1 = new TestAnimation; - QAbstractAnimationJob *a3_s_o1 = new TestAnimation; - - StateChangeListener a1Spy; - a1_s_o1->addAnimationChangeListener(&a1Spy, QAbstractAnimationJob::StateChange); - StateChangeListener a2Spy; - a2_s_o1->addAnimationChangeListener(&a2Spy, QAbstractAnimationJob::StateChange); - StateChangeListener a3Spy; - a3_s_o1->addAnimationChangeListener(&a3Spy, QAbstractAnimationJob::StateChange); - StateChangeListener seqSpy; - sequence->addAnimationChangeListener(&seqSpy, QAbstractAnimationJob::StateChange); - - a2_s_o1->setLoopCount(2); - sequence->appendAnimation(a1_s_o1); - sequence->appendAnimation(a2_s_o1); - sequence->appendAnimation(a3_s_o1); - sequence->setLoopCount(2); - - QSequentialAnimationGroupJob group; - StateChangeListener groupSpy; - group.addAnimationChangeListener(&groupSpy, QAbstractAnimationJob::StateChange); - - group.appendAnimation(sequence); - group.setLoopCount(2); - - group.start(); - group.pause(); - - // Current time = 1750 - group.setCurrentTime(1750); - QCOMPARE(group.currentLoopTime(), 1750); - QCOMPARE(sequence->currentLoopTime(), 750); - QCOMPARE(sequence->currentLoop(), 1); - QCOMPARE(a1_s_o1->currentLoopTime(), 250); - QCOMPARE(a2_s_o1->currentLoopTime(), 250); - QCOMPARE(a2_s_o1->currentLoop(), 1); - // this animation is at the beginning because it is the current one inside sequence - QCOMPARE(a3_s_o1->currentLoop(), 0); - QCOMPARE(a3_s_o1->currentLoopTime(), 0); - QCOMPARE(sequence->currentAnimation(), a3_s_o1); - - QCOMPARE(group.state(), QAnimationGroupJob::Paused); - QCOMPARE(sequence->state(), QAnimationGroupJob::Paused); - QCOMPARE(a1_s_o1->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a2_s_o1->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a3_s_o1->state(), QAnimationGroupJob::Paused); - - QCOMPARE(a1Spy.count(), 5); // Running,Paused,Stopped,Running,Stopped - QVERIFY(compareStates(a1Spy, (StateList() << QAbstractAnimationJob::Running - << QAbstractAnimationJob::Paused - << QAbstractAnimationJob::Stopped - << QAbstractAnimationJob::Running - << QAbstractAnimationJob::Stopped))); - - QCOMPARE(a2Spy.count(), 4); // Running,Stopped,Running,Stopped - QVERIFY(compareStates(a3Spy, (StateList() << QAbstractAnimationJob::Running - << QAbstractAnimationJob::Stopped - << QAbstractAnimationJob::Running - << QAbstractAnimationJob::Paused))); - - QCOMPARE(seqSpy.count(), 2); // Running,Paused - QCOMPARE(groupSpy.count(), 2); // Running,Paused - - // Looping, current time = duration + 1 - group.setCurrentTime(group.duration() + 1); - QCOMPARE(group.currentLoopTime(), 1); - QCOMPARE(group.currentLoop(), 1); - QCOMPARE(sequence->currentLoopTime(), 1); - QCOMPARE(sequence->currentLoop(), 0); - QCOMPARE(a1_s_o1->currentLoopTime(), 1); - QCOMPARE(a2_s_o1->currentLoopTime(), 250); - QCOMPARE(a2_s_o1->currentLoop(), 1); - // this animation is at the end because it was run on the previous loop - QCOMPARE(a3_s_o1->currentLoop(), 0); - QCOMPARE(a3_s_o1->currentLoopTime(), 250); - - QCOMPARE(group.state(), QAnimationGroupJob::Paused); - QCOMPARE(sequence->state(), QAnimationGroupJob::Paused); - QCOMPARE(a1_s_o1->state(), QAnimationGroupJob::Paused); - QCOMPARE(a2_s_o1->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a3_s_o1->state(), QAnimationGroupJob::Stopped); - - QCOMPARE(a1Spy.count(), 7); // Running,Paused,Stopped,Running,Stopped,Running,Stopped - QCOMPARE(a2Spy.count(), 4); // Running, Stopped, Running, Stopped - QVERIFY(compareStates(a3Spy, (StateList() << QAbstractAnimationJob::Running - << QAbstractAnimationJob::Stopped - << QAbstractAnimationJob::Running - << QAbstractAnimationJob::Paused - << QAbstractAnimationJob::Stopped))); - QVERIFY(compareStates(seqSpy, (StateList() << QAbstractAnimationJob::Running - << QAbstractAnimationJob::Paused - << QAbstractAnimationJob::Stopped - << QAbstractAnimationJob::Running - << QAbstractAnimationJob::Paused))); - QCOMPARE(groupSpy.count(), 2); - - //cleanup - a1_s_o1->removeAnimationChangeListener(&a1Spy, QAbstractAnimationJob::StateChange); - a2_s_o1->removeAnimationChangeListener(&a2Spy, QAbstractAnimationJob::StateChange); - a3_s_o1->removeAnimationChangeListener(&a3Spy, QAbstractAnimationJob::StateChange); - sequence->removeAnimationChangeListener(&seqSpy, QAbstractAnimationJob::StateChange); - group.removeAnimationChangeListener(&groupSpy, QAbstractAnimationJob::StateChange); -} - -void tst_QSequentialAnimationGroupJob::startDelay() -{ - QSequentialAnimationGroupJob group; - group.appendAnimation(new QPauseAnimationJob(250)); - group.appendAnimation(new QPauseAnimationJob(125)); - QCOMPARE(group.totalDuration(), 375); - - group.start(); - QCOMPARE(group.state(), QAnimationGroupJob::Running); - - QTest::qWait(500); - - QTRY_COMPARE(group.state(), QAnimationGroupJob::Stopped); - QVERIFY(group.currentLoopTime() == 375); -} - -void tst_QSequentialAnimationGroupJob::clearGroup() -{ - QSequentialAnimationGroupJob group; - - static const int animationCount = 20; - - for (int i = 0; i < animationCount/2; ++i) { - QSequentialAnimationGroupJob *subGroup = new QSequentialAnimationGroupJob; - group.appendAnimation(subGroup); - group.appendAnimation(new QPauseAnimationJob(100)); - subGroup->appendAnimation(new QPauseAnimationJob(10)); - } - - int count = 0; - for (QAbstractAnimationJob *anim = group.firstChild(); anim; anim = anim->nextSibling()) - ++count; - QCOMPARE(count, animationCount); - - group.clear(); - - QVERIFY(!group.firstChild() && !group.lastChild()); - QCOMPARE(group.currentLoopTime(), 0); -} - -void tst_QSequentialAnimationGroupJob::groupWithZeroDurationAnimations() -{ - QSequentialAnimationGroupJob group; - - TestValueAnimation *a1 = new TestValueAnimation(0); - a1->start = 42; - a1->end = 43; - group.appendAnimation(a1); - - //this should just run fine and change nothing - group.setCurrentTime(0); - QCOMPARE(group.currentAnimation(), static_cast(a1)); - - TestValueAnimation *a2 = new TestValueAnimation(500); - a2->start = 13; - a2->end = 31; - group.appendAnimation(a2); - - TestValueAnimation *a3 = new TestValueAnimation(0); - a3->start = 43; - a3->end = 44; - group.appendAnimation(a3); - - TestValueAnimation *a4 = new TestValueAnimation(250); - a4->start = 13; - a4->end = 75; - group.appendAnimation(a4); - - TestValueAnimation *a5 = new TestValueAnimation(0); - a5->start = 42; - a5->end = 12; - group.appendAnimation(a5); - - QCOMPARE((int)a1->value, 43); //### is this actually the behavior we want? - QCOMPARE((int)a2->value, 0); - QCOMPARE((int)a3->value, 0); - QCOMPARE((int)a4->value, 0); - QCOMPARE((int)a5->value, 0); - - group.start(); - - QCOMPARE((int)a1->value, 43); //### is this actually the behavior we want? - QCOMPARE((int)a2->value, 13); - QCOMPARE((int)a3->value, 0); - QCOMPARE((int)a4->value, 0); - QCOMPARE((int)a5->value, 0); - - QTest::qWait(100); - - QCOMPARE((int)a1->value, 43); - QVERIFY(a2->value > 13 && a2->value < 31); - QCOMPARE((int)a3->value, 0); - QCOMPARE((int)a4->value, 0); - QCOMPARE((int)a5->value, 0); - - QTest::qWait(500); - - QTRY_COMPARE((int)a3->value, 44); - QCOMPARE((int)a1->value, 43); - QCOMPARE((int)a2->value, 31); - //QCOMPARE((int)a4->value, 36); - QCOMPARE((int)a5->value, 0); - QCOMPARE(a1->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a2->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a3->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a4->state(), QAnimationGroupJob::Running); - QCOMPARE(a5->state(), QAnimationGroupJob::Stopped); - QCOMPARE(group.state(), QAnimationGroupJob::Running); - QTest::qWait(500); - - QTRY_COMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE((int)a1->value, 43); - QCOMPARE((int)a2->value, 31); - QCOMPARE((int)a3->value, 44); - QCOMPARE((int)a4->value, 75); - QCOMPARE((int)a5->value, 12); - QCOMPARE(a1->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a2->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a3->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a4->state(), QAnimationGroupJob::Stopped); - QCOMPARE(a5->state(), QAnimationGroupJob::Stopped); -} - -void tst_QSequentialAnimationGroupJob::propagateGroupUpdateToChildren() -{ - // this test verifies if group state changes are updating its children correctly - QSequentialAnimationGroupJob group; - - TestAnimation anim1(100); - TestAnimation anim2(200); - - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim1.state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim2.state(), QAnimationGroupJob::Stopped); - - group.appendAnimation(&anim1); - group.appendAnimation(&anim2); - - group.start(); - - QCOMPARE(group.state(), QAnimationGroupJob::Running); - QCOMPARE(anim1.state(), QAnimationGroupJob::Running); - QCOMPARE(anim2.state(), QAnimationGroupJob::Stopped); - - group.pause(); - - QCOMPARE(group.state(), QAnimationGroupJob::Paused); - QCOMPARE(anim1.state(), QAnimationGroupJob::Paused); - QCOMPARE(anim2.state(), QAnimationGroupJob::Stopped); - - group.stop(); - - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim1.state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim2.state(), QAnimationGroupJob::Stopped); -} - -void tst_QSequentialAnimationGroupJob::updateChildrenWithRunningGroup() -{ - // assert that its possible to modify a child's state directly while their group is running - QSequentialAnimationGroupJob group; - - TestAnimation anim(200); - - StateChangeListener groupStateChangedSpy; - group.addAnimationChangeListener(&groupStateChangedSpy, QAbstractAnimationJob::StateChange); - StateChangeListener childStateChangedSpy; - anim.addAnimationChangeListener(&childStateChangedSpy, QAbstractAnimationJob::StateChange); - - QCOMPARE(groupStateChangedSpy.count(), 0); - QCOMPARE(childStateChangedSpy.count(), 0); - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim.state(), QAnimationGroupJob::Stopped); - - group.appendAnimation(&anim); - - group.start(); - - QCOMPARE(group.state(), QAnimationGroupJob::Running); - QCOMPARE(anim.state(), QAnimationGroupJob::Running); - - QCOMPARE(groupStateChangedSpy.count(), 1); - QCOMPARE(childStateChangedSpy.count(), 1); - - QCOMPARE(groupStateChangedSpy.states.at(0), QAnimationGroupJob::Running); - QCOMPARE(childStateChangedSpy.states.at(0), QAnimationGroupJob::Running); - - // starting directly a running child will not have any effect - anim.start(); - - QCOMPARE(groupStateChangedSpy.count(), 1); - QCOMPARE(childStateChangedSpy.count(), 1); - - anim.pause(); - - QCOMPARE(group.state(), QAnimationGroupJob::Running); - QCOMPARE(anim.state(), QAnimationGroupJob::Paused); - - // in the animation stops directly, the group will still be running - anim.stop(); - - QCOMPARE(group.state(), QAnimationGroupJob::Running); - QCOMPARE(anim.state(), QAnimationGroupJob::Stopped); - - //cleanup - group.removeAnimationChangeListener(&groupStateChangedSpy, QAbstractAnimationJob::StateChange); - anim.removeAnimationChangeListener(&childStateChangedSpy, QAbstractAnimationJob::StateChange); -} - -void tst_QSequentialAnimationGroupJob::deleteChildrenWithRunningGroup() -{ - // test if children can be activated when their group is stopped - QSequentialAnimationGroupJob group; - - TestAnimation *anim1 = new TestAnimation(200); - group.appendAnimation(anim1); - - QCOMPARE(group.duration(), anim1->duration()); - - group.start(); - QCOMPARE(group.state(), QAnimationGroupJob::Running); - QCOMPARE(anim1->state(), QAnimationGroupJob::Running); - - QTest::qWait(100); - QTRY_VERIFY(group.currentLoopTime() > 0); - - delete anim1; - QVERIFY(!group.firstChild()); - QCOMPARE(group.duration(), 0); - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE(group.currentLoopTime(), 0); //that's the invariant -} - -void tst_QSequentialAnimationGroupJob::startChildrenWithStoppedGroup() -{ - // test if children can be activated when their group is stopped - QSequentialAnimationGroupJob group; - - TestAnimation anim1(200); - TestAnimation anim2(200); - - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim1.state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim2.state(), QAnimationGroupJob::Stopped); - - group.appendAnimation(&anim1); - group.appendAnimation(&anim2); - - group.stop(); - - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim1.state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim2.state(), QAnimationGroupJob::Stopped); - - anim1.start(); - anim2.start(); - anim2.pause(); - - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim1.state(), QAnimationGroupJob::Running); - QCOMPARE(anim2.state(), QAnimationGroupJob::Paused); -} - -void tst_QSequentialAnimationGroupJob::stopGroupWithRunningChild() -{ - // children that started independently will not be affected by a group stop - QSequentialAnimationGroupJob group; - - TestAnimation anim1(200); - TestAnimation anim2(200); - - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim1.state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim2.state(), QAnimationGroupJob::Stopped); - - group.appendAnimation(&anim1); - group.appendAnimation(&anim2); - - anim1.start(); - anim2.start(); - anim2.pause(); - - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim1.state(), QAnimationGroupJob::Running); - QCOMPARE(anim2.state(), QAnimationGroupJob::Paused); - - group.stop(); - - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim1.state(), QAnimationGroupJob::Running); - QCOMPARE(anim2.state(), QAnimationGroupJob::Paused); - - anim1.stop(); - anim2.stop(); - - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim1.state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim2.state(), QAnimationGroupJob::Stopped); -} - -void tst_QSequentialAnimationGroupJob::startGroupWithRunningChild() -{ - // as the group has precedence over its children, starting a group will restart all the children - QSequentialAnimationGroupJob group; - - TestAnimation *anim1 = new TestAnimation(200); - TestAnimation *anim2 = new TestAnimation(200); - - StateChangeListener stateChangedSpy1; - anim1->addAnimationChangeListener(&stateChangedSpy1, QAbstractAnimationJob::StateChange); - StateChangeListener stateChangedSpy2; - anim2->addAnimationChangeListener(&stateChangedSpy2, QAbstractAnimationJob::StateChange); - - QCOMPARE(stateChangedSpy1.count(), 0); - QCOMPARE(stateChangedSpy2.count(), 0); - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim1->state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim2->state(), QAnimationGroupJob::Stopped); - - group.appendAnimation(anim1); - group.appendAnimation(anim2); - - anim1->start(); - anim2->start(); - anim2->pause(); - - QVERIFY(compareStates(stateChangedSpy1, (StateList() << QAbstractAnimationJob::Running))); - - QVERIFY(compareStates(stateChangedSpy2, (StateList() << QAbstractAnimationJob::Running - << QAbstractAnimationJob::Paused))); - - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim1->state(), QAnimationGroupJob::Running); - QCOMPARE(anim2->state(), QAnimationGroupJob::Paused); - - group.start(); - - QVERIFY(compareStates(stateChangedSpy1, (StateList() << QAbstractAnimationJob::Running - << QAbstractAnimationJob::Stopped - << QAbstractAnimationJob::Running))); - QVERIFY(compareStates(stateChangedSpy2, (StateList() << QAbstractAnimationJob::Running - << QAbstractAnimationJob::Paused))); - - QCOMPARE(group.state(), QAnimationGroupJob::Running); - QCOMPARE(anim1->state(), QAnimationGroupJob::Running); - QCOMPARE(anim2->state(), QAnimationGroupJob::Paused); - - QTest::qWait(300); - - QCOMPARE(group.state(), QAnimationGroupJob::Running); - QCOMPARE(anim1->state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim2->state(), QAnimationGroupJob::Running); - - QCOMPARE(stateChangedSpy2.count(), 4); - QCOMPARE(stateChangedSpy2.states.at(2), QAnimationGroupJob::Stopped); - QCOMPARE(stateChangedSpy2.states.at(3), QAnimationGroupJob::Running); - - group.stop(); - - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim1->state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim2->state(), QAnimationGroupJob::Stopped); - - anim1->removeAnimationChangeListener(&stateChangedSpy1, QAbstractAnimationJob::StateChange); - anim2->removeAnimationChangeListener(&stateChangedSpy2, QAbstractAnimationJob::StateChange); -} - -void tst_QSequentialAnimationGroupJob::zeroDurationAnimation() -{ - QSequentialAnimationGroupJob group; - - TestAnimation *anim1 = new TestAnimation(0); - TestAnimation *anim2 = new TestAnimation(100); - TestValueAnimation *anim3 = new TestValueAnimation(0); - anim3->end = 100; - - StateChangeListener stateChangedSpy; - anim1->addAnimationChangeListener(&stateChangedSpy, QAbstractAnimationJob::StateChange); - - group.appendAnimation(anim1); - group.appendAnimation(anim2); - group.appendAnimation(anim3); - group.setLoopCount(2); - group.start(); - - QCOMPARE(stateChangedSpy.count(), 2); - QCOMPARE(stateChangedSpy.states.at(0), QAnimationGroupJob::Running); - QCOMPARE(stateChangedSpy.states.at(1), QAnimationGroupJob::Stopped); - - QCOMPARE(anim1->state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim2->state(), QAnimationGroupJob::Running); - QCOMPARE(group.state(), QAnimationGroupJob::Running); - - //now let's try to seek to the next loop - group.setCurrentTime(group.duration() + 1); - QCOMPARE(anim1->state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim2->state(), QAnimationGroupJob::Running); - QCOMPARE(anim3->state(), QAnimationGroupJob::Stopped); - QCOMPARE(group.state(), QAnimationGroupJob::Running); - //TODO: test that anim3 was run - QCOMPARE(anim3->value, qreal(100)); //anim3 should have been run - - anim1->removeAnimationChangeListener(&stateChangedSpy, QAbstractAnimationJob::StateChange); -} - -void tst_QSequentialAnimationGroupJob::stopUncontrolledAnimations() -{ - QSequentialAnimationGroupJob group; - - UncontrolledAnimation notTimeDriven; - QCOMPARE(notTimeDriven.totalDuration(), -1); - - TestAnimation loopsForever(100); - loopsForever.setLoopCount(-1); - - group.appendAnimation(¬TimeDriven); - group.appendAnimation(&loopsForever); - - group.start(); - - QCOMPARE(group.state(), QAnimationGroupJob::Running); - QCOMPARE(notTimeDriven.state(), QAnimationGroupJob::Running); - QCOMPARE(loopsForever.state(), QAnimationGroupJob::Stopped); - - notTimeDriven.stop(); - - QCOMPARE(group.state(), QAnimationGroupJob::Running); - QCOMPARE(notTimeDriven.state(), QAnimationGroupJob::Stopped); - QCOMPARE(loopsForever.state(), QAnimationGroupJob::Running); - - loopsForever.stop(); - - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE(notTimeDriven.state(), QAnimationGroupJob::Stopped); - QCOMPARE(loopsForever.state(), QAnimationGroupJob::Stopped); -} - -void tst_QSequentialAnimationGroupJob::finishWithUncontrolledAnimation() -{ - //1st case: - //first we test a group with one uncontrolled animation - QSequentialAnimationGroupJob group; - UncontrolledAnimation notTimeDriven; - group.appendAnimation(¬TimeDriven); - FinishedListener spy; - group.addAnimationChangeListener(&spy, QAbstractAnimationJob::Completion); - - group.start(); - QCOMPARE(group.state(), QAnimationGroupJob::Running); - QCOMPARE(notTimeDriven.state(), QAnimationGroupJob::Running); - QCOMPARE(group.currentLoopTime(), 0); - QCOMPARE(notTimeDriven.currentLoopTime(), 0); - - QTest::qWait(300); //wait for the end of notTimeDriven - QTRY_COMPARE(notTimeDriven.state(), QAnimationGroupJob::Stopped); - const int actualDuration = notTimeDriven.currentLoopTime(); - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE(group.currentLoopTime(), actualDuration); - QCOMPARE(spy.count(), 1); - - //2nd case: - // lets make sure the seeking will work again - spy.clear(); - TestAnimation anim; - group.appendAnimation(&anim); - StateChangeListener animStateChangedSpy; - anim.addAnimationChangeListener(&animStateChangedSpy, QAbstractAnimationJob::StateChange); - - group.setCurrentTime(300); - QCOMPARE(group.state(), QAnimationGroupJob::Stopped); - QCOMPARE(notTimeDriven.currentLoopTime(), actualDuration); - QCOMPARE(group.currentAnimation(), static_cast(&anim)); - - //3rd case: - //now let's add a perfectly defined animation at the end - QCOMPARE(animStateChangedSpy.count(), 0); - group.start(); - QCOMPARE(group.state(), QAnimationGroupJob::Running); - QCOMPARE(notTimeDriven.state(), QAnimationGroupJob::Running); - QCOMPARE(group.currentLoopTime(), 0); - QCOMPARE(notTimeDriven.currentLoopTime(), 0); - - QCOMPARE(animStateChangedSpy.count(), 0); - - QTest::qWait(300); //wait for the end of notTimeDriven - QTRY_COMPARE(notTimeDriven.state(), QAnimationGroupJob::Stopped); - QCOMPARE(group.state(), QAnimationGroupJob::Running); - QCOMPARE(anim.state(), QAnimationGroupJob::Running); - QCOMPARE(group.currentAnimation(), static_cast(&anim)); - QCOMPARE(animStateChangedSpy.count(), 1); - QTest::qWait(300); //wait for the end of anim - - QTRY_COMPARE(anim.state(), QAnimationGroupJob::Stopped); - QCOMPARE(anim.currentLoopTime(), anim.duration()); - - //we should simply be at the end - QCOMPARE(spy.count(), 1); - QCOMPARE(animStateChangedSpy.count(), 2); - QCOMPARE(group.currentLoopTime(), notTimeDriven.currentLoopTime() + anim.currentLoopTime()); - - //cleanup - group.removeAnimationChangeListener(&spy, QAbstractAnimationJob::Completion); - anim.removeAnimationChangeListener(&animStateChangedSpy, QAbstractAnimationJob::StateChange); -} - -void tst_QSequentialAnimationGroupJob::addRemoveAnimation() -{ - //this test is specific to the sequential animation group - QSequentialAnimationGroupJob group; - - QCOMPARE(group.duration(), 0); - QCOMPARE(group.currentLoopTime(), 0); - QAbstractAnimationJob *anim1 = new TestAnimation; - group.appendAnimation(anim1); - QCOMPARE(group.duration(), 250); - QCOMPARE(group.currentLoopTime(), 0); - QCOMPARE(group.currentAnimation(), anim1); - - //let's append an animation - QAbstractAnimationJob *anim2 = new TestAnimation; - group.appendAnimation(anim2); - QCOMPARE(group.duration(), 500); - QCOMPARE(group.currentLoopTime(), 0); - QCOMPARE(group.currentAnimation(), anim1); - - //let's prepend an animation - QAbstractAnimationJob *anim0 = new TestAnimation; - group.prependAnimation(anim0); - QCOMPARE(group.duration(), 750); - QCOMPARE(group.currentLoopTime(), 0); - QCOMPARE(group.currentAnimation(), anim0); //anim0 has become the new currentAnimation - - group.setCurrentTime(300); //anim0 | anim1 | anim2 - QCOMPARE(group.currentLoopTime(), 300); - QCOMPARE(group.currentAnimation(), anim1); - QCOMPARE(anim1->currentLoopTime(), 50); - - group.removeAnimation(anim0); //anim1 | anim2 - QCOMPARE(group.currentLoopTime(), 50); - QCOMPARE(group.currentAnimation(), anim1); - QCOMPARE(anim1->currentLoopTime(), 50); - - group.setCurrentTime(0); - group.prependAnimation(anim0); //anim0 | anim1 | anim2 - group.setCurrentTime(300); - QCOMPARE(group.currentLoopTime(), 300); - QCOMPARE(group.currentAnimation(), anim1); - QCOMPARE(anim1->currentLoopTime(), 50); - - group.removeAnimation(anim1); //anim0 | anim2 - QCOMPARE(group.currentLoopTime(), 250); - QCOMPARE(group.currentAnimation(), anim2); - QCOMPARE(anim0->currentLoopTime(), 250); -} - -void tst_QSequentialAnimationGroupJob::currentAnimation() -{ - QSequentialAnimationGroupJob group; - QVERIFY(group.currentAnimation() == 0); - - TestAnimation anim(0); - group.appendAnimation(&anim); - QCOMPARE(group.currentAnimation(), static_cast(&anim)); -} - -void tst_QSequentialAnimationGroupJob::currentAnimationWithZeroDuration() -{ - QSequentialAnimationGroupJob group; - QVERIFY(group.currentAnimation() == 0); - - TestAnimation zero1(0); - TestAnimation zero2(0); - - TestAnimation anim; - - TestAnimation zero3(0); - TestAnimation zero4(0); - - group.appendAnimation(&zero1); - group.appendAnimation(&zero2); - group.appendAnimation(&anim); - group.appendAnimation(&zero3); - group.appendAnimation(&zero4); - - QCOMPARE(group.currentAnimation(), static_cast(&zero1)); - - group.setCurrentTime(0); - QCOMPARE(group.currentAnimation(), static_cast(&anim)); - - group.setCurrentTime(group.duration()); - QCOMPARE(group.currentAnimation(), static_cast(&zero4)); - - group.setDirection(QAbstractAnimationJob::Backward); - - group.setCurrentTime(0); - QCOMPARE(group.currentAnimation(), static_cast(&zero1)); - - group.setCurrentTime(group.duration()); - QCOMPARE(group.currentAnimation(), static_cast(&anim)); -} - -void tst_QSequentialAnimationGroupJob::insertAnimation() -{ - QSequentialAnimationGroupJob group; - group.setLoopCount(2); - TestAnimation *anim = new TestAnimation; - group.appendAnimation(anim); - QCOMPARE(group.duration(), anim->duration()); - group.setCurrentTime(300); - QCOMPARE(group.currentLoop(), 1); - - //this will crash if the sequential group calls duration on the created animation - group.appendAnimation(new TestAnimation); -} - -class ClearFinishedListener: public QAnimationJobChangeListener -{ -public: - ClearFinishedListener(QSequentialAnimationGroupJob *g) : group(g) {} - - virtual void animationFinished(QAbstractAnimationJob *) - { - group->clear(); - } - - QSequentialAnimationGroupJob *group; -}; - -class RefillFinishedListener: public QAnimationJobChangeListener -{ -public: - RefillFinishedListener(QSequentialAnimationGroupJob *g) : group(g) {} - - virtual void animationFinished(QAbstractAnimationJob *) - { - group->stop(); - group->clear(); - group->appendAnimation(new TestAnimation); - group->start(); - } - - QSequentialAnimationGroupJob *group; -}; - -void tst_QSequentialAnimationGroupJob::clear() -{ - QSKIP("deleting an animation when finished is not currently supported"); - QSequentialAnimationGroupJob group; - TestAnimation *anim1 = new TestAnimation; - group.appendAnimation(anim1); - ClearFinishedListener clearListener(&group); - anim1->addAnimationChangeListener(&clearListener, QAbstractAnimationJob::Completion); - - TestAnimation *anim2 = new TestAnimation; - group.appendAnimation(anim2); - QCOMPARE(group.firstChild(), anim1); - QCOMPARE(group.lastChild(), anim2); - - group.start(); - QTest::qWait(anim1->duration() + 100); - QTRY_VERIFY(!group.firstChild()); - QCOMPARE(group.state(), QAbstractAnimationJob::Stopped); - QCOMPARE(group.currentLoopTime(), 0); - - anim1 = new TestAnimation; - group.appendAnimation(anim1); - RefillFinishedListener refillListener(&group); - anim1->addAnimationChangeListener(&refillListener, QAbstractAnimationJob::Completion); - group.start(); - QTest::qWait(anim1->duration() + 100); - QTRY_COMPARE(group.state(), QAbstractAnimationJob::Running); -} - -void tst_QSequentialAnimationGroupJob::pauseResume() -{ - QParallelAnimationGroupJob group; - TestAnimation *anim = new TestAnimation; - group.appendAnimation(anim); - StateChangeListener spy; - anim->addAnimationChangeListener(&spy, QAbstractAnimationJob::StateChange); - QCOMPARE(group.duration(), 250); - group.start(); - QTest::qWait(100); - QTRY_COMPARE(group.state(), QAnimationGroupJob::Running); - QCOMPARE(anim->state(), QAnimationGroupJob::Running); - QCOMPARE(spy.count(), 1); - spy.clear(); - const int currentTime = group.currentLoopTime(); - QCOMPARE(anim->currentLoopTime(), currentTime); - - group.pause(); - QCOMPARE(group.state(), QAnimationGroupJob::Paused); - QCOMPARE(group.currentLoopTime(), currentTime); - QCOMPARE(anim->state(), QAnimationGroupJob::Paused); - QCOMPARE(anim->currentLoopTime(), currentTime); - QCOMPARE(spy.count(), 1); - spy.clear(); - - group.resume(); - QCOMPARE(group.state(), QAnimationGroupJob::Running); - QCOMPARE(group.currentLoopTime(), currentTime); - QCOMPARE(anim->state(), QAnimationGroupJob::Running); - QCOMPARE(anim->currentLoopTime(), currentTime); - QCOMPARE(spy.count(), 1); - - anim->removeAnimationChangeListener(&spy, QAbstractAnimationJob::StateChange); -} - -QTEST_MAIN(tst_QSequentialAnimationGroupJob) -#include "tst_qsequentialanimationgroupjob.moc" diff --git a/tests/auto/declarative/debugger/debugger.pro b/tests/auto/declarative/debugger/debugger.pro deleted file mode 100644 index 314f0d1b78..0000000000 --- a/tests/auto/declarative/debugger/debugger.pro +++ /dev/null @@ -1,16 +0,0 @@ -TEMPLATE = subdirs - -PRIVATETESTS += \ - qdeclarativeenginedebug \ - qdeclarativedebugclient \ - qdeclarativedebugservice \ - qdeclarativedebugjs \ - qdeclarativeinspector \ - qdeclarativeprofilerservice \ - qpacketprotocol \ - qv8profilerservice \ - qdebugmessageservice - -contains(QT_CONFIG, private_tests) { - SUBDIRS += $$PRIVATETESTS -} diff --git a/tests/auto/declarative/debugger/qdebugmessageservice/data/test.qml b/tests/auto/declarative/debugger/qdebugmessageservice/data/test.qml deleted file mode 100644 index ab86c7d468..0000000000 --- a/tests/auto/declarative/debugger/qdebugmessageservice/data/test.qml +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Item { - width: 360 - height: 360 - Component.onCompleted: { - console.log("console.log") - console.count("console.count"); - } -} diff --git a/tests/auto/declarative/debugger/qdebugmessageservice/qdebugmessageservice.pro b/tests/auto/declarative/debugger/qdebugmessageservice/qdebugmessageservice.pro deleted file mode 100644 index 698e9604f0..0000000000 --- a/tests/auto/declarative/debugger/qdebugmessageservice/qdebugmessageservice.pro +++ /dev/null @@ -1,21 +0,0 @@ -CONFIG += testcase -TARGET = tst_qdebugmessageservice -QT += network declarative-private testlib -macx:CONFIG -= app_bundle - -HEADERS += ../shared/debugutil_p.h - -SOURCES += tst_qdebugmessageservice.cpp \ - ../shared/debugutil.cpp - -INCLUDEPATH += ../shared - -include(../../../shared/util.pri) - -testDataFiles.files = data -testDataFiles.path = . -DEPLOYMENT += testDataFiles - -CONFIG += parallel_test - -OTHER_FILES += data/test.qml diff --git a/tests/auto/declarative/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp b/tests/auto/declarative/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp deleted file mode 100644 index 94738dc083..0000000000 --- a/tests/auto/declarative/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp +++ /dev/null @@ -1,242 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -//QDeclarativeDebugTest -#include "../shared/debugutil_p.h" -#include "../../../shared/util.h" - -#include -#include - -const char *NORMALMODE = "-qmljsdebugger=port:3777,block"; -const char *QMLFILE = "test.qml"; - -class QDeclarativeDebugMsgClient; -class tst_QDebugMessageService : public QDeclarativeDataTest -{ - Q_OBJECT - -public: - tst_QDebugMessageService(); - - void init(); - -private slots: - void initTestCase(); - void cleanupTestCase(); - - void cleanup(); - - void retrieveDebugOutput(); - -private: - QDeclarativeDebugProcess *m_process; - QDeclarativeDebugMsgClient *m_client; - QDeclarativeDebugConnection *m_connection; -}; - -struct LogEntry { - LogEntry(QtMsgType _type, QString _message) - : type(_type), message(_message) {} - - QtMsgType type; - QString message; - int line; - QString file; - QString function; - - QString toString() const { return QString::number(type) + ": " + message; } -}; - -bool operator==(const LogEntry &t1, const LogEntry &t2) -{ - return t1.type == t2.type && t1.message == t2.message - && t1.line == t2.line && t1.file == t2.file - && t1.function == t2.function; -} - -class QDeclarativeDebugMsgClient : public QDeclarativeDebugClient -{ - Q_OBJECT -public: - QDeclarativeDebugMsgClient(QDeclarativeDebugConnection *connection) - : QDeclarativeDebugClient(QLatin1String("DebugMessages"), connection) - { - } - - QList logBuffer; - -protected: - //inherited from QDeclarativeDebugClient - void stateChanged(State state); - void messageReceived(const QByteArray &data); - -signals: - void enabled(); - void debugOutput(); -}; - -void QDeclarativeDebugMsgClient::stateChanged(State state) -{ - if (state == Enabled) { - emit enabled(); - } -} - -void QDeclarativeDebugMsgClient::messageReceived(const QByteArray &data) -{ - QDataStream ds(data); - QByteArray command; - ds >> command; - - if (command == "MESSAGE") { - int type; - QByteArray message; - QByteArray file; - QByteArray function; - int line; - ds >> type >> message >> file >> line >> function; - QVERIFY(ds.atEnd()); - - QVERIFY(type >= QtDebugMsg); - QVERIFY(type <= QtFatalMsg); - - LogEntry entry((QtMsgType)type, QString::fromUtf8(message)); - entry.line = line; - entry.file = QString::fromUtf8(file); - entry.function = QString::fromUtf8(function); - logBuffer << entry; - emit debugOutput(); - } else { - QFAIL("Unknown message"); - } -} - -tst_QDebugMessageService::tst_QDebugMessageService() -{ -} - -void tst_QDebugMessageService::initTestCase() -{ - QDeclarativeDataTest::initTestCase(); - m_process = 0; - m_client = 0; - m_connection = 0; -} - -void tst_QDebugMessageService::cleanupTestCase() -{ - if (m_process) - delete m_process; - - if (m_client) - delete m_client; - - if (m_connection) - delete m_connection; -} - -void tst_QDebugMessageService::init() -{ - m_connection = new QDeclarativeDebugConnection(); - m_process = new QDeclarativeDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene"); - m_client = new QDeclarativeDebugMsgClient(m_connection); - - m_process->start(QStringList() << QLatin1String(NORMALMODE) << QDeclarativeDataTest::instance()->testFile(QMLFILE)); - if (!m_process->waitForSessionStart()) { - QFAIL(QString("Could not launch app. Application output: \n%1").arg(m_process->output()).toAscii()); - } - - m_connection->connectToHost("127.0.0.1", 3777); - QVERIFY(m_connection->waitForConnected()); - - QVERIFY(QDeclarativeDebugTest::waitForSignal(m_client, SIGNAL(enabled()))); -} - -void tst_QDebugMessageService::cleanup() -{ - if (QTest::currentTestFailed()) - qDebug() << m_process->output(); - if (m_process) - delete m_process; - - if (m_client) - delete m_client; - - if (m_connection) - delete m_connection; - - m_process = 0; - m_client = 0; - m_connection = 0; -} - -void tst_QDebugMessageService::retrieveDebugOutput() -{ - init(); - - int maxTries = 2; - while ((m_client->logBuffer.size() < 2) - || (maxTries-- > 0)) - QDeclarativeDebugTest::waitForSignal(m_client, SIGNAL(debugOutput()), 1000); - - QVERIFY(m_client->logBuffer.size() >= 2); - - const QString path = - QUrl::fromLocalFile(QDeclarativeDataTest::instance()->testFile(QMLFILE)).toString(); - LogEntry entry1(QtDebugMsg, QLatin1String("console.log")); - entry1.line = 48; - entry1.file = path; - entry1.function = QLatin1String("onCompleted"); - LogEntry entry2(QtDebugMsg, QLatin1String("console.count: 1")); - entry2.line = 49; - entry2.file = path; - entry2.function = QLatin1String("onCompleted"); - - QVERIFY(m_client->logBuffer.contains(entry1)); - QVERIFY(m_client->logBuffer.contains(entry2)); -} - -QTEST_MAIN(tst_QDebugMessageService) - -#include "tst_qdebugmessageservice.moc" diff --git a/tests/auto/declarative/debugger/qdeclarativedebugclient/qdeclarativedebugclient.pro b/tests/auto/declarative/debugger/qdeclarativedebugclient/qdeclarativedebugclient.pro deleted file mode 100644 index 8eb33fb81d..0000000000 --- a/tests/auto/declarative/debugger/qdeclarativedebugclient/qdeclarativedebugclient.pro +++ /dev/null @@ -1,11 +0,0 @@ -CONFIG += testcase -TARGET = tst_qdeclarativedebugclient -macx:CONFIG -= app_bundle - -HEADERS += ../shared/debugutil_p.h -SOURCES += tst_qdeclarativedebugclient.cpp \ - ../shared/debugutil.cpp - -CONFIG += declarative_debug - -QT += declarative-private testlib diff --git a/tests/auto/declarative/debugger/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp b/tests/auto/declarative/debugger/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp deleted file mode 100644 index e059c7617b..0000000000 --- a/tests/auto/declarative/debugger/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp +++ /dev/null @@ -1,197 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include -#include -#include -#include -#include -#include - -#include - -#include "../shared/debugutil_p.h" - -#define PORT 13770 -#define STR_PORT "13770" - -class tst_QDeclarativeDebugClient : public QObject -{ - Q_OBJECT - -private: - QDeclarativeDebugConnection *m_conn; - -private slots: - void initTestCase(); - - void name(); - void state(); - void sendMessage(); - void parallelConnect(); - void sequentialConnect(); -}; - -void tst_QDeclarativeDebugClient::initTestCase() -{ - const QString waitingMsg = QString("QDeclarativeDebugServer: Waiting for connection on port %1...").arg(PORT); - QTest::ignoreMessage(QtWarningMsg, waitingMsg.toAscii().constData()); - new QDeclarativeEngine(this); - - m_conn = new QDeclarativeDebugConnection(this); - - QDeclarativeDebugTestClient client("tst_QDeclarativeDebugClient::handshake()", m_conn); - QDeclarativeDebugTestService service("tst_QDeclarativeDebugClient::handshake()"); - - QTest::ignoreMessage(QtWarningMsg, "QDeclarativeDebugServer: Connection established"); - for (int i = 0; i < 50; ++i) { - // try for 5 seconds ... - m_conn->connectToHost("127.0.0.1", PORT); - if (m_conn->waitForConnected()) - break; - QTest::qSleep(100); - } - - QVERIFY(m_conn->isConnected()); - - QTRY_VERIFY(QDeclarativeDebugService::hasDebuggingClient()); - QTRY_COMPARE(client.state(), QDeclarativeDebugClient::Enabled); -} - -void tst_QDeclarativeDebugClient::name() -{ - QString name = "tst_QDeclarativeDebugClient::name()"; - - QDeclarativeDebugClient client(name, m_conn); - QCOMPARE(client.name(), name); -} - -void tst_QDeclarativeDebugClient::state() -{ - { - QDeclarativeDebugConnection dummyConn; - QDeclarativeDebugClient client("tst_QDeclarativeDebugClient::state()", &dummyConn); - QCOMPARE(client.state(), QDeclarativeDebugClient::NotConnected); - QCOMPARE(client.serviceVersion(), -1.0f); - } - - QDeclarativeDebugTestClient client("tst_QDeclarativeDebugClient::state()", m_conn); - QCOMPARE(client.state(), QDeclarativeDebugClient::Unavailable); - - { - QDeclarativeDebugTestService service("tst_QDeclarativeDebugClient::state()", 2); - QTRY_COMPARE(client.state(), QDeclarativeDebugClient::Enabled); - QCOMPARE(client.serviceVersion(), 2.0f); - } - - QTRY_COMPARE(client.state(), QDeclarativeDebugClient::Unavailable); - - // duplicate plugin name - QTest::ignoreMessage(QtWarningMsg, "QDeclarativeDebugClient: Conflicting plugin name \"tst_QDeclarativeDebugClient::state()\" "); - QDeclarativeDebugClient client2("tst_QDeclarativeDebugClient::state()", m_conn); - QCOMPARE(client2.state(), QDeclarativeDebugClient::NotConnected); - - QDeclarativeDebugClient client3("tst_QDeclarativeDebugClient::state3()", 0); - QCOMPARE(client3.state(), QDeclarativeDebugClient::NotConnected); -} - -void tst_QDeclarativeDebugClient::sendMessage() -{ - QDeclarativeDebugTestService service("tst_QDeclarativeDebugClient::sendMessage()"); - QDeclarativeDebugTestClient client("tst_QDeclarativeDebugClient::sendMessage()", m_conn); - - QByteArray msg = "hello!"; - - QTRY_COMPARE(client.state(), QDeclarativeDebugClient::Enabled); - - client.sendMessage(msg); - QByteArray resp = client.waitForResponse(); - QCOMPARE(resp, msg); -} - -void tst_QDeclarativeDebugClient::parallelConnect() -{ - QDeclarativeDebugConnection connection2; - - QTest::ignoreMessage(QtWarningMsg, "QDeclarativeDebugServer: Another client is already connected"); - // will connect & immediately disconnect - connection2.connectToHost("127.0.0.1", PORT); - QVERIFY(connection2.waitForConnected()); - QTRY_COMPARE(connection2.state(), QAbstractSocket::UnconnectedState); - QVERIFY(m_conn->isConnected()); -} - -void tst_QDeclarativeDebugClient::sequentialConnect() -{ - QDeclarativeDebugConnection connection2; - QDeclarativeDebugTestClient client2("tst_QDeclarativeDebugClient::handshake()", &connection2); - QDeclarativeDebugTestService service("tst_QDeclarativeDebugClient::handshake()"); - - m_conn->close(); - QVERIFY(!m_conn->isConnected()); - QCOMPARE(m_conn->state(), QAbstractSocket::UnconnectedState); - - // Make sure that the disconnect is actually delivered to the server - QTest::qWait(100); - - connection2.connectToHost("127.0.0.1", PORT); - QTest::ignoreMessage(QtWarningMsg, "QDeclarativeDebugServer: Connection established"); - QVERIFY(connection2.waitForConnected()); - QVERIFY(connection2.isConnected()); - QTRY_VERIFY(client2.state() == QDeclarativeDebugClient::Enabled); -} - -int main(int argc, char *argv[]) -{ - int _argc = argc + 1; - char **_argv = new char*[_argc]; - for (int i = 0; i < argc; ++i) - _argv[i] = argv[i]; - char arg[] = "-qmljsdebugger=port:" STR_PORT; - _argv[_argc - 1] = arg; - - QGuiApplication app(_argc, _argv); - tst_QDeclarativeDebugClient tc; - return QTest::qExec(&tc, _argc, _argv); - delete _argv; -} - -#include "tst_qdeclarativedebugclient.moc" - diff --git a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/breakpointRelocation.qml b/tests/auto/declarative/debugger/qdeclarativedebugjs/data/breakpointRelocation.qml deleted file mode 100644 index 1f0f9e22c9..0000000000 --- a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/breakpointRelocation.qml +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -//DO NOT CHANGE - -Item { - Component.onCompleted: { - //Comment - - var b = 6; - } -} - diff --git a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/changeBreakpoint.qml b/tests/auto/declarative/debugger/qdeclarativedebugjs/data/changeBreakpoint.qml deleted file mode 100644 index fd81b3f805..0000000000 --- a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/changeBreakpoint.qml +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -//DO NOT CHANGE - -Item { - id: item - property int d: 0 - - function doSomething() { - var a = 5; - var b = 6; - } - - Timer { - id: timer; interval: 1; running: true; repeat: true - onTriggered: doSomething(); - } - -} diff --git a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/condition.qml b/tests/auto/declarative/debugger/qdeclarativedebugjs/data/condition.qml deleted file mode 100644 index ad4144be11..0000000000 --- a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/condition.qml +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -//DO NOT CHANGE - -Item { - id: item - property int a: 0 - Timer { - id: timer; interval: 1; repeat: true; running: true - onTriggered: a++ - } -} - diff --git a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/createComponent.qml b/tests/auto/declarative/debugger/qdeclarativedebugjs/data/createComponent.qml deleted file mode 100644 index 993f33a661..0000000000 --- a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/createComponent.qml +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -//DO NOT CHANGE -Item { - Component.onCompleted: { - var component = Qt.createComponent("oncompleted.qml") - if (component.status === Component.Ready) { - component.createObject(); - } - } -} - - diff --git a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/exception.qml b/tests/auto/declarative/debugger/qdeclarativedebugjs/data/exception.qml deleted file mode 100644 index b491087a02..0000000000 --- a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/exception.qml +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -//DO NOT CHANGE - -Item { - id: root - - Component.onCompleted: dummy() -} - diff --git a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/loadjsfile.qml b/tests/auto/declarative/debugger/qdeclarativedebugjs/data/loadjsfile.qml deleted file mode 100644 index 4fff66a325..0000000000 --- a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/loadjsfile.qml +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import "test.js" as Script - -//DO NOT CHANGE -Item { - Component.onCompleted: Script.printMessage("onCompleted"); -} diff --git a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/oncompleted.qml b/tests/auto/declarative/debugger/qdeclarativedebugjs/data/oncompleted.qml deleted file mode 100644 index e03ba2ca79..0000000000 --- a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/oncompleted.qml +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -//DO NOT CHANGE - -Item { - Component.onCompleted: { - console.log("Hello world") - } - id: root - property int a: 10 -} - diff --git a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/stepAction.qml b/tests/auto/declarative/debugger/qdeclarativedebugjs/data/stepAction.qml deleted file mode 100644 index 690f9fd446..0000000000 --- a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/stepAction.qml +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -//DO NOT CHANGE - -Item { - id: item - property int d: 0 - - function doSomething() { - var a = 5; - var b = 6; - } - - Component.onCompleted: doSomething() - -} diff --git a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/test.js b/tests/auto/declarative/debugger/qdeclarativedebugjs/data/test.js deleted file mode 100644 index 7de138bdf6..0000000000 --- a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/test.js +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -function printMessage(msg) -{ - print(msg); -} - -function add(a,b) -{ - //This is a comment and below is an empty line - - var out = a + b; - return out; -} diff --git a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/test.qml b/tests/auto/declarative/debugger/qdeclarativedebugjs/data/test.qml deleted file mode 100644 index 200f26b1c3..0000000000 --- a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/test.qml +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -//DO NOT CHANGE - -Item { - Component.onCompleted: { - var a = [1, 2] - var b = {a: "hello", d: 1 } - var c - var d = 12 - } -} - diff --git a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/timer.qml b/tests/auto/declarative/debugger/qdeclarativedebugjs/data/timer.qml deleted file mode 100644 index d9440415d2..0000000000 --- a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/timer.qml +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -//DO NOT CHANGE -Item { - Timer { - id: timer; interval: 1; running: true; repeat: true; triggeredOnStart: true - onTriggered: { - console.log("timer"); - } - } -} diff --git a/tests/auto/declarative/debugger/qdeclarativedebugjs/qdeclarativedebugjs.pro b/tests/auto/declarative/debugger/qdeclarativedebugjs/qdeclarativedebugjs.pro deleted file mode 100644 index 5618995b4d..0000000000 --- a/tests/auto/declarative/debugger/qdeclarativedebugjs/qdeclarativedebugjs.pro +++ /dev/null @@ -1,29 +0,0 @@ -CONFIG += testcase -TARGET = tst_qdeclarativedebugjs -QT += declarative-private testlib -macx:CONFIG -= app_bundle - -HEADERS += ../shared/debugutil_p.h -SOURCES += tst_qdeclarativedebugjs.cpp \ - ../shared/debugutil.cpp - -INCLUDEPATH += ../shared - -include (../../../shared/util.pri) - -testDataFiles.files = data -testDataFiles.path = . -DEPLOYMENT += testDataFiles - -CONFIG += parallel_test - -OTHER_FILES += data/test.qml data/test.js \ - data/timer.qml \ - data/exception.qml \ - data/oncompleted.qml \ - data/loadjsfile.qml \ - data/condition.qml \ - data/changeBreakpoint.qml \ - data/stepAction.qml \ - data/breakpointRelocation.qml \ - data/createComponent.qml diff --git a/tests/auto/declarative/debugger/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp b/tests/auto/declarative/debugger/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp deleted file mode 100644 index 7d57c8eda2..0000000000 --- a/tests/auto/declarative/debugger/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp +++ /dev/null @@ -1,1790 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -//QDeclarativeDebugTest -#include "../shared/debugutil_p.h" -#include "../../../shared/util.h" - -const char *V8REQUEST = "v8request"; -const char *V8MESSAGE = "v8message"; -const char *SEQ = "seq"; -const char *TYPE = "type"; -const char *COMMAND = "command"; -const char *ARGUMENTS = "arguments"; -const char *STEPACTION = "stepaction"; -const char *STEPCOUNT = "stepcount"; -const char *EXPRESSION = "expression"; -const char *FRAME = "frame"; -const char *GLOBAL = "global"; -const char *DISABLEBREAK = "disable_break"; -const char *HANDLES = "handles"; -const char *INCLUDESOURCE = "includeSource"; -const char *FROMFRAME = "fromFrame"; -const char *TOFRAME = "toFrame"; -const char *BOTTOM = "bottom"; -const char *NUMBER = "number"; -const char *FRAMENUMBER = "frameNumber"; -const char *TYPES = "types"; -const char *IDS = "ids"; -const char *FILTER = "filter"; -const char *FROMLINE = "fromLine"; -const char *TOLINE = "toLine"; -const char *TARGET = "target"; -const char *LINE = "line"; -const char *COLUMN = "column"; -const char *ENABLED = "enabled"; -const char *CONDITION = "condition"; -const char *IGNORECOUNT = "ignoreCount"; -const char *BREAKPOINT = "breakpoint"; -const char *FLAGS = "flags"; - -const char *CONTINEDEBUGGING = "continue"; -const char *EVALUATE = "evaluate"; -const char *LOOKUP = "lookup"; -const char *BACKTRACE = "backtrace"; -const char *SCOPE = "scope"; -const char *SCOPES = "scopes"; -const char *SCRIPTS = "scripts"; -const char *SOURCE = "source"; -const char *SETBREAKPOINT = "setbreakpoint"; -const char *CHANGEBREAKPOINT = "changebreakpoint"; -const char *CLEARBREAKPOINT = "clearbreakpoint"; -const char *SETEXCEPTIONBREAK = "setexceptionbreak"; -const char *V8FLAGS = "v8flags"; -const char *VERSION = "version"; -const char *DISCONNECT = "disconnect"; -const char *LISTBREAKPOINTS = "listbreakpoints"; -const char *GARBAGECOLLECTOR = "gc"; -//const char *PROFILE = "profile"; - -const char *CONNECT = "connect"; -const char *INTERRUPT = "interrupt"; -const char *BREAKAFTERCOMPILE = "breakaftercompile"; - -const char *REQUEST = "request"; -const char *IN = "in"; -const char *NEXT = "next"; -const char *OUT = "out"; - -const char *FUNCTION = "function"; -const char *SCRIPT = "script"; -const char *SCRIPTREGEXP = "scriptRegExp"; -const char *EVENT = "event"; - -const char *ALL = "all"; -const char *UNCAUGHT = "uncaught"; - -//const char *PAUSE = "pause"; -//const char *RESUME = "resume"; - -const char *BLOCKMODE = "-qmljsdebugger=port:3771,block"; -const char *NORMALMODE = "-qmljsdebugger=port:3771"; -const char *TEST_QMLFILE = "test.qml"; -const char *TEST_JSFILE = "test.js"; -const char *TIMER_QMLFILE = "timer.qml"; -const char *LOADJSFILE_QMLFILE = "loadjsfile.qml"; -const char *EXCEPTION_QMLFILE = "exception.qml"; -const char *ONCOMPLETED_QMLFILE = "oncompleted.qml"; -const char *CREATECOMPONENT_QMLFILE = "createComponent.qml"; -const char *CONDITION_QMLFILE = "condition.qml"; -const char *CHANGEBREAKPOINT_QMLFILE = "changeBreakpoint.qml"; -const char *STEPACTION_QMLFILE = "stepAction.qml"; -const char *BREAKPOINTRELOCATION_QMLFILE = "breakpointRelocation.qml"; - -#define VARIANTMAPINIT \ - QString obj("{}"); \ - QJSValue jsonVal = parser.call(QJSValueList() << obj); \ - jsonVal.setProperty(SEQ,QJSValue(seq++)); \ - jsonVal.setProperty(TYPE,REQUEST); - - -#undef QVERIFY -#define QVERIFY(statement) \ -do {\ - if (!QTest::qVerify((statement), #statement, "", __FILE__, __LINE__)) {\ - if (QTest::currentTestFailed()) \ - qDebug().nospace() << "\nDEBUGGEE OUTPUT:\n" << process->output();\ - return;\ - }\ -} while (0) - - -class QJSDebugClient; - -class tst_QDeclarativeDebugJS : public QDeclarativeDataTest -{ - Q_OBJECT - - bool init(const QString &qmlFile = QString(TEST_QMLFILE), bool blockMode = true); - -private slots: - void initTestCase(); - void cleanupTestCase(); - - void cleanup(); - - void connect(); - void interrupt(); - void breakAfterCompile(); - void getVersion(); - void getVersionWhenAttaching(); - - void applyV8Flags(); - - void disconnect(); - - void gc(); - - void listBreakpoints(); - - void setBreakpointInScriptOnCompleted(); - void setBreakpointInScriptOnComponentCreated(); - void setBreakpointInScriptOnTimerCallback(); - void setBreakpointInScriptInDifferentFile(); - void setBreakpointInScriptOnComment(); - void setBreakpointInScriptOnEmptyLine(); - void setBreakpointInScriptWithCondition(); - //void setBreakpointInFunction(); //NOT SUPPORTED - void setBreakpointOnEvent(); - void setBreakpointWhenAttaching(); - - void changeBreakpoint(); - void changeBreakpointOnCondition(); - - void clearBreakpoint(); - - void setExceptionBreak(); - - void stepNext(); - void stepNextWithCount(); - void stepIn(); - void stepOut(); - void continueDebugging(); - - void backtrace(); - - void getFrameDetails(); - - void getScopeDetails(); - - void evaluateInGlobalScope(); - void evaluateInLocalScope(); - - void getScopes(); - - void getScripts(); - - void getSource(); - - // void profile(); //NOT SUPPORTED - - // void verifyQMLOptimizerDisabled(); - -private: - QDeclarativeDebugProcess *process; - QJSDebugClient *client; - QDeclarativeDebugConnection *connection; - QTime t; -}; - -class QJSDebugClient : public QDeclarativeDebugClient -{ - Q_OBJECT -public: - enum StepAction - { - Continue, - In, - Out, - Next - }; - - enum Exception - { - All, - Uncaught - }; - -// enum ProfileCommand -// { -// Pause, -// Resume -// }; - - QJSDebugClient(QDeclarativeDebugConnection *connection) - : QDeclarativeDebugClient(QLatin1String("V8Debugger"), connection), - seq(0) - { - parser = jsEngine.evaluate(QLatin1String("JSON.parse")); - stringify = jsEngine.evaluate(QLatin1String("JSON.stringify")); - } - - void connect(); - void interrupt(); - void breakAfterCompile(bool enabled); - - void continueDebugging(StepAction stepAction, int stepCount = 1); - void evaluate(QString expr, bool global = false, bool disableBreak = false, int frame = -1, const QVariantMap &addContext = QVariantMap()); - void lookup(QList handles, bool includeSource = false); - void backtrace(int fromFrame = -1, int toFrame = -1, bool bottom = false); - void frame(int number = -1); - void scope(int number = -1, int frameNumber = -1); - void scopes(int frameNumber = -1); - void scripts(int types = 4, QList ids = QList(), bool includeSource = false, QVariant filter = QVariant()); - void source(int frame = -1, int fromLine = -1, int toLine = -1); - void setBreakpoint(QString type, QString target, int line = -1, int column = -1, bool enabled = true, QString condition = QString(), int ignoreCount = -1); - void changeBreakpoint(int breakpoint, bool enabled = true, QString condition = QString(), int ignoreCount = -1); - void clearBreakpoint(int breakpoint); - void setExceptionBreak(Exception type, bool enabled = false); - void v8flags(QString flags); - void version(); - //void profile(ProfileCommand command); //NOT SUPPORTED - void disconnect(); - void gc(); - void listBreakpoints(); - -protected: - //inherited from QDeclarativeDebugClient - void stateChanged(State state); - void messageReceived(const QByteArray &data); - -signals: - void enabled(); - void connected(); - void interruptRequested(); - void breakAfterCompileRequested(); - void result(); - void stopped(); - -private: - void sendMessage(const QByteArray &); - void flushSendBuffer(); - QByteArray packMessage(const QByteArray &type, const QByteArray &message = QByteArray()); - -private: - QJSEngine jsEngine; - int seq; - - QList sendBuffer; -public: - QJSValue parser; - QJSValue stringify; - QByteArray response; - -}; - -void QJSDebugClient::connect() -{ - sendMessage(packMessage(CONNECT)); -} - -void QJSDebugClient::interrupt() -{ - sendMessage(packMessage(INTERRUPT)); -} - -void QJSDebugClient::breakAfterCompile(bool enabled) -{ - QByteArray request; - QDataStream rs(&request, QIODevice::WriteOnly); - rs << enabled; - sendMessage(packMessage(BREAKAFTERCOMPILE, request)); -} - -void QJSDebugClient::continueDebugging(StepAction action, int count) -{ - // { "seq" : , - // "type" : "request", - // "command" : "continue", - // "arguments" : { "stepaction" : <"in", "next" or "out">, - // "stepcount" : - // } - // } - VARIANTMAPINIT; - jsonVal.setProperty(QLatin1String(COMMAND),QJSValue(QLatin1String(CONTINEDEBUGGING))); - - if (action != Continue) { - QJSValue args = parser.call(QJSValueList() << obj); - switch (action) { - case In: args.setProperty(QLatin1String(STEPACTION),QJSValue(QLatin1String(IN))); - break; - case Out: args.setProperty(QLatin1String(STEPACTION),QJSValue(QLatin1String(OUT))); - break; - case Next: args.setProperty(QLatin1String(STEPACTION),QJSValue(QLatin1String(NEXT))); - break; - default:break; - } - if (!args.isUndefined()) { - if (count != 1) - args.setProperty(QLatin1String(STEPCOUNT),QJSValue(count)); - jsonVal.setProperty(QLatin1String(ARGUMENTS),args); - } - } - QJSValue json = stringify.call(QJSValueList() << jsonVal); - sendMessage(packMessage(V8REQUEST, json.toString().toUtf8())); -} - -void QJSDebugClient::evaluate(QString expr, bool global, bool disableBreak, int frame, const QVariantMap &/*addContext*/) -{ - // { "seq" : , - // "type" : "request", - // "command" : "evaluate", - // "arguments" : { "expression" : , - // "frame" : , - // "global" : , - // "disable_break" : , - // "additional_context" : [ - // { "name" : , "handle" : }, - // { "name" : , "handle" : }, - // ... - // ] - // } - // } - VARIANTMAPINIT; - jsonVal.setProperty(QLatin1String(COMMAND),QJSValue(QLatin1String(EVALUATE))); - - QJSValue args = parser.call(QJSValueList() << obj); - args.setProperty(QLatin1String(EXPRESSION),QJSValue(expr)); - - if (frame != -1) - args.setProperty(QLatin1String(FRAME),QJSValue(frame)); - - if (global) - args.setProperty(QLatin1String(GLOBAL),QJSValue(global)); - - if (disableBreak) - args.setProperty(QLatin1String(DISABLEBREAK),QJSValue(disableBreak)); - - if (!args.isUndefined()) { - jsonVal.setProperty(QLatin1String(ARGUMENTS),args); - } - - QJSValue json = stringify.call(QJSValueList() << jsonVal); - sendMessage(packMessage(V8REQUEST, json.toString().toUtf8())); -} - -void QJSDebugClient::lookup(QList handles, bool includeSource) -{ - // { "seq" : , - // "type" : "request", - // "command" : "lookup", - // "arguments" : { "handles" : , - // "includeSource" : , - // } - // } - VARIANTMAPINIT; - jsonVal.setProperty(QLatin1String(COMMAND),QJSValue(QLatin1String(LOOKUP))); - - QJSValue args = parser.call(QJSValueList() << obj); - - QString arr("[]"); - QJSValue array = parser.call(QJSValueList() << arr); - int index = 0; - foreach (int handle, handles) { - array.setProperty(index++,QJSValue(handle)); - } - args.setProperty(QLatin1String(HANDLES),array); - - if (includeSource) - args.setProperty(QLatin1String(INCLUDESOURCE),QJSValue(includeSource)); - - if (!args.isUndefined()) { - jsonVal.setProperty(QLatin1String(ARGUMENTS),args); - } - - QJSValue json = stringify.call(QJSValueList() << jsonVal); - sendMessage(packMessage(V8REQUEST, json.toString().toUtf8())); -} - -void QJSDebugClient::backtrace(int fromFrame, int toFrame, bool bottom) -{ - // { "seq" : , - // "type" : "request", - // "command" : "backtrace", - // "arguments" : { "fromFrame" : - // "toFrame" : - // "bottom" : - // } - // } - VARIANTMAPINIT; - jsonVal.setProperty(QLatin1String(COMMAND),QJSValue(QLatin1String(BACKTRACE))); - - QJSValue args = parser.call(QJSValueList() << obj); - - if (fromFrame != -1) - args.setProperty(QLatin1String(FROMFRAME),QJSValue(fromFrame)); - - if (toFrame != -1) - args.setProperty(QLatin1String(TOFRAME),QJSValue(toFrame)); - - if (bottom) - args.setProperty(QLatin1String(BOTTOM),QJSValue(bottom)); - - if (!args.isUndefined()) { - jsonVal.setProperty(QLatin1String(ARGUMENTS),args); - } - - QJSValue json = stringify.call(QJSValueList() << jsonVal); - sendMessage(packMessage(V8REQUEST, json.toString().toUtf8())); -} - -void QJSDebugClient::frame(int number) -{ - // { "seq" : , - // "type" : "request", - // "command" : "frame", - // "arguments" : { "number" : - // } - // } - VARIANTMAPINIT; - jsonVal.setProperty(QLatin1String(COMMAND),QJSValue(QLatin1String(FRAME))); - - if (number != -1) { - QJSValue args = parser.call(QJSValueList() << obj); - args.setProperty(QLatin1String(NUMBER),QJSValue(number)); - - if (!args.isUndefined()) { - jsonVal.setProperty(QLatin1String(ARGUMENTS),args); - } - } - - QJSValue json = stringify.call(QJSValueList() << jsonVal); - sendMessage(packMessage(V8REQUEST, json.toString().toUtf8())); -} - -void QJSDebugClient::scope(int number, int frameNumber) -{ - // { "seq" : , - // "type" : "request", - // "command" : "scope", - // "arguments" : { "number" : - // "frameNumber" : - // } - // } - VARIANTMAPINIT; - jsonVal.setProperty(QLatin1String(COMMAND),QJSValue(QLatin1String(SCOPE))); - - if (number != -1) { - QJSValue args = parser.call(QJSValueList() << obj); - args.setProperty(QLatin1String(NUMBER),QJSValue(number)); - - if (frameNumber != -1) - args.setProperty(QLatin1String(FRAMENUMBER),QJSValue(frameNumber)); - - if (!args.isUndefined()) { - jsonVal.setProperty(QLatin1String(ARGUMENTS),args); - } - } - - QJSValue json = stringify.call(QJSValueList() << jsonVal); - sendMessage(packMessage(V8REQUEST, json.toString().toUtf8())); -} - -void QJSDebugClient::scopes(int frameNumber) -{ - // { "seq" : , - // "type" : "request", - // "command" : "scopes", - // "arguments" : { "frameNumber" : - // } - // } - VARIANTMAPINIT; - jsonVal.setProperty(QLatin1String(COMMAND),QJSValue(QLatin1String(SCOPES))); - - if (frameNumber != -1) { - QJSValue args = parser.call(QJSValueList() << obj); - args.setProperty(QLatin1String(FRAMENUMBER),QJSValue(frameNumber)); - - if (!args.isUndefined()) { - jsonVal.setProperty(QLatin1String(ARGUMENTS),args); - } - } - - QJSValue json = stringify.call(QJSValueList() << jsonVal); - sendMessage(packMessage(V8REQUEST, json.toString().toUtf8())); -} - -void QJSDebugClient::scripts(int types, QList ids, bool includeSource, QVariant /*filter*/) -{ - // { "seq" : , - // "type" : "request", - // "command" : "scripts", - // "arguments" : { "types" : - // "ids" : - // "includeSource" : - // "filter" : - // } - // } - VARIANTMAPINIT; - jsonVal.setProperty(QLatin1String(COMMAND),QJSValue(QLatin1String(SCRIPTS))); - - QJSValue args = parser.call(QJSValueList() << obj); - args.setProperty(QLatin1String(TYPES),QJSValue(types)); - - if (ids.count()) { - QString arr("[]"); - QJSValue array = parser.call(QJSValueList() << arr); - int index = 0; - foreach (int id, ids) { - array.setProperty(index++,QJSValue(id)); - } - args.setProperty(QLatin1String(IDS),array); - } - - if (includeSource) - args.setProperty(QLatin1String(INCLUDESOURCE),QJSValue(includeSource)); - - if (!args.isUndefined()) { - jsonVal.setProperty(QLatin1String(ARGUMENTS),args); - } - - QJSValue json = stringify.call(QJSValueList() << jsonVal); - sendMessage(packMessage(V8REQUEST, json.toString().toUtf8())); -} - -void QJSDebugClient::source(int frame, int fromLine, int toLine) -{ - // { "seq" : , - // "type" : "request", - // "command" : "source", - // "arguments" : { "frame" : - // "fromLine" : - // "toLine" : - // } - // } - VARIANTMAPINIT; - jsonVal.setProperty(QLatin1String(COMMAND),QJSValue(QLatin1String(SOURCE))); - - QJSValue args = parser.call(QJSValueList() << obj); - - if (frame != -1) - args.setProperty(QLatin1String(FRAME),QJSValue(frame)); - - if (fromLine != -1) - args.setProperty(QLatin1String(FROMLINE),QJSValue(fromLine)); - - if (toLine != -1) - args.setProperty(QLatin1String(TOLINE),QJSValue(toLine)); - - if (!args.isUndefined()) { - jsonVal.setProperty(QLatin1String(ARGUMENTS),args); - } - - QJSValue json = stringify.call(QJSValueList() << jsonVal); - sendMessage(packMessage(V8REQUEST, json.toString().toUtf8())); -} - -void QJSDebugClient::setBreakpoint(QString type, QString target, int line, int column, bool enabled, QString condition, int ignoreCount) -{ - // { "seq" : , - // "type" : "request", - // "command" : "setbreakpoint", - // "arguments" : { "type" : <"function" or "script" or "scriptId" or "scriptRegExp"> - // "target" : - // "line" : - // "column" : - // "enabled" : - // "condition" : - // "ignoreCount" : - // } - // } - - if (type == QLatin1String(EVENT)) { - QByteArray reply; - QDataStream rs(&reply, QIODevice::WriteOnly); - rs << target.toUtf8() << enabled; - sendMessage(packMessage(QByteArray("breakonsignal"), reply)); - - } else { - VARIANTMAPINIT; - jsonVal.setProperty(QLatin1String(COMMAND),QJSValue(QLatin1String(SETBREAKPOINT))); - - QJSValue args = parser.call(QJSValueList() << obj); - - args.setProperty(QLatin1String(TYPE),QJSValue(type)); - args.setProperty(QLatin1String(TARGET),QJSValue(target)); - - if (line != -1) - args.setProperty(QLatin1String(LINE),QJSValue(line)); - - if (column != -1) - args.setProperty(QLatin1String(COLUMN),QJSValue(column)); - - args.setProperty(QLatin1String(ENABLED),QJSValue(enabled)); - - if (!condition.isEmpty()) - args.setProperty(QLatin1String(CONDITION),QJSValue(condition)); - - if (ignoreCount != -1) - args.setProperty(QLatin1String(IGNORECOUNT),QJSValue(ignoreCount)); - - if (!args.isUndefined()) { - jsonVal.setProperty(QLatin1String(ARGUMENTS),args); - } - - QJSValue json = stringify.call(QJSValueList() << jsonVal); - sendMessage(packMessage(V8REQUEST, json.toString().toUtf8())); - } -} - -void QJSDebugClient::changeBreakpoint(int breakpoint, bool enabled, QString condition, int ignoreCount) -{ - // { "seq" : , - // "type" : "request", - // "command" : "changebreakpoint", - // "arguments" : { "breakpoint" : - // "enabled" : - // "condition" : - // "ignoreCount" : , - // "type" : "request", - // "command" : "clearbreakpoint", - // "arguments" : { "breakpoint" : - // } - // } - VARIANTMAPINIT; - jsonVal.setProperty(QLatin1String(COMMAND),QJSValue(QLatin1String(CLEARBREAKPOINT))); - - QJSValue args = parser.call(QJSValueList() << obj); - - args.setProperty(QLatin1String(BREAKPOINT),QJSValue(breakpoint)); - - if (!args.isUndefined()) { - jsonVal.setProperty(QLatin1String(ARGUMENTS),args); - } - - QJSValue json = stringify.call(QJSValueList() << jsonVal); - sendMessage(packMessage(V8REQUEST, json.toString().toUtf8())); -} - -void QJSDebugClient::setExceptionBreak(Exception type, bool enabled) -{ - // { "seq" : , - // "type" : "request", - // "command" : "setexceptionbreak", - // "arguments" : { "type" : , - // "enabled" : - // } - // } - VARIANTMAPINIT; - jsonVal.setProperty(QLatin1String(COMMAND),QJSValue(QLatin1String(SETEXCEPTIONBREAK))); - - QJSValue args = parser.call(QJSValueList() << obj); - - if (type == All) - args.setProperty(QLatin1String(TYPE),QJSValue(QLatin1String(ALL))); - else if (type == Uncaught) - args.setProperty(QLatin1String(TYPE),QJSValue(QLatin1String(UNCAUGHT))); - - if (enabled) - args.setProperty(QLatin1String(ENABLED),QJSValue(enabled)); - - if (!args.isUndefined()) { - jsonVal.setProperty(QLatin1String(ARGUMENTS),args); - } - - QJSValue json = stringify.call(QJSValueList() << jsonVal); - sendMessage(packMessage(V8REQUEST, json.toString().toUtf8())); -} - -void QJSDebugClient::v8flags(QString flags) -{ - // { "seq" : , - // "type" : "request", - // "command" : "v8flags", - // "arguments" : { "flags" : - // } - // } - VARIANTMAPINIT; - jsonVal.setProperty(QLatin1String(COMMAND),QJSValue(QLatin1String(V8FLAGS))); - - QJSValue args = parser.call(QJSValueList() << obj); - - args.setProperty(QLatin1String(FLAGS),QJSValue(flags)); - - if (!args.isUndefined()) { - jsonVal.setProperty(QLatin1String(ARGUMENTS),args); - } - - QJSValue json = stringify.call(QJSValueList() << jsonVal); - sendMessage(packMessage(V8REQUEST, json.toString().toUtf8())); -} - -void QJSDebugClient::version() -{ - // { "seq" : , - // "type" : "request", - // "command" : "version", - // } - VARIANTMAPINIT; - jsonVal.setProperty(QLatin1String(COMMAND),QJSValue(QLatin1String(VERSION))); - - QJSValue json = stringify.call(QJSValueList() << jsonVal); - sendMessage(packMessage(V8REQUEST, json.toString().toUtf8())); -} - -//void QJSDebugClient::profile(ProfileCommand command) -//{ -//// { "seq" : , -//// "type" : "request", -//// "command" : "profile", -//// "arguments" : { "command" : "resume" or "pause" } -//// } -// VARIANTMAPINIT; -// jsonVal.setProperty(QLatin1String(COMMAND),QJSValue(QLatin1String(PROFILE))); - -// QJSValue args = parser.call(QJSValueList() << obj); - -// if (command == Resume) -// args.setProperty(QLatin1String(COMMAND),QJSValue(QLatin1String(RESUME))); -// else -// args.setProperty(QLatin1String(COMMAND),QJSValue(QLatin1String(PAUSE))); - -// args.setProperty(QLatin1String("modules"),QJSValue(1)); -// if (!args.isUndefined()) { -// jsonVal.setProperty(QLatin1String(ARGUMENTS),args); -// } - -// QJSValue json = stringify.call(QJSValueList() << jsonVal); -// sendMessage(packMessage(V8REQUEST, json.toString().toUtf8())); -//} - -void QJSDebugClient::disconnect() -{ - // { "seq" : , - // "type" : "request", - // "command" : "disconnect", - // } - VARIANTMAPINIT; - jsonVal.setProperty(QLatin1String(COMMAND),QJSValue(QLatin1String(DISCONNECT))); - - QJSValue json = stringify.call(QJSValueList() << jsonVal); - sendMessage(packMessage(DISCONNECT, json.toString().toUtf8())); -} - -void QJSDebugClient::gc() -{ - // { "seq" : , - // "type" : "request", - // "command" : "gc", - // "arguments" : { "type" : , - // } - // } - VARIANTMAPINIT; - jsonVal.setProperty(QLatin1String(COMMAND),QJSValue(QLatin1String(GARBAGECOLLECTOR))); - - QJSValue args = parser.call(QJSValueList() << obj); - - args.setProperty(QLatin1String(TYPE),QJSValue(QLatin1String(ALL))); - - if (!args.isUndefined()) { - jsonVal.setProperty(QLatin1String(ARGUMENTS),args); - } - - QJSValue json = stringify.call(QJSValueList() << jsonVal); - sendMessage(packMessage(V8REQUEST, json.toString().toUtf8())); -} - -void QJSDebugClient::listBreakpoints() -{ - // { "seq" : , - // "type" : "request", - // "command" : "listbreakpoints", - // } - VARIANTMAPINIT; - jsonVal.setProperty(QLatin1String(COMMAND),QJSValue(QLatin1String(LISTBREAKPOINTS))); - - QJSValue json = stringify.call(QJSValueList() << jsonVal); - sendMessage(packMessage(V8REQUEST, json.toString().toUtf8())); -} - -void QJSDebugClient::stateChanged(State state) -{ - if (state == Enabled) { - flushSendBuffer(); - emit enabled(); - } -} - -void QJSDebugClient::messageReceived(const QByteArray &data) -{ - QDataStream ds(data); - QByteArray command; - ds >> command; - - if (command == "V8DEBUG") { - QByteArray type; - ds >> type >> response; - - if (type == CONNECT) { - emit connected(); - - } else if (type == INTERRUPT) { - emit interruptRequested(); - - } else if (type == V8MESSAGE) { - QString jsonString(response); - QVariantMap value = parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap(); - QString type = value.value("type").toString(); - - if (type == "response") { - - if (!value.value("success").toBool()) { -// qDebug() << "Error: The test case will fail since no signal is emitted"; - return; - } - - QString debugCommand(value.value("command").toString()); - if (debugCommand == "backtrace" || - debugCommand == "lookup" || - debugCommand == "setbreakpoint" || - debugCommand == "evaluate" || - debugCommand == "listbreakpoints" || - debugCommand == "version" || - debugCommand == "v8flags" || - debugCommand == "disconnect" || - debugCommand == "gc" || - debugCommand == "changebreakpoint" || - debugCommand == "clearbreakpoint" || - debugCommand == "frame" || - debugCommand == "scope" || - debugCommand == "scopes" || - debugCommand == "scripts" || - debugCommand == "source" || - debugCommand == "setexceptionbreak" /*|| - debugCommand == "profile"*/) { - emit result(); - - } else { - // DO NOTHING - } - - } else if (type == QLatin1String(EVENT)) { - QString event(value.value(QLatin1String(EVENT)).toString()); - - if (event == "break" || - event == "exception") - emit stopped(); - } - - } else if (type == BREAKAFTERCOMPILE) { - emit breakAfterCompileRequested(); - - } - } -} - -void QJSDebugClient::sendMessage(const QByteArray &msg) -{ - if (state() == Enabled) { - QDeclarativeDebugClient::sendMessage(msg); - } else { - sendBuffer.append(msg); - } -} - -void QJSDebugClient::flushSendBuffer() -{ - foreach (const QByteArray &msg, sendBuffer) - QDeclarativeDebugClient::sendMessage(msg); - sendBuffer.clear(); -} - -QByteArray QJSDebugClient::packMessage(const QByteArray &type, const QByteArray &message) -{ - QByteArray reply; - QDataStream rs(&reply, QIODevice::WriteOnly); - QByteArray cmd = "V8DEBUG"; - rs << cmd << type << message; - return reply; -} - -void tst_QDeclarativeDebugJS::initTestCase() -{ - QDeclarativeDataTest::initTestCase(); - t.start(); - process = 0; - client = 0; - connection = 0; -} - -void tst_QDeclarativeDebugJS::cleanupTestCase() -{ - if (process) { - process->stop(); - delete process; - } - - if (client) - delete client; - - if (connection) - delete connection; - -// qDebug() << "Time Elapsed:" << t.elapsed(); -} - -bool tst_QDeclarativeDebugJS::init(const QString &qmlFile, bool blockMode) -{ - connection = new QDeclarativeDebugConnection(); - process = new QDeclarativeDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene"); - client = new QJSDebugClient(connection); - - QStringList systemEnvironment = QProcess::systemEnvironment(); - systemEnvironment << "QML_DISABLE_OPTIMIZER=1"; - process->setEnvironment(systemEnvironment); - if (blockMode) - process->start(QStringList() << QLatin1String(BLOCKMODE) << testFile(qmlFile)); - else - process->start(QStringList() << QLatin1String(NORMALMODE) << testFile(qmlFile)); - - if (!process->waitForSessionStart()) { - return false; - } - - connection->connectToHost("127.0.0.1", 3771); - if (!connection->waitForConnected()) - return false; - - return QDeclarativeDebugTest::waitForSignal(client, SIGNAL(enabled())); -} - -void tst_QDeclarativeDebugJS::cleanup() -{ - if (process) { - process->stop(); - delete process; - } - - if (client) - delete client; - - if (connection) - delete connection; - - process = 0; - client = 0; - connection = 0; -} - -void tst_QDeclarativeDebugJS::connect() -{ - //void connect() - - QVERIFY(init()); - client->connect(); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(connected()))); -} - -void tst_QDeclarativeDebugJS::interrupt() -{ - //void connect() - - QVERIFY(init()); - client->connect(); - - client->interrupt(); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(interruptRequested()))); -} - -void tst_QDeclarativeDebugJS::breakAfterCompile() -{ - //void breakAfterCompile(bool enabled) - - QVERIFY(init()); - client->breakAfterCompile(true); - client->connect(); - - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(breakAfterCompileRequested()))); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(stopped()))); -} - -void tst_QDeclarativeDebugJS::getVersion() -{ - //void version() - - QVERIFY(init()); - client->connect(); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(connected()))); - - client->version(); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(result()))); -} - -void tst_QDeclarativeDebugJS::getVersionWhenAttaching() -{ - //void version() - - QVERIFY(init(QLatin1String(TIMER_QMLFILE), false)); - client->connect(); - - client->version(); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(result()))); -} - -void tst_QDeclarativeDebugJS::applyV8Flags() -{ - //void v8flags(QString flags) - - QVERIFY(init()); - client->connect(); - - client->v8flags(QString()); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(result()))); -} - -void tst_QDeclarativeDebugJS::disconnect() -{ - //void disconnect() - - QVERIFY(init()); - client->connect(); - - client->disconnect(); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(result()))); -} - -void tst_QDeclarativeDebugJS::gc() -{ - //void gc() - - QVERIFY(init()); - client->connect(); - - client->gc(); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(result()))); -} - -void tst_QDeclarativeDebugJS::listBreakpoints() -{ - //void listBreakpoints() - - int sourceLine1 = 47; - int sourceLine2 = 48; - int sourceLine3 = 49; - - QVERIFY(init()); - client->connect(); - - client->setBreakpoint(QLatin1String(SCRIPTREGEXP), QLatin1String(TEST_QMLFILE), sourceLine1, -1, true); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(result()))); - client->setBreakpoint(QLatin1String(SCRIPTREGEXP), QLatin1String(TEST_QMLFILE), sourceLine2, -1, true); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(result()))); - client->setBreakpoint(QLatin1String(SCRIPTREGEXP), QLatin1String(TEST_QMLFILE), sourceLine3, -1, true); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(result()))); - client->listBreakpoints(); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(result()))); - - QString jsonString(client->response); - QVariantMap value = client->parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap(); - - QList breakpoints = value.value("body").toMap().value("breakpoints").toList(); - - QCOMPARE(breakpoints.count(), 3); -} - -void tst_QDeclarativeDebugJS::setBreakpointInScriptOnCompleted() -{ - //void setBreakpoint(QString type, QString target, int line = -1, int column = -1, bool enabled = false, QString condition = QString(), int ignoreCount = -1) - - int sourceLine = 47; - QVERIFY(init(ONCOMPLETED_QMLFILE)); - - client->setBreakpoint(QLatin1String(SCRIPTREGEXP), QLatin1String(ONCOMPLETED_QMLFILE), sourceLine, -1, true); - client->connect(); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(stopped()))); - - QString jsonString(client->response); - QVariantMap value = client->parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap(); - - QVariantMap body = value.value("body").toMap(); - - QCOMPARE(body.value("sourceLine").toInt(), sourceLine); - QCOMPARE(QFileInfo(body.value("script").toMap().value("name").toString()).fileName(), QLatin1String(ONCOMPLETED_QMLFILE)); -} - -void tst_QDeclarativeDebugJS::setBreakpointInScriptOnComponentCreated() -{ - //void setBreakpoint(QString type, QString target, int line = -1, int column = -1, bool enabled = false, QString condition = QString(), int ignoreCount = -1) - - int sourceLine = 47; - QVERIFY(init(CREATECOMPONENT_QMLFILE)); - - client->setBreakpoint(QLatin1String(SCRIPTREGEXP), QLatin1String(ONCOMPLETED_QMLFILE), sourceLine, -1, true); - client->connect(); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(stopped()))); - - QString jsonString(client->response); - QVariantMap value = client->parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap(); - - QVariantMap body = value.value("body").toMap(); - - QCOMPARE(body.value("sourceLine").toInt(), sourceLine); - QCOMPARE(QFileInfo(body.value("script").toMap().value("name").toString()).fileName(), QLatin1String(ONCOMPLETED_QMLFILE)); -} - -void tst_QDeclarativeDebugJS::setBreakpointInScriptOnTimerCallback() -{ - int sourceLine = 48; - QVERIFY(init(TIMER_QMLFILE)); - - client->connect(); - - client->setBreakpoint(QLatin1String(SCRIPTREGEXP), QLatin1String(TIMER_QMLFILE), sourceLine, -1, true); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(stopped()))); - - QString jsonString(client->response); - QVariantMap value = client->parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap(); - - QVariantMap body = value.value("body").toMap(); - - QCOMPARE(body.value("sourceLine").toInt(), sourceLine); - QCOMPARE(QFileInfo(body.value("script").toMap().value("name").toString()).fileName(), QLatin1String(TIMER_QMLFILE)); -} - -void tst_QDeclarativeDebugJS::setBreakpointInScriptInDifferentFile() -{ - //void setBreakpoint(QString type, QString target, int line = -1, int column = -1, bool enabled = false, QString condition = QString(), int ignoreCount = -1) - - int sourceLine = 43; - QVERIFY(init(LOADJSFILE_QMLFILE)); - - client->connect(); - client->setBreakpoint(QLatin1String(SCRIPTREGEXP), QLatin1String(TEST_JSFILE), sourceLine, -1, true); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(stopped()))); - - QString jsonString(client->response); - QVariantMap value = client->parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap(); - - QVariantMap body = value.value("body").toMap(); - - QCOMPARE(body.value("sourceLine").toInt(), sourceLine); - QCOMPARE(QFileInfo(body.value("script").toMap().value("name").toString()).fileName(), QLatin1String(TEST_JSFILE)); -} - -void tst_QDeclarativeDebugJS::setBreakpointInScriptOnComment() -{ - //void setBreakpoint(QString type, QString target, int line = -1, int column = -1, bool enabled = false, QString condition = QString(), int ignoreCount = -1) - - int sourceLine = 47; - int actualLine = 49; - QVERIFY(init(BREAKPOINTRELOCATION_QMLFILE)); - - client->connect(); - client->setBreakpoint(QLatin1String(SCRIPTREGEXP), QLatin1String(BREAKPOINTRELOCATION_QMLFILE), sourceLine, -1, true); - QEXPECT_FAIL("", "Relocation of breakpoints is disabled right now", Abort); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(stopped()), 1)); - - QString jsonString(client->response); - QVariantMap value = client->parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap(); - - QVariantMap body = value.value("body").toMap(); - - QCOMPARE(body.value("sourceLine").toInt(), actualLine); - QCOMPARE(QFileInfo(body.value("script").toMap().value("name").toString()).fileName(), QLatin1String(BREAKPOINTRELOCATION_QMLFILE)); -} - -void tst_QDeclarativeDebugJS::setBreakpointInScriptOnEmptyLine() -{ - //void setBreakpoint(QString type, QString target, int line = -1, int column = -1, bool enabled = false, QString condition = QString(), int ignoreCount = -1) - - int sourceLine = 48; - int actualLine = 49; - QVERIFY(init(BREAKPOINTRELOCATION_QMLFILE)); - - client->connect(); - client->setBreakpoint(QLatin1String(SCRIPTREGEXP), QLatin1String(BREAKPOINTRELOCATION_QMLFILE), sourceLine, -1, true); - QEXPECT_FAIL("", "Relocation of breakpoints is disabled right now", Abort); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(stopped()), 1)); - - QString jsonString(client->response); - QVariantMap value = client->parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap(); - - QVariantMap body = value.value("body").toMap(); - - QCOMPARE(body.value("sourceLine").toInt(), actualLine); - QCOMPARE(QFileInfo(body.value("script").toMap().value("name").toString()).fileName(), QLatin1String(BREAKPOINTRELOCATION_QMLFILE)); -} - -void tst_QDeclarativeDebugJS::setBreakpointInScriptWithCondition() -{ - //void setBreakpoint(QString type, QString target, int line = -1, int column = -1, bool enabled = false, QString condition = QString(), int ignoreCount = -1) - - int out = 10; - int sourceLine = 50; - QVERIFY(init(CONDITION_QMLFILE)); - - client->connect(); - client->setBreakpoint(QLatin1String(SCRIPTREGEXP), QLatin1String(CONDITION_QMLFILE), sourceLine, 1, true, QLatin1String("a > 10")); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(stopped()))); - - //Get the frame index - QString jsonString = client->response; - QVariantMap value = client->parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap(); - - QVariantMap body = value.value("body").toMap(); - - int frameIndex = body.value("index").toInt(); - - //Verify the value of 'result' - client->evaluate(QLatin1String("a"),frameIndex); - - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(result()))); - - jsonString = client->response; - value = client->parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap(); - - body = value.value("body").toMap(); - - QVERIFY(body.value("value").toInt() > out); -} - -void tst_QDeclarativeDebugJS::setBreakpointWhenAttaching() -{ - int sourceLine = 49; - QVERIFY(init(QLatin1String(TIMER_QMLFILE), false)); - - client->connect(); - client->setBreakpoint(QLatin1String(SCRIPTREGEXP), QLatin1String(TIMER_QMLFILE), sourceLine); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(stopped()))); -} - -//void tst_QDeclarativeDebugJS::setBreakpointInFunction() -//{ -// //void setBreakpoint(QString type, QString target, int line = -1, int column = -1, bool enabled = false, QString condition = QString(), int ignoreCount = -1) - -// int actualLine = 31; - -// client->connect(); -// client->setBreakpoint(QLatin1String(FUNCTION), QLatin1String("doSomethingElse"), -1, -1, true); - -// QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(stopped()))); - -// QString jsonString(client->response); -// QVariantMap value = client->parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap(); - -// QVariantMap body = value.value("body").toMap(); - -// QCOMPARE(body.value("sourceLine").toInt(), actualLine); -// QCOMPARE(QFileInfo(body.value("script").toMap().value("name").toString()).fileName(), QLatin1String(QMLFILE)); -//} - -void tst_QDeclarativeDebugJS::setBreakpointOnEvent() -{ - //void setBreakpoint(QString type, QString target, int line = -1, int column = -1, bool enabled = false, QString condition = QString(), int ignoreCount = -1) - - QVERIFY(init(TIMER_QMLFILE)); - - client->connect(); - - client->setBreakpoint(QLatin1String(EVENT), QLatin1String("triggered"), -1, -1, true); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(stopped()))); - - QString jsonString(client->response); - QVariantMap value = client->parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap(); - - QVariantMap body = value.value("body").toMap(); - - QCOMPARE(QFileInfo(body.value("script").toMap().value("name").toString()).fileName(), QLatin1String(TIMER_QMLFILE)); -} - - -void tst_QDeclarativeDebugJS::changeBreakpoint() -{ - //void changeBreakpoint(int breakpoint, bool enabled = false, QString condition = QString(), int ignoreCount = -1) - - int sourceLine1 = 50; - int sourceLine2 = 51; - QVERIFY(init(CHANGEBREAKPOINT_QMLFILE)); - - client->connect(); - client->setBreakpoint(QLatin1String(SCRIPTREGEXP), QLatin1String(CHANGEBREAKPOINT_QMLFILE), sourceLine2, -1, true); - client->setBreakpoint(QLatin1String(SCRIPTREGEXP), QLatin1String(CHANGEBREAKPOINT_QMLFILE), sourceLine1, -1, true); - - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(stopped()))); - - //Will hit 1st brakpoint, change this breakpoint enable = false - QString jsonString(client->response); - QVariantMap value = client->parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap(); - - QVariantMap body = value.value("body").toMap(); - QList breakpointsHit = body.value("breakpoints").toList(); - - int breakpoint = breakpointsHit.at(0).toInt(); - client->changeBreakpoint(breakpoint,false); - - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(result()))); - - //Continue with debugging - client->continueDebugging(QJSDebugClient::Continue); - //Hit 2nd breakpoint - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(stopped()))); - - //Continue with debugging - client->continueDebugging(QJSDebugClient::Continue); - //Should stop at 2nd breakpoint - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(stopped()))); - - jsonString = client->response; - value = client->parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap(); - - body = value.value("body").toMap(); - - QCOMPARE(body.value("sourceLine").toInt(), sourceLine2); -} - -void tst_QDeclarativeDebugJS::changeBreakpointOnCondition() -{ - //void changeBreakpoint(int breakpoint, bool enabled = false, QString condition = QString(), int ignoreCount = -1) - - int sourceLine1 = 50; - int sourceLine2 = 51; - - QVERIFY(init(CHANGEBREAKPOINT_QMLFILE)); - - client->connect(); - client->setBreakpoint(QLatin1String(SCRIPTREGEXP), QLatin1String(CHANGEBREAKPOINT_QMLFILE), sourceLine1, -1, true); - client->setBreakpoint(QLatin1String(SCRIPTREGEXP), QLatin1String(CHANGEBREAKPOINT_QMLFILE), sourceLine2, -1, true); - - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(stopped()))); - - //Will hit 1st brakpoint, change this breakpoint enable = false - QString jsonString(client->response); - QVariantMap value = client->parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap(); - - QVariantMap body = value.value("body").toMap(); - QList breakpointsHit = body.value("breakpoints").toList(); - - int breakpoint = breakpointsHit.at(0).toInt(); - client->changeBreakpoint(breakpoint, false, QLatin1String("d == 0")); - - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(result()))); - - //Continue with debugging - client->continueDebugging(QJSDebugClient::Continue); - //Hit 2nd breakpoint - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(stopped()))); - - //Continue with debugging - client->continueDebugging(QJSDebugClient::Continue); - //Should stop at 2nd breakpoint - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(stopped()))); - - jsonString = client->response; - value = client->parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap(); - - body = value.value("body").toMap(); - - QCOMPARE(body.value("sourceLine").toInt(), sourceLine2); - -} - -void tst_QDeclarativeDebugJS::clearBreakpoint() -{ - //void clearBreakpoint(int breakpoint); - - int sourceLine1 = 50; - int sourceLine2 = 51; - QVERIFY(init(CHANGEBREAKPOINT_QMLFILE)); - - client->connect(); - client->setBreakpoint(QLatin1String(SCRIPTREGEXP), QLatin1String(CHANGEBREAKPOINT_QMLFILE), sourceLine1, -1, true); - client->setBreakpoint(QLatin1String(SCRIPTREGEXP), QLatin1String(CHANGEBREAKPOINT_QMLFILE), sourceLine2, -1, true); - - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(stopped()))); - - //Will hit 1st brakpoint, change this breakpoint enable = false - QString jsonString(client->response); - QVariantMap value = client->parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap(); - - QVariantMap body = value.value("body").toMap(); - QList breakpointsHit = body.value("breakpoints").toList(); - - int breakpoint = breakpointsHit.at(0).toInt(); - client->clearBreakpoint(breakpoint); - - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(result()))); - - //Continue with debugging - client->continueDebugging(QJSDebugClient::Continue); - //Hit 2nd breakpoint - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(stopped()))); - - //Continue with debugging - client->continueDebugging(QJSDebugClient::Continue); - //Should stop at 2nd breakpoint - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(stopped()))); - - jsonString = client->response; - value = client->parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap(); - - body = value.value("body").toMap(); - - QCOMPARE(body.value("sourceLine").toInt(), sourceLine2); -} - -void tst_QDeclarativeDebugJS::setExceptionBreak() -{ - //void setExceptionBreak(QString type, bool enabled = false); - - QVERIFY(init(EXCEPTION_QMLFILE)); - client->setExceptionBreak(QJSDebugClient::All,true); - client->connect(); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(stopped()))); -} - -void tst_QDeclarativeDebugJS::stepNext() -{ - //void continueDebugging(StepAction stepAction, int stepCount = 1); - - int sourceLine = 50; - QVERIFY(init(STEPACTION_QMLFILE)); - - client->setBreakpoint(QLatin1String(SCRIPTREGEXP), QLatin1String(STEPACTION_QMLFILE), sourceLine, -1, true); - client->connect(); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(stopped()))); - - client->continueDebugging(QJSDebugClient::Next); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(stopped()))); - - QString jsonString(client->response); - QVariantMap value = client->parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap(); - - QVariantMap body = value.value("body").toMap(); - - QCOMPARE(body.value("sourceLine").toInt(), sourceLine + 1); - QCOMPARE(QFileInfo(body.value("script").toMap().value("name").toString()).fileName(), QLatin1String(STEPACTION_QMLFILE)); -} - -void tst_QDeclarativeDebugJS::stepNextWithCount() -{ - //void continueDebugging(StepAction stepAction, int stepCount = 1); - - int sourceLine = 50; - QVERIFY(init(STEPACTION_QMLFILE)); - - client->connect(); - client->setBreakpoint(QLatin1String(SCRIPTREGEXP), QLatin1String(STEPACTION_QMLFILE), sourceLine, -1, true); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(stopped()))); - - client->continueDebugging(QJSDebugClient::Next, 2); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(stopped()))); - - QString jsonString(client->response); - QVariantMap value = client->parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap(); - - QVariantMap body = value.value("body").toMap(); - - QCOMPARE(body.value("sourceLine").toInt(), sourceLine + 2); - QCOMPARE(QFileInfo(body.value("script").toMap().value("name").toString()).fileName(), QLatin1String(STEPACTION_QMLFILE)); -} - -void tst_QDeclarativeDebugJS::stepIn() -{ - //void continueDebugging(StepAction stepAction, int stepCount = 1); - - int sourceLine = 54; - int actualLine = 50; - QVERIFY(init(STEPACTION_QMLFILE)); - - client->connect(); - client->setBreakpoint(QLatin1String(SCRIPTREGEXP), QLatin1String(STEPACTION_QMLFILE), sourceLine, 1, true); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(stopped()))); - - client->continueDebugging(QJSDebugClient::In); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(stopped()))); - - QString jsonString(client->response); - QVariantMap value = client->parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap(); - - QVariantMap body = value.value("body").toMap(); - - QCOMPARE(body.value("sourceLine").toInt(), actualLine); - QCOMPARE(QFileInfo(body.value("script").toMap().value("name").toString()).fileName(), QLatin1String(STEPACTION_QMLFILE)); -} - -void tst_QDeclarativeDebugJS::stepOut() -{ - //void continueDebugging(StepAction stepAction, int stepCount = 1); - - int sourceLine = 50; - int actualLine = 54; - QVERIFY(init(STEPACTION_QMLFILE)); - - client->connect(); - client->setBreakpoint(QLatin1String(SCRIPTREGEXP), QLatin1String(STEPACTION_QMLFILE), sourceLine, -1, true); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(stopped()))); - - client->continueDebugging(QJSDebugClient::Out); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(stopped()))); - - QString jsonString(client->response); - QVariantMap value = client->parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap(); - - QVariantMap body = value.value("body").toMap(); - - QCOMPARE(body.value("sourceLine").toInt(), actualLine); - QCOMPARE(QFileInfo(body.value("script").toMap().value("name").toString()).fileName(), QLatin1String(STEPACTION_QMLFILE)); -} - -void tst_QDeclarativeDebugJS::continueDebugging() -{ - //void continueDebugging(StepAction stepAction, int stepCount = 1); - - int sourceLine1 = 54; - int sourceLine2 = 51; - QVERIFY(init(STEPACTION_QMLFILE)); - - client->connect(); - client->setBreakpoint(QLatin1String(SCRIPTREGEXP), QLatin1String(STEPACTION_QMLFILE), sourceLine1, -1, true); - client->setBreakpoint(QLatin1String(SCRIPTREGEXP), QLatin1String(STEPACTION_QMLFILE), sourceLine2, -1, true); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(stopped()))); - - client->continueDebugging(QJSDebugClient::Continue); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(stopped()))); - - QString jsonString(client->response); - QVariantMap value = client->parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap(); - - QVariantMap body = value.value("body").toMap(); - - QCOMPARE(body.value("sourceLine").toInt(), sourceLine2); - QCOMPARE(QFileInfo(body.value("script").toMap().value("name").toString()).fileName(), QLatin1String(STEPACTION_QMLFILE)); -} - -void tst_QDeclarativeDebugJS::backtrace() -{ - //void backtrace(int fromFrame = -1, int toFrame = -1, bool bottom = false); - - int sourceLine = 47; - QVERIFY(init(ONCOMPLETED_QMLFILE)); - - client->setBreakpoint(QLatin1String(SCRIPTREGEXP), QLatin1String(ONCOMPLETED_QMLFILE), sourceLine, -1, true); - client->connect(); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(stopped()))); - - client->backtrace(); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(result()))); -} - -void tst_QDeclarativeDebugJS::getFrameDetails() -{ - //void frame(int number = -1); - - int sourceLine = 47; - QVERIFY(init(ONCOMPLETED_QMLFILE)); - - client->setBreakpoint(QLatin1String(SCRIPTREGEXP), QLatin1String(ONCOMPLETED_QMLFILE), sourceLine, -1, true); - client->connect(); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(stopped()))); - - client->frame(); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(result()))); -} - -void tst_QDeclarativeDebugJS::getScopeDetails() -{ - //void scope(int number = -1, int frameNumber = -1); - - int sourceLine = 47; - QVERIFY(init(ONCOMPLETED_QMLFILE)); - - client->setBreakpoint(QLatin1String(SCRIPTREGEXP), QLatin1String(ONCOMPLETED_QMLFILE), sourceLine, -1, true); - client->connect(); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(stopped()))); - - client->scope(); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(result()))); -} - -void tst_QDeclarativeDebugJS::evaluateInGlobalScope() -{ - //void evaluate(QString expr, bool global = false, bool disableBreak = false, int frame = -1, const QVariantMap &addContext = QVariantMap()); - - QVERIFY(init()); - - client->connect(); - client->evaluate(QLatin1String("print('Hello World')"), true); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(result()))); - - //Verify the value of 'print' - QString jsonString(client->response); - QVariantMap value = client->parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap(); - - QVariantMap body = value.value("body").toMap(); - - QCOMPARE(body.value("text").toString(),QLatin1String("undefined")); -} - -void tst_QDeclarativeDebugJS::evaluateInLocalScope() -{ - //void evaluate(QString expr, bool global = false, bool disableBreak = false, int frame = -1, const QVariantMap &addContext = QVariantMap()); - - int sourceLine = 47; - QVERIFY(init(ONCOMPLETED_QMLFILE)); - - client->setBreakpoint(QLatin1String(SCRIPTREGEXP), QLatin1String(ONCOMPLETED_QMLFILE), sourceLine, -1, true); - client->connect(); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(stopped()))); - - client->frame(); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(result()))); - - //Get the frame index - QString jsonString(client->response); - QVariantMap value = client->parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap(); - - QVariantMap body = value.value("body").toMap(); - - int frameIndex = body.value("index").toInt(); - - client->evaluate(QLatin1String("root.a"), frameIndex); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(result()))); - - //Verify the value of 'timer.interval' - jsonString = client->response; - value = client->parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap(); - - body = value.value("body").toMap(); - - QCOMPARE(body.value("value").toInt(),10); -} - -void tst_QDeclarativeDebugJS::getScopes() -{ - //void scopes(int frameNumber = -1); - - int sourceLine = 47; - QVERIFY(init(ONCOMPLETED_QMLFILE)); - - client->setBreakpoint(QLatin1String(SCRIPTREGEXP), QLatin1String(ONCOMPLETED_QMLFILE), sourceLine, -1, true); - client->connect(); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(stopped()))); - - client->scopes(); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(result()))); -} - -void tst_QDeclarativeDebugJS::getScripts() -{ - //void scripts(int types = -1, QList ids = QList(), bool includeSource = false, QVariant filter = QVariant()); - -#ifdef Q_OS_MAC - QSKIP("QTBUG-23475 - Unreliable test on Mac OS X"); -#endif - - QVERIFY(init()); - - client->connect(); - - client->scripts(); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(result()))); - QString jsonString(client->response); - QVariantMap value = client->parser.call(QJSValueList() - << QJSValue(jsonString)).toVariant().toMap(); - - QList scripts = value.value("body").toList(); - - QCOMPARE(scripts.count(), 2); -} - -void tst_QDeclarativeDebugJS::getSource() -{ - //void source(int frame = -1, int fromLine = -1, int toLine = -1); - - int sourceLine = 47; - QVERIFY(init(ONCOMPLETED_QMLFILE)); - - client->setBreakpoint(QLatin1String(SCRIPTREGEXP), QLatin1String(ONCOMPLETED_QMLFILE), sourceLine, -1, true); - client->connect(); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(stopped()))); - - client->source(); - QVERIFY(QDeclarativeDebugTest::waitForSignal(client, SIGNAL(result()))); -} - -QTEST_MAIN(tst_QDeclarativeDebugJS) - -#include "tst_qdeclarativedebugjs.moc" - diff --git a/tests/auto/declarative/debugger/qdeclarativedebugservice/qdeclarativedebugservice.pro b/tests/auto/declarative/debugger/qdeclarativedebugservice/qdeclarativedebugservice.pro deleted file mode 100644 index 015a7232f6..0000000000 --- a/tests/auto/declarative/debugger/qdeclarativedebugservice/qdeclarativedebugservice.pro +++ /dev/null @@ -1,11 +0,0 @@ -CONFIG += testcase -TARGET = tst_qdeclarativedebugservice -macx:CONFIG -= app_bundle - -HEADERS += ../shared/debugutil_p.h -SOURCES += tst_qdeclarativedebugservice.cpp \ - ../shared/debugutil.cpp - -CONFIG += parallel_test declarative_debug - -QT += declarative-private testlib diff --git a/tests/auto/declarative/debugger/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp b/tests/auto/declarative/debugger/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp deleted file mode 100644 index c38b7854e0..0000000000 --- a/tests/auto/declarative/debugger/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp +++ /dev/null @@ -1,216 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include -#include -#include -#include -#include -#include - -#include - -#include -#include - -#include "../../../shared/util.h" -#include "../shared/debugutil_p.h" - -#define PORT 13769 -#define STR_PORT "13769" - -class tst_QDeclarativeDebugService : public QObject -{ - Q_OBJECT -private: - QDeclarativeDebugConnection *m_conn; - -private slots: - void initTestCase(); - - void name(); - void version(); - void state(); - void sendMessage(); - void idForObject(); - void objectForId(); - void objectToString(); -}; - -void tst_QDeclarativeDebugService::initTestCase() -{ - const QString waitingMsg = QString("QDeclarativeDebugServer: Waiting for connection on port %1...").arg(PORT); - QTest::ignoreMessage(QtWarningMsg, waitingMsg.toAscii().constData()); - new QDeclarativeEngine(this); - - m_conn = new QDeclarativeDebugConnection(this); - - - QTest::ignoreMessage(QtWarningMsg, "QDeclarativeDebugServer: Connection established"); - for (int i = 0; i < 50; ++i) { - // try for 5 seconds ... - m_conn->connectToHost("127.0.0.1", PORT); - if (m_conn->waitForConnected()) - break; - QTest::qSleep(100); - } - QVERIFY(m_conn->isConnected()); - - QTRY_VERIFY(QDeclarativeDebugService::hasDebuggingClient()); -} - -void tst_QDeclarativeDebugService::name() -{ - QString name = "tst_QDeclarativeDebugService::name()"; - - QDeclarativeDebugService service(name, 1); - QCOMPARE(service.name(), name); -} - -void tst_QDeclarativeDebugService::version() -{ - QString name = "tst_QDeclarativeDebugService::name()"; - - QDeclarativeDebugService service(name, 2); - QCOMPARE(service.version(), 2.0f); -} - -void tst_QDeclarativeDebugService::state() -{ - QDeclarativeDebugTestService service("tst_QDeclarativeDebugService::state()"); - QCOMPARE(service.state(), QDeclarativeDebugService::Unavailable); - - { - QDeclarativeDebugTestClient client("tst_QDeclarativeDebugService::state()", m_conn); - QTRY_COMPARE(client.state(), QDeclarativeDebugClient::Enabled); - QTRY_COMPARE(service.state(), QDeclarativeDebugService::Enabled); - } - - - QTRY_COMPARE(service.state(), QDeclarativeDebugService::Unavailable); - - QTest::ignoreMessage(QtWarningMsg, "QDeclarativeDebugService: Conflicting plugin name \"tst_QDeclarativeDebugService::state()\" "); - QDeclarativeDebugTestService duplicate("tst_QDeclarativeDebugService::state()"); - QCOMPARE(duplicate.state(), QDeclarativeDebugService::NotConnected); -} - -void tst_QDeclarativeDebugService::sendMessage() -{ - QDeclarativeDebugTestService service("tst_QDeclarativeDebugService::sendMessage()"); - QDeclarativeDebugTestClient client("tst_QDeclarativeDebugService::sendMessage()", m_conn); - - QByteArray msg = "hello!"; - - QTRY_COMPARE(client.state(), QDeclarativeDebugClient::Enabled); - QTRY_COMPARE(service.state(), QDeclarativeDebugService::Enabled); - - client.sendMessage(msg); - QByteArray resp = client.waitForResponse(); - QCOMPARE(resp, msg); - - QTest::ignoreMessage(QtWarningMsg, "QDeclarativeDebugService: Conflicting plugin name \"tst_QDeclarativeDebugService::sendMessage()\" "); - QDeclarativeDebugTestService duplicate("tst_QDeclarativeDebugService::sendMessage()"); - duplicate.sendMessage("msg"); -} - -void tst_QDeclarativeDebugService::idForObject() -{ - QCOMPARE(QDeclarativeDebugService::idForObject(0), -1); - - QObject *objA = new QObject; - - int idA = QDeclarativeDebugService::idForObject(objA); - QVERIFY(idA >= 0); - QCOMPARE(QDeclarativeDebugService::objectForId(idA), objA); - - int idAA = QDeclarativeDebugService::idForObject(objA); - QCOMPARE(idAA, idA); - - QObject *objB = new QObject; - int idB = QDeclarativeDebugService::idForObject(objB); - QVERIFY(idB != idA); - QCOMPARE(QDeclarativeDebugService::objectForId(idB), objB); - - delete objA; - delete objB; -} - -void tst_QDeclarativeDebugService::objectForId() -{ - QCOMPARE(QDeclarativeDebugService::objectForId(-1), static_cast(0)); - QCOMPARE(QDeclarativeDebugService::objectForId(1), static_cast(0)); - - QObject *obj = new QObject; - int id = QDeclarativeDebugService::idForObject(obj); - QCOMPARE(QDeclarativeDebugService::objectForId(id), obj); - - delete obj; - QCOMPARE(QDeclarativeDebugService::objectForId(id), static_cast(0)); -} - -void tst_QDeclarativeDebugService::objectToString() -{ - QCOMPARE(QDeclarativeDebugService::objectToString(0), QString("NULL")); - - QObject *obj = new QObject; - QCOMPARE(QDeclarativeDebugService::objectToString(obj), QString("QObject: ")); - - obj->setObjectName("Hello"); - QCOMPARE(QDeclarativeDebugService::objectToString(obj), QString("QObject: Hello")); - delete obj; -} - - -int main(int argc, char *argv[]) -{ - int _argc = argc + 1; - char **_argv = new char*[_argc]; - for (int i = 0; i < argc; ++i) - _argv[i] = argv[i]; - char arg[] = "-qmljsdebugger=port:" STR_PORT; - _argv[_argc - 1] = arg; - - QGuiApplication app(_argc, _argv); - tst_QDeclarativeDebugService tc; - return QTest::qExec(&tc, _argc, _argv); - delete _argv; -} - -#include "tst_qdeclarativedebugservice.moc" diff --git a/tests/auto/declarative/debugger/qdeclarativeenginedebug/qdeclarativeenginedebug.pro b/tests/auto/declarative/debugger/qdeclarativeenginedebug/qdeclarativeenginedebug.pro deleted file mode 100644 index 6b414d3c32..0000000000 --- a/tests/auto/declarative/debugger/qdeclarativeenginedebug/qdeclarativeenginedebug.pro +++ /dev/null @@ -1,11 +0,0 @@ -CONFIG += testcase -TARGET = tst_qdeclarativeenginedebug -macx:CONFIG -= app_bundle - -HEADERS += ../shared/debugutil_p.h -SOURCES += tst_qdeclarativeenginedebug.cpp \ - ../shared/debugutil.cpp - -CONFIG += parallel_test declarative_debug - -QT += core-private declarative-private quick-private v8-private testlib diff --git a/tests/auto/declarative/debugger/qdeclarativeenginedebug/tst_qdeclarativeenginedebug.cpp b/tests/auto/declarative/debugger/qdeclarativeenginedebug/tst_qdeclarativeenginedebug.cpp deleted file mode 100644 index 246ba6080a..0000000000 --- a/tests/auto/declarative/debugger/qdeclarativeenginedebug/tst_qdeclarativeenginedebug.cpp +++ /dev/null @@ -1,1235 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include "../shared/debugutil_p.h" - -Q_DECLARE_METATYPE(QDeclarativeDebugWatch::State) - -class tst_QDeclarativeEngineDebug : public QObject -{ - Q_OBJECT - -private: - QDeclarativeDebugObjectReference findRootObject(int context = 0, bool recursive = false); - QDeclarativeDebugPropertyReference findProperty(const QList &props, const QString &name) const; - void waitForQuery(QDeclarativeDebugQuery *query); - - void recursiveObjectTest(QObject *o, const QDeclarativeDebugObjectReference &oref, bool recursive) const; - - void recursiveCompareObjects(const QDeclarativeDebugObjectReference &a, const QDeclarativeDebugObjectReference &b) const; - void recursiveCompareContexts(const QDeclarativeDebugContextReference &a, const QDeclarativeDebugContextReference &b) const; - void compareProperties(const QDeclarativeDebugPropertyReference &a, const QDeclarativeDebugPropertyReference &b) const; - - QDeclarativeDebugConnection *m_conn; - QDeclarativeEngineDebug *m_dbg; - QDeclarativeEngine *m_engine; - QQuickItem *m_rootItem; - - QObjectList m_components; - -private slots: - void initTestCase(); - void cleanupTestCase(); - - void watch_property(); - void watch_object(); - void watch_expression(); - void watch_expression_data(); - void watch_context(); - void watch_file(); - - void queryAvailableEngines(); - void queryRootContexts(); - void queryObject(); - void queryObject_data(); - void queryExpressionResult(); - void queryExpressionResult_data(); - - void tst_QDeclarativeDebugFileReference(); - void tst_QDeclarativeDebugEngineReference(); - void tst_QDeclarativeDebugObjectReference(); - void tst_QDeclarativeDebugContextReference(); - void tst_QDeclarativeDebugPropertyReference(); - - void setBindingForObject(); - void setMethodBody(); - void queryObjectTree(); - void setBindingInStates(); -}; - -class NonScriptProperty : public QObject { - Q_OBJECT - Q_PROPERTY(int nonScriptProp READ nonScriptProp WRITE setNonScriptProp NOTIFY nonScriptPropChanged SCRIPTABLE false) -public: - int nonScriptProp() const { return 0; } - void setNonScriptProp(int) {} -signals: - void nonScriptPropChanged(); -}; -QML_DECLARE_TYPE(NonScriptProperty) - - -QDeclarativeDebugObjectReference tst_QDeclarativeEngineDebug::findRootObject(int context, bool recursive) -{ - QDeclarativeDebugEnginesQuery *q_engines = m_dbg->queryAvailableEngines(this); - waitForQuery(q_engines); - - if (q_engines->engines().count() == 0) - return QDeclarativeDebugObjectReference(); - QDeclarativeDebugRootContextQuery *q_context = m_dbg->queryRootContexts(q_engines->engines()[0].debugId(), this); - waitForQuery(q_context); - - if (q_context->rootContext().objects().count() == 0) - return QDeclarativeDebugObjectReference(); - QDeclarativeDebugObjectQuery *q_obj = recursive ? - m_dbg->queryObjectRecursive(q_context->rootContext().objects()[context], this) : - m_dbg->queryObject(q_context->rootContext().objects()[context], this); - waitForQuery(q_obj); - - QDeclarativeDebugObjectReference result = q_obj->object(); - - delete q_engines; - delete q_context; - delete q_obj; - - return result; -} - -QDeclarativeDebugPropertyReference tst_QDeclarativeEngineDebug::findProperty(const QList &props, const QString &name) const -{ - foreach(const QDeclarativeDebugPropertyReference &p, props) { - if (p.name() == name) - return p; - } - return QDeclarativeDebugPropertyReference(); -} - -void tst_QDeclarativeEngineDebug::waitForQuery(QDeclarativeDebugQuery *query) -{ - QVERIFY(query); - QCOMPARE(query->parent(), qobject_cast(this)); - QVERIFY(query->state() == QDeclarativeDebugQuery::Waiting); - if (!QDeclarativeDebugTest::waitForSignal(query, SIGNAL(stateChanged(QDeclarativeDebugQuery::State)))) - QFAIL("query timed out"); -} - -void tst_QDeclarativeEngineDebug::recursiveObjectTest(QObject *o, const QDeclarativeDebugObjectReference &oref, bool recursive) const -{ - const QMetaObject *meta = o->metaObject(); - - QDeclarativeType *type = QDeclarativeMetaType::qmlType(meta); - QString className = type ? QString(type->qmlTypeName()) : QString(meta->className()); - className = className.mid(className.lastIndexOf(QLatin1Char('/'))+1); - - QCOMPARE(oref.debugId(), QDeclarativeDebugService::idForObject(o)); - QCOMPARE(oref.name(), o->objectName()); - QCOMPARE(oref.className(), className); - QCOMPARE(oref.contextDebugId(), QDeclarativeDebugService::idForObject(qmlContext(o))); - - const QObjectList &children = o->children(); - for (int i=0; i= 0); - - QDeclarativeDebugObjectReference cref; - foreach (const QDeclarativeDebugObjectReference &ref, oref.children()) { - if (ref.debugId() == debugId) { - cref = ref; - break; - } - } - QVERIFY(cref.debugId() >= 0); - - if (recursive) - recursiveObjectTest(child, cref, true); - } - - foreach (const QDeclarativeDebugPropertyReference &p, oref.properties()) { - QCOMPARE(p.objectDebugId(), QDeclarativeDebugService::idForObject(o)); - - // signal properties are fake - they are generated from QDeclarativeBoundSignal children - if (p.name().startsWith("on") && p.name().length() > 2 && p.name()[2].isUpper()) { - QList signalHandlers = o->findChildren(); - QString signal = p.value().toString(); - bool found = false; - for (int i = 0; i < signalHandlers.count(); ++i) - if (signalHandlers.at(i)->expression()->expression() == signal) { - found = true; - break; - } - QVERIFY(found); - QVERIFY(p.valueTypeName().isEmpty()); - QVERIFY(p.binding().isEmpty()); - QVERIFY(!p.hasNotifySignal()); - continue; - } - - QMetaProperty pmeta = meta->property(meta->indexOfProperty(p.name().toUtf8().constData())); - - QCOMPARE(p.name(), QString::fromUtf8(pmeta.name())); - - if (pmeta.type() < QVariant::UserType && pmeta.userType() != QMetaType::QVariant) // TODO test complex types - QCOMPARE(p.value(), pmeta.read(o)); - - if (p.name() == "parent") - QVERIFY(p.valueTypeName() == "QGraphicsObject*" || p.valueTypeName() == "QQuickItem*"); - else - QCOMPARE(p.valueTypeName(), QString::fromUtf8(pmeta.typeName())); - - QDeclarativeAbstractBinding *binding = - QDeclarativePropertyPrivate::binding(QDeclarativeProperty(o, p.name())); - if (binding) - QCOMPARE(binding->expression(), p.binding()); - - QCOMPARE(p.hasNotifySignal(), pmeta.hasNotifySignal()); - - QVERIFY(pmeta.isValid()); - } -} - -void tst_QDeclarativeEngineDebug::recursiveCompareObjects(const QDeclarativeDebugObjectReference &a, const QDeclarativeDebugObjectReference &b) const -{ - QCOMPARE(a.debugId(), b.debugId()); - QCOMPARE(a.className(), b.className()); - QCOMPARE(a.name(), b.name()); - QCOMPARE(a.contextDebugId(), b.contextDebugId()); - - QCOMPARE(a.source().url(), b.source().url()); - QCOMPARE(a.source().lineNumber(), b.source().lineNumber()); - QCOMPARE(a.source().columnNumber(), b.source().columnNumber()); - - QCOMPARE(a.properties().count(), b.properties().count()); - QCOMPARE(a.children().count(), b.children().count()); - - QList aprops = a.properties(); - QList bprops = b.properties(); - - for (int i=0; i(); - qmlRegisterType("Test", 1, 0, "NonScriptPropertyElement"); - - QTest::ignoreMessage(QtWarningMsg, "QDeclarativeDebugServer: Waiting for connection on port 3768..."); - m_engine = new QDeclarativeEngine(this); - - QList qml; - qml << "import QtQuick 2.0\n" - "import Test 1.0\n" - "Item {" - "id: root\n" - "width: 10; height: 20; scale: blueRect.scale;" - "Rectangle { id: blueRect; width: 500; height: 600; color: \"blue\"; }" - "Text { color: blueRect.color; }" - "MouseArea {" - "onEntered: { console.log('hello') }" - "}" - "property variant varObj\n" - "property variant varObjList: []\n" - "property variant varObjMap\n" - "Component.onCompleted: {\n" - "varObj = blueRect;\n" - "var list = varObjList;\n" - "list[0] = blueRect;\n" - "varObjList = list;\n" - "var map = new Object;\n" - "map.rect = blueRect;\n" - "varObjMap = map;\n" - "}\n" - "NonScriptPropertyElement {\n" - "}\n" - "}"; - - // add second component to test multiple root contexts - qml << "import QtQuick 2.0\n" - "Item {}"; - - // and a third to test methods - qml << "import QtQuick 2.0\n" - "Item {" - "function myMethodNoArgs() { return 3; }\n" - "function myMethod(a) { return a + 9; }\n" - "function myMethodIndirect() { myMethod(3); }\n" - "}"; - - // and a fourth to test states - qml << "import QtQuick 2.0\n" - "Rectangle {\n" - "id:rootRect\n" - "width:100\n" - "states: [\n" - "State {\n" - "name:\"state1\"\n" - "PropertyChanges {\n" - "target:rootRect\n" - "width:200\n" - "}\n" - "}\n" - "]\n" - "transitions: [\n" - "Transition {\n" - "from:\"*\"\n" - "to:\"state1\"\n" - "PropertyAnimation {\n" - "target:rootRect\n" - "property:\"width\"\n" - "duration:100\n" - "}\n" - "}\n" - "]\n" - "}\n" - ; - - for (int i=0; i(component.create()); - } - m_rootItem = qobject_cast(m_components.first()); - - // add an extra context to test for multiple contexts - QDeclarativeContext *context = new QDeclarativeContext(m_engine->rootContext(), this); - context->setObjectName("tst_QDeclarativeDebug_childContext"); - - m_conn = new QDeclarativeDebugConnection(this); - m_conn->connectToHost("127.0.0.1", 3768); - - QTest::ignoreMessage(QtWarningMsg, "QDeclarativeDebugServer: Connection established"); - bool ok = m_conn->waitForConnected(); - QVERIFY(ok); - QTRY_VERIFY(QDeclarativeDebugService::hasDebuggingClient()); - m_dbg = new QDeclarativeEngineDebug(m_conn, this); - QTRY_VERIFY(m_dbg->state() == QDeclarativeEngineDebug::Enabled); -} - -void tst_QDeclarativeEngineDebug::cleanupTestCase() -{ - delete m_dbg; - delete m_conn; - qDeleteAll(m_components); - delete m_engine; -} - -void tst_QDeclarativeEngineDebug::setMethodBody() -{ - QDeclarativeDebugObjectReference obj = findRootObject(2); - - QObject *root = m_components.at(2); - // Without args - { - QVariant rv; - QVERIFY(QMetaObject::invokeMethod(root, "myMethodNoArgs", Qt::DirectConnection, - Q_RETURN_ARG(QVariant, rv))); - QVERIFY(rv == QVariant(qreal(3))); - - - QVERIFY(m_dbg->setMethodBody(obj.debugId(), "myMethodNoArgs", "return 7")); - QTest::qWait(100); - - QVERIFY(QMetaObject::invokeMethod(root, "myMethodNoArgs", Qt::DirectConnection, - Q_RETURN_ARG(QVariant, rv))); - QVERIFY(rv == QVariant(qreal(7))); - } - - // With args - { - QVariant rv; - QVERIFY(QMetaObject::invokeMethod(root, "myMethod", Qt::DirectConnection, - Q_RETURN_ARG(QVariant, rv), Q_ARG(QVariant, QVariant(19)))); - QVERIFY(rv == QVariant(qreal(28))); - - QVERIFY(m_dbg->setMethodBody(obj.debugId(), "myMethod", "return a + 7")); - QTest::qWait(100); - - QVERIFY(QMetaObject::invokeMethod(root, "myMethod", Qt::DirectConnection, - Q_RETURN_ARG(QVariant, rv), Q_ARG(QVariant, QVariant(19)))); - QVERIFY(rv == QVariant(qreal(26))); - } -} - -void tst_QDeclarativeEngineDebug::watch_property() -{ - QDeclarativeDebugObjectReference obj = findRootObject(); - QDeclarativeDebugPropertyReference prop = findProperty(obj.properties(), "width"); - - QDeclarativeDebugPropertyWatch *watch; - - QDeclarativeEngineDebug *unconnected = new QDeclarativeEngineDebug(0); - watch = unconnected->addWatch(prop, this); - QCOMPARE(watch->state(), QDeclarativeDebugWatch::Dead); - delete watch; - delete unconnected; - - watch = m_dbg->addWatch(QDeclarativeDebugPropertyReference(), this); - QVERIFY(QDeclarativeDebugTest::waitForSignal(watch, SIGNAL(stateChanged(QDeclarativeDebugWatch::State)))); - QCOMPARE(watch->state(), QDeclarativeDebugWatch::Inactive); - delete watch; - - watch = m_dbg->addWatch(prop, this); - QCOMPARE(watch->state(), QDeclarativeDebugWatch::Waiting); - QCOMPARE(watch->objectDebugId(), obj.debugId()); - QCOMPARE(watch->name(), prop.name()); - - QSignalSpy spy(watch, SIGNAL(valueChanged(QByteArray,QVariant))); - - int origWidth = m_rootItem->property("width").toInt(); - m_rootItem->setProperty("width", origWidth*2); - - // stateChanged() is received before valueChanged() - QVERIFY(QDeclarativeDebugTest::waitForSignal(watch, SIGNAL(stateChanged(QDeclarativeDebugWatch::State)))); - QCOMPARE(watch->state(), QDeclarativeDebugWatch::Active); - QCOMPARE(spy.count(), 1); - - m_dbg->removeWatch(watch); - delete watch; - - // restore original value and verify spy doesn't get additional signal since watch has been removed - m_rootItem->setProperty("width", origWidth); - QTest::qWait(100); - QCOMPARE(spy.count(), 1); - - QCOMPARE(spy.at(0).at(0).value(), prop.name().toUtf8()); - QCOMPARE(spy.at(0).at(1).value(), qVariantFromValue(origWidth*2)); -} - -void tst_QDeclarativeEngineDebug::watch_object() -{ - QDeclarativeDebugEnginesQuery *q_engines = m_dbg->queryAvailableEngines(this); - waitForQuery(q_engines); - - QVERIFY(q_engines->engines().count() > 0); - QDeclarativeDebugRootContextQuery *q_context = m_dbg->queryRootContexts(q_engines->engines()[0].debugId(), this); - waitForQuery(q_context); - - QVERIFY(q_context->rootContext().objects().count() > 0); - QDeclarativeDebugObjectQuery *q_obj = m_dbg->queryObject(q_context->rootContext().objects()[0], this); - waitForQuery(q_obj); - - QDeclarativeDebugObjectReference obj = q_obj->object(); - - delete q_engines; - delete q_context; - delete q_obj; - - QDeclarativeDebugWatch *watch; - - QDeclarativeEngineDebug *unconnected = new QDeclarativeEngineDebug(0); - watch = unconnected->addWatch(obj, this); - QCOMPARE(watch->state(), QDeclarativeDebugWatch::Dead); - delete watch; - delete unconnected; - - watch = m_dbg->addWatch(QDeclarativeDebugObjectReference(), this); - QVERIFY(QDeclarativeDebugTest::waitForSignal(watch, SIGNAL(stateChanged(QDeclarativeDebugWatch::State)))); - QCOMPARE(watch->state(), QDeclarativeDebugWatch::Inactive); - delete watch; - - watch = m_dbg->addWatch(obj, this); - QCOMPARE(watch->state(), QDeclarativeDebugWatch::Waiting); - QCOMPARE(watch->objectDebugId(), obj.debugId()); - - QSignalSpy spy(watch, SIGNAL(valueChanged(QByteArray,QVariant))); - - int origWidth = m_rootItem->property("width").toInt(); - int origHeight = m_rootItem->property("height").toInt(); - m_rootItem->setProperty("width", origWidth*2); - m_rootItem->setProperty("height", origHeight*2); - - // stateChanged() is received before any valueChanged() signals - QVERIFY(QDeclarativeDebugTest::waitForSignal(watch, SIGNAL(stateChanged(QDeclarativeDebugWatch::State)))); - QCOMPARE(watch->state(), QDeclarativeDebugWatch::Active); - QVERIFY(spy.count() > 0); - - int newWidth = -1; - int newHeight = -1; - for (int i=0; i() == "width") - newWidth = values[1].value().toInt(); - else if (values[0].value() == "height") - newHeight = values[1].value().toInt(); - - } - - m_dbg->removeWatch(watch); - delete watch; - - // since watch has been removed, restoring the original values should not trigger a valueChanged() - spy.clear(); - m_rootItem->setProperty("width", origWidth); - m_rootItem->setProperty("height", origHeight); - QTest::qWait(100); - QCOMPARE(spy.count(), 0); - - QCOMPARE(newWidth, origWidth * 2); - QCOMPARE(newHeight, origHeight * 2); -} - -void tst_QDeclarativeEngineDebug::watch_expression() -{ - QFETCH(QString, expr); - QFETCH(int, increment); - QFETCH(int, incrementCount); - - int origWidth = m_rootItem->property("width").toInt(); - - QDeclarativeDebugObjectReference obj = findRootObject(); - - QDeclarativeDebugObjectExpressionWatch *watch; - - QDeclarativeEngineDebug *unconnected = new QDeclarativeEngineDebug(0); - watch = unconnected->addWatch(obj, expr, this); - QCOMPARE(watch->state(), QDeclarativeDebugWatch::Dead); - delete watch; - delete unconnected; - - watch = m_dbg->addWatch(QDeclarativeDebugObjectReference(), expr, this); - QVERIFY(QDeclarativeDebugTest::waitForSignal(watch, SIGNAL(stateChanged(QDeclarativeDebugWatch::State)))); - QCOMPARE(watch->state(), QDeclarativeDebugWatch::Inactive); - delete watch; - - watch = m_dbg->addWatch(obj, expr, this); - QCOMPARE(watch->state(), QDeclarativeDebugWatch::Waiting); - QCOMPARE(watch->objectDebugId(), obj.debugId()); - QCOMPARE(watch->expression(), expr); - - QSignalSpy spyState(watch, SIGNAL(stateChanged(QDeclarativeDebugWatch::State))); - - QSignalSpy spy(watch, SIGNAL(valueChanged(QByteArray,QVariant))); - int expectedSpyCount = incrementCount + 1; // should also get signal with expression's initial value - - int width = origWidth; - for (int i=0; i 0) { - width += increment; - m_rootItem->setProperty("width", width); - } - if (!QDeclarativeDebugTest::waitForSignal(watch, SIGNAL(valueChanged(QByteArray,QVariant)))) - QFAIL("Did not receive valueChanged() for expression"); - } - - if (spyState.count() == 0) - QVERIFY(QDeclarativeDebugTest::waitForSignal(watch, SIGNAL(stateChanged(QDeclarativeDebugWatch::State)))); - QCOMPARE(spyState.count(), 1); - QCOMPARE(watch->state(), QDeclarativeDebugWatch::Active); - - m_dbg->removeWatch(watch); - delete watch; - - // restore original value and verify spy doesn't get a signal since watch has been removed - m_rootItem->setProperty("width", origWidth); - QTest::qWait(100); - QCOMPARE(spy.count(), expectedSpyCount); - - width = origWidth + increment; - for (int i=0; i().toInt(), width); - width += increment; - } -} - -void tst_QDeclarativeEngineDebug::watch_expression_data() -{ - QTest::addColumn("expr"); - QTest::addColumn("increment"); - QTest::addColumn("incrementCount"); - - QTest::newRow("width") << "width" << 0 << 0; - QTest::newRow("width+10") << "width + 10" << 10 << 5; -} - -void tst_QDeclarativeEngineDebug::watch_context() -{ - QDeclarativeDebugContextReference c; - QTest::ignoreMessage(QtWarningMsg, "QDeclarativeEngineDebug::addWatch(): Not implemented"); - QVERIFY(!m_dbg->addWatch(c, QString(), this)); -} - -void tst_QDeclarativeEngineDebug::watch_file() -{ - QDeclarativeDebugFileReference f; - QTest::ignoreMessage(QtWarningMsg, "QDeclarativeEngineDebug::addWatch(): Not implemented"); - QVERIFY(!m_dbg->addWatch(f, this)); -} - -void tst_QDeclarativeEngineDebug::queryAvailableEngines() -{ - QDeclarativeDebugEnginesQuery *q_engines; - - QDeclarativeEngineDebug *unconnected = new QDeclarativeEngineDebug(0); - q_engines = unconnected->queryAvailableEngines(0); - QCOMPARE(q_engines->state(), QDeclarativeDebugQuery::Error); - delete q_engines; - delete unconnected; - - q_engines = m_dbg->queryAvailableEngines(this); - delete q_engines; - - q_engines = m_dbg->queryAvailableEngines(this); - QVERIFY(q_engines->engines().isEmpty()); - waitForQuery(q_engines); - - // TODO test multiple engines - QList engines = q_engines->engines(); - QCOMPARE(engines.count(), 1); - - foreach(const QDeclarativeDebugEngineReference &e, engines) { - QCOMPARE(e.debugId(), QDeclarativeDebugService::idForObject(m_engine)); - QCOMPARE(e.name(), m_engine->objectName()); - } - - // Make query invalid by deleting client - q_engines = m_dbg->queryAvailableEngines(this); - QCOMPARE(q_engines->state(), QDeclarativeDebugQuery::Waiting); - delete m_dbg; - QCOMPARE(q_engines->state(), QDeclarativeDebugQuery::Error); - delete q_engines; - m_dbg = new QDeclarativeEngineDebug(m_conn, this); -} - -void tst_QDeclarativeEngineDebug::queryRootContexts() -{ - QDeclarativeDebugEnginesQuery *q_engines = m_dbg->queryAvailableEngines(this); - waitForQuery(q_engines); - int engineId = q_engines->engines()[0].debugId(); - delete q_engines; - - QDeclarativeDebugRootContextQuery *q_context; - - QDeclarativeEngineDebug *unconnected = new QDeclarativeEngineDebug(0); - q_context = unconnected->queryRootContexts(engineId, this); - QCOMPARE(q_context->state(), QDeclarativeDebugQuery::Error); - delete q_context; - delete unconnected; - - q_context = m_dbg->queryRootContexts(engineId, this); - delete q_context; - - q_context = m_dbg->queryRootContexts(engineId, this); - waitForQuery(q_context); - - QDeclarativeContext *actualContext = m_engine->rootContext(); - QDeclarativeDebugContextReference context = q_context->rootContext(); - QCOMPARE(context.debugId(), QDeclarativeDebugService::idForObject(actualContext)); - QCOMPARE(context.name(), actualContext->objectName()); - - QCOMPARE(context.objects().count(), 4); // 4 qml component objects created for context in main() - - // root context query sends only root object data - it doesn't fill in - // the children or property info - QCOMPARE(context.objects()[0].properties().count(), 0); - QCOMPARE(context.objects()[0].children().count(), 0); - - QCOMPARE(context.contexts().count(), 5); - QVERIFY(context.contexts()[0].debugId() >= 0); - QCOMPARE(context.contexts()[0].name(), QString("tst_QDeclarativeDebug_childContext")); - - // Make query invalid by deleting client - q_context = m_dbg->queryRootContexts(engineId, this); - QCOMPARE(q_context->state(), QDeclarativeDebugQuery::Waiting); - delete m_dbg; - QCOMPARE(q_context->state(), QDeclarativeDebugQuery::Error); - delete q_context; - m_dbg = new QDeclarativeEngineDebug(m_conn, this); -} - -void tst_QDeclarativeEngineDebug::queryObject() -{ - QFETCH(bool, recursive); - - QDeclarativeDebugEnginesQuery *q_engines = m_dbg->queryAvailableEngines(this); - waitForQuery(q_engines); - - QDeclarativeDebugRootContextQuery *q_context = m_dbg->queryRootContexts(q_engines->engines()[0].debugId(), this); - waitForQuery(q_context); - QDeclarativeDebugObjectReference rootObject = q_context->rootContext().objects()[0]; - - QDeclarativeDebugObjectQuery *q_obj = 0; - - QDeclarativeEngineDebug *unconnected = new QDeclarativeEngineDebug(0); - q_obj = recursive ? unconnected->queryObjectRecursive(rootObject, this) : unconnected->queryObject(rootObject, this); - QCOMPARE(q_obj->state(), QDeclarativeDebugQuery::Error); - delete q_obj; - delete unconnected; - - q_obj = recursive ? m_dbg->queryObjectRecursive(rootObject, this) : m_dbg->queryObject(rootObject, this); - delete q_obj; - - q_obj = recursive ? m_dbg->queryObjectRecursive(rootObject, this) : m_dbg->queryObject(rootObject, this); - waitForQuery(q_obj); - - QDeclarativeDebugObjectReference obj = q_obj->object(); - - delete q_engines; - delete q_context; - - // Make query invalid by deleting client - q_obj = recursive ? m_dbg->queryObjectRecursive(rootObject, this) : m_dbg->queryObject(rootObject, this); - QCOMPARE(q_obj->state(), QDeclarativeDebugQuery::Waiting); - delete m_dbg; - QCOMPARE(q_obj->state(), QDeclarativeDebugQuery::Error); - delete q_obj; - m_dbg = new QDeclarativeEngineDebug(m_conn, this); - - // check source as defined in main() - QDeclarativeDebugFileReference source = obj.source(); - QCOMPARE(source.url(), QUrl::fromLocalFile("")); - QCOMPARE(source.lineNumber(), 3); - QCOMPARE(source.columnNumber(), 1); - - // generically test all properties, children and childrens' properties - recursiveObjectTest(m_rootItem, obj, recursive); - - if (recursive) { - foreach(const QDeclarativeDebugObjectReference &child, obj.children()) - QVERIFY(child.properties().count() > 0); - - QDeclarativeDebugObjectReference rect; - QDeclarativeDebugObjectReference text; - foreach (const QDeclarativeDebugObjectReference &child, obj.children()) { - if (child.className() == "Rectangle") - rect = child; - else if (child.className() == "Text") - text = child; - } - - // test specific property values - QCOMPARE(findProperty(rect.properties(), "width").value(), qVariantFromValue(500)); - QCOMPARE(findProperty(rect.properties(), "height").value(), qVariantFromValue(600)); - QCOMPARE(findProperty(rect.properties(), "color").value(), qVariantFromValue(QColor("blue"))); - - QCOMPARE(findProperty(text.properties(), "color").value(), qVariantFromValue(QColor("blue"))); - } else { - foreach(const QDeclarativeDebugObjectReference &child, obj.children()) - QCOMPARE(child.properties().count(), 0); - } -} - -void tst_QDeclarativeEngineDebug::queryObject_data() -{ - QTest::addColumn("recursive"); - - QTest::newRow("non-recursive") << false; - QTest::newRow("recursive") << true; -} - -void tst_QDeclarativeEngineDebug::queryExpressionResult() -{ - QFETCH(QString, expr); - QFETCH(QVariant, result); - - QDeclarativeDebugEnginesQuery *q_engines = m_dbg->queryAvailableEngines(this); - waitForQuery(q_engines); // check immediate deletion is ok - - QDeclarativeDebugRootContextQuery *q_context = m_dbg->queryRootContexts(q_engines->engines()[0].debugId(), this); - waitForQuery(q_context); - int objectId = q_context->rootContext().objects()[0].debugId(); - - QDeclarativeDebugExpressionQuery *q_expr; - - QDeclarativeEngineDebug *unconnected = new QDeclarativeEngineDebug(0); - q_expr = unconnected->queryExpressionResult(objectId, expr, this); - QCOMPARE(q_expr->state(), QDeclarativeDebugQuery::Error); - delete q_expr; - delete unconnected; - - q_expr = m_dbg->queryExpressionResult(objectId, expr, this); - delete q_expr; - - q_expr = m_dbg->queryExpressionResult(objectId, expr, this); - QCOMPARE(q_expr->expression().toString(), expr); - waitForQuery(q_expr); - - QCOMPARE(q_expr->result(), result); - - delete q_engines; - delete q_context; - - // Make query invalid by deleting client - q_expr = m_dbg->queryExpressionResult(objectId, expr, this); - QCOMPARE(q_expr->state(), QDeclarativeDebugQuery::Waiting); - delete m_dbg; - QCOMPARE(q_expr->state(), QDeclarativeDebugQuery::Error); - delete q_expr; - m_dbg = new QDeclarativeEngineDebug(m_conn, this); -} - -void tst_QDeclarativeEngineDebug::queryExpressionResult_data() -{ - QTest::addColumn("expr"); - QTest::addColumn("result"); - - QTest::newRow("width + 50") << "width + 50" << qVariantFromValue(60); - QTest::newRow("blueRect.width") << "blueRect.width" << qVariantFromValue(500); - QTest::newRow("bad expr") << "aeaef" << qVariantFromValue(QString("")); - QTest::newRow("QObject*") << "varObj" << qVariantFromValue(QString("")); - QTest::newRow("list of QObject*") << "varObjList" << qVariantFromValue(QString("")); - QVariantMap map; - map.insert(QLatin1String("rect"), QVariant(QLatin1String(""))); - QTest::newRow("varObjMap") << "varObjMap" << qVariantFromValue(map); -} - -void tst_QDeclarativeEngineDebug::tst_QDeclarativeDebugFileReference() -{ - QDeclarativeDebugFileReference ref; - QVERIFY(ref.url().isEmpty()); - QCOMPARE(ref.lineNumber(), -1); - QCOMPARE(ref.columnNumber(), -1); - - ref.setUrl(QUrl("http://test")); - QCOMPARE(ref.url(), QUrl("http://test")); - ref.setLineNumber(1); - QCOMPARE(ref.lineNumber(), 1); - ref.setColumnNumber(1); - QCOMPARE(ref.columnNumber(), 1); - - QDeclarativeDebugFileReference copy(ref); - QDeclarativeDebugFileReference copyAssign; - copyAssign = ref; - foreach (const QDeclarativeDebugFileReference &r, (QList() << copy << copyAssign)) { - QCOMPARE(r.url(), ref.url()); - QCOMPARE(r.lineNumber(), ref.lineNumber()); - QCOMPARE(r.columnNumber(), ref.columnNumber()); - } -} - -void tst_QDeclarativeEngineDebug::tst_QDeclarativeDebugEngineReference() -{ - QDeclarativeDebugEngineReference ref; - QCOMPARE(ref.debugId(), -1); - QVERIFY(ref.name().isEmpty()); - - ref = QDeclarativeDebugEngineReference(1); - QCOMPARE(ref.debugId(), 1); - QVERIFY(ref.name().isEmpty()); - - QDeclarativeDebugEnginesQuery *q_engines = m_dbg->queryAvailableEngines(this); - waitForQuery(q_engines); - ref = q_engines->engines()[0]; - delete q_engines; - - QDeclarativeDebugEngineReference copy(ref); - QDeclarativeDebugEngineReference copyAssign; - copyAssign = ref; - foreach (const QDeclarativeDebugEngineReference &r, (QList() << copy << copyAssign)) { - QCOMPARE(r.debugId(), ref.debugId()); - QCOMPARE(r.name(), ref.name()); - } -} - -void tst_QDeclarativeEngineDebug::tst_QDeclarativeDebugObjectReference() -{ - QDeclarativeDebugObjectReference ref; - QCOMPARE(ref.debugId(), -1); - QCOMPARE(ref.className(), QString()); - QCOMPARE(ref.name(), QString()); - QCOMPARE(ref.contextDebugId(), -1); - QVERIFY(ref.properties().isEmpty()); - QVERIFY(ref.children().isEmpty()); - - QDeclarativeDebugFileReference source = ref.source(); - QVERIFY(source.url().isEmpty()); - QVERIFY(source.lineNumber() < 0); - QVERIFY(source.columnNumber() < 0); - - ref = QDeclarativeDebugObjectReference(1); - QCOMPARE(ref.debugId(), 1); - - QDeclarativeDebugObjectReference rootObject = findRootObject(); - QDeclarativeDebugObjectQuery *query = m_dbg->queryObjectRecursive(rootObject, this); - waitForQuery(query); - ref = query->object(); - delete query; - - QVERIFY(ref.debugId() >= 0); - - QDeclarativeDebugObjectReference copy(ref); - QDeclarativeDebugObjectReference copyAssign; - copyAssign = ref; - foreach (const QDeclarativeDebugObjectReference &r, (QList() << copy << copyAssign)) - recursiveCompareObjects(r, ref); -} - -void tst_QDeclarativeEngineDebug::tst_QDeclarativeDebugContextReference() -{ - QDeclarativeDebugContextReference ref; - QCOMPARE(ref.debugId(), -1); - QVERIFY(ref.name().isEmpty()); - QVERIFY(ref.objects().isEmpty()); - QVERIFY(ref.contexts().isEmpty()); - - QDeclarativeDebugEnginesQuery *q_engines = m_dbg->queryAvailableEngines(this); - waitForQuery(q_engines); - QDeclarativeDebugRootContextQuery *q_context = m_dbg->queryRootContexts(q_engines->engines()[0].debugId(), this); - waitForQuery(q_context); - - ref = q_context->rootContext(); - delete q_engines; - delete q_context; - QVERIFY(ref.debugId() >= 0); - - QDeclarativeDebugContextReference copy(ref); - QDeclarativeDebugContextReference copyAssign; - copyAssign = ref; - foreach (const QDeclarativeDebugContextReference &r, (QList() << copy << copyAssign)) - recursiveCompareContexts(r, ref); -} - -void tst_QDeclarativeEngineDebug::tst_QDeclarativeDebugPropertyReference() -{ - QDeclarativeDebugObjectReference rootObject = findRootObject(); - QDeclarativeDebugObjectQuery *query = m_dbg->queryObject(rootObject, this); - waitForQuery(query); - QDeclarativeDebugObjectReference obj = query->object(); - delete query; - - QDeclarativeDebugPropertyReference ref = findProperty(obj.properties(), "scale"); - QVERIFY(ref.objectDebugId() > 0); - QVERIFY(!ref.name().isEmpty()); - QVERIFY(!ref.value().isNull()); - QVERIFY(!ref.valueTypeName().isEmpty()); - QVERIFY(!ref.binding().isEmpty()); - QVERIFY(ref.hasNotifySignal()); - - QDeclarativeDebugPropertyReference copy(ref); - QDeclarativeDebugPropertyReference copyAssign; - copyAssign = ref; - foreach (const QDeclarativeDebugPropertyReference &r, (QList() << copy << copyAssign)) - compareProperties(r, ref); -} - -void tst_QDeclarativeEngineDebug::setBindingForObject() -{ - QDeclarativeDebugObjectReference rootObject = findRootObject(); - QVERIFY(rootObject.debugId() != -1); - QDeclarativeDebugPropertyReference widthPropertyRef = findProperty(rootObject.properties(), "width"); - - QCOMPARE(widthPropertyRef.value(), QVariant(10)); - QCOMPARE(widthPropertyRef.binding(), QString()); - - // - // set literal - // - m_dbg->setBindingForObject(rootObject.debugId(), "width", "15", true); - - rootObject = findRootObject(); - widthPropertyRef = findProperty(rootObject.properties(), "width"); - - QCOMPARE(widthPropertyRef.value(), QVariant(15)); - QCOMPARE(widthPropertyRef.binding(), QString()); - - // - // set expression - // - m_dbg->setBindingForObject(rootObject.debugId(), "width", "height", false); - - rootObject = findRootObject(); - widthPropertyRef = findProperty(rootObject.properties(), "width"); - - QCOMPARE(widthPropertyRef.value(), QVariant(20)); - QCOMPARE(widthPropertyRef.binding(), QString("height")); - - // - // reset - // - m_dbg->resetBindingForObject(rootObject.debugId(), "width"); - - rootObject = findRootObject(); - widthPropertyRef = findProperty(rootObject.properties(), "width"); - - // QCOMPARE(widthPropertyRef.value(), QVariant(0)); // TODO: Shouldn't this work? - QCOMPARE(widthPropertyRef.binding(), QString()); - - // - // set handler - // - rootObject = findRootObject(); - QCOMPARE(rootObject.children().size(), 5); // Rectangle, Text, MouseArea, Component.onCompleted, NonScriptPropertyElement - QDeclarativeDebugObjectReference mouseAreaObject = rootObject.children().at(2); - QDeclarativeDebugObjectQuery *q_obj = m_dbg->queryObjectRecursive(mouseAreaObject, this); - waitForQuery(q_obj); - mouseAreaObject = q_obj->object(); - - QCOMPARE(mouseAreaObject.className(), QString("MouseArea")); - - QDeclarativeDebugPropertyReference onEnteredRef = findProperty(mouseAreaObject.properties(), "onEntered"); - - QCOMPARE(onEnteredRef.name(), QString("onEntered")); - QCOMPARE(onEnteredRef.value(), QVariant("(function onEntered() { { console.log('hello') } })")); - - m_dbg->setBindingForObject(mouseAreaObject.debugId(), "onEntered", "{console.log('hello, world') }", false) ; - - rootObject = findRootObject(); - mouseAreaObject = rootObject.children().at(2); - q_obj = m_dbg->queryObjectRecursive(mouseAreaObject, this); - waitForQuery(q_obj); - mouseAreaObject = q_obj->object(); - onEnteredRef = findProperty(mouseAreaObject.properties(), "onEntered"); - QCOMPARE(onEnteredRef.name(), QString("onEntered")); - QCOMPARE(onEnteredRef.value(), QVariant("{console.log('hello, world') }")); -} - -void tst_QDeclarativeEngineDebug::setBindingInStates() -{ - // Check if changing bindings of propertychanges works - - const int sourceIndex = 3; - - QDeclarativeDebugObjectReference obj = findRootObject(sourceIndex); - - QVERIFY(obj.debugId() != -1); - QVERIFY(obj.children().count() >= 2); - - // We are going to switch state a couple of times, we need to get rid of the transition before - QDeclarativeDebugExpressionQuery *q_deleteTransition = m_dbg->queryExpressionResult(obj.debugId(),QString("transitions = []"),this); - waitForQuery(q_deleteTransition); - delete q_deleteTransition; - - - // check initial value of the property that is changing - QDeclarativeDebugExpressionQuery *q_setState; - q_setState = m_dbg->queryExpressionResult(obj.debugId(),QString("state=\"state1\""),this); - waitForQuery(q_setState); - delete q_setState; - - obj = findRootObject(sourceIndex); - QCOMPARE(findProperty(obj.properties(),"width").value().toInt(),200); - - - q_setState = m_dbg->queryExpressionResult(obj.debugId(),QString("state=\"\""),this); - waitForQuery(q_setState); - delete q_setState; - - - obj = findRootObject(sourceIndex, true); - QCOMPARE(findProperty(obj.properties(),"width").value().toInt(),100); - - - // change the binding - QDeclarativeDebugObjectReference state = obj.children()[1]; - QCOMPARE(state.className(), QString("State")); - QVERIFY(state.children().count() > 0); - - QDeclarativeDebugObjectReference propertyChange = state.children()[0]; - QVERIFY(propertyChange.debugId() != -1); - - QVERIFY( m_dbg->setBindingForObject(propertyChange.debugId(), "width",QVariant(300),true) ); - - // check properties changed in state - obj = findRootObject(sourceIndex); - QCOMPARE(findProperty(obj.properties(),"width").value().toInt(),100); - - - q_setState = m_dbg->queryExpressionResult(obj.debugId(),QString("state=\"state1\""),this); - waitForQuery(q_setState); - delete q_setState; - - obj = findRootObject(sourceIndex); - QCOMPARE(findProperty(obj.properties(),"width").value().toInt(),300); - - // check changing properties of base state from within a state - QVERIFY(m_dbg->setBindingForObject(obj.debugId(),"width","height*2",false)); - QVERIFY(m_dbg->setBindingForObject(obj.debugId(),"height","200",true)); - - obj = findRootObject(sourceIndex); - QCOMPARE(findProperty(obj.properties(),"width").value().toInt(),300); - - q_setState = m_dbg->queryExpressionResult(obj.debugId(),QString("state=\"\""),this); - waitForQuery(q_setState); - delete q_setState; - - obj = findRootObject(sourceIndex); - QCOMPARE(findProperty(obj.properties(),"width").value().toInt(), 400); - - // reset binding while in a state - q_setState = m_dbg->queryExpressionResult(obj.debugId(),QString("state=\"state1\""),this); - waitForQuery(q_setState); - delete q_setState; - - obj = findRootObject(sourceIndex); - QCOMPARE(findProperty(obj.properties(),"width").value().toInt(), 300); - - m_dbg->resetBindingForObject(propertyChange.debugId(), "width"); - - obj = findRootObject(sourceIndex); - QCOMPARE(findProperty(obj.properties(),"width").value().toInt(), 400); - - // re-add binding - m_dbg->setBindingForObject(propertyChange.debugId(), "width", "300", true); - - obj = findRootObject(sourceIndex); - QCOMPARE(findProperty(obj.properties(),"width").value().toInt(), 300); -} - -void tst_QDeclarativeEngineDebug::queryObjectTree() -{ - const int sourceIndex = 3; - - // Check if states/transitions are initialized when fetching root item - QDeclarativeDebugEnginesQuery *q_engines = m_dbg->queryAvailableEngines(this); - waitForQuery(q_engines); - - QDeclarativeDebugRootContextQuery *q_context = m_dbg->queryRootContexts(q_engines->engines()[0].debugId(), this); - waitForQuery(q_context); - - QVERIFY(q_context->rootContext().objects().count() > sourceIndex); - QDeclarativeDebugObjectReference rootObject = q_context->rootContext().objects()[sourceIndex]; - - QDeclarativeDebugObjectQuery *q_obj = m_dbg->queryObjectRecursive(rootObject, this); - waitForQuery(q_obj); - - QDeclarativeDebugObjectReference obj = q_obj->object(); - - delete q_engines; - delete q_context; - delete q_obj; - - QVERIFY(obj.debugId() != -1); - QVERIFY(obj.children().count() >= 2); - - - - // check state - QDeclarativeDebugObjectReference state = obj.children()[1]; - QCOMPARE(state.className(), QString("State")); - QVERIFY(state.children().count() > 0); - - QDeclarativeDebugObjectReference propertyChange = state.children()[0]; - QVERIFY(propertyChange.debugId() != -1); - - QDeclarativeDebugPropertyReference propertyChangeTarget = findProperty(propertyChange.properties(),"target"); - QCOMPARE(propertyChangeTarget.objectDebugId(), propertyChange.debugId()); - - QDeclarativeDebugObjectReference targetReference = qvariant_cast(propertyChangeTarget.value()); - QVERIFY(targetReference.debugId() != -1); - - - - // check transition - QDeclarativeDebugObjectReference transition = obj.children()[0]; - QCOMPARE(transition.className(), QString("Transition")); - QCOMPARE(findProperty(transition.properties(),"from").value().toString(), QString("*")); - QCOMPARE(findProperty(transition.properties(),"to").value(), findProperty(state.properties(),"name").value()); - QVERIFY(transition.children().count() > 0); - - QDeclarativeDebugObjectReference animation = transition.children()[0]; - QVERIFY(animation.debugId() != -1); - - QDeclarativeDebugPropertyReference animationTarget = findProperty(animation.properties(),"target"); - QCOMPARE(animationTarget.objectDebugId(), animation.debugId()); - - targetReference = qvariant_cast(animationTarget.value()); - QVERIFY(targetReference.debugId() != -1); - - QCOMPARE(findProperty(animation.properties(),"property").value().toString(), QString("width")); - QCOMPARE(findProperty(animation.properties(),"duration").value().toInt(), 100); -} - -int main(int argc, char *argv[]) -{ - int _argc = argc + 1; - char **_argv = new char*[_argc]; - for (int i = 0; i < argc; ++i) - _argv[i] = argv[i]; - char arg[] = "-qmljsdebugger=port:3768"; - _argv[_argc - 1] = arg; - - QGuiApplication app(_argc, _argv); - tst_QDeclarativeEngineDebug tc; - return QTest::qExec(&tc, _argc, _argv); - delete _argv; -} - -#include "tst_qdeclarativeenginedebug.moc" diff --git a/tests/auto/declarative/debugger/qdeclarativeinspector/app/app.pro b/tests/auto/declarative/debugger/qdeclarativeinspector/app/app.pro deleted file mode 100644 index 6433631c4b..0000000000 --- a/tests/auto/declarative/debugger/qdeclarativeinspector/app/app.pro +++ /dev/null @@ -1,9 +0,0 @@ -TARGET = app -QT += declarative quick widgets - -CONFIG += declarative_debug -macx:CONFIG -= app_bundle - -SOURCES += main.cpp - -OTHER_FILES += qtquick1.qml qtquick2.qml diff --git a/tests/auto/declarative/debugger/qdeclarativeinspector/app/main.cpp b/tests/auto/declarative/debugger/qdeclarativeinspector/app/main.cpp deleted file mode 100644 index a7ef09c283..0000000000 --- a/tests/auto/declarative/debugger/qdeclarativeinspector/app/main.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include -#include -#include - -int main(int argc, char *argv[]) -{ - QGuiApplication app(argc, argv); - - bool qtquick2 = true; - for (int i = 1; i < app.arguments().size(); ++i) { - const QString arg = app.arguments().at(i); - if (arg == "-qtquick1") { - qtquick2 = false; - } else if (arg == "-qtquick2") { - qtquick2 = true; - } else { - qWarning() << "Usage: " << app.arguments().at(0) << "[-qtquick1|-qtquick2]"; - return -1; - } - } - - if (qtquick2) { - QQuickView *view = new QQuickView(); - view->setSource(QUrl::fromLocalFile("app/qtquick2.qml")); - } else { - qWarning("No suitable QtQuick1 implementation is available!"); - } - return app.exec(); -} diff --git a/tests/auto/declarative/debugger/qdeclarativeinspector/app/qtquick2.qml b/tests/auto/declarative/debugger/qdeclarativeinspector/app/qtquick2.qml deleted file mode 100644 index 9c36e13c5b..0000000000 --- a/tests/auto/declarative/debugger/qdeclarativeinspector/app/qtquick2.qml +++ /dev/null @@ -1,5 +0,0 @@ -import QtQuick 2.0 - -Item { - -} diff --git a/tests/auto/declarative/debugger/qdeclarativeinspector/qdeclarativeinspector.pro b/tests/auto/declarative/debugger/qdeclarativeinspector/qdeclarativeinspector.pro deleted file mode 100644 index 28d16a5029..0000000000 --- a/tests/auto/declarative/debugger/qdeclarativeinspector/qdeclarativeinspector.pro +++ /dev/null @@ -1,3 +0,0 @@ -TEMPLATE = subdirs - -SUBDIRS += tst_qdeclarativeinspector.pro app diff --git a/tests/auto/declarative/debugger/qdeclarativeinspector/tst_qdeclarativeinspector.cpp b/tests/auto/declarative/debugger/qdeclarativeinspector/tst_qdeclarativeinspector.cpp deleted file mode 100644 index 4d7e57f4d4..0000000000 --- a/tests/auto/declarative/debugger/qdeclarativeinspector/tst_qdeclarativeinspector.cpp +++ /dev/null @@ -1,186 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include -#include -#include -#include -#include -#include - -#include "../../../../../src/plugins/qmltooling/shared/qdeclarativeinspectorprotocol.h" -#include "../shared/debugutil_p.h" - -using namespace QmlJSDebugger; - -#define PORT 13772 -#define STR_PORT "13772" - -class QDeclarativeInspectorClient : public QDeclarativeDebugClient -{ - Q_OBJECT - -public: - QDeclarativeInspectorClient(QDeclarativeDebugConnection *connection) - : QDeclarativeDebugClient(QLatin1String("QDeclarativeObserverMode"), connection) - , m_showAppOnTop(false) - { - } - - bool showAppOnTop() const { return m_showAppOnTop; } - void setShowAppOnTop(bool showOnTop); - -signals: - void showAppOnTopChanged(); - -protected: - void messageReceived(const QByteArray &message); - -private: - bool m_showAppOnTop; -}; - -class tst_QDeclarativeInspector : public QObject -{ - Q_OBJECT - -public: - tst_QDeclarativeInspector() - : m_process(0) - , m_connection(0) - , m_client(0) - { - } - - -private: - QDeclarativeDebugProcess *m_process; - QDeclarativeDebugConnection *m_connection; - QDeclarativeInspectorClient *m_client; - -private slots: - void initTestCase(); - void cleanupTestCase(); - void init(); - void cleanup(); - - void connect(); - void showAppOnTop(); -}; - - -void QDeclarativeInspectorClient::setShowAppOnTop(bool showOnTop) -{ - QByteArray message; - QDataStream ds(&message, QIODevice::WriteOnly); - ds << InspectorProtocol::ShowAppOnTop << showOnTop; - - sendMessage(message); -} - -void QDeclarativeInspectorClient::messageReceived(const QByteArray &message) -{ - QDataStream ds(message); - InspectorProtocol::Message type; - ds >> type; - - switch (type) { - case InspectorProtocol::ShowAppOnTop: - ds >> m_showAppOnTop; - emit showAppOnTopChanged(); - break; - default: - qDebug() << "Unhandled message " << (int)type; - } -} - -void tst_QDeclarativeInspector::initTestCase() -{ -} - -void tst_QDeclarativeInspector::cleanupTestCase() -{ -} - -void tst_QDeclarativeInspector::init() -{ - const QString executable = SRCDIR"/app/app"; - const QString argument = "-qmljsdebugger=port:"STR_PORT",block"; - - m_process = new QDeclarativeDebugProcess(executable); - m_process->start(QStringList() << argument); - if (!m_process->waitForSessionStart()) { - QFAIL(QString("Could not launch app '%1'.\nApplication output:\n%2").arg(executable, m_process->output()).toAscii()); - } - - QDeclarativeDebugConnection *m_connection = new QDeclarativeDebugConnection(); - m_client = new QDeclarativeInspectorClient(m_connection); - - m_connection->connectToHost(QLatin1String("127.0.0.1"), PORT); -} - -void tst_QDeclarativeInspector::cleanup() -{ - delete m_process; - delete m_connection; - delete m_client; -} - -void tst_QDeclarativeInspector::connect() -{ - QTRY_COMPARE(m_client->state(), QDeclarativeDebugClient::Enabled); -} - -void tst_QDeclarativeInspector::showAppOnTop() -{ - QTRY_COMPARE(m_client->state(), QDeclarativeDebugClient::Enabled); - - m_client->setShowAppOnTop(true); - QVERIFY(QDeclarativeDebugTest::waitForSignal(m_client, SIGNAL(showAppOnTopChanged()))); - QCOMPARE(m_client->showAppOnTop(), true); - - m_client->setShowAppOnTop(false); - QVERIFY(QDeclarativeDebugTest::waitForSignal(m_client, SIGNAL(showAppOnTopChanged()))); - QCOMPARE(m_client->showAppOnTop(), false); -} - -QTEST_MAIN(tst_QDeclarativeInspector) - -#include "tst_qdeclarativeinspector.moc" diff --git a/tests/auto/declarative/debugger/qdeclarativeinspector/tst_qdeclarativeinspector.pro b/tests/auto/declarative/debugger/qdeclarativeinspector/tst_qdeclarativeinspector.pro deleted file mode 100644 index 6ea6010a32..0000000000 --- a/tests/auto/declarative/debugger/qdeclarativeinspector/tst_qdeclarativeinspector.pro +++ /dev/null @@ -1,12 +0,0 @@ -CONFIG += testcase -TARGET = tst_qdeclarativeinspector -macx:CONFIG -= app_bundle - -HEADERS += ../shared/debugutil_p.h -SOURCES += tst_qdeclarativeinspector.cpp \ - ../shared/debugutil.cpp - -DEFINES += SRCDIR=\\\"$$PWD\\\" -CONFIG += parallel_test declarative_debug - -QT += declarative-private testlib diff --git a/tests/auto/declarative/debugger/qdeclarativeprofilerservice/data/exit.qml b/tests/auto/declarative/debugger/qdeclarativeprofilerservice/data/exit.qml deleted file mode 100644 index b250524caa..0000000000 --- a/tests/auto/declarative/debugger/qdeclarativeprofilerservice/data/exit.qml +++ /dev/null @@ -1,9 +0,0 @@ -import QtQuick 2.0 - -Item { - Timer { - running: true - interval: 1 - onTriggered: Qt.quit(); - } -} diff --git a/tests/auto/declarative/debugger/qdeclarativeprofilerservice/data/test.qml b/tests/auto/declarative/debugger/qdeclarativeprofilerservice/data/test.qml deleted file mode 100644 index 9c36e13c5b..0000000000 --- a/tests/auto/declarative/debugger/qdeclarativeprofilerservice/data/test.qml +++ /dev/null @@ -1,5 +0,0 @@ -import QtQuick 2.0 - -Item { - -} diff --git a/tests/auto/declarative/debugger/qdeclarativeprofilerservice/qdeclarativeprofilerservice.pro b/tests/auto/declarative/debugger/qdeclarativeprofilerservice/qdeclarativeprofilerservice.pro deleted file mode 100644 index 564945faf7..0000000000 --- a/tests/auto/declarative/debugger/qdeclarativeprofilerservice/qdeclarativeprofilerservice.pro +++ /dev/null @@ -1,15 +0,0 @@ -CONFIG += testcase -TARGET = tst_qdeclarativeprofilerservice -macx:CONFIG -= app_bundle - -HEADERS += ../shared/debugutil_p.h - -SOURCES += tst_qdeclarativeprofilerservice.cpp \ - ../shared/debugutil.cpp -OTHER_FILES += data/test.qml - -include (../../../shared/util.pri) - -CONFIG += parallel_test declarative_debug - -QT += declarative-private testlib diff --git a/tests/auto/declarative/debugger/qdeclarativeprofilerservice/tst_qdeclarativeprofilerservice.cpp b/tests/auto/declarative/debugger/qdeclarativeprofilerservice/tst_qdeclarativeprofilerservice.cpp deleted file mode 100644 index 5de7b8621d..0000000000 --- a/tests/auto/declarative/debugger/qdeclarativeprofilerservice/tst_qdeclarativeprofilerservice.cpp +++ /dev/null @@ -1,310 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include - -#include "QtDeclarative/private/qdeclarativeprofilerservice_p.h" -#include "../shared/debugutil_p.h" -#include "../../../shared/util.h" - -#define PORT 13773 -#define STR_PORT "13773" - -class QDeclarativeProfilerClient : public QDeclarativeDebugClient -{ - Q_OBJECT - -public: - QDeclarativeProfilerClient(QDeclarativeDebugConnection *connection) - : QDeclarativeDebugClient(QLatin1String("CanvasFrameRate"), connection) - { - } - - QList traceMessages; - - void setTraceState(bool enabled) { - QByteArray message; - QDataStream stream(&message, QIODevice::WriteOnly); - stream << enabled; - sendMessage(message); - } - -signals: - void complete(); - -protected: - void messageReceived(const QByteArray &message); -}; - -class tst_QDeclarativeProfilerService : public QDeclarativeDataTest -{ - Q_OBJECT - -public: - tst_QDeclarativeProfilerService() - : m_process(0) - , m_connection(0) - , m_client(0) - { - } - -private: - QDeclarativeDebugProcess *m_process; - QDeclarativeDebugConnection *m_connection; - QDeclarativeProfilerClient *m_client; - - void connect(bool block, const QString &testFile); - -private slots: - void cleanup(); - - void blockingConnectWithTraceEnabled(); - void blockingConnectWithTraceDisabled(); - void nonBlockingConnect(); - void profileOnExit(); -}; - -void QDeclarativeProfilerClient::messageReceived(const QByteArray &message) -{ - QByteArray msg = message; - QDataStream stream(&msg, QIODevice::ReadOnly); - - - QDeclarativeProfilerData data; - data.time = -2; - data.messageType = -1; - data.detailType = -1; - data.line = -1; - data.framerate = -1; - data.animationcount = -1; - - stream >> data.time >> data.messageType; - - QVERIFY(data.time >= -1); - - switch (data.messageType) { - case (QDeclarativeProfilerService::Event): { - stream >> data.detailType; - - switch (data.detailType) { - case QDeclarativeProfilerService::AnimationFrame: { - stream >> data.framerate >> data.animationcount; - QVERIFY(data.framerate != -1); - QVERIFY(data.animationcount != -1); - break; - } - case QDeclarativeProfilerService::FramePaint: - case QDeclarativeProfilerService::Mouse: - case QDeclarativeProfilerService::Key: - case QDeclarativeProfilerService::StartTrace: - case QDeclarativeProfilerService::EndTrace: - break; - default: { - QString failMsg = QString("Unknown event type:") + data.detailType; - QFAIL(qPrintable(failMsg)); - break; - } - } - break; - } - case QDeclarativeProfilerService::Complete: { - emit complete(); - return; - } - case QDeclarativeProfilerService::RangeStart: { - stream >> data.detailType; - QVERIFY(data.detailType >= 0 && data.detailType < QDeclarativeProfilerService::MaximumRangeType); - break; - } - case QDeclarativeProfilerService::RangeEnd: { - stream >> data.detailType; - QVERIFY(data.detailType >= 0 && data.detailType < QDeclarativeProfilerService::MaximumRangeType); - break; - } - case QDeclarativeProfilerService::RangeData: { - stream >> data.detailType >> data.detailData; - QVERIFY(data.detailType >= 0 && data.detailType < QDeclarativeProfilerService::MaximumRangeType); - break; - } - case QDeclarativeProfilerService::RangeLocation: { - stream >> data.detailType >> data.detailData >> data.line >> data.column; - QVERIFY(data.detailType >= 0 && data.detailType < QDeclarativeProfilerService::MaximumRangeType); - QVERIFY(data.line >= -2); - break; - } - default: - QString failMsg = QString("Unknown message type:") + data.messageType; - QFAIL(qPrintable(failMsg)); - break; - } - QVERIFY(stream.atEnd()); - traceMessages.append(data); -} - -void tst_QDeclarativeProfilerService::connect(bool block, const QString &testFile) -{ - const QString executable = QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene"; - QStringList arguments; - - if (block) - arguments << QString("-qmljsdebugger=port:"STR_PORT",block"); - else - arguments << QString("-qmljsdebugger=port:"STR_PORT); - - arguments << QDeclarativeDataTest::instance()->testFile(testFile); - - m_process = new QDeclarativeDebugProcess(executable); - m_process->start(QStringList() << arguments); - if (!m_process->waitForSessionStart()) { - QString failMsg = QString("Could not launch app '%1'.\nApplication output:\n%2").arg( - executable, m_process->output()); - QFAIL(qPrintable(failMsg)); - } - - QDeclarativeDebugConnection *m_connection = new QDeclarativeDebugConnection(); - m_client = new QDeclarativeProfilerClient(m_connection); - - m_connection->connectToHost(QLatin1String("127.0.0.1"), PORT); -} - -void tst_QDeclarativeProfilerService::cleanup() -{ - delete m_process; - delete m_connection; - delete m_client; -} - -void tst_QDeclarativeProfilerService::blockingConnectWithTraceEnabled() -{ - connect(true, "test.qml"); - QTRY_COMPARE(m_client->state(), QDeclarativeDebugClient::Enabled); - - m_client->setTraceState(true); - m_client->setTraceState(false); - if (!QDeclarativeDebugTest::waitForSignal(m_client, SIGNAL(complete()))) { - QString failMsg - = QString("No trace received in time. App output: \n%1\n").arg(m_process->output()); - QFAIL(qPrintable(failMsg)); - } - - QVERIFY(m_client->traceMessages.count()); - // must start with "StartTrace" - QCOMPARE(m_client->traceMessages.first().messageType, (int)QDeclarativeProfilerService::Event); - QCOMPARE(m_client->traceMessages.first().detailType, (int)QDeclarativeProfilerService::StartTrace); - - // must end with "EndTrace" - QCOMPARE(m_client->traceMessages.last().messageType, (int)QDeclarativeProfilerService::Event); - QCOMPARE(m_client->traceMessages.last().detailType, (int)QDeclarativeProfilerService::EndTrace); -} - -void tst_QDeclarativeProfilerService::blockingConnectWithTraceDisabled() -{ - connect(true, "test.qml"); - QTRY_COMPARE(m_client->state(), QDeclarativeDebugClient::Enabled); - - m_client->setTraceState(false); - m_client->setTraceState(true); - m_client->setTraceState(false); - if (!QDeclarativeDebugTest::waitForSignal(m_client, SIGNAL(complete()))) { - QString failMsg - = QString("No trace received in time. App output: \n%1\n").arg(m_process->output()); - QFAIL(qPrintable(failMsg)); - } - - QVERIFY(m_client->traceMessages.count()); - - // must start with "StartTrace" - QCOMPARE(m_client->traceMessages.first().messageType, (int)QDeclarativeProfilerService::Event); - QCOMPARE(m_client->traceMessages.first().detailType, (int)QDeclarativeProfilerService::StartTrace); - - // must end with "EndTrace" - QCOMPARE(m_client->traceMessages.last().messageType, (int)QDeclarativeProfilerService::Event); - QCOMPARE(m_client->traceMessages.last().detailType, (int)QDeclarativeProfilerService::EndTrace); -} - -void tst_QDeclarativeProfilerService::nonBlockingConnect() -{ - connect(false, "test.qml"); - QTRY_COMPARE(m_client->state(), QDeclarativeDebugClient::Enabled); - - m_client->setTraceState(true); - m_client->setTraceState(false); - if (!QDeclarativeDebugTest::waitForSignal(m_client, SIGNAL(complete()))) { - QString failMsg - = QString("No trace received in time. App output: \n%1\n").arg(m_process->output()); - QFAIL(qPrintable(failMsg)); - } - - // must start with "StartTrace" - QCOMPARE(m_client->traceMessages.first().messageType, (int)QDeclarativeProfilerService::Event); - QCOMPARE(m_client->traceMessages.first().detailType, (int)QDeclarativeProfilerService::StartTrace); - - // must end with "EndTrace" - QCOMPARE(m_client->traceMessages.last().messageType, (int)QDeclarativeProfilerService::Event); - QCOMPARE(m_client->traceMessages.last().detailType, (int)QDeclarativeProfilerService::EndTrace); -} - -void tst_QDeclarativeProfilerService::profileOnExit() -{ - connect(true, "exit.qml"); - QTRY_COMPARE(m_client->state(), QDeclarativeDebugClient::Enabled); - - m_client->setTraceState(true); - - if (!QDeclarativeDebugTest::waitForSignal(m_client, SIGNAL(complete()))) { - QString failMsg - = QString("No trace received in time. App output: \n%1\n").arg(m_process->output()); - QFAIL(qPrintable(failMsg)); - } - - // must start with "StartTrace" - QCOMPARE(m_client->traceMessages.first().messageType, (int)QDeclarativeProfilerService::Event); - QCOMPARE(m_client->traceMessages.first().detailType, (int)QDeclarativeProfilerService::StartTrace); - - // must end with "EndTrace" - QCOMPARE(m_client->traceMessages.last().messageType, (int)QDeclarativeProfilerService::Event); - QCOMPARE(m_client->traceMessages.last().detailType, (int)QDeclarativeProfilerService::EndTrace); -} - -QTEST_MAIN(tst_QDeclarativeProfilerService) - -#include "tst_qdeclarativeprofilerservice.moc" diff --git a/tests/auto/declarative/debugger/qpacketprotocol/qpacketprotocol.pro b/tests/auto/declarative/debugger/qpacketprotocol/qpacketprotocol.pro deleted file mode 100644 index 949132feff..0000000000 --- a/tests/auto/declarative/debugger/qpacketprotocol/qpacketprotocol.pro +++ /dev/null @@ -1,10 +0,0 @@ -CONFIG += testcase -TARGET = tst_qpacketprotocol -macx:CONFIG -= app_bundle - -HEADERS += ../shared/debugutil_p.h -SOURCES += tst_qpacketprotocol.cpp \ - ../shared/debugutil.cpp - -CONFIG += parallel_test -QT += declarative-private network testlib diff --git a/tests/auto/declarative/debugger/qpacketprotocol/tst_qpacketprotocol.cpp b/tests/auto/declarative/debugger/qpacketprotocol/tst_qpacketprotocol.cpp deleted file mode 100644 index ac664730cb..0000000000 --- a/tests/auto/declarative/debugger/qpacketprotocol/tst_qpacketprotocol.cpp +++ /dev/null @@ -1,263 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "../shared/debugutil_p.h" - -class tst_QPacketProtocol : public QObject -{ - Q_OBJECT - -private: - QTcpServer *m_server; - QTcpSocket *m_client; - QTcpSocket *m_serverConn; - -private slots: - void init(); - void cleanup(); - - void maximumPacketSize(); - void setMaximumPacketSize(); - void setMaximumPacketSize_data(); - void send(); - void send_data(); - void packetsAvailable(); - void packetsAvailable_data(); - void clear(); - void read(); - void device(); - - void tst_QPacket_clear(); -}; - -void tst_QPacketProtocol::init() -{ - m_server = new QTcpServer(this); - m_serverConn = 0; - QVERIFY(m_server->listen(QHostAddress("127.0.0.1"))); - - m_client = new QTcpSocket(this); - m_client->connectToHost(m_server->serverAddress(), m_server->serverPort()); - - QVERIFY(m_client->waitForConnected()); - QVERIFY(m_server->waitForNewConnection(5000)); - m_serverConn = m_server->nextPendingConnection(); -} - -void tst_QPacketProtocol::cleanup() -{ - delete m_client; - delete m_serverConn; - delete m_server; -} - -void tst_QPacketProtocol::maximumPacketSize() -{ - QPacketProtocol p(m_client); - QCOMPARE(p.maximumPacketSize(), 0x7FFFFFFF); -} - -void tst_QPacketProtocol::setMaximumPacketSize() -{ - QFETCH(qint32, size); - QFETCH(qint32, expected); - - QPacketProtocol out(m_serverConn); - QCOMPARE(out.setMaximumPacketSize(size), expected); -} - -void tst_QPacketProtocol::setMaximumPacketSize_data() -{ - QTest::addColumn("size"); - QTest::addColumn("expected"); - - QTest::newRow("invalid") << qint32(sizeof(qint32) - 1) << qint32(0x7FFFFFFF); - QTest::newRow("still invalid") << qint32(sizeof(qint32)) << qint32(0x7FFFFFFF); - QTest::newRow("valid") << qint32(sizeof(qint32) + 1) << qint32(sizeof(qint32) + 1); -} - -void tst_QPacketProtocol::send() -{ - QFETCH(bool, useAutoSend); - - QPacketProtocol in(m_client); - QPacketProtocol out(m_serverConn); - - QByteArray ba; - int num; - - if (useAutoSend) { - out.send() << "Hello world" << 123; - } else { - QPacket packet; - packet << "Hello world" << 123; - out.send(packet); - } - - QVERIFY(QDeclarativeDebugTest::waitForSignal(&in, SIGNAL(readyRead()))); - - QPacket p = in.read(); - p >> ba >> num; - QCOMPARE(ba, QByteArray("Hello world") + '\0'); - QCOMPARE(num, 123); -} - -void tst_QPacketProtocol::send_data() -{ - QTest::addColumn("useAutoSend"); - - QTest::newRow("auto send") << true; - QTest::newRow("no auto send") << false; -} - -void tst_QPacketProtocol::packetsAvailable() -{ - QFETCH(int, packetCount); - - QPacketProtocol out(m_client); - QPacketProtocol in(m_serverConn); - - QCOMPARE(out.packetsAvailable(), qint64(0)); - QCOMPARE(in.packetsAvailable(), qint64(0)); - - for (int i=0; i("packetCount"); - - QTest::newRow("1") << 1; - QTest::newRow("2") << 2; - QTest::newRow("10") << 10; -} - -void tst_QPacketProtocol::clear() -{ - QPacketProtocol in(m_client); - QPacketProtocol out(m_serverConn); - - out.send() << 123; - out.send() << 456; - QVERIFY(QDeclarativeDebugTest::waitForSignal(&in, SIGNAL(readyRead()))); - - in.clear(); - QVERIFY(in.read().isEmpty()); -} - -void tst_QPacketProtocol::read() -{ - QPacketProtocol in(m_client); - QPacketProtocol out(m_serverConn); - - QVERIFY(in.read().isEmpty()); - - out.send() << 123; - out.send() << 456; - QVERIFY(QDeclarativeDebugTest::waitForSignal(&in, SIGNAL(readyRead()))); - - int num; - - QPacket p1 = in.read(); - QVERIFY(!p1.isEmpty()); - p1 >> num; - QCOMPARE(num, 123); - - QPacket p2 = in.read(); - QVERIFY(!p2.isEmpty()); - p2 >> num; - QCOMPARE(num, 456); - - QVERIFY(in.read().isEmpty()); -} - -void tst_QPacketProtocol::device() -{ - QPacketProtocol p(m_client); - QVERIFY(p.device() == m_client); -} - -void tst_QPacketProtocol::tst_QPacket_clear() -{ - QPacketProtocol protocol(m_client); - - QPacket packet; - - packet << "Hello world!" << 123; - protocol.send(packet); - - packet.clear(); - QVERIFY(packet.isEmpty()); - packet << "Goodbyte world!" << 789; - protocol.send(packet); - - QByteArray ba; - int num; - QPacketProtocol in(m_serverConn); - QVERIFY(QDeclarativeDebugTest::waitForSignal(&in, SIGNAL(readyRead()))); - - QPacket p1 = in.read(); - p1 >> ba >> num; - QCOMPARE(ba, QByteArray("Hello world!") + '\0'); - QCOMPARE(num, 123); - - QPacket p2 = in.read(); - p2 >> ba >> num; - QCOMPARE(ba, QByteArray("Goodbyte world!") + '\0'); - QCOMPARE(num, 789); -} - -QTEST_MAIN(tst_QPacketProtocol) - -#include "tst_qpacketprotocol.moc" diff --git a/tests/auto/declarative/debugger/qv8profilerservice/data/console.qml b/tests/auto/declarative/debugger/qv8profilerservice/data/console.qml deleted file mode 100644 index c23c820216..0000000000 --- a/tests/auto/declarative/debugger/qv8profilerservice/data/console.qml +++ /dev/null @@ -1,14 +0,0 @@ -import QtQuick 2.0 - - -Item { - function f() - { - } - - Component.onCompleted: { - console.profile(); - f(); - console.profileEnd(); - } -} diff --git a/tests/auto/declarative/debugger/qv8profilerservice/data/exit.qml b/tests/auto/declarative/debugger/qv8profilerservice/data/exit.qml deleted file mode 100644 index 604265354c..0000000000 --- a/tests/auto/declarative/debugger/qv8profilerservice/data/exit.qml +++ /dev/null @@ -1,11 +0,0 @@ -import QtQuick 2.0 - -Item { - Timer { - running: true - interval: 1 - onTriggered: { - Qt.quit(); - } - } -} diff --git a/tests/auto/declarative/debugger/qv8profilerservice/data/test.qml b/tests/auto/declarative/debugger/qv8profilerservice/data/test.qml deleted file mode 100644 index 9c36e13c5b..0000000000 --- a/tests/auto/declarative/debugger/qv8profilerservice/data/test.qml +++ /dev/null @@ -1,5 +0,0 @@ -import QtQuick 2.0 - -Item { - -} diff --git a/tests/auto/declarative/debugger/qv8profilerservice/qv8profilerservice.pro b/tests/auto/declarative/debugger/qv8profilerservice/qv8profilerservice.pro deleted file mode 100644 index eb57dff2fe..0000000000 --- a/tests/auto/declarative/debugger/qv8profilerservice/qv8profilerservice.pro +++ /dev/null @@ -1,16 +0,0 @@ -CONFIG += testcase -TARGET = tst_qv8profilerservice -macx:CONFIG -= app_bundle - -HEADERS += ../shared/debugutil_p.h - -SOURCES += tst_qv8profilerservice.cpp \ - ../shared/debugutil.cpp - -include (../../../shared/util.pri) - -OTHER_FILES += data/test.qml - -CONFIG += parallel_test declarative_debug - -QT += declarative-private testlib diff --git a/tests/auto/declarative/debugger/qv8profilerservice/tst_qv8profilerservice.cpp b/tests/auto/declarative/debugger/qv8profilerservice/tst_qv8profilerservice.cpp deleted file mode 100644 index 92b893afc6..0000000000 --- a/tests/auto/declarative/debugger/qv8profilerservice/tst_qv8profilerservice.cpp +++ /dev/null @@ -1,280 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include - -#include "QtDeclarative/private/qv8profilerservice_p.h" -#include "../shared/debugutil_p.h" -#include "../../../shared/util.h" - -#define PORT 13774 -#define STR_PORT "13774" - -class QV8ProfilerClient : public QDeclarativeDebugClient -{ - Q_OBJECT - -public: - QV8ProfilerClient(QDeclarativeDebugConnection *connection) - : QDeclarativeDebugClient(QLatin1String("V8Profiler"), connection) - { - } - - void startProfiling(const QString &name) { - QByteArray message; - QDataStream stream(&message, QIODevice::WriteOnly); - stream << QByteArray("V8PROFILER") << QByteArray("start") << name; - sendMessage(message); - } - - void stopProfiling(const QString &name) { - QByteArray message; - QDataStream stream(&message, QIODevice::WriteOnly); - stream << QByteArray("V8PROFILER") << QByteArray("stop") << name; - sendMessage(message); - } - - void takeSnapshot() { - QByteArray message; - QDataStream stream(&message, QIODevice::WriteOnly); - stream << QByteArray("V8SNAPSHOT") << QByteArray("full"); - sendMessage(message); - } - - void deleteSnapshots() { - QByteArray message; - QDataStream stream(&message, QIODevice::WriteOnly); - stream << QByteArray("V8SNAPSHOT") << QByteArray("delete"); - sendMessage(message); - } - - QList traceMessages; - QList snapshotMessages; - -signals: - void complete(); - void snapshot(); - -protected: - void messageReceived(const QByteArray &message); -}; - -class tst_QV8ProfilerService : public QDeclarativeDataTest -{ - Q_OBJECT - -public: - tst_QV8ProfilerService() - : m_process(0) - , m_connection(0) - , m_client(0) - { - } - -private: - QDeclarativeDebugProcess *m_process; - QDeclarativeDebugConnection *m_connection; - QV8ProfilerClient *m_client; - - void connect(bool block, const QString &testFile); - -private slots: - void cleanup(); - - void blockingConnectWithTraceEnabled(); - void blockingConnectWithTraceDisabled(); - void nonBlockingConnect(); - void snapshot(); - void profileOnExit(); - void console(); -}; - -void QV8ProfilerClient::messageReceived(const QByteArray &message) -{ - QByteArray msg = message; - QDataStream stream(&msg, QIODevice::ReadOnly); - - int messageType; - stream >> messageType; - - QVERIFY(messageType >= 0); - QVERIFY(messageType < QV8ProfilerService::V8MaximumMessage); - - switch (messageType) { - case QV8ProfilerService::V8Entry: { - QV8ProfilerData entry; - stream >> entry.filename >> entry.functionname >> entry.lineNumber >> entry.totalTime >> entry.selfTime >> entry.treeLevel; - traceMessages.append(entry); - break; - } - case QV8ProfilerService::V8Complete: - emit complete(); - break; - case QV8ProfilerService::V8SnapshotChunk: { - QByteArray json; - stream >> json; - snapshotMessages.append(json); - break; - } - case QV8ProfilerService::V8SnapshotComplete: - emit snapshot(); - break; - default: - QString failMessage = QString("Unknown message type: %1").arg(messageType); - QFAIL(qPrintable(failMessage)); - } - - QVERIFY(stream.atEnd()); -} - -void tst_QV8ProfilerService::connect(bool block, const QString &testFile) -{ - const QString executable = QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene"; - QStringList arguments; - - if (block) - arguments << QString("-qmljsdebugger=port:"STR_PORT",block"); - else - arguments << QString("-qmljsdebugger=port:"STR_PORT); - - arguments << QDeclarativeDataTest::instance()->testFile(testFile); - - m_process = new QDeclarativeDebugProcess(executable); - m_process->start(QStringList() << arguments); - if (!m_process->waitForSessionStart()) { - QString failMsg = QString("Could not launch app '%1'.\nApplication output:\n%2").arg( - executable, m_process->output()); - QFAIL(qPrintable(failMsg)); - } - - QDeclarativeDebugConnection *m_connection = new QDeclarativeDebugConnection(); - m_client = new QV8ProfilerClient(m_connection); - - m_connection->connectToHost(QLatin1String("127.0.0.1"), PORT); -} - -void tst_QV8ProfilerService::cleanup() -{ - if (QTest::currentTestFailed()) - qDebug() << "Application Output:" << m_process->output(); - - delete m_process; - delete m_connection; - delete m_client; -} - -void tst_QV8ProfilerService::blockingConnectWithTraceEnabled() -{ - connect(true, "test.qml"); - QTRY_COMPARE(m_client->state(), QDeclarativeDebugClient::Enabled); - - m_client->startProfiling(""); - m_client->stopProfiling(""); - QVERIFY2(QDeclarativeDebugTest::waitForSignal(m_client, SIGNAL(complete())), - "No trace received in time."); -} - -void tst_QV8ProfilerService::blockingConnectWithTraceDisabled() -{ - connect(true, "test.qml"); - QTRY_COMPARE(m_client->state(), QDeclarativeDebugClient::Enabled); - - m_client->stopProfiling(""); - if (QDeclarativeDebugTest::waitForSignal(m_client, SIGNAL(complete()), 1000)) { - QString failMsg - = QString("Unexpected trace received! App output: %1\n\n").arg(m_process->output()); - QFAIL(qPrintable(failMsg)); - } - m_client->startProfiling(""); - m_client->stopProfiling(""); - QVERIFY2(QDeclarativeDebugTest::waitForSignal(m_client, SIGNAL(complete())), - "No trace received in time."); -} - -void tst_QV8ProfilerService::nonBlockingConnect() -{ - connect(false, "test.qml"); - QTRY_COMPARE(m_client->state(), QDeclarativeDebugClient::Enabled); - - m_client->startProfiling(""); - m_client->stopProfiling(""); - QVERIFY2(QDeclarativeDebugTest::waitForSignal(m_client, SIGNAL(complete())), - "No trace received in time."); -} - -void tst_QV8ProfilerService::snapshot() -{ - connect(false, "test.qml"); - QTRY_COMPARE(m_client->state(), QDeclarativeDebugClient::Enabled); - - m_client->takeSnapshot(); - QVERIFY2(QDeclarativeDebugTest::waitForSignal(m_client, SIGNAL(snapshot())), - "No trace received in time."); -} - -void tst_QV8ProfilerService::profileOnExit() -{ - connect(true, "exit.qml"); - QTRY_COMPARE(m_client->state(), QDeclarativeDebugClient::Enabled); - - m_client->startProfiling(""); - - QVERIFY2(QDeclarativeDebugTest::waitForSignal(m_client, SIGNAL(complete())), - "No trace received in time."); - //QVERIFY(!m_client->traceMessages.isEmpty()); -} - -void tst_QV8ProfilerService::console() -{ - connect(true, "console.qml"); - QTRY_COMPARE(m_client->state(), QDeclarativeDebugClient::Enabled); - - m_client->stopProfiling(""); - - QVERIFY2(QDeclarativeDebugTest::waitForSignal(m_client, SIGNAL(complete())), - "No trace received in time."); - QVERIFY(!m_client->traceMessages.isEmpty()); -} - -QTEST_MAIN(tst_QV8ProfilerService) - -#include "tst_qv8profilerservice.moc" diff --git a/tests/auto/declarative/debugger/shared/debugutil.cpp b/tests/auto/declarative/debugger/shared/debugutil.cpp deleted file mode 100644 index fcac1bc61d..0000000000 --- a/tests/auto/declarative/debugger/shared/debugutil.cpp +++ /dev/null @@ -1,190 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "debugutil_p.h" - -#include -#include - -#include -#include - -bool QDeclarativeDebugTest::waitForSignal(QObject *receiver, const char *member, int timeout) { - QEventLoop loop; - QTimer timer; - timer.setSingleShot(true); - QObject::connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit())); - QObject::connect(receiver, member, &loop, SLOT(quit())); - timer.start(timeout); - loop.exec(); - return timer.isActive(); -} - -QDeclarativeDebugTestService::QDeclarativeDebugTestService(const QString &s, float version, QObject *parent) - : QDeclarativeDebugService(s, version, parent) -{ - registerService(); -} - -void QDeclarativeDebugTestService::messageReceived(const QByteArray &ba) -{ - sendMessage(ba); -} - -void QDeclarativeDebugTestService::stateChanged(State) -{ - emit stateHasChanged(); -} - - -QDeclarativeDebugTestClient::QDeclarativeDebugTestClient(const QString &s, QDeclarativeDebugConnection *c) - : QDeclarativeDebugClient(s, c) -{ -} - -QByteArray QDeclarativeDebugTestClient::waitForResponse() -{ - lastMsg.clear(); - QDeclarativeDebugTest::waitForSignal(this, SIGNAL(serverMessage(QByteArray))); - if (lastMsg.isEmpty()) { - qWarning() << "tst_QDeclarativeDebugClient: no response from server!"; - return QByteArray(); - } - return lastMsg; -} - -void QDeclarativeDebugTestClient::stateChanged(State stat) -{ - QCOMPARE(stat, state()); - emit stateHasChanged(); -} - -void QDeclarativeDebugTestClient::messageReceived(const QByteArray &ba) -{ - lastMsg = ba; - emit serverMessage(ba); -} - -QDeclarativeDebugProcess::QDeclarativeDebugProcess(const QString &executable) - : m_executable(executable) - , m_started(false) -{ - m_process.setProcessChannelMode(QProcess::MergedChannels); - m_timer.setSingleShot(true); - m_timer.setInterval(5000); - connect(&m_process, SIGNAL(readyReadStandardOutput()), this, SLOT(processAppOutput())); - connect(&m_timer, SIGNAL(timeout()), &m_eventLoop, SLOT(quit())); -} - -QDeclarativeDebugProcess::~QDeclarativeDebugProcess() -{ - stop(); -} - -void QDeclarativeDebugProcess::start(const QStringList &arguments) -{ - m_mutex.lock(); - m_process.setEnvironment(m_environment); - m_process.start(m_executable, arguments); - m_process.waitForStarted(); - m_timer.start(); - m_mutex.unlock(); -} - -void QDeclarativeDebugProcess::stop() -{ - if (m_process.state() != QProcess::NotRunning) { - m_process.kill(); - m_process.waitForFinished(5000); - } -} - -bool QDeclarativeDebugProcess::waitForSessionStart() -{ - if (m_process.state() != QProcess::Running) { - qWarning() << "Could not start up " << m_executable; - return false; - } - m_eventLoop.exec(QEventLoop::ExcludeUserInputEvents); - - return m_started; -} - -void QDeclarativeDebugProcess::setEnvironment(const QStringList &environment) -{ - m_environment = environment; -} - -QString QDeclarativeDebugProcess::output() const -{ - return m_output; -} - -void QDeclarativeDebugProcess::processAppOutput() -{ - m_mutex.lock(); - - QString newOutput = m_process.readAll(); - m_output.append(newOutput); - m_outputBuffer.append(newOutput); - - while (true) { - const int nlIndex = m_outputBuffer.indexOf(QLatin1Char('\n')); - if (nlIndex < 0) // no further complete lines - break; - const QString line = m_outputBuffer.left(nlIndex); - m_outputBuffer = m_outputBuffer.right(m_outputBuffer.size() - nlIndex - 1); - - if (line.startsWith("Qml debugging is enabled")) // ignore - continue; - if (line.startsWith("QDeclarativeDebugServer:")) { - if (line.contains("Waiting for connection ")) { - m_started = true; - m_eventLoop.quit(); - continue; - } - if (line.contains("Connection established")) { - continue; - } - } - } - m_mutex.unlock(); -} diff --git a/tests/auto/declarative/debugger/shared/debugutil_p.h b/tests/auto/declarative/debugger/shared/debugutil_p.h deleted file mode 100644 index 520cb11a5a..0000000000 --- a/tests/auto/declarative/debugger/shared/debugutil_p.h +++ /dev/null @@ -1,127 +0,0 @@ - -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef DEBUGUTIL_H -#define DEBUGUTIL_H - -#include -#include -#include -#include -#include - -#include - -#include -#include - -class QDeclarativeDebugTest -{ -public: - static bool waitForSignal(QObject *receiver, const char *member, int timeout = 5000); -}; - -class QDeclarativeDebugTestService : public QDeclarativeDebugService -{ - Q_OBJECT -public: - QDeclarativeDebugTestService(const QString &s, float version = 1, QObject *parent = 0); - -signals: - void stateHasChanged(); - -protected: - virtual void messageReceived(const QByteArray &ba); - virtual void stateChanged(State state); -}; - -class QDeclarativeDebugTestClient : public QDeclarativeDebugClient -{ - Q_OBJECT -public: - QDeclarativeDebugTestClient(const QString &s, QDeclarativeDebugConnection *c); - - QByteArray waitForResponse(); - -signals: - void stateHasChanged(); - void serverMessage(const QByteArray &); - -protected: - virtual void stateChanged(State state); - virtual void messageReceived(const QByteArray &ba); - -private: - QByteArray lastMsg; -}; - -class QDeclarativeDebugProcess : public QObject -{ - Q_OBJECT -public: - QDeclarativeDebugProcess(const QString &executable); - ~QDeclarativeDebugProcess(); - - void setEnvironment(const QStringList &environment); - - void start(const QStringList &arguments); - bool waitForSessionStart(); - - QString output() const; - void stop(); - -private slots: - void processAppOutput(); - -private: - QString m_executable; - QProcess m_process; - QString m_outputBuffer; - QString m_output; - QTimer m_timer; - QEventLoop m_eventLoop; - QMutex m_mutex; - bool m_started; - QStringList m_environment; -}; - -#endif // DEBUGUTIL_H diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro deleted file mode 100644 index 7288da27ba..0000000000 --- a/tests/auto/declarative/declarative.pro +++ /dev/null @@ -1,55 +0,0 @@ -TEMPLATE = subdirs - -METATYPETESTS += \ - qdeclarativemetatype - -PUBLICTESTS += \ - parserstress \ - qdeclarativecomponent \ - qdeclarativeconsole \ - qdeclarativecontext \ - qdeclarativeengine \ - qdeclarativeerror \ - qdeclarativefolderlistmodel \ - qdeclarativeincubator \ - qdeclarativeinfo \ - qdeclarativelistreference \ - qdeclarativelocale \ - qdeclarativemoduleplugin \ - qdeclarativeqt \ - qdeclarativetranslation \ - qdeclarativexmlhttprequest \ - qdeclarativeparser \ - qjsengine \ - qjsvalue \ - qjsvalueiterator \ - qmlmin \ - qmlplugindump - -PRIVATETESTS += \ - animation \ - qdeclarativebinding \ - qdeclarativechangeset \ - qdeclarativeconnection \ - qdeclarativecpputils \ - qdeclarativeecmascript \ - qdeclarativeexpression \ - qdeclarativeimageprovider \ - qdeclarativeinstruction \ - qdeclarativelanguage \ - qdeclarativelistcompositor \ - qdeclarativelistmodel \ - qdeclarativeproperty \ - qdeclarativepropertymap \ - qdeclarativesqldatabase \ - qdeclarativevaluetypes \ - qdeclarativeworkerscript \ - v4 - -SUBDIRS += $$PUBLICTESTS -SUBDIRS += $$METATYPETESTS -SUBDIRS += debugger - -contains(QT_CONFIG, private_tests) { - SUBDIRS += $$PRIVATETESTS -} diff --git a/tests/auto/declarative/parserstress/parserstress.pro b/tests/auto/declarative/parserstress/parserstress.pro deleted file mode 100644 index 021b1de9cc..0000000000 --- a/tests/auto/declarative/parserstress/parserstress.pro +++ /dev/null @@ -1,12 +0,0 @@ -CONFIG += testcase -TARGET = tst_parserstress -macx:CONFIG -= app_bundle - -SOURCES += tst_parserstress.cpp - -DEFINES += SRCDIR=\\\"$$PWD\\\" -DEFINES += TESTDATADIR=\\\"$$PWD/tests\\\" - -CONFIG += parallel_test - -QT += core-private gui-private declarative-private testlib diff --git a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4-1.js b/tests/auto/declarative/parserstress/tests/ecma/Array/15.4-1.js deleted file mode 100644 index b73ca2df71..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4-1.js +++ /dev/null @@ -1,135 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.4-1.js'; - -/** - 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); - -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]") - ); - -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") - ); - -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]") - ); - -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") - ); - -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]") - ); - -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") - ); - -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]") - ); - -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") - ); - -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)]") - ); - -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") - ); - -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]") - ); - -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") - ); - -print(typeof testcases, testcases instanceof Array, testcases.length); -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4-2.js b/tests/auto/declarative/parserstress/tests/ecma/Array/15.4-2.js deleted file mode 100644 index 7d00703d30..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4-2.js +++ /dev/null @@ -1,114 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.4-2.js'; - -/** - 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); - -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") ); - -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") ); - -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") ); - -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") ); - - -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") ); - -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") ); - -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") ); - -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)") ); - -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)") ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.1.1.js b/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.1.1.js deleted file mode 100644 index b894433d01..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.1.1.js +++ /dev/null @@ -1,111 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.4.1.1.js'; - -/** - 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); - -new TestCase( SECTION, - "typeof Array(1,2)", - "object", - typeof Array(1,2) ); - -new TestCase( SECTION, - "(Array(1,2)).toString", - Array.prototype.toString, - (Array(1,2)).toString ); - -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()") ); - -new TestCase( SECTION, - "(Array(1,2)).length", - 2, - (Array(1,2)).length ); - -new TestCase( SECTION, - "var arr = (Array(1,2)); arr[0]", - 1, - eval("var arr = (Array(1,2)); arr[0]") ); - -new TestCase( SECTION, - "var arr = (Array(1,2)); arr[1]", - 2, - eval("var arr = (Array(1,2)); arr[1]") ); - -new TestCase( SECTION, - "var arr = (Array(1,2)); String(arr)", - "1,2", - eval("var arr = (Array(1,2)); String(arr)") ); - -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); -} - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.1.2.js b/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.1.2.js deleted file mode 100644 index 7e2e7ef436..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.1.2.js +++ /dev/null @@ -1,162 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.4.1.2.js'; - -/** - 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); - -new TestCase( SECTION, - "(Array()).length", - 0, - (Array()).length ); - -new TestCase( SECTION, - "(Array(0)).length", - 0, - (Array(0)).length ); - -new TestCase( SECTION, - "(Array(1)).length", - 1, - (Array(1)).length ); - -new TestCase( SECTION, - "(Array(10)).length", - 10, - (Array(10)).length ); - -new TestCase( SECTION, - "(Array('1')).length", - 1, - (Array('1')).length ); - -new TestCase( SECTION, - "(Array(1000)).length", - 1000, - (Array(1000)).length ); - -new TestCase( SECTION, - "(Array('1000')).length", - 1, - (Array('1000')).length ); - -new TestCase( SECTION, - "(Array(4294967295)).length", - ToUint32(4294967295), - (Array(4294967295)).length ); - -new TestCase( SECTION, - "(Array(Math.pow(2,31)-1)).length", - ToUint32(Math.pow(2,31)-1), - (Array(Math.pow(2,31)-1)).length ); - -new TestCase( SECTION, - "(Array(Math.pow(2,31))).length", - ToUint32(Math.pow(2,31)), - (Array(Math.pow(2,31))).length ); - -new TestCase( SECTION, - "(Array(Math.pow(2,31)+1)).length", - ToUint32(Math.pow(2,31)+1), - (Array(Math.pow(2,31)+1)).length ); - -new TestCase( SECTION, - "(Array('8589934592')).length", - 1, - (Array("8589934592")).length ); - -new TestCase( SECTION, - "(Array('4294967296')).length", - 1, - (Array("4294967296")).length ); - -new TestCase( SECTION, - "(Array(1073741823)).length", - ToUint32(1073741823), - (Array(1073741823)).length ); - -new TestCase( SECTION, - "(Array(1073741824)).length", - ToUint32(1073741824), - (Array(1073741824)).length ); - -new TestCase( SECTION, - "(Array('a string')).length", - 1, - (Array("a string")).length ); - -test(); - -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 ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.1.3.js b/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.1.3.js deleted file mode 100644 index b36f339966..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.1.3.js +++ /dev/null @@ -1,84 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.4.1.3.js'; - -/** - 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); - -new TestCase( SECTION, - "typeof Array()", - "object", - typeof Array() ); - -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()") ); - -new TestCase( SECTION, - "(Array()).length", - 0, - (Array()).length ); - -new TestCase( SECTION, - "Array().toString()", - "", - Array().toString() ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.1.js b/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.1.js deleted file mode 100644 index 414c901926..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.1.js +++ /dev/null @@ -1,132 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.4.1.js'; - -/** - 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); - -new TestCase( SECTION, - "Array() +''", - "", - Array() +"" ); - -new TestCase( SECTION, - "typeof Array()", - "object", - typeof Array() ); - -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()") ); - -new TestCase( SECTION, - "var arr = Array(); arr.toString == Array.prototype.toString", - true, - eval("var arr = Array(); arr.toString == Array.prototype.toString") ); - -new TestCase( SECTION, - "Array().length", - 0, - Array().length ); - -new TestCase( SECTION, - "Array(1,2,3) +''", - "1,2,3", - Array(1,2,3) +"" ); - -new TestCase( SECTION, - "typeof Array(1,2,3)", - "object", - typeof Array(1,2,3) ); - -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()") ); - -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") ); - -new TestCase( SECTION, - "Array(1,2,3).length", - 3, - Array(1,2,3).length ); - -new TestCase( SECTION, - "typeof Array(12345)", - "object", - typeof Array(12345) ); - -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()") ); - -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") ); - -new TestCase( SECTION, - "Array(12345).length", - 12345, - Array(12345).length ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.2.1-1.js b/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.2.1-1.js deleted file mode 100644 index 986684e338..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.2.1-1.js +++ /dev/null @@ -1,112 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.4.2.1-1.js'; - -/** - 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); - -new TestCase( SECTION, - "typeof new Array(1,2)", - "object", - typeof new Array(1,2) ); - -new TestCase( SECTION, - "(new Array(1,2)).toString", - Array.prototype.toString, - (new Array(1,2)).toString ); - -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()") ); - -new TestCase( SECTION, - "(new Array(1,2)).length", - 2, - (new Array(1,2)).length ); - -new TestCase( SECTION, - "var arr = (new Array(1,2)); arr[0]", - 1, - eval("var arr = (new Array(1,2)); arr[0]") ); - -new TestCase( SECTION, - "var arr = (new Array(1,2)); arr[1]", - 2, - eval("var arr = (new Array(1,2)); arr[1]") ); - -new TestCase( SECTION, - "var arr = (new Array(1,2)); String(arr)", - "1,2", - eval("var arr = (new Array(1,2)); String(arr)") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.2.1-2.js b/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.2.1-2.js deleted file mode 100644 index 9e957cbb21..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.2.1-2.js +++ /dev/null @@ -1,101 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.4.2.1-2.js'; - -/** - 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); - - -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 ( var item = 0; item < TEST_LENGTH; item++ ) { - new TestCase( SECTION, - "["+item+"]", - item, - TEST_ARRAY[item] ); -} - -new TestCase( SECTION, - "new Array( ["+TEST_LENGTH+" arguments] ) +''", - ARGUMENTS, - TEST_ARRAY +"" ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.2.1-3.js b/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.2.1-3.js deleted file mode 100644 index 4d1806d9b8..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.2.1-3.js +++ /dev/null @@ -1,137 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.4.2.1-3.js'; - -/** - 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 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 ( var item = 0; item < TEST_LENGTH; item++ ) { - new TestCase( SECTION, - "TEST_ARRAY["+item+"]", - item, - TEST_ARRAY[item] ); -} - -new TestCase( SECTION, - "new Array( ["+TEST_LENGTH+" arguments] ) +''", - ARGUMENTS, - TEST_ARRAY +"" ); - -new TestCase( SECTION, - "TEST_ARRAY.toString", - Array.prototype.toString, - TEST_ARRAY.toString ); - -new TestCase( SECTION, - "TEST_ARRAY.join", - Array.prototype.join, - TEST_ARRAY.join ); - -new TestCase( SECTION, - "TEST_ARRAY.sort", - Array.prototype.sort, - TEST_ARRAY.sort ); - -new TestCase( SECTION, - "TEST_ARRAY.reverse", - Array.prototype.reverse, - TEST_ARRAY.reverse ); - -new TestCase( SECTION, - "TEST_ARRAY.length", - TEST_LENGTH, - TEST_ARRAY.length ); - -new TestCase( SECTION, - "TEST_ARRAY.toString = Object.prototype.toString; TEST_ARRAY.toString()", - "[object Array]", - eval("TEST_ARRAY.toString = Object.prototype.toString; TEST_ARRAY.toString()") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.2.2-1.js b/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.2.2-1.js deleted file mode 100644 index 255d0b5fb4..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.2.2-1.js +++ /dev/null @@ -1,183 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.4.2.2-1.js'; - -/** - 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); - -new TestCase( SECTION, - "new Array(0)", - "", - (new Array(0)).toString() ); - -new TestCase( SECTION, - "typeof new Array(0)", - "object", - (typeof new Array(0)) ); - -new TestCase( SECTION, - "(new Array(0)).length", - 0, - (new Array(0)).length ); - -new TestCase( SECTION, - "(new Array(0)).toString", - Array.prototype.toString, - (new Array(0)).toString ); - -new TestCase( SECTION, - "new Array(1)", - "", - (new Array(1)).toString() ); - -new TestCase( SECTION, - "new Array(1).length", - 1, - (new Array(1)).length ); - -new TestCase( SECTION, - "(new Array(1)).toString", - Array.prototype.toString, - (new Array(1)).toString ); - -new TestCase( SECTION, - "(new Array(-0)).length", - 0, - (new Array(-0)).length ); - -new TestCase( SECTION, - "(new Array(0)).length", - 0, - (new Array(0)).length ); - -new TestCase( SECTION, - "(new Array(10)).length", - 10, - (new Array(10)).length ); - -new TestCase( SECTION, - "(new Array('1')).length", - 1, - (new Array('1')).length ); - -new TestCase( SECTION, - "(new Array(1000)).length", - 1000, - (new Array(1000)).length ); - -new TestCase( SECTION, - "(new Array('1000')).length", - 1, - (new Array('1000')).length ); - -new TestCase( SECTION, - "(new Array(4294967295)).length", - ToUint32(4294967295), - (new Array(4294967295)).length ); - -new TestCase( SECTION, - "(new Array('8589934592')).length", - 1, - (new Array("8589934592")).length ); - -new TestCase( SECTION, - "(new Array('4294967296')).length", - 1, - (new Array("4294967296")).length ); - -new TestCase( SECTION, - "(new Array(1073741824)).length", - ToUint32(1073741824), - (new Array(1073741824)).length ); - -test(); - -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 ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.2.2-2.js b/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.2.2-2.js deleted file mode 100644 index e77ba8d876..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.2.2-2.js +++ /dev/null @@ -1,118 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.4.2.2-2.js'; - -/** - 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); - -new TestCase( SECTION, - "(new Array(new Number(1073741823))).length", - 1, - (new Array(new Number(1073741823))).length ); - -new TestCase( SECTION, - "(new Array(new Number(0))).length", - 1, - (new Array(new Number(0))).length ); - -new TestCase( SECTION, - "(new Array(new Number(1000))).length", - 1, - (new Array(new Number(1000))).length ); - -new TestCase( SECTION, - "(new Array('mozilla, larryzilla, curlyzilla')).length", - 1, - (new Array('mozilla, larryzilla, curlyzilla')).length ); - -new TestCase( SECTION, - "(new Array(true)).length", - 1, - (new Array(true)).length ); - -new TestCase( SECTION, - "(new Array(false)).length", - 1, - (new Array(false)).length); - -new TestCase( SECTION, - "(new Array(new Boolean(true)).length", - 1, - (new Array(new Boolean(true))).length ); - -new TestCase( SECTION, - "(new Array(new Boolean(false)).length", - 1, - (new Array(new Boolean(false))).length ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.2.3.js b/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.2.3.js deleted file mode 100644 index 27d9bd257b..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.2.3.js +++ /dev/null @@ -1,101 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.4.2.3.js'; - -/** - 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); - -new TestCase( SECTION, - "new Array() +''", - "", - (new Array()) +"" ); - -new TestCase( SECTION, - "typeof new Array()", - "object", - (typeof new Array()) ); - -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()") ); - -new TestCase( SECTION, - "(new Array()).length", - 0, - (new Array()).length ); - -new TestCase( SECTION, - "(new Array()).toString == Array.prototype.toString", - true, - (new Array()).toString == Array.prototype.toString ); - -new TestCase( SECTION, - "(new Array()).join == Array.prototype.join", - true, - (new Array()).join == Array.prototype.join ); - -new TestCase( SECTION, - "(new Array()).reverse == Array.prototype.reverse", - true, - (new Array()).reverse == Array.prototype.reverse ); - -new TestCase( SECTION, - "(new Array()).sort == Array.prototype.sort", - true, - (new Array()).sort == Array.prototype.sort ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.3.1-2.js b/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.3.1-2.js deleted file mode 100644 index 36c1967f16..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.3.1-2.js +++ /dev/null @@ -1,81 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.4.3.1-2.js'; - -/** - 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 ARRAY_PROTO = Array.prototype; - -new TestCase( SECTION, - "var props = ''; for ( p in Array ) { props += p } props", - "", - eval("var props = ''; for ( p in Array ) { props += p } props") ); - -new TestCase( SECTION, - "Array.prototype = null; Array.prototype", - ARRAY_PROTO, - eval("Array.prototype = null; Array.prototype") ); - -new TestCase( SECTION, - "delete Array.prototype", - false, - delete Array.prototype ); - -new TestCase( SECTION, - "delete Array.prototype; Array.prototype", - ARRAY_PROTO, - eval("delete Array.prototype; Array.prototype") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.3.2.js b/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.3.2.js deleted file mode 100644 index dfb47ca284..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.3.2.js +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.4.3.2.js'; - -/** - 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); - -new TestCase( SECTION, - "Array.length", - 1, - Array.length ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.4.1.js b/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.4.1.js deleted file mode 100644 index bd886b0cb0..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.4.1.js +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.4.4.1.js'; - -/** - 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); - - -new TestCase( SECTION, - "Array.prototype.constructor == Array", - true, - Array.prototype.constructor == Array); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.4.2.js b/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.4.2.js deleted file mode 100644 index d0be6bd471..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.4.2.js +++ /dev/null @@ -1,120 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.4.4.2.js'; - -/** - 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); - -print(1); -new TestCase( SECTION, - "Array.prototype.toString.length", - 0, - Array.prototype.toString.length ); - -print(2); -new TestCase( SECTION, - "(new Array()).toString()", - "", - (new Array()).toString() ); - -print(3); -new TestCase( SECTION, - "(new Array(2)).toString()", - ",", - (new Array(2)).toString() ); - -print(4); -new TestCase( SECTION, - "(new Array(0,1)).toString()", - "0,1", - (new Array(0,1)).toString() ); - -print(5); -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() ); - -print(6); -new TestCase( SECTION, - "(new Array( Boolean(1), Boolean(0))).toString()", - "true,false", - (new Array(Boolean(1),Boolean(0))).toString() ); - -print(7); -new TestCase( SECTION, - "(new Array(void 0,null)).toString()", - ",", - (new Array(void 0,null)).toString() ); - -print(8); -var EXPECT_STRING = ""; -var MYARR = new Array(); - -for ( var i = -50; i < 50; i+= 0.25 ) { - print(i); - MYARR[MYARR.length] = i; - EXPECT_STRING += i +","; -} - -EXPECT_STRING = EXPECT_STRING.substring( 0, EXPECT_STRING.length -1 ); - -print(9); -new TestCase( SECTION, - "MYARR.toString()", - EXPECT_STRING, - MYARR.toString() ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.4.3-1.js b/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.4.3-1.js deleted file mode 100644 index ff97512a44..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.4.3-1.js +++ /dev/null @@ -1,163 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.4.4.3-1.js'; - -/** - 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, pschwartau@netscape.com - Date: 07 October 1997 - Modified: 14 July 2002 - Reason: See http://bugzilla.mozilla.org/show_bug.cgi?id=155285 - ECMA-262 Ed.3 Section 15.4.4.5 Array.prototype.join() - Step 3: If |separator| is |undefined|, let |separator| - be the single-character string "," - * - */ - -var SECTION = "15.4.4.3-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Array.prototype.join()"); - -var ARR_PROTOTYPE = Array.prototype; - -new TestCase( SECTION, "Array.prototype.join.length", 1, Array.prototype.join.length ); -new TestCase( SECTION, "delete Array.prototype.join.length", false, delete Array.prototype.join.length ); -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 - -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 - -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 -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 -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 -new TestCase( SECTION, - "var TEST_ARRAY = new Array(null, void 0, true, false, 123, new Object(), new Boolean(true) ); TEST_ARRAY.join(void 0)", - ",,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(void 0)") ); - -// length is greater than 0, separator is not supplied -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 -new TestCase( SECTION, - "var TEST_ARRAY = new Array(null, void 0, true, false, 123, new Object(), new Boolean(true) ); TEST_ARRAY.join('\v')", - decodeURIComponent("%0B%0Btrue%0Bfalse%0B123%0B[object Object]%0Btrue"), - 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 -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 +")" ); - -new TestCase( SECTION, - "TEST_ARRAY.join("+SEPARATOR+")", - TEST_RESULT, - TEST_ARRAY.join( SEPARATOR ) ); - -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 -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(':')") ); - -test(); - -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; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.4.4-1.js b/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.4.4-1.js deleted file mode 100644 index 503d7e635e..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.4.4-1.js +++ /dev/null @@ -1,294 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.4.4.4-1.js'; - -/** - 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"; -var BUGNUMBER="123724"; -startTest(); - -writeHeaderToLog( SECTION + " Array.prototype.reverse()"); - -var ARR_PROTOTYPE = Array.prototype; - -new TestCase( SECTION, - "Array.prototype.reverse.length", - 0, - Array.prototype.reverse.length ); - -new TestCase( SECTION, - "delete Array.prototype.reverse.length", - false, - delete Array.prototype.reverse.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 -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); - -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); - -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); - -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); - -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); - -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); - -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); - -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 ); - -new TestCase( SECTION, - S +"; A.reverse(); A.length", - R.length, - eval( S + "; A.reverse(); A.length") ); - -CheckItems( R, A ); - -test(); - -function CheckItems( R, A ) { - for ( var i = 0; i < R.length; i++ ) { - new TestCase( - SECTION, - "A["+i+ "]", - R[i], - 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.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; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.4.4-2.js b/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.4.4-2.js deleted file mode 100644 index a9b7b0ec14..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.4.4-2.js +++ /dev/null @@ -1,169 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.4.4.4-2.js'; - -/** - 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(); - -writeHeaderToLog( SECTION + " Array.prototype.reverse()"); - -var ARR_PROTOTYPE = Array.prototype; - -new TestCase( SECTION, "Array.prototype.reverse.length", 0, Array.prototype.reverse.length ); -new TestCase( SECTION, "delete Array.prototype.reverse.length", false, delete Array.prototype.reverse.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 -new TestCase( SECTION, - "var A = new Array(); A.reverse(); A.length", - 0, - eval("var A = new Array(); A.reverse(); A.length") ); - -test(); - -function CheckItems( R, A ) { - for ( var i = 0; i < R.length; i++ ) { - new TestCase( - SECTION, - "A["+i+ "]", - R[i], - A[i] ); - } -} -test(); - -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; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.4.5-1.js b/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.4.5-1.js deleted file mode 100644 index a3a521da09..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.4.5-1.js +++ /dev/null @@ -1,225 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.4.4.5-1.js'; - -/** - 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 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] ); -} - -test(); - -function CheckItems( S ) { - eval( S ); - var E = Sort( A ); - - new TestCase( SECTION, - S +"; A.sort(); A.length", - E.length, - eval( S + "; A.sort(); A.length") ); - - for ( var i = 0; i < E.length; i++ ) { - new TestCase( - SECTION, - "A["+i+ "].toString()", - E[i] +"", - A[i] +""); - - if ( A[i] == void 0 && typeof A[i] == "undefined" ) { - 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; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.4.5-2.js b/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.4.5-2.js deleted file mode 100644 index 301c435d15..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.4.5-2.js +++ /dev/null @@ -1,227 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.4.4.5-2.js'; - -/** - 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 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] ); -} - -test(); - -function CheckItems( S ) { - eval( S ); - var E = Sort( A ); - - 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++ ) { - new TestCase( - SECTION, - "A["+i+ "].toString()", - E[i] +"", - A[i] +""); - - if ( A[i] == void 0 && typeof A[i] == "undefined" ) { - 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; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.4.5-3.js b/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.4.5-3.js deleted file mode 100644 index 984d2fe80a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.4.5-3.js +++ /dev/null @@ -1,182 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.4.4.5-3.js'; - -/** - 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 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; i < array.length; i++) { - new TestCase( - SECTION, - "testarr1["+i+"]", - realarr[i], - testarr1[i] ); -} - -for ( var i=0; i < array.length; i++) { - new TestCase( - SECTION, - "testarr2["+i+"]", - realarr[i], - testarr2[i] ); -} - -for ( var i=0; i < array.length; i++) { - new TestCase( - SECTION, - "testarr3["+i+"]", - realarr[i], - testarr3[i] ); -} - -for ( var i=0; i < array.length; i++) { - new TestCase( - SECTION, - "testarr4["+i+"]", - stringarr[i].toString(), - testarr4[i].toString() ); -} - -test(); - -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; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.4.js b/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.4.js deleted file mode 100644 index 2ab2072098..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.4.js +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.4.4.js'; - -/** - 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); - - -new TestCase( SECTION, "Array.prototype.length", 0, Array.prototype.length ); - -// verify that prototype object is an Array object. -new TestCase( SECTION, "typeof Array.prototype", "object", typeof Array.prototype ); - -new TestCase( SECTION, - "Array.prototype.toString = Object.prototype.toString; Array.prototype.toString()", - "[object Array]", - eval("Array.prototype.toString = Object.prototype.toString; Array.prototype.toString()") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.5.1-1.js b/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.5.1-1.js deleted file mode 100644 index 090300d59b..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.5.1-1.js +++ /dev/null @@ -1,170 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.4.5.1-1.js'; - -/** - 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); - - -// P is "length" - -new TestCase( SECTION, - "var A = new Array(); A.length = 1000; A.length", - 1000, - eval("var A = new Array(); A.length = 1000; A.length") ); - -// A has Property P, and P is not length or an array index -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") ); - -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 - -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]") ); - -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; - -new TestCase( SECTION, - TEST_STRING +" A[150] = 'hello'; A[150]", - 'hello', - eval( TEST_STRING + " A[150] = 'hello'; A[150]" ) ); - -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 - -new TestCase( SECTION, - "var A = new Array(); A[123] = true; A.length", - 124, - eval("var A = new Array(); A[123] = true; A.length") ); - -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++ ) { - 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" - -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") ); - -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") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.5.1-2.js b/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.5.1-2.js deleted file mode 100644 index 2966a00456..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.5.1-2.js +++ /dev/null @@ -1,152 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.4.5.1-2.js'; - -/** - 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 gTestcases 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 a = new Array(); - -AddCase( "3.00", "three" ); -AddCase( "00010", "eight" ); -AddCase( "37xyz", "thirty-five" ); -AddCase("5000000000", 5) - AddCase( "-2", -3 ); - -new TestCase( SECTION, - "a[10]", - void 0, - a[10] ); - -new TestCase( SECTION, - "a[3]", - void 0, - a[3] ); - -a[4] = "four"; - -new TestCase( SECTION, - "a[4] = \"four\"; a[4]", - "four", - a[4] ); - -new TestCase( SECTION, - "a[\"4\"]", - "four", - a["4"] ); - -new TestCase( SECTION, - "a[\"4.00\"]", - void 0, - a["4.00"] ); - -new TestCase( SECTION, - "a.length", - 5, - a.length ); - - -a["5000000000"] = 5; - -new TestCase( SECTION, - "a[\"5000000000\"] = 5; a.length", - 5, - a.length ); - -new TestCase( SECTION, - "a[\"-2\"] = -3; a.length", - 5, - a.length ); - -test(); - -function AddCase ( arg, value ) { - - a[arg] = value; - - new TestCase( SECTION, - "a[\"" + arg + "\"] = "+ value +"; a.length", - 0, - a.length ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.5.2-1.js b/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.5.2-1.js deleted file mode 100644 index ff15f9d4e8..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.5.2-1.js +++ /dev/null @@ -1,86 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.4.5.2-1.js'; - -/** - 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); - -new TestCase( SECTION, - "var A = new Array(); A.length", - 0, - eval("var A = new Array(); A.length") ); -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") ); -new TestCase( SECTION, - "var A = new Array(); A.length = 123; A.length", - 123, - eval("var A = new Array(); A.length = 123; A.length") ); -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") ); -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") ); -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") ); -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.5.2-2.js b/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.5.2-2.js deleted file mode 100644 index 56a400ab49..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Array/15.4.5.2-2.js +++ /dev/null @@ -1,127 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.4.5.2-2.js'; - -/** - 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); - -addCase( new Array(), 0, Math.pow(2,14), Math.pow(2,14) ); - -addCase( new Array(), 0, 1, 1 ); - -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; - - 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; - } - } - 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; - } - } - new TestCase( SECTION, - "verify that new items are undefined", - true, - passed ); - } - } - -} - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Array/browser.js b/tests/auto/declarative/parserstress/tests/ecma/Array/browser.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/auto/declarative/parserstress/tests/ecma/Array/shell.js b/tests/auto/declarative/parserstress/tests/ecma/Array/shell.js deleted file mode 100644 index 9480d9e77d..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Array/shell.js +++ /dev/null @@ -1 +0,0 @@ -gTestsubsuite = 'Array'; diff --git a/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.1.js b/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.1.js deleted file mode 100644 index b698cbe407..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.1.js +++ /dev/null @@ -1,96 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.6.1.js'; - -/** - 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 array = new Array(); -var item = 0; - -new TestCase( SECTION, "Boolean(1)", true, Boolean(1) ); -new TestCase( SECTION, "Boolean(0)", false, Boolean(0) ); -new TestCase( SECTION, "Boolean(-1)", true, Boolean(-1) ); -new TestCase( SECTION, "Boolean('1')", true, Boolean("1") ); -new TestCase( SECTION, "Boolean('0')", true, Boolean("0") ); -new TestCase( SECTION, "Boolean('-1')", true, Boolean("-1") ); -new TestCase( SECTION, "Boolean(true)", true, Boolean(true) ); -new TestCase( SECTION, "Boolean(false)", false, Boolean(false) ); - -new TestCase( SECTION, "Boolean('true')", true, Boolean("true") ); -new TestCase( SECTION, "Boolean('false')", true, Boolean("false") ); -new TestCase( SECTION, "Boolean(null)", false, Boolean(null) ); - -new TestCase( SECTION, "Boolean(-Infinity)", true, Boolean(Number.NEGATIVE_INFINITY) ); -new TestCase( SECTION, "Boolean(NaN)", false, Boolean(Number.NaN) ); -new TestCase( SECTION, "Boolean(void(0))", false, Boolean( void(0) ) ); -new TestCase( SECTION, "Boolean(x=0)", false, Boolean( x=0 ) ); -new TestCase( SECTION, "Boolean(x=1)", true, Boolean( x=1 ) ); -new TestCase( SECTION, "Boolean(x=false)", false, Boolean( x=false ) ); -new TestCase( SECTION, "Boolean(x=true)", true, Boolean( x=true ) ); -new TestCase( SECTION, "Boolean(x=null)", false, Boolean( x=null ) ); -new TestCase( SECTION, "Boolean()", false, Boolean() ); -// array[item++] = new TestCase( SECTION, "Boolean(var someVar)", false, Boolean( someVar ) ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.2.js b/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.2.js deleted file mode 100644 index f9fccb3e57..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.2.js +++ /dev/null @@ -1,161 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.6.2.js'; - -/** - 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 array = new Array(); -var item = 0; - -new TestCase( SECTION, "typeof (new Boolean(1))", "object", typeof (new Boolean(1)) ); -new TestCase( SECTION, "(new Boolean(1)).constructor", Boolean.prototype.constructor, (new Boolean(1)).constructor ); -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()") ); -new TestCase( SECTION, "(new Boolean(1)).valueOf()", true, (new Boolean(1)).valueOf() ); -new TestCase( SECTION, "typeof new Boolean(1)", "object", typeof new Boolean(1) ); -new TestCase( SECTION, "(new Boolean(0)).constructor", Boolean.prototype.constructor, (new Boolean(0)).constructor ); -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()") ); -new TestCase( SECTION, "(new Boolean(0)).valueOf()", false, (new Boolean(0)).valueOf() ); -new TestCase( SECTION, "typeof new Boolean(0)", "object", typeof new Boolean(0) ); -new TestCase( SECTION, "(new Boolean(-1)).constructor", Boolean.prototype.constructor, (new Boolean(-1)).constructor ); -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()") ); -new TestCase( SECTION, "(new Boolean(-1)).valueOf()", true, (new Boolean(-1)).valueOf() ); -new TestCase( SECTION, "typeof new Boolean(-1)", "object", typeof new Boolean(-1) ); -new TestCase( SECTION, "(new Boolean('1')).constructor", Boolean.prototype.constructor, (new Boolean('1')).constructor ); -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()") ); -new TestCase( SECTION, "(new Boolean('1')).valueOf()", true, (new Boolean('1')).valueOf() ); -new TestCase( SECTION, "typeof new Boolean('1')", "object", typeof new Boolean('1') ); -new TestCase( SECTION, "(new Boolean('0')).constructor", Boolean.prototype.constructor, (new Boolean('0')).constructor ); -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()") ); -new TestCase( SECTION, "(new Boolean('0')).valueOf()", true, (new Boolean('0')).valueOf() ); -new TestCase( SECTION, "typeof new Boolean('0')", "object", typeof new Boolean('0') ); -new TestCase( SECTION, "(new Boolean('-1')).constructor", Boolean.prototype.constructor, (new Boolean('-1')).constructor ); -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()") ); -new TestCase( SECTION, "(new Boolean('-1')).valueOf()", true, (new Boolean('-1')).valueOf() ); -new TestCase( SECTION, "typeof new Boolean('-1')", "object", typeof new Boolean('-1') ); -new TestCase( SECTION, "(new Boolean(new Boolean(true))).constructor", Boolean.prototype.constructor, (new Boolean(new Boolean(true))).constructor ); -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()") ); -new TestCase( SECTION, "(new Boolean(new Boolean(true))).valueOf()", true, (new Boolean(new Boolean(true))).valueOf() ); -new TestCase( SECTION, "typeof new Boolean(new Boolean(true))", "object", typeof new Boolean(new Boolean(true)) ); -new TestCase( SECTION, "(new Boolean(Number.NaN)).constructor", Boolean.prototype.constructor, (new Boolean(Number.NaN)).constructor ); -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()") ); -new TestCase( SECTION, "(new Boolean(Number.NaN)).valueOf()", false, (new Boolean(Number.NaN)).valueOf() ); -new TestCase( SECTION, "typeof new Boolean(Number.NaN)", "object", typeof new Boolean(Number.NaN) ); -new TestCase( SECTION, "(new Boolean(null)).constructor", Boolean.prototype.constructor, (new Boolean(null)).constructor ); -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()") ); -new TestCase( SECTION, "(new Boolean(null)).valueOf()", false, (new Boolean(null)).valueOf() ); -new TestCase( SECTION, "typeof new Boolean(null)", "object", typeof new Boolean(null) ); -new TestCase( SECTION, "(new Boolean(void 0)).constructor", Boolean.prototype.constructor, (new Boolean(void 0)).constructor ); -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()") ); -new TestCase( SECTION, "(new Boolean(void 0)).valueOf()", false, (new Boolean(void 0)).valueOf() ); -new TestCase( SECTION, "typeof new Boolean(void 0)", "object", typeof new Boolean(void 0) ); -new TestCase( SECTION, "(new Boolean(Number.POSITIVE_INFINITY)).constructor", Boolean.prototype.constructor, (new Boolean(Number.POSITIVE_INFINITY)).constructor ); -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()") ); -new TestCase( SECTION, "(new Boolean(Number.POSITIVE_INFINITY)).valueOf()", true, (new Boolean(Number.POSITIVE_INFINITY)).valueOf() ); -new TestCase( SECTION, "typeof new Boolean(Number.POSITIVE_INFINITY)", "object", typeof new Boolean(Number.POSITIVE_INFINITY) ); -new TestCase( SECTION, "(new Boolean(Number.NEGATIVE_INFINITY)).constructor", Boolean.prototype.constructor, (new Boolean(Number.NEGATIVE_INFINITY)).constructor ); -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()") ); -new TestCase( SECTION, "(new Boolean(Number.NEGATIVE_INFINITY)).valueOf()", true, (new Boolean(Number.NEGATIVE_INFINITY)).valueOf() ); -new TestCase( SECTION, "typeof new Boolean(Number.NEGATIVE_INFINITY)", "object", typeof new Boolean(Number.NEGATIVE_INFINITY) ); -new TestCase( SECTION, "(new Boolean(Number.NEGATIVE_INFINITY)).constructor", Boolean.prototype.constructor, (new Boolean(Number.NEGATIVE_INFINITY)).constructor ); -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()") ); -new TestCase( "15.6.2.2", "(new Boolean()).valueOf()", false, (new Boolean()).valueOf() ); -new TestCase( "15.6.2.2", "typeof new Boolean()", "object", typeof new Boolean() ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.3.1-1.js b/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.3.1-1.js deleted file mode 100644 index 0be8097487..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.3.1-1.js +++ /dev/null @@ -1,72 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.6.3.1-1.js'; - -/** - 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 array = new Array(); -var item = 0; - -new TestCase( SECTION, - "var str='';for ( p in Boolean ) { str += p } str;", - "", - eval("var str='';for ( p in Boolean ) { str += p } str;") ); -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.3.1-2.js b/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.3.1-2.js deleted file mode 100644 index 5d435982d4..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.3.1-2.js +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.6.3.1-2.js'; - -/** - 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 array = new Array(); -var item = 0; - -new TestCase( SECTION, - "delete( Boolean.prototype)", - false, - delete( Boolean.prototype) ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.3.1-3.js b/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.3.1-3.js deleted file mode 100644 index 0f1b125267..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.3.1-3.js +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.6.3.1-3.js'; - -/** - 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 array = new Array(); -var item = 0; - -new TestCase( SECTION, - "delete( Boolean.prototype); Boolean.prototype", - Boolean.prototype, - eval("delete( Boolean.prototype); Boolean.prototype") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.3.1-4.js b/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.3.1-4.js deleted file mode 100644 index 822750308a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.3.1-4.js +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.6.3.1-4.js'; - -/** - 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 BOOL_PROTO = Boolean.prototype; - -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") ); - -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") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.3.1.js b/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.3.1.js deleted file mode 100644 index ca808c63a5..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.3.1.js +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.6.3.1.js'; - -/** - 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); - -new TestCase( SECTION, "Boolean.prototype.valueOf()", false, Boolean.prototype.valueOf() ); -new TestCase( SECTION, "Boolean.length", 1, Boolean.length ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4-1.js b/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4-1.js deleted file mode 100644 index 584562b2a8..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4-1.js +++ /dev/null @@ -1,72 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.6.4-1.js'; - -/** - 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"); - -new TestCase( SECTION, "typeof Boolean.prototype == typeof( new Boolean )", true, typeof Boolean.prototype == typeof( new Boolean ) ); -new TestCase( SECTION, "typeof( Boolean.prototype )", "object", typeof(Boolean.prototype) ); -new TestCase( SECTION, - "Boolean.prototype.toString = Object.prototype.toString; Boolean.prototype.toString()", - "[object Boolean]", - eval("Boolean.prototype.toString = Object.prototype.toString; Boolean.prototype.toString()") ); -new TestCase( SECTION, "Boolean.prototype.valueOf()", false, Boolean.prototype.valueOf() ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.1.js b/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.1.js deleted file mode 100644 index 3b75fb49ec..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.1.js +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.6.4.1.js'; - -/** - 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 ); - -new TestCase( SECTION, - "( Boolean.prototype.constructor == Boolean )", - true , - (Boolean.prototype.constructor == Boolean) ); -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.2-1.js b/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.2-1.js deleted file mode 100644 index 54bd2e19d3..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.2-1.js +++ /dev/null @@ -1,97 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.6.4.2-1.js'; - -/** - 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 ); - - -new TestCase( SECTION, "new Boolean(1)", "true", (new Boolean(1)).toString() ); -new TestCase( SECTION, "new Boolean(0)", "false", (new Boolean(0)).toString() ); -new TestCase( SECTION, "new Boolean(-1)", "true", (new Boolean(-1)).toString() ); -new TestCase( SECTION, "new Boolean('1')", "true", (new Boolean("1")).toString() ); -new TestCase( SECTION, "new Boolean('0')", "true", (new Boolean("0")).toString() ); -new TestCase( SECTION, "new Boolean(true)", "true", (new Boolean(true)).toString() ); -new TestCase( SECTION, "new Boolean(false)", "false", (new Boolean(false)).toString() ); -new TestCase( SECTION, "new Boolean('true')", "true", (new Boolean('true')).toString() ); -new TestCase( SECTION, "new Boolean('false')", "true", (new Boolean('false')).toString() ); - -new TestCase( SECTION, "new Boolean('')", "false", (new Boolean('')).toString() ); -new TestCase( SECTION, "new Boolean(null)", "false", (new Boolean(null)).toString() ); -new TestCase( SECTION, "new Boolean(void(0))", "false", (new Boolean(void(0))).toString() ); -new TestCase( SECTION, "new Boolean(-Infinity)", "true", (new Boolean(Number.NEGATIVE_INFINITY)).toString() ); -new TestCase( SECTION, "new Boolean(NaN)", "false", (new Boolean(Number.NaN)).toString() ); -new TestCase( SECTION, "new Boolean()", "false", (new Boolean()).toString() ); -new TestCase( SECTION, "new Boolean(x=1)", "true", (new Boolean(x=1)).toString() ); -new TestCase( SECTION, "new Boolean(x=0)", "false", (new Boolean(x=0)).toString() ); -new TestCase( SECTION, "new Boolean(x=false)", "false", (new Boolean(x=false)).toString() ); -new TestCase( SECTION, "new Boolean(x=true)", "true", (new Boolean(x=true)).toString() ); -new TestCase( SECTION, "new Boolean(x=null)", "false", (new Boolean(x=null)).toString() ); -new TestCase( SECTION, "new Boolean(x='')", "false", (new Boolean(x="")).toString() ); -new TestCase( SECTION, "new Boolean(x=' ')", "true", (new Boolean(x=" ")).toString() ); - -new TestCase( SECTION, "new Boolean(new MyObject(true))", "true", (new Boolean(new MyObject(true))).toString() ); -new TestCase( SECTION, "new Boolean(new MyObject(false))", "true", (new Boolean(new MyObject(false))).toString() ); - -test(); - -function MyObject( value ) { - this.value = value; - this.valueOf = new Function( "return this.value" ); - return this; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.2-2.js b/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.2-2.js deleted file mode 100644 index 2039004472..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.2-2.js +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.6.4.2-2.js'; - -/** - 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 ); - -new TestCase( SECTION, - "tostr=Boolean.prototype.toString; x=new Boolean(); x.toString=tostr;x.toString()", - "false", - eval("tostr=Boolean.prototype.toString; x=new Boolean(); x.toString=tostr;x.toString()") ); -new TestCase( SECTION, - "tostr=Boolean.prototype.toString; x=new Boolean(true); x.toString=tostr; x.toString()", - "true", - eval("tostr=Boolean.prototype.toString; x=new Boolean(true); x.toString=tostr; x.toString()") ); -new TestCase( SECTION, - "tostr=Boolean.prototype.toString; x=new Boolean(false); x.toString=tostr;x.toString()", - "false", - eval("tostr=Boolean.prototype.toString; x=new Boolean(); x.toString=tostr;x.toString()") ); -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.2-3.js b/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.2-3.js deleted file mode 100644 index 4dcc65f21f..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.2-3.js +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.6.4.2-3.js'; - -/** - 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 ); - -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()") ); -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()") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.2-4-n.js b/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.2-4-n.js deleted file mode 100644 index 0dd3e5f349..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.2-4-n.js +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.6.4.2-4-n.js'; - -/** - 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 ); - -DESCRIPTION = "tostr=Boolean.prototype.toString; x=new String( 'hello' ); x.toString=tostr; x.toString()"; -EXPECTED = "error"; - -new TestCase( SECTION, - "tostr=Boolean.prototype.toString; x=new String( 'hello' ); x.toString=tostr; x.toString()", - "error", - eval("tostr=Boolean.prototype.toString; x=new String( 'hello' ); x.toString=tostr; x.toString()") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.3-1.js b/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.3-1.js deleted file mode 100644 index 8b913e011e..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.3-1.js +++ /dev/null @@ -1,88 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.6.4.3-1.js'; - -/** - 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); - -new TestCase( SECTION, "new Boolean(1)", true, (new Boolean(1)).valueOf() ); - -new TestCase( SECTION, "new Boolean(0)", false, (new Boolean(0)).valueOf() ); -new TestCase( SECTION, "new Boolean(-1)", true, (new Boolean(-1)).valueOf() ); -new TestCase( SECTION, "new Boolean('1')", true, (new Boolean("1")).valueOf() ); -new TestCase( SECTION, "new Boolean('0')", true, (new Boolean("0")).valueOf() ); -new TestCase( SECTION, "new Boolean(true)", true, (new Boolean(true)).valueOf() ); -new TestCase( SECTION, "new Boolean(false)", false, (new Boolean(false)).valueOf() ); -new TestCase( SECTION, "new Boolean('true')", true, (new Boolean("true")).valueOf() ); -new TestCase( SECTION, "new Boolean('false')", true, (new Boolean('false')).valueOf() ); - -new TestCase( SECTION, "new Boolean('')", false, (new Boolean('')).valueOf() ); -new TestCase( SECTION, "new Boolean(null)", false, (new Boolean(null)).valueOf() ); -new TestCase( SECTION, "new Boolean(void(0))", false, (new Boolean(void(0))).valueOf() ); -new TestCase( SECTION, "new Boolean(-Infinity)", true, (new Boolean(Number.NEGATIVE_INFINITY)).valueOf() ); -new TestCase( SECTION, "new Boolean(NaN)", false, (new Boolean(Number.NaN)).valueOf() ); -new TestCase( SECTION, "new Boolean()", false, (new Boolean()).valueOf() ); - -new TestCase( SECTION, "new Boolean(x=1)", true, (new Boolean(x=1)).valueOf() ); -new TestCase( SECTION, "new Boolean(x=0)", false, (new Boolean(x=0)).valueOf() ); -new TestCase( SECTION, "new Boolean(x=false)", false, (new Boolean(x=false)).valueOf() ); -new TestCase( SECTION, "new Boolean(x=true)", true, (new Boolean(x=true)).valueOf() ); -new TestCase( SECTION, "new Boolean(x=null)", false, (new Boolean(x=null)).valueOf() ); -new TestCase( SECTION, "new Boolean(x='')", false, (new Boolean(x="")).valueOf() ); -new TestCase( SECTION, "new Boolean(x=' ')", true, (new Boolean(x=" ")).valueOf() ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.3-2.js b/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.3-2.js deleted file mode 100644 index 5548a7874f..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.3-2.js +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.6.4.3-2.js'; - -/** - 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); - - -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()") ); - -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()") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.3-3.js b/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.3-3.js deleted file mode 100644 index f05dfc0c60..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.3-3.js +++ /dev/null @@ -1,66 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.6.4.3-3.js'; - -/** - 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); - -new TestCase( SECTION, - "x=true; x.valueOf=Boolean.prototype.valueOf;x.valueOf()", - true, - eval("x=true; x.valueOf=Boolean.prototype.valueOf;x.valueOf()") ); -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.3-4-n.js b/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.3-4-n.js deleted file mode 100644 index 4ebabfa84c..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.3-4-n.js +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.6.4.3-4-n.js'; - -/** - 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); - -DESCRIPTION = "valof=Boolean.prototype.valueOf; x=new String( 'hello' ); x.valueOf=valof;x.valueOf()" - EXPECTED = "error"; - -new TestCase( SECTION, - "valof=Boolean.prototype.valueOf; x=new String( 'hello' ); x.valueOf=valof;x.valueOf()", - "error", - eval("valof=Boolean.prototype.valueOf; x=new String( 'hello' ); x.valueOf=valof;x.valueOf()") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.3.js b/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.3.js deleted file mode 100644 index 570652ee39..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.3.js +++ /dev/null @@ -1,83 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.6.4.3.js'; - -/** - 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 -*/ - -startTest(); - -new TestCase( "15.8.6.4", "new Boolean(1)", true, (new Boolean(1)).valueOf() ); - -new TestCase( "15.8.6.4", "new Boolean(0)", false, (new Boolean(0)).valueOf() ); -new TestCase( "15.8.6.4", "new Boolean(-1)", true, (new Boolean(-1)).valueOf() ); -new TestCase( "15.8.6.4", "new Boolean('1')", true, (new Boolean("1")).valueOf() ); -new TestCase( "15.8.6.4", "new Boolean('0')", true, (new Boolean("0")).valueOf() ); -new TestCase( "15.8.6.4", "new Boolean(true)", true, (new Boolean(true)).valueOf() ); -new TestCase( "15.8.6.4", "new Boolean(false)", false, (new Boolean(false)).valueOf() ); -new TestCase( "15.8.6.4", "new Boolean('true')", true, (new Boolean("true")).valueOf() ); -new TestCase( "15.8.6.4", "new Boolean('false')", true, (new Boolean('false')).valueOf() ); - -new TestCase( "15.8.6.4", "new Boolean('')", false, (new Boolean('')).valueOf() ); -new TestCase( "15.8.6.4", "new Boolean(null)", false, (new Boolean(null)).valueOf() ); -new TestCase( "15.8.6.4", "new Boolean(void(0))", false, (new Boolean(void(0))).valueOf() ); -new TestCase( "15.8.6.4", "new Boolean(-Infinity)", true, (new Boolean(Number.NEGATIVE_INFINITY)).valueOf() ); -new TestCase( "15.8.6.4", "new Boolean(NaN)", false, (new Boolean(Number.NaN)).valueOf() ); -new TestCase( "15.8.6.4", "new Boolean()", false, (new Boolean()).valueOf() ); - -new TestCase( "15.8.6.4", "new Boolean(x=1)", true, (new Boolean(x=1)).valueOf() ); -new TestCase( "15.8.6.4", "new Boolean(x=0)", false, (new Boolean(x=0)).valueOf() ); -new TestCase( "15.8.6.4", "new Boolean(x=false)", false, (new Boolean(x=false)).valueOf() ); -new TestCase( "15.8.6.4", "new Boolean(x=true)", true, (new Boolean(x=true)).valueOf() ); -new TestCase( "15.8.6.4", "new Boolean(x=null)", false, (new Boolean(x=null)).valueOf() ); -new TestCase( "15.8.6.4", "new Boolean(x='')", false, (new Boolean(x="")).valueOf() ); -new TestCase( "15.8.6.4", "new Boolean(x=' ')", true, (new Boolean(x=" ")).valueOf() ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.js b/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.js deleted file mode 100644 index 0c95d255fe..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Boolean/15.6.4.js +++ /dev/null @@ -1,80 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.6.4.js'; - -/** - 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); - -new TestCase( SECTION, - "Boolean.prototype == false", - true, - Boolean.prototype == false ); - -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(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Boolean/browser.js b/tests/auto/declarative/parserstress/tests/ecma/Boolean/browser.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/auto/declarative/parserstress/tests/ecma/Boolean/shell.js b/tests/auto/declarative/parserstress/tests/ecma/Boolean/shell.js deleted file mode 100644 index 2ff7258ce8..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Boolean/shell.js +++ /dev/null @@ -1 +0,0 @@ -gTestsubsuite = 'Boolean'; diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.1.1-1.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.1.1-1.js deleted file mode 100644 index 8e82d205f3..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.1.1-1.js +++ /dev/null @@ -1,96 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.1.1-1.js'; - -/** - 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 - -*/ - -// 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"; -startTest(); - -writeHeaderToLog("15.8.1.1 Time Range"); - -var M_SECS; -var CURRENT_YEAR; - -for ( M_SECS = 0, CURRENT_YEAR = 1970; - M_SECS < 8640000000000000; - M_SECS += FOUR_HUNDRED_YEARS, CURRENT_YEAR += 400 ) { - - new TestCase( SECTION, - "new Date("+M_SECS+")", - CURRENT_YEAR, - (new Date( M_SECS)).getUTCFullYear() ); -} - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.1.1-2.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.1.1-2.js deleted file mode 100644 index 7b8c2644e3..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.1.1-2.js +++ /dev/null @@ -1,91 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.1.1-2.js'; - -/** - 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 -*/ - -// 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"; -startTest(); - -writeHeaderToLog("15.8.1.1 Time Range"); - -var M_SECS; -var CURRENT_YEAR; - -for ( M_SECS = 0, CURRENT_YEAR = 1970; - M_SECS > -8640000000000000; - M_SECS -= FOUR_HUNDRED_YEARS, CURRENT_YEAR -= 400 ) { - - new TestCase( SECTION, - "new Date("+M_SECS+")", - CURRENT_YEAR, - (new Date( M_SECS )).getUTCFullYear() ); - -} - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.1.13-1.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.1.13-1.js deleted file mode 100755 index 720b39dd54..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.1.13-1.js +++ /dev/null @@ -1,79 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.1.13-1.js'; - -/** - File Name: 15.9.1.13-1.js - ECMA Section: 15.9.1.1 MakeDate(day, time) - Description: - - The operator MakeDate calculates a number of milliseconds from its - two arguments, which must be ECMAScript number values. This - operator functions as follows: - - 1. If day is not finite or time is not finite, return NaN. - - 2. Compute day * msPerDay + time. - - 3. Return Result(2). -*/ -startTest(); - -new TestCase( SECTION, - "MakeDate(Number.POSITIVE_INFINITY, 0)", - Number.NaN, - MakeDate(Number.POSITIVE_INFINITY, 0)); - -new TestCase( SECTION, - "MakeDate(Number.NEGATIVE_INFINITY, 0)", - Number.NaN, - MakeDate(Number.NEGATIVE_INFINITY, 0)); - -new TestCase( SECTION, - "MakeDate(0, Number.POSITIVE_INFINITY)", - Number.NaN, - MakeDate(0, Number.POSITIVE_INFINITY)); - -new TestCase( SECTION, - "MakeDate(0, Number.NEGATIVE_INFINITY)", - Number.NaN, - MakeDate(0, Number.NEGATIVE_INFINITY)); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.2.1.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.2.1.js deleted file mode 100644 index 6cd76efb6b..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.2.1.js +++ /dev/null @@ -1,104 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.2.1.js'; - -/** - 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 TODAY = new Date(); - -// Dates around 1970 - -new TestCase( SECTION, "Date(1970,0,1,0,0,0,0)", (new Date()).toString(), Date(1970,0,1,0,0,0,0) ); -new TestCase( SECTION, "Date(1969,11,31,15,59,59,999)", (new Date()).toString(), Date(1969,11,31,15,59,59,999)); -new TestCase( SECTION, "Date(1969,11,31,16,0,0,0)", (new Date()).toString(), Date(1969,11,31,16,0,0,0)); -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 -new TestCase( SECTION, "Date(1999,11,15,59,59,999)", (new Date()).toString(), Date(1999,11,15,59,59,999)); -new TestCase( SECTION, "Date(1999,11,16,0,0,0,0)", (new Date()).toString(), Date(1999,11,16,0,0,0,0)); -new TestCase( SECTION, "Date(1999,11,31,23,59,59,999)", (new Date()).toString(), Date(1999,11,31,23,59,59,999) ); -new TestCase( SECTION, "Date(2000,0,1,0,0,0,0)", (new Date()).toString(), Date(2000,0,0,0,0,0,0) ); -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 - -new TestCase( SECTION, "Date(1899,11,31,23,59,59,999)", (new Date()).toString(), Date(1899,11,31,23,59,59,999)); -new TestCase( SECTION, "Date(1900,0,1,0,0,0,0)", (new Date()).toString(), Date(1900,0,1,0,0,0,0) ); -new TestCase( SECTION, "Date(1900,0,1,0,0,0,1)", (new Date()).toString(), Date(1900,0,1,0,0,0,1) ); -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 - -new TestCase( SECTION, "Date( 2000,1,29,0,0,0,0)", (new Date()).toString(), Date(2000,1,29,0,0,0,0)); -new TestCase( SECTION, "Date( 2000,1,28,23,59,59,999)", (new Date()).toString(), Date( 2000,1,28,23,59,59,999)); -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 -new TestCase( SECTION, "Date(2004,11,31,23,59,59,999)", (new Date()).toString(), Date(2004,11,31,23,59,59,999)); -new TestCase( SECTION, "Date(2005,0,1,0,0,0,0)", (new Date()).toString(), Date(2005,0,1,0,0,0,0) ); -new TestCase( SECTION, "Date(2005,0,1,0,0,0,1)", (new Date()).toString(), Date(2005,0,1,0,0,0,1) ); -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 -new TestCase( SECTION, "Date(2031,11,31,23,59,59,999)", (new Date()).toString(), Date(2031,11,31,23,59,59,999)); -new TestCase( SECTION, "Date(2032,0,1,0,0,0,0)", (new Date()).toString(), Date(2032,0,1,0,0,0,0) ); -new TestCase( SECTION, "Date(2032,0,1,0,0,0,1)", (new Date()).toString(), Date(2032,0,1,0,0,0,1) ); -new TestCase( SECTION, "Date(2031,11,31,16,0,0,0,0)", (new Date()).toString(), Date(2031,11,31,16,0,0,0,0)); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.2.2-1.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.2.2-1.js deleted file mode 100644 index 0c643cfd3a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.2.2-1.js +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.2.2-1.js'; - -/** - 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 ); - -// Dates around 1970 - -new TestCase( SECTION, "Date(1970,0,1,0,0,0)", (new Date()).toString(), Date(1970,0,1,0,0,0) ); -new TestCase( SECTION, "Date(1969,11,31,15,59,59)", (new Date()).toString(), Date(1969,11,31,15,59,59)); -new TestCase( SECTION, "Date(1969,11,31,16,0,0)", (new Date()).toString(), Date(1969,11,31,16,0,0)); -new TestCase( SECTION, "Date(1969,11,31,16,0,1)", (new Date()).toString(), Date(1969,11,31,16,0,1)); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.2.2-2.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.2.2-2.js deleted file mode 100644 index af95bb3ae6..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.2.2-2.js +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.2.2-2.js'; - -/** - 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 ); - -// Dates around 2000 -new TestCase( SECTION, "Date(1999,11,15,59,59)", (new Date()).toString(), Date(1999,11,15,59,59)); -new TestCase( SECTION, "Date(1999,11,16,0,0,0)", (new Date()).toString(), Date(1999,11,16,0,0,0)); -new TestCase( SECTION, "Date(1999,11,31,23,59,59)", (new Date()).toString(), Date(1999,11,31,23,59,59) ); -new TestCase( SECTION, "Date(2000,0,1,0,0,0)", (new Date()).toString(), Date(2000,0,0,0,0,0) ); -new TestCase( SECTION, "Date(2000,0,1,0,0,1)", (new Date()).toString(), Date(2000,0,0,0,0,1) ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.2.2-3.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.2.2-3.js deleted file mode 100644 index f7de60b5b1..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.2.2-3.js +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.2.2-3.js'; - -/** - 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 ); - -// Dates around 1900 - -new TestCase( SECTION, "Date(1899,11,31,23,59,59)", (new Date()).toString(), Date(1899,11,31,23,59,59)); -new TestCase( SECTION, "Date(1900,0,1,0,0,0)", (new Date()).toString(), Date(1900,0,1,0,0,0) ); -new TestCase( SECTION, "Date(1900,0,1,0,0,1)", (new Date()).toString(), Date(1900,0,1,0,0,1) ); -new TestCase( SECTION, "Date(1899,11,31,16,0,0,0)", (new Date()).toString(), Date(1899,11,31,16,0,0,0)); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.2.2-4.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.2.2-4.js deleted file mode 100644 index 119b4f2559..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.2.2-4.js +++ /dev/null @@ -1,68 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.2.2-4.js'; - -/** - 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 ); - -// Dates around feb 29, 2000 - -new TestCase( SECTION, "Date( 2000,1,29,0,0,0)", (new Date()).toString(), Date(2000,1,29,0,0,0)); -new TestCase( SECTION, "Date( 2000,1,28,23,59,59)", (new Date()).toString(), Date( 2000,1,28,23,59,59)); -new TestCase( SECTION, "Date( 2000,1,27,16,0,0)", (new Date()).toString(), Date(2000,1,27,16,0,0)); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.2.2-5.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.2.2-5.js deleted file mode 100644 index d9369ca4c5..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.2.2-5.js +++ /dev/null @@ -1,68 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.2.2-5.js'; - -/** - 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 ); - -// Dates around jan 1, 2005 -new TestCase( SECTION, "Date(2004,11,31,23,59,59)", (new Date()).toString(), Date(2004,11,31,23,59,59)); -new TestCase( SECTION, "Date(2005,0,1,0,0,0)", (new Date()).toString(), Date(2005,0,1,0,0,0) ); -new TestCase( SECTION, "Date(2005,0,1,0,0,1)", (new Date()).toString(), Date(2005,0,1,0,0,1) ); -new TestCase( SECTION, "Date(2004,11,31,16,0,0,0)", (new Date()).toString(), Date(2004,11,31,16,0,0,0)); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.2.2-6.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.2.2-6.js deleted file mode 100644 index 8e549936e3..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.2.2-6.js +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.2.2-6.js'; - -/** - 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 ); - -// Dates around jan 1, 2032 -new TestCase( SECTION, "Date(2031,11,31,23,59,59)", (new Date()).toString(), Date(2031,11,31,23,59,59)); -new TestCase( SECTION, "Date(2032,0,1,0,0,0)", (new Date()).toString(), Date(2032,0,1,0,0,0) ); -new TestCase( SECTION, "Date(2032,0,1,0,0,1)", (new Date()).toString(), Date(2032,0,1,0,0,1) ); -new TestCase( SECTION, "Date(2031,11,31,16,0,0,0)", (new Date()).toString(), Date(2031,11,31,16,0,0,0)); -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.1-1.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.1-1.js deleted file mode 100644 index 642169a60c..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.1-1.js +++ /dev/null @@ -1,239 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.3.1-1.js'; - -/** - 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); - -// 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-PST_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-PST_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-PST_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-PST_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-PST_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-PST_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-PST_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-PST_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-PST_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-PST_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-PST_ADJUST+1,2000,0,1,6,8,0,0,1,2000,0,1,6,0,0,0,1] ); - -// Dates around 29 Feb 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] ); - -addNewTestCase( new Date(2000,1,29,0,0,0,0), - "new Date(2000,1,29,0,0,0,0)", - [UTC_FEB_29_2000-PST_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-PST_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-PST_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-PST_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-PST_ADJUST+1,1900,0,1,1,8,0,0,1,1900,0,1,1,0,0,0,1] ); - -// Dates around 2005 - -addNewTestCase( new Date(2005,0,1,0,0,0,0), - "new Date(2005,0,1,0,0,0,0)", - [UTC_JAN_1_2005-PST_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_JAN_1_2005,2005,0,1,6,0,0,0,0,2004,11,31,5,16,0,0,0] ); - -test(); - - -function addNewTestCase( DateCase, DateString, ResultArray ) { - //adjust hard-coded ResultArray for tester's timezone instead of PST - adjustResultArray(ResultArray); - - new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() ); -} - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.1-2.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.1-2.js deleted file mode 100644 index fb9dff486c..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.1-2.js +++ /dev/null @@ -1,152 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.3.1-2.js'; - -/** - 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); - - -// all the "ResultArrays" below are hard-coded to Pacific Standard Time values - - -// 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-PST_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-PST_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-PST_ADJUST+1,2000,0,1,6,8,0,0,1,2000,0,1,6,0,0,0,1] ); - -test(); - -function addNewTestCase( DateCase, DateString, ResultArray ) { - //adjust hard-coded ResultArray for tester's timezone instead of PST - adjustResultArray(ResultArray); - - new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.1-3.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.1-3.js deleted file mode 100644 index 0d888b089c..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.1-3.js +++ /dev/null @@ -1,141 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.3.1-3.js'; - -/** - 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); - -// all the "ResultArrays" below are hard-coded to Pacific Standard Time values - -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 - PST_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 - PST_ADJUST,2000,1,29,2,8,0,0,0,2000,1,29,2,0,0,0,0] ); - -test(); - -function addNewTestCase( DateCase, DateString, ResultArray ) { - //adjust hard-coded ResultArray for tester's timezone instead of PST - adjustResultArray(ResultArray); - - - new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.1-4.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.1-4.js deleted file mode 100644 index 5f95a5b797..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.1-4.js +++ /dev/null @@ -1,151 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.3.1-4.js'; - -/** - 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); - -// all the "ResultArrays" below are hard-coded to Pacific Standard Time values - - -// 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-PST_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-PST_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-PST_ADJUST+1,1900,0,1,1,8,0,0,1,1900,0,1,1,0,0,0,1] ); - -test(); - -function addNewTestCase( DateCase, DateString, ResultArray ) { - //adjust hard-coded ResultArray for tester's timezone instead of PST - adjustResultArray(ResultArray); - - new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.1-5.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.1-5.js deleted file mode 100644 index f37c1c8da2..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.1-5.js +++ /dev/null @@ -1,140 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.3.1-5.js'; - -/** - 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); - -// all the "ResultArrays" below are hard-coded to Pacific Standard Time values - - -// Dates around 2005 - -addNewTestCase( new Date(2005,0,1,0,0,0,0), - "new Date(2005,0,1,0,0,0,0)", - [UTC_JAN_1_2005-PST_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_JAN_1_2005,2005,0,1,6,0,0,0,0,2004,11,31,5,16,0,0,0] ); - -test(); - -function addNewTestCase( DateCase, DateString, ResultArray ) { - //adjust hard-coded ResultArray for tester's timezone instead of PST - adjustResultArray(ResultArray); - - new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() ); -} - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.2-1.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.2-1.js deleted file mode 100644 index ae0502be64..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.2-1.js +++ /dev/null @@ -1,151 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.3.2-1.js'; - -/** - 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 gTestcases array must be global. -var SECTION = "15.9.3.1"; -var TITLE = "Date( year, month, date, hours, minutes, seconds )"; -startTest(); - -writeHeaderToLog( SECTION+" " +TITLE ); - -// 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] ); - -test(); - -function addNewTestCase( DateCase, DateString, ResultArray ) { - //adjust hard-coded ResultArray for tester's timezone instead of PST - adjustResultArray(ResultArray); - - - new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() ); - -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.2-2.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.2-2.js deleted file mode 100644 index acc2ac7f0b..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.2-2.js +++ /dev/null @@ -1,142 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.3.2-2.js'; - -/** - 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 gTestcases array must be global. -var SECTION = "15.9.3.1"; -var TITLE = "Date( year, month, date, hours, minutes, seconds )"; -startTest(); - -writeHeaderToLog( SECTION+" " +TITLE ); - -// 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] ); - -test(); - -function addNewTestCase( DateCase, DateString, ResultArray ) { - //adjust hard-coded ResultArray for tester's timezone instead of PST - adjustResultArray(ResultArray); - - new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() ); - -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.2-3.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.2-3.js deleted file mode 100644 index d4b48fed35..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.2-3.js +++ /dev/null @@ -1,146 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.3.2-3.js'; - -/** - 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 gTestcases array must be global. -var SECTION = "15.9.3.1"; -var TITLE = "Date( year, month, date, hours, minutes, seconds )"; -startTest(); - -writeHeaderToLog( SECTION+" " +TITLE ); - -// 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] ); - -test(); - -function addNewTestCase( DateCase, DateString, ResultArray ) { - //adjust hard-coded ResultArray for tester's timezone instead of PST - adjustResultArray(ResultArray); - - new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() ); - -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.2-4.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.2-4.js deleted file mode 100644 index 1b2757cd9a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.2-4.js +++ /dev/null @@ -1,143 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.3.2-4.js'; - -/** - 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 gTestcases array must be global. -var SECTION = "15.9.3.1"; -var TITLE = "Date( year, month, date, hours, minutes, seconds )"; -startTest(); - -writeHeaderToLog( SECTION+" " +TITLE ); - -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] ); - -test(); - -function addNewTestCase( DateCase, DateString, ResultArray ) { - //adjust hard-coded ResultArray for tester's timezone instead of PST - adjustResultArray(ResultArray); - - new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() ); - -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.2-5.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.2-5.js deleted file mode 100644 index 09d6272c6f..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.2-5.js +++ /dev/null @@ -1,140 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.3.2-5.js'; - -/** - 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 gTestcases array must be global. -var SECTION = "15.9.3.1"; -var TITLE = "Date( year, month, date, hours, minutes, seconds )"; -startTest(); - -writeHeaderToLog( SECTION+" " +TITLE ); - -// Dates around Jan 1, 2005 - -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] ); - -test(); - -function addNewTestCase( DateCase, DateString, ResultArray ) { -//adjust hard-coded ResultArray for tester's timezone instead of PST - adjustResultArray(ResultArray); - - new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() ); - -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.8-1.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.8-1.js deleted file mode 100644 index d48199ccba..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.8-1.js +++ /dev/null @@ -1,155 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.3.8-1.js'; - -/** - 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 gTestcases array must be global. -var gTc= 0; -var TITLE = "Date constructor: new Date( value )"; -var SECTION = "15.9.3.8"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION +" " + TITLE ); - -// all the "ResultArrays" below are hard-coded to Pacific Standard Time values - -var TZ_ADJUST = -TZ_PST * 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] ); - -test(); - -function addNewTestCase( DateCase, DateString, ResultArray ) { - //adjust hard-coded ResultArray for tester's timezone instead of PST - adjustResultArray(ResultArray, 'msMode'); - - - new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() ); - new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() ); - new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.8-2.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.8-2.js deleted file mode 100644 index f9d8d36d04..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.8-2.js +++ /dev/null @@ -1,153 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.3.8-2.js'; - -/** - 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 gTestcases array must be global. -var gTc= 0; -var TITLE = "Date constructor: new Date( value )"; -var SECTION = "15.9.3.8"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION +" " + TITLE ); - -// all the "ResultArrays" below are hard-coded to Pacific Standard Time values - -var TZ_ADJUST = -TZ_PST * 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] ); - -test(); - -function addNewTestCase( DateCase, DateString, ResultArray ) { - //adjust hard-coded ResultArray for tester's timezone instead of PST - adjustResultArray(ResultArray, 'msMode'); - - new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() ); - new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() ); - new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.8-3.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.8-3.js deleted file mode 100644 index c3042a8216..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.8-3.js +++ /dev/null @@ -1,160 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.3.8-3.js'; - -/** - 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 gTestcases array must be global. -var gTc= 0; -var TITLE = "Date constructor: new Date( value )"; -var SECTION = "15.9.3.8"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION +" " + TITLE ); - -// all the "ResultArrays" below are hard-coded to Pacific Standard Time values - -var TZ_ADJUST = -TZ_PST * 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] ); - -test(); - -function addNewTestCase( DateCase, DateString, ResultArray ) { - //adjust hard-coded ResultArray for tester's timezone instead of PST - adjustResultArray(ResultArray, 'msMode'); - - new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() ); - new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() ); - new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.8-4.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.8-4.js deleted file mode 100644 index c3a1eae7dc..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.8-4.js +++ /dev/null @@ -1,161 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.3.8-4.js'; - -/** - 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 gTestcases array must be global. -var gTc= 0; -var TITLE = "Date constructor: new Date( value )"; -var SECTION = "15.9.3.8"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION +" " + TITLE ); - -// all the "ResultArrays" below are hard-coded to Pacific Standard Time values - -var TZ_ADJUST = -TZ_PST * msPerHour; - -// Dates around Feb 29, 2000 - -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] ); - -test(); - -function addNewTestCase( DateCase, DateString, ResultArray ) { - //adjust hard-coded ResultArray for tester's timezone instead of PST - adjustResultArray(ResultArray, 'msMode'); - - new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() ); - new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() ); - new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.8-5.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.8-5.js deleted file mode 100644 index 405842c79f..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.3.8-5.js +++ /dev/null @@ -1,161 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.3.8-5.js'; - -/** - 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 gTestcases array must be global. -var gTc= 0; -var TITLE = "Date constructor: new Date( value )"; -var SECTION = "15.9.3.8"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION +" " + TITLE ); - -// all the "ResultArrays" below are hard-coded to Pacific Standard Time values - -var TZ_ADJUST = -TZ_PST * 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] ); - -test(); - -function addNewTestCase( DateCase, DateString, ResultArray ) { - //adjust hard-coded ResultArray for tester's timezone instead of PST - adjustResultArray(ResultArray, 'msMode'); - - new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() ); - new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() ); - new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.4.2-1.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.4.2-1.js deleted file mode 100644 index 4b269f264f..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.4.2-1.js +++ /dev/null @@ -1,81 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.4.2-1.js'; - -/** - * 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. diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.4.2.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.4.2.js deleted file mode 100644 index 5a518e6442..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.4.2.js +++ /dev/null @@ -1,191 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.4.2.js'; - -/** - 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 gTestcases array must be global. -writeHeaderToLog("15.9.4.2 Date.parse()" ); - -// 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 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 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] ); - - -test(); - -function addNewTestCase( DateCase, DateString, ResultArray ) { - DateCase = DateCase; - - new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() ); - new TestCase( SECTION, "Date.parse(" + DateCase.toString() +")", Math.floor(ResultArray[TIME]/1000)*1000, Date.parse(DateCase.toString()) ); - new TestCase( SECTION, "Date.parse(" + DateCase.toGMTString() +")", Math.floor(ResultArray[TIME]/1000)*1000, Date.parse(DateCase.toGMTString()) ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.4.3.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.4.3.js deleted file mode 100644 index b0549588aa..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.4.3.js +++ /dev/null @@ -1,186 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.4.3.js'; - -var SECTION = "15.9.4.3"; -var TITLE = "Date.UTC( year, month, date, hours, minutes, seconds, ms )"; -startTest(); - -// 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) ); - -test(); - -function addNewTestCase( DateCase, DateString, ExpectDate) { - DateCase = DateCase; - - new TestCase( SECTION, DateString, ExpectDate.value, DateCase ); - new TestCase( SECTION, DateString, ExpectDate.value, DateCase ); -} - -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)) ); -} - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.1.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.1.js deleted file mode 100644 index 3185a7c4e5..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.1.js +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.1.js'; - -/** - 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); - -new TestCase( SECTION, - "Date.prototype.constructor == Date", - true, - Date.prototype.constructor == Date ); -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-1.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-1.js deleted file mode 100644 index cd73d288c9..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-1.js +++ /dev/null @@ -1,85 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.10-1.js'; - -/** - 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); - -addTestCase( TIME_NOW ); - -new TestCase( SECTION, - "(new Date(NaN)).getDate()", - NaN, - (new Date(NaN)).getDate() ); - -new TestCase( SECTION, - "Date.prototype.getDate.length", - 0, - Date.prototype.getDate.length ); -test(); - -function addTestCase( t ) { - var start = TimeFromYear(YearFromTime(t)); - var stop = TimeFromYear(YearFromTime(t) + 1); - - for (var d = start; d < stop; d += msPerDay) - { - new TestCase( SECTION, - "(new Date("+d+")).getDate()", - DateFromTime(LocalTime(d)), - (new Date(d)).getDate() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-10.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-10.js deleted file mode 100644 index 4142635486..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-10.js +++ /dev/null @@ -1,89 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.10-10.js'; - -/** - 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); - -// some daylight savings time cases - -var DST_START_1998 = GetDSTStart(TimeFromYear(1998)); - -addTestCase( DST_START_1998+1 ); - -new TestCase( SECTION, - "(new Date(NaN)).getDate()", - NaN, - (new Date(NaN)).getDate() ); - -new TestCase( SECTION, - "Date.prototype.getDate.length", - 0, - Date.prototype.getDate.length ); -test(); - -function addTestCase( t ) { - var start = TimeFromYear(YearFromTime(t)); - var stop = TimeFromYear(YearFromTime(t) + 1); - - for (var d = start; d < stop; d += msPerDay) - { - new TestCase( SECTION, - "(new Date("+d+")).getDate()", - DateFromTime(LocalTime(d)), - (new Date(d)).getDate() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-11.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-11.js deleted file mode 100644 index dfadc18838..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-11.js +++ /dev/null @@ -1,89 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.10-11.js'; - -/** - 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); - -// some daylight savings time cases - -var DST_END_1998 = GetDSTEnd(TimeFromYear(1998)); - -addTestCase( DST_END_1998 ); - -new TestCase( SECTION, - "(new Date(NaN)).getDate()", - NaN, - (new Date(NaN)).getDate() ); - -new TestCase( SECTION, - "Date.prototype.getDate.length", - 0, - Date.prototype.getDate.length ); -test(); - -function addTestCase( t ) { - var start = TimeFromYear(YearFromTime(t)); - var stop = TimeFromYear(YearFromTime(t) + 1); - - for (var d = start; d < stop; d += msPerDay) - { - new TestCase( SECTION, - "(new Date("+d+")).getDate()", - DateFromTime(LocalTime(d)), - (new Date(d)).getDate() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-12.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-12.js deleted file mode 100644 index 2557108faf..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-12.js +++ /dev/null @@ -1,89 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.10-12.js'; - -/** - 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); - -// some daylight savings time cases - -var DST_END_1998 = GetDSTEnd(TimeFromYear(1998)); - -addTestCase( DST_END_1998-1 ); - -new TestCase( SECTION, - "(new Date(NaN)).getDate()", - NaN, - (new Date(NaN)).getDate() ); - -new TestCase( SECTION, - "Date.prototype.getDate.length", - 0, - Date.prototype.getDate.length ); -test(); - -function addTestCase( t ) { - var start = TimeFromYear(YearFromTime(t)); - var stop = TimeFromYear(YearFromTime(t) + 1); - - for (var d = start; d < stop; d += msPerDay) - { - new TestCase( SECTION, - "(new Date("+d+")).getDate()", - DateFromTime(LocalTime(d)), - (new Date(d)).getDate() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-13.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-13.js deleted file mode 100644 index e0e2402ebd..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-13.js +++ /dev/null @@ -1,89 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.10-13.js'; - -/** - 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); - -// some daylight savings time cases - -var DST_END_1998 = GetDSTEnd(TimeFromYear(1998)); - -addTestCase( DST_END_1998+1 ); - -new TestCase( SECTION, - "(new Date(NaN)).getDate()", - NaN, - (new Date(NaN)).getDate() ); - -new TestCase( SECTION, - "Date.prototype.getDate.length", - 0, - Date.prototype.getDate.length ); -test(); - -function addTestCase( t ) { - var start = TimeFromYear(YearFromTime(t)); - var stop = TimeFromYear(YearFromTime(t) + 1); - - for (var d = start; d < stop; d += msPerDay) - { - new TestCase( SECTION, - "(new Date("+d+")).getDate()", - DateFromTime(LocalTime(d)), - (new Date(d)).getDate() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-2.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-2.js deleted file mode 100644 index e44cfcc5d7..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-2.js +++ /dev/null @@ -1,87 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.10-2.js'; - -/** - 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); - -// addTestCase( TIME_0000 ); - -new TestCase( SECTION, - "(new Date(NaN)).getDate()", - NaN, - (new Date(NaN)).getDate() ); - -new TestCase( SECTION, - "Date.prototype.getDate.length", - 0, - Date.prototype.getDate.length ); -test(); - -function addTestCase( t ) { - print(t); - var start = TimeFromYear(YearFromTime(t)); - var stop = TimeFromYear(YearFromTime(t) + 1); - - for (var d = start; d < stop; d += msPerDay) - { - print(start, stop, d); - new TestCase( SECTION, - "(new Date("+d+")).getDate()", - DateFromTime(LocalTime(d)), - (new Date(d)).getDate() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-3.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-3.js deleted file mode 100644 index 325c9bfaf2..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-3.js +++ /dev/null @@ -1,85 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.10-3.js'; - -/** - 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); - -addTestCase( TIME_1970 ); - -new TestCase( SECTION, - "(new Date(NaN)).getDate()", - NaN, - (new Date(NaN)).getDate() ); - -new TestCase( SECTION, - "Date.prototype.getDate.length", - 0, - Date.prototype.getDate.length ); -test(); - -function addTestCase( t ) { - var start = TimeFromYear(YearFromTime(t)); - var stop = TimeFromYear(YearFromTime(t) + 1); - - for (var d = start; d < stop; d += msPerDay) - { - new TestCase( SECTION, - "(new Date("+d+")).getDate()", - DateFromTime(LocalTime(d)), - (new Date(d)).getDate() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-4.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-4.js deleted file mode 100644 index 41676c2658..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-4.js +++ /dev/null @@ -1,85 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.10-4.js'; - -/** - 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); - -addTestCase( TIME_1900 ); - -new TestCase( SECTION, - "(new Date(NaN)).getDate()", - NaN, - (new Date(NaN)).getDate() ); - -new TestCase( SECTION, - "Date.prototype.getDate.length", - 0, - Date.prototype.getDate.length ); -test(); - -function addTestCase( t ) { - var start = TimeFromYear(YearFromTime(t)); - var stop = TimeFromYear(YearFromTime(t) + 1); - - for (var d = start; d < stop; d += msPerDay) - { - new TestCase( SECTION, - "(new Date("+d+")).getDate()", - DateFromTime(LocalTime(d)), - (new Date(d)).getDate() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-5.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-5.js deleted file mode 100644 index f17b0a0b29..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-5.js +++ /dev/null @@ -1,85 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.10-5.js'; - -/** - 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); - -addTestCase( TIME_2000 ); - -new TestCase( SECTION, - "(new Date(NaN)).getDate()", - NaN, - (new Date(NaN)).getDate() ); - -new TestCase( SECTION, - "Date.prototype.getDate.length", - 0, - Date.prototype.getDate.length ); -test(); - -function addTestCase( t ) { - var start = TimeFromYear(YearFromTime(t)); - var stop = TimeFromYear(YearFromTime(t) + 1); - - for (var d = start; d < stop; d += msPerDay) - { - new TestCase( SECTION, - "(new Date("+d+")).getDate()", - DateFromTime(LocalTime(d)), - (new Date(d)).getDate() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-6.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-6.js deleted file mode 100644 index 84f57b8805..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-6.js +++ /dev/null @@ -1,85 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.10-6.js'; - -/** - 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); - -addTestCase( UTC_FEB_29_2000 ); - -new TestCase( SECTION, - "(new Date(NaN)).getDate()", - NaN, - (new Date(NaN)).getDate() ); - -new TestCase( SECTION, - "Date.prototype.getDate.length", - 0, - Date.prototype.getDate.length ); -test(); - -function addTestCase( t ) { - var start = TimeFromYear(YearFromTime(t)); - var stop = TimeFromYear(YearFromTime(t) + 1); - - for (var d = start; d < stop; d += msPerDay) - { - new TestCase( SECTION, - "(new Date("+d+")).getDate()", - DateFromTime(LocalTime(d)), - (new Date(d)).getDate() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-7.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-7.js deleted file mode 100644 index 96ba89078a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-7.js +++ /dev/null @@ -1,85 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.10-7.js'; - -/** - 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); - -addTestCase( UTC_JAN_1_2005 ); - -new TestCase( SECTION, - "(new Date(NaN)).getDate()", - NaN, - (new Date(NaN)).getDate() ); - -new TestCase( SECTION, - "Date.prototype.getDate.length", - 0, - Date.prototype.getDate.length ); -test(); - -function addTestCase( t ) { - var start = TimeFromYear(YearFromTime(t)); - var stop = TimeFromYear(YearFromTime(t) + 1); - - for (var d = start; d < stop; d += msPerDay) - { - new TestCase( SECTION, - "(new Date("+d+")).getDate()", - DateFromTime(LocalTime(d)), - (new Date(d)).getDate() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-8.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-8.js deleted file mode 100644 index bae220a94e..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-8.js +++ /dev/null @@ -1,89 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.10-8.js'; - -/** - 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); - -// some daylight savings time cases - -var DST_START_1998 = GetDSTStart(TimeFromYear(1998)); - -addTestCase( DST_START_1998 ); - -new TestCase( SECTION, - "(new Date(NaN)).getDate()", - NaN, - (new Date(NaN)).getDate() ); - -new TestCase( SECTION, - "Date.prototype.getDate.length", - 0, - Date.prototype.getDate.length ); -test(); - -function addTestCase( t ) { - var start = TimeFromYear(YearFromTime(t)); - var stop = TimeFromYear(YearFromTime(t) + 1); - - for (var d = start; d < stop; d += msPerDay) - { - new TestCase( SECTION, - "(new Date("+d+")).getDate()", - DateFromTime(LocalTime(d)), - (new Date(d)).getDate() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-9.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-9.js deleted file mode 100644 index a1cee0e682..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.10-9.js +++ /dev/null @@ -1,89 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.10-9.js'; - -/** - 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); - -// some daylight savings time cases - -var DST_START_1998 = GetDSTStart(TimeFromYear(1998)); - -addTestCase( DST_START_1998-1 ); - -new TestCase( SECTION, - "(new Date(NaN)).getDate()", - NaN, - (new Date(NaN)).getDate() ); - -new TestCase( SECTION, - "Date.prototype.getDate.length", - 0, - Date.prototype.getDate.length ); -test(); - -function addTestCase( t ) { - var start = TimeFromYear(YearFromTime(t)); - var stop = TimeFromYear(YearFromTime(t) + 1); - - for (var d = start; d < stop; d += msPerDay) - { - new TestCase( SECTION, - "(new Date("+d+")).getDate()", - DateFromTime(LocalTime(d)), - (new Date(d)).getDate() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.11-1.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.11-1.js deleted file mode 100644 index 5c2439ba09..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.11-1.js +++ /dev/null @@ -1,76 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.11-1.js'; - -/** - 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); - -addTestCase( TIME_NOW ); - -test(); - -function addTestCase( t ) { - var start = TimeFromYear(YearFromTime(t)); - var stop = TimeFromYear(YearFromTime(t) + 1); - - for (var d = start; d < stop; d += msPerDay) - { - new TestCase( SECTION, - "(new Date("+d+")).getUTCDate()", - DateFromTime(d), - (new Date(d)).getUTCDate() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.11-2.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.11-2.js deleted file mode 100644 index d9eda4cfc1..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.11-2.js +++ /dev/null @@ -1,76 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.11-2.js'; - -/** - 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); - -// addTestCase( TIME_0000 ); - -test(); - -function addTestCase( t ) { - var start = TimeFromYear(YearFromTime(t)); - var stop = TimeFromYear(YearFromTime(t) + 1); - - for (var d = start; d < stop; d += msPerDay) - { - new TestCase( SECTION, - "(new Date("+d+")).getUTCDate()", - DateFromTime(d), - (new Date(d)).getUTCDate() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.11-3.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.11-3.js deleted file mode 100644 index d35f8d5967..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.11-3.js +++ /dev/null @@ -1,76 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.11-3.js'; - -/** - 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); - -addTestCase( TIME_1970 ); - -test(); - -function addTestCase( t ) { - var start = TimeFromYear(YearFromTime(t)); - var stop = TimeFromYear(YearFromTime(t) + 1); - - for (var d = start; d < stop; d += msPerDay) - { - new TestCase( SECTION, - "(new Date("+d+")).getUTCDate()", - DateFromTime(d), - (new Date(d)).getUTCDate() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.11-4.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.11-4.js deleted file mode 100644 index 4fc9f2ee65..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.11-4.js +++ /dev/null @@ -1,76 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.11-4.js'; - -/** - 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); - -addTestCase( TIME_1900 ); - -test(); - -function addTestCase( t ) { - var start = TimeFromYear(YearFromTime(t)); - var stop = TimeFromYear(YearFromTime(t) + 1); - - for (var d = start; d < stop; d += msPerDay) - { - new TestCase( SECTION, - "(new Date("+d+")).getUTCDate()", - DateFromTime(d), - (new Date(d)).getUTCDate() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.11-5.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.11-5.js deleted file mode 100644 index cee93a770b..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.11-5.js +++ /dev/null @@ -1,76 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.11-5.js'; - -/** - 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); - -addTestCase( TIME_2000 ); - -test(); - -function addTestCase( t ) { - var start = TimeFromYear(YearFromTime(t)); - var stop = TimeFromYear(YearFromTime(t) + 1); - - for (var d = start; d < stop; d += msPerDay) - { - new TestCase( SECTION, - "(new Date("+d+")).getUTCDate()", - DateFromTime(d), - (new Date(d)).getUTCDate() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.11-6.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.11-6.js deleted file mode 100644 index b756e43a7e..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.11-6.js +++ /dev/null @@ -1,76 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.11-6.js'; - -/** - 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); - -addTestCase( UTC_FEB_29_2000 ); - -test(); - -function addTestCase( t ) { - var start = TimeFromYear(YearFromTime(t)); - var stop = TimeFromYear(YearFromTime(t) + 1); - - for (var d = start; d < stop; d += msPerDay) - { - new TestCase( SECTION, - "(new Date("+d+")).getUTCDate()", - DateFromTime(d), - (new Date(d)).getUTCDate() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.11-7.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.11-7.js deleted file mode 100644 index 65c5c1c765..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.11-7.js +++ /dev/null @@ -1,76 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.11-7.js'; - -/** - 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); - -addTestCase( UTC_JAN_1_2005 ); - -test(); - -function addTestCase( t ) { - var start = TimeFromYear(YearFromTime(t)); - var stop = TimeFromYear(YearFromTime(t) + 1); - - for (var d = start; d < stop; d += msPerDay) - { - new TestCase( SECTION, - "(new Date("+d+")).getUTCDate()", - DateFromTime(d), - (new Date(d)).getUTCDate() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.12-1.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.12-1.js deleted file mode 100644 index c173ffb193..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.12-1.js +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.12-1.js'; - -/** - File Name: 15.9.5.12.js - ECMA Section: 15.9.5.12 - Description: Date.prototype.getDay - - - 1. Let t be this time value. - 2. If t is NaN, return NaN. - 3. Return WeekDay(LocalTime(t)). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.12"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getDay()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -addTestCase( TIME_NOW ); - -test(); - -function addTestCase( t ) { - var start = TimeFromYear(YearFromTime(t)); - var stop = TimeFromYear(YearFromTime(t) + 1); - - for (var d = start; d < stop; d += msPerDay) - { - new TestCase( SECTION, - "(new Date("+d+")).getDay()", - WeekDay((LocalTime(d))), - (new Date(d)).getDay() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.12-2.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.12-2.js deleted file mode 100644 index 5967da6ef6..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.12-2.js +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.12-2.js'; - -/** - File Name: 15.9.5.12.js - ECMA Section: 15.9.5.12 - Description: Date.prototype.getDay - - - 1. Let t be this time value. - 2. If t is NaN, return NaN. - 3. Return WeekDay(LocalTime(t)). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.12"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getDay()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -// addTestCase( TIME_0000 ); - -test(); - -function addTestCase( t ) { - var start = TimeFromYear(YearFromTime(t)); - var stop = TimeFromYear(YearFromTime(t) + 1); - - for (var d = start; d < stop; d += msPerDay) - { - new TestCase( SECTION, - "(new Date("+d+")).getDay()", - WeekDay((LocalTime(d))), - (new Date(d)).getDay() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.12-3.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.12-3.js deleted file mode 100644 index 9ce226665c..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.12-3.js +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.12-3.js'; - -/** - File Name: 15.9.5.12.js - ECMA Section: 15.9.5.12 - Description: Date.prototype.getDay - - - 1. Let t be this time value. - 2. If t is NaN, return NaN. - 3. Return WeekDay(LocalTime(t)). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.12"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getDay()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -addTestCase( TIME_1970 ); - -test(); - -function addTestCase( t ) { - var start = TimeFromYear(YearFromTime(t)); - var stop = TimeFromYear(YearFromTime(t) + 1); - - for (var d = start; d < stop; d += msPerDay) - { - new TestCase( SECTION, - "(new Date("+d+")).getDay()", - WeekDay((LocalTime(d))), - (new Date(d)).getDay() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.12-4.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.12-4.js deleted file mode 100644 index 3b752a1767..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.12-4.js +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.12-4.js'; - -/** - File Name: 15.9.5.12.js - ECMA Section: 15.9.5.12 - Description: Date.prototype.getDay - - - 1. Let t be this time value. - 2. If t is NaN, return NaN. - 3. Return WeekDay(LocalTime(t)). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.12"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getDay()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -addTestCase( TIME_1900 ); - -test(); - -function addTestCase( t ) { - var start = TimeFromYear(YearFromTime(t)); - var stop = TimeFromYear(YearFromTime(t) + 1); - - for (var d = start; d < stop; d += msPerDay) - { - new TestCase( SECTION, - "(new Date("+d+")).getDay()", - WeekDay((LocalTime(d))), - (new Date(d)).getDay() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.12-5.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.12-5.js deleted file mode 100644 index 7fe153a5ea..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.12-5.js +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.12-5.js'; - -/** - File Name: 15.9.5.12.js - ECMA Section: 15.9.5.12 - Description: Date.prototype.getDay - - - 1. Let t be this time value. - 2. If t is NaN, return NaN. - 3. Return WeekDay(LocalTime(t)). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.12"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getDay()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -addTestCase( TIME_2000 ); - -test(); - -function addTestCase( t ) { - var start = TimeFromYear(YearFromTime(t)); - var stop = TimeFromYear(YearFromTime(t) + 1); - - for (var d = start; d < stop; d += msPerDay) - { - new TestCase( SECTION, - "(new Date("+d+")).getDay()", - WeekDay((LocalTime(d))), - (new Date(d)).getDay() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.12-6.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.12-6.js deleted file mode 100644 index 663ab81b2d..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.12-6.js +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.12-6.js'; - -/** - File Name: 15.9.5.12.js - ECMA Section: 15.9.5.12 - Description: Date.prototype.getDay - - - 1. Let t be this time value. - 2. If t is NaN, return NaN. - 3. Return WeekDay(LocalTime(t)). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.12"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getDay()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -addTestCase( UTC_FEB_29_2000 ); - -test(); - -function addTestCase( t ) { - var start = TimeFromYear(YearFromTime(t)); - var stop = TimeFromYear(YearFromTime(t) + 1); - - for (var d = start; d < stop; d += msPerDay) - { - new TestCase( SECTION, - "(new Date("+d+")).getDay()", - WeekDay((LocalTime(d))), - (new Date(d)).getDay() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.12-7.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.12-7.js deleted file mode 100644 index 23a0218058..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.12-7.js +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.12-7.js'; - -/** - File Name: 15.9.5.12.js - ECMA Section: 15.9.5.12 - Description: Date.prototype.getDay - - - 1. Let t be this time value. - 2. If t is NaN, return NaN. - 3. Return WeekDay(LocalTime(t)). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.12"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getDay()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -addTestCase( UTC_JAN_1_2005 ); - -test(); - -function addTestCase( t ) { - var start = TimeFromYear(YearFromTime(t)); - var stop = TimeFromYear(YearFromTime(t) + 1); - - for (var d = start; d < stop; d += msPerDay) - { - new TestCase( SECTION, - "(new Date("+d+")).getDay()", - WeekDay((LocalTime(d))), - (new Date(d)).getDay() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.12-8.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.12-8.js deleted file mode 100644 index 4f3f66e0ce..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.12-8.js +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.12-8.js'; - -/** - File Name: 15.9.5.12 - ECMA Section: 15.9.5.12 - Description: Date.prototype.getDay - - - 1. Let t be this time value. - 2. If t is NaN, return NaN. - 3. Return WeekDay(LocalTime(t)). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.12"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getDay()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "(new Date(NaN)).getDay()", - NaN, - (new Date(NaN)).getDay() ); - -new TestCase( SECTION, - "Date.prototype.getDay.length", - 0, - Date.prototype.getDay.length ); -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.13-1.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.13-1.js deleted file mode 100644 index d82f39a7e0..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.13-1.js +++ /dev/null @@ -1,79 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.13-1.js'; - -/** - File Name: 15.9.5.13.js - ECMA Section: 15.9.5.13 - Description: Date.prototype.getUTCDay - - 1.Let t be this time value. - 2.If t is NaN, return NaN. - 3.Return WeekDay(t). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.13"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getUTCDay()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -// get the current time -var now = (new Date()).valueOf(); - -addTestCase( now ); - -test(); - -function addTestCase( t ) { - var start = TimeFromYear(YearFromTime(t)); - var stop = TimeFromYear(YearFromTime(t) + 1); - - for (var d = start; d < stop; d += msPerDay) - { - new TestCase( SECTION, - "(new Date("+d+")).getUTCDay()", - WeekDay((d)), - (new Date(d)).getUTCDay() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.13-2.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.13-2.js deleted file mode 100644 index 13f0d080e3..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.13-2.js +++ /dev/null @@ -1,76 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.13-2.js'; - -/** - File Name: 15.9.5.13 - ECMA Section: 15.9.5.13 - Description: Date.prototype.getUTCDay - - 1.Let t be this time value. - 2.If t is NaN, return NaN. - 3.Return WeekDay(t). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.13"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getUTCDay()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -addTestCase( TIME_0000 ); - -test(); - -function addTestCase( t ) { - var start = TimeFromYear(YearFromTime(t)); - var stop = TimeFromYear(YearFromTime(t) + 1); - - for (var d = start; d < stop; d += msPerDay) - { - new TestCase( SECTION, - "(new Date("+d+")).getUTCDay()", - WeekDay((d)), - (new Date(d)).getUTCDay() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.13-3.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.13-3.js deleted file mode 100644 index 7c78072ee5..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.13-3.js +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.13-3.js'; - -/** - File Name: 15.9.5.13.js - ECMA Section: 15.9.5.13 - Description: Date.prototype.getUTCDay - - 1.Let t be this time value. - 2.If t is NaN, return NaN. - 3.Return WeekDay(t). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.13"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getUTCDay()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -addTestCase( TIME_1970 ); - -test(); - -function addTestCase( t ) { - var start = TimeFromYear(YearFromTime(t)); - var stop = TimeFromYear(YearFromTime(t) + 1); - - for (var d = start; d < stop; d += msPerDay) - { - new TestCase( SECTION, - "(new Date("+d+")).getUTCDay()", - WeekDay((d)), - (new Date(d)).getUTCDay() ); - } -} - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.13-4.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.13-4.js deleted file mode 100644 index bcfcfb8c00..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.13-4.js +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.13-4.js'; - -/** - File Name: 15.9.5.13.js - ECMA Section: 15.9.5.13 - Description: Date.prototype.getUTCDay - - 1.Let t be this time value. - 2.If t is NaN, return NaN. - 3.Return WeekDay(t). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.13"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getUTCDay()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -addTestCase( TIME_1900 ); - -test(); - -function addTestCase( t ) { - var start = TimeFromYear(YearFromTime(t)); - var stop = TimeFromYear(YearFromTime(t) + 1); - - for (var d = start; d < stop; d += msPerDay) - { - new TestCase( SECTION, - "(new Date("+d+")).getUTCDay()", - WeekDay((d)), - (new Date(d)).getUTCDay() ); - } -} - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.13-5.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.13-5.js deleted file mode 100644 index 96b1acb170..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.13-5.js +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.13-5.js'; - -/** - File Name: 15.9.5.13.js - ECMA Section: 15.9.5.13 - Description: Date.prototype.getUTCDay - - 1.Let t be this time value. - 2.If t is NaN, return NaN. - 3.Return WeekDay(t). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.13"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getUTCDay()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -addTestCase( TIME_2000 ); - -test(); - -function addTestCase( t ) { - var start = TimeFromYear(YearFromTime(t)); - var stop = TimeFromYear(YearFromTime(t) + 1); - - for (var d = start; d < stop; d += msPerDay) - { - new TestCase( SECTION, - "(new Date("+d+")).getUTCDay()", - WeekDay((d)), - (new Date(d)).getUTCDay() ); - } -} - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.13-6.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.13-6.js deleted file mode 100644 index e749ad6b7f..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.13-6.js +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.13-6.js'; - -/** - File Name: 15.9.5.13.js - ECMA Section: 15.9.5.13 - Description: Date.prototype.getUTCDay - - 1.Let t be this time value. - 2.If t is NaN, return NaN. - 3.Return WeekDay(t). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.13"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getUTCDay()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -addTestCase( UTC_FEB_29_2000 ); - -test(); - -function addTestCase( t ) { - var start = TimeFromYear(YearFromTime(t)); - var stop = TimeFromYear(YearFromTime(t) + 1); - - for (var d = start; d < stop; d += msPerDay) - { - new TestCase( SECTION, - "(new Date("+d+")).getUTCDay()", - WeekDay((d)), - (new Date(d)).getUTCDay() ); - } -} - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.13-7.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.13-7.js deleted file mode 100644 index 63607f8d2d..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.13-7.js +++ /dev/null @@ -1,76 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.13-7.js'; - -/** - File Name: 15.9.5.13.js - ECMA Section: 15.9.5.13 - Description: Date.prototype.getUTCDay - - 1.Let t be this time value. - 2.If t is NaN, return NaN. - 3.Return WeekDay(t). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.13"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getUTCDay()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -addTestCase( UTC_JAN_1_2005 ); - -test(); - -function addTestCase( t ) { - var start = TimeFromYear(YearFromTime(t)); - var stop = TimeFromYear(YearFromTime(t) + 1); - - for (var d = start; d < stop; d += msPerDay) - { - new TestCase( SECTION, - "(new Date("+d+")).getUTCDay()", - WeekDay((d)), - (new Date(d)).getUTCDay() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.13-8.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.13-8.js deleted file mode 100644 index 75d42b200b..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.13-8.js +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.13-8.js'; - -/** - File Name: 15.9.5.13.js - ECMA Section: 15.9.5.13 - Description: Date.prototype.getUTCDay - - 1.Let t be this time value. - 2.If t is NaN, return NaN. - 3.Return WeekDay(t). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.13"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getUTCDay()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "(new Date(NaN)).getUTCDay()", - NaN, - (new Date(NaN)).getUTCDay() ); - -new TestCase( SECTION, - "Date.prototype.getUTCDay.length", - 0, - Date.prototype.getUTCDay.length ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.14.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.14.js deleted file mode 100644 index 5a3f8216da..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.14.js +++ /dev/null @@ -1,87 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.14.js'; - -/** - File Name: 15.9.5.14.js - ECMA Section: 15.9.5.14 - Description: Date.prototype.getHours - 1. Let t be this time value. - 2. If t is NaN, return NaN. - 3. Return HourFromTime(LocalTime(t)). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.14"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getHours()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -addTestCase( TIME_NOW ); -addTestCase( TIME_0000 ); -addTestCase( TIME_1970 ); -addTestCase( TIME_1900 ); -addTestCase( TIME_2000 ); -addTestCase( UTC_FEB_29_2000 ); -addTestCase( UTC_JAN_1_2005 ); - -new TestCase( SECTION, - "(new Date(NaN)).getHours()", - NaN, - (new Date(NaN)).getHours() ); - -new TestCase( SECTION, - "Date.prototype.getHours.length", - 0, - Date.prototype.getHours.length ); -test(); - -function addTestCase( t ) { - for ( h = 0; h < 24; h+=4 ) { - t += msPerHour; - new TestCase( SECTION, - "(new Date("+t+")).getHours()", - HourFromTime((LocalTime(t))), - (new Date(t)).getHours() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.15.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.15.js deleted file mode 100644 index ca2babd7ef..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.15.js +++ /dev/null @@ -1,88 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.15.js'; - -/** - File Name: 15.9.5.15.js - ECMA Section: 15.9.5.15 - Description: Date.prototype.getUTCHours - - 1. Let t be this time value. - 2. If t is NaN, return NaN. - 3. Return HourFromTime(t). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.15"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getUTCHours()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -addTestCase( TIME_NOW ); -addTestCase( TIME_0000 ); -addTestCase( TIME_1970 ); -addTestCase( TIME_1900 ); -addTestCase( TIME_2000 ); -addTestCase( UTC_FEB_29_2000 ); -addTestCase( UTC_JAN_1_2005 ); - -new TestCase( SECTION, - "(new Date(NaN)).getUTCHours()", - NaN, - (new Date(NaN)).getUTCHours() ); - -new TestCase( SECTION, - "Date.prototype.getUTCHours.length", - 0, - Date.prototype.getUTCHours.length ); -test(); - -function addTestCase( t ) { - for ( h = 0; h < 24; h+=3 ) { - t += msPerHour; - new TestCase( SECTION, - "(new Date("+t+")).getUTCHours()", - HourFromTime((t)), - (new Date(t)).getUTCHours() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.16.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.16.js deleted file mode 100644 index e791b74eae..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.16.js +++ /dev/null @@ -1,87 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.16.js'; - -/** - File Name: 15.9.5.16.js - ECMA Section: 15.9.5.16 - Description: Date.prototype.getMinutes - 1.Let t be this time value. - 2.If t is NaN, return NaN. - 3.Return MinFromTime(LocalTime(t)). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.16"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getMinutes()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -addTestCase( TIME_NOW ); -addTestCase( TIME_0000 ); -addTestCase( TIME_1970 ); -addTestCase( TIME_1900 ); -addTestCase( TIME_2000 ); -addTestCase( UTC_FEB_29_2000 ); -addTestCase( UTC_JAN_1_2005 ); - -new TestCase( SECTION, - "(new Date(NaN)).getMinutes()", - NaN, - (new Date(NaN)).getMinutes() ); - -new TestCase( SECTION, - "Date.prototype.getMinutes.length", - 0, - Date.prototype.getMinutes.length ); -test(); - -function addTestCase( t ) { - for ( m = 0; m <= 60; m+=10 ) { - t += msPerMinute; - new TestCase( SECTION, - "(new Date("+t+")).getMinutes()", - MinFromTime((LocalTime(t))), - (new Date(t)).getMinutes() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.17.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.17.js deleted file mode 100644 index e9b30c3eed..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.17.js +++ /dev/null @@ -1,88 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.17.js'; - -/** - File Name: 15.9.5.17.js - ECMA Section: 15.9.5.17 - Description: Date.prototype.getUTCMinutes - - 1. Let t be this time value. - 2. If t is NaN, return NaN. - 3. Return MinFromTime(t). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.17"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getUTCMinutes()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -addTestCase( TIME_NOW ); -addTestCase( TIME_0000 ); -addTestCase( TIME_1970 ); -addTestCase( TIME_1900 ); -addTestCase( TIME_2000 ); -addTestCase( UTC_FEB_29_2000 ); -addTestCase( UTC_JAN_1_2005 ); - -new TestCase( SECTION, - "(new Date(NaN)).getUTCMinutes()", - NaN, - (new Date(NaN)).getUTCMinutes() ); - -new TestCase( SECTION, - "Date.prototype.getUTCMinutes.length", - 0, - Date.prototype.getUTCMinutes.length ); -test(); - -function addTestCase( t ) { - for ( m = 0; m <= 60; m+=10 ) { - t += msPerMinute; - new TestCase( SECTION, - "(new Date("+t+")).getUTCMinutes()", - MinFromTime(t), - (new Date(t)).getUTCMinutes() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.18.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.18.js deleted file mode 100644 index f735168efe..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.18.js +++ /dev/null @@ -1,88 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.18.js'; - -/** - File Name: 15.9.5.18.js - ECMA Section: 15.9.5.18 - Description: Date.prototype.getSeconds - - 1. Let t be this time value. - 2. If t is NaN, return NaN. - 3. Return SecFromTime(LocalTime(t)). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.18"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getSeconds()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -addTestCase( TIME_NOW ); -addTestCase( TIME_0000 ); -addTestCase( TIME_1970 ); -addTestCase( TIME_1900 ); -addTestCase( TIME_2000 ); -addTestCase( UTC_FEB_29_2000 ); -addTestCase( UTC_JAN_1_2005 ); - -new TestCase( SECTION, - "(new Date(NaN)).getSeconds()", - NaN, - (new Date(NaN)).getSeconds() ); - -new TestCase( SECTION, - "Date.prototype.getSeconds.length", - 0, - Date.prototype.getSeconds.length ); -test(); - -function addTestCase( t ) { - for ( m = 0; m <= 60; m+=10 ) { - t += 1000; - new TestCase( SECTION, - "(new Date("+t+")).getSeconds()", - SecFromTime(LocalTime(t)), - (new Date(t)).getSeconds() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.19.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.19.js deleted file mode 100644 index 2a0d7430ef..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.19.js +++ /dev/null @@ -1,88 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.19.js'; - -/** - File Name: 15.9.5.19.js - ECMA Section: 15.9.5.19 - Description: Date.prototype.getUTCSeconds - - 1. Let t be this time value. - 2. If t is NaN, return NaN. - 3. Return SecFromTime(t). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.19"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getUTCSeconds()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -addTestCase( TIME_NOW ); -addTestCase( TIME_0000 ); -addTestCase( TIME_1970 ); -addTestCase( TIME_1900 ); -addTestCase( TIME_2000 ); -addTestCase( UTC_FEB_29_2000 ); -addTestCase( UTC_JAN_1_2005 ); - -new TestCase( SECTION, - "(new Date(NaN)).getUTCSeconds()", - NaN, - (new Date(NaN)).getUTCSeconds() ); - -new TestCase( SECTION, - "Date.prototype.getUTCSeconds.length", - 0, - Date.prototype.getUTCSeconds.length ); -test(); - -function addTestCase( t ) { - for ( m = 0; m <= 60; m+=10 ) { - t += 1000; - new TestCase( SECTION, - "(new Date("+t+")).getUTCSeconds()", - SecFromTime(t), - (new Date(t)).getUTCSeconds() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.2-1.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.2-1.js deleted file mode 100644 index 7ec3c691c8..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.2-1.js +++ /dev/null @@ -1,151 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.2-1.js'; - -/** - File Name: 15.9.5.2.js - ECMA Section: 15.9.5.2 Date.prototype.toString - Description: - This function returns a string value. The contents of the string are - implementation dependent, but are intended to represent the Date in a - convenient, human-readable form in the current time zone. - - The toString function is not generic; it generates a runtime error if its - this value is not a Date object. Therefore it cannot be transferred to - other kinds of objects for use as a method. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.toString"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "Date.prototype.toString.length", - 0, - Date.prototype.toString.length ); - -var now = new Date(); - -// can't test the content of the string, but can verify that the string is -// parsable by Date.parse - -new TestCase( SECTION, - "Math.abs(Date.parse(now.toString()) - now.valueOf()) < 1000", - true, - Math.abs(Date.parse(now.toString()) - now.valueOf()) < 1000 ); - -new TestCase( SECTION, - "typeof now.toString()", - "string", - typeof now.toString() ); -// 1970 - -new TestCase( SECTION, - "Date.parse( (new Date(0)).toString() )", - 0, - Date.parse( (new Date(0)).toString() ) ); - -new TestCase( SECTION, - "Date.parse( (new Date("+TZ_ADJUST+")).toString() )", - TZ_ADJUST, - Date.parse( (new Date(TZ_ADJUST)).toString() ) ); - -// 1900 -new TestCase( SECTION, - "Date.parse( (new Date("+TIME_1900+")).toString() )", - TIME_1900, - Date.parse( (new Date(TIME_1900)).toString() ) ); - -new TestCase( SECTION, - "Date.parse( (new Date("+TIME_1900 -TZ_ADJUST+")).toString() )", - TIME_1900 -TZ_ADJUST, - Date.parse( (new Date(TIME_1900 -TZ_ADJUST)).toString() ) ); - -// 2000 -new TestCase( SECTION, - "Date.parse( (new Date("+TIME_2000+")).toString() )", - TIME_2000, - Date.parse( (new Date(TIME_2000)).toString() ) ); - -new TestCase( SECTION, - "Date.parse( (new Date("+TIME_2000 -TZ_ADJUST+")).toString() )", - TIME_2000 -TZ_ADJUST, - Date.parse( (new Date(TIME_2000 -TZ_ADJUST)).toString() ) ); - -// 29 Feb 2000 - -new TestCase( SECTION, - "Date.parse( (new Date("+UTC_FEB_29_2000+")).toString() )", - UTC_FEB_29_2000, - Date.parse( (new Date(UTC_FEB_29_2000)).toString() ) ); - -new TestCase( SECTION, - "Date.parse( (new Date("+(UTC_FEB_29_2000-1000)+")).toString() )", - UTC_FEB_29_2000-1000, - Date.parse( (new Date(UTC_FEB_29_2000-1000)).toString() ) ); - - -new TestCase( SECTION, - "Date.parse( (new Date("+(UTC_FEB_29_2000-TZ_ADJUST)+")).toString() )", - UTC_FEB_29_2000-TZ_ADJUST, - Date.parse( (new Date(UTC_FEB_29_2000-TZ_ADJUST)).toString() ) ); -// 2O05 - -new TestCase( SECTION, - "Date.parse( (new Date("+UTC_JAN_1_2005+")).toString() )", - UTC_JAN_1_2005, - Date.parse( (new Date(UTC_JAN_1_2005)).toString() ) ); - -new TestCase( SECTION, - "Date.parse( (new Date("+(UTC_JAN_1_2005-1000)+")).toString() )", - UTC_JAN_1_2005-1000, - Date.parse( (new Date(UTC_JAN_1_2005-1000)).toString() ) ); - -new TestCase( SECTION, - "Date.parse( (new Date("+(UTC_JAN_1_2005-TZ_ADJUST)+")).toString() )", - UTC_JAN_1_2005-TZ_ADJUST, - Date.parse( (new Date(UTC_JAN_1_2005-TZ_ADJUST)).toString() ) ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.2-2-n.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.2-2-n.js deleted file mode 100644 index c5513b8168..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.2-2-n.js +++ /dev/null @@ -1,84 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.2-2-n.js'; - -/** - File Name: 15.9.5.2-2.js - ECMA Section: 15.9.5.2 Date.prototype.toString - Description: - This function returns a string value. The contents of the string are - implementation dependent, but are intended to represent the Date in a - convenient, human-readable form in the current time zone. - - The toString function is not generic; it generates a runtime error if its - this value is not a Date object. Therefore it cannot be transferred to - other kinds of objects for use as a method. - - - This verifies that calling toString on an object that is not a string - generates a runtime error. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.2-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.toString"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var OBJ = new MyObject( new Date(0) ); - -DESCRIPTION = "var OBJ = new MyObject( new Date(0) ); OBJ.toString()"; -EXPECTED = "error"; - -new TestCase( SECTION, - "var OBJ = new MyObject( new Date(0) ); OBJ.toString()", - "error", - eval("OBJ.toString()") ); -test(); - -function MyObject( value ) { - this.value = value; - this.valueOf = new Function( "return this.value" ); - this.toString = Date.prototype.toString; - return this; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.2.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.2.js deleted file mode 100644 index ef2df0510b..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.2.js +++ /dev/null @@ -1,151 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.2.js'; - -/** - File Name: 15.9.5.2.js - ECMA Section: 15.9.5.2 Date.prototype.toString - Description: - This function returns a string value. The contents of the string are - implementation dependent, but are intended to represent the Date in a - convenient, human-readable form in the current time zone. - - The toString function is not generic; it generates a runtime error if its - this value is not a Date object. Therefore it cannot be transferred to - other kinds of objects for use as a method. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.toString"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "Date.prototype.toString.length", - 0, - Date.prototype.toString.length ); - -var now = new Date(); - -// can't test the content of the string, but can verify that the string is -// parsable by Date.parse - -new TestCase( SECTION, - "Math.abs(Date.parse(now.toString()) - now.valueOf()) < 1000", - true, - Math.abs(Date.parse(now.toString()) - now.valueOf()) < 1000 ); - -new TestCase( SECTION, - "typeof now.toString()", - "string", - typeof now.toString() ); -// 1970 - -new TestCase( SECTION, - "Date.parse( (new Date(0)).toString() )", - 0, - Date.parse( (new Date(0)).toString() ) ); - -new TestCase( SECTION, - "Date.parse( (new Date("+TZ_ADJUST+")).toString() )", - TZ_ADJUST, - Date.parse( (new Date(TZ_ADJUST)).toString() ) ); - -// 1900 -new TestCase( SECTION, - "Date.parse( (new Date("+TIME_1900+")).toString() )", - TIME_1900, - Date.parse( (new Date(TIME_1900)).toString() ) ); - -new TestCase( SECTION, - "Date.parse( (new Date("+TIME_1900 -TZ_ADJUST+")).toString() )", - TIME_1900 -TZ_ADJUST, - Date.parse( (new Date(TIME_1900 -TZ_ADJUST)).toString() ) ); - -// 2000 -new TestCase( SECTION, - "Date.parse( (new Date("+TIME_2000+")).toString() )", - TIME_2000, - Date.parse( (new Date(TIME_2000)).toString() ) ); - -new TestCase( SECTION, - "Date.parse( (new Date("+TIME_2000 -TZ_ADJUST+")).toString() )", - TIME_2000 -TZ_ADJUST, - Date.parse( (new Date(TIME_2000 -TZ_ADJUST)).toString() ) ); - -// 29 Feb 2000 - -new TestCase( SECTION, - "Date.parse( (new Date("+UTC_FEB_29_2000+")).toString() )", - UTC_FEB_29_2000, - Date.parse( (new Date(UTC_FEB_29_2000)).toString() ) ); - -new TestCase( SECTION, - "Date.parse( (new Date("+(UTC_FEB_29_2000-1000)+")).toString() )", - UTC_FEB_29_2000-1000, - Date.parse( (new Date(UTC_FEB_29_2000-1000)).toString() ) ); - - -new TestCase( SECTION, - "Date.parse( (new Date("+(UTC_FEB_29_2000-TZ_ADJUST)+")).toString() )", - UTC_FEB_29_2000-TZ_ADJUST, - Date.parse( (new Date(UTC_FEB_29_2000-TZ_ADJUST)).toString() ) ); -// 2O05 - -new TestCase( SECTION, - "Date.parse( (new Date("+UTC_JAN_1_2005+")).toString() )", - UTC_JAN_1_2005, - Date.parse( (new Date(UTC_JAN_1_2005)).toString() ) ); - -new TestCase( SECTION, - "Date.parse( (new Date("+(UTC_JAN_1_2005-1000)+")).toString() )", - UTC_JAN_1_2005-1000, - Date.parse( (new Date(UTC_JAN_1_2005-1000)).toString() ) ); - -new TestCase( SECTION, - "Date.parse( (new Date("+(UTC_JAN_1_2005-TZ_ADJUST)+")).toString() )", - UTC_JAN_1_2005-TZ_ADJUST, - Date.parse( (new Date(UTC_JAN_1_2005-TZ_ADJUST)).toString() ) ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.20.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.20.js deleted file mode 100644 index fb3dafde2c..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.20.js +++ /dev/null @@ -1,88 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.20.js'; - -/** - File Name: 15.9.5.20.js - ECMA Section: 15.9.5.20 - Description: Date.prototype.getMilliseconds - - 1. Let t be this time value. - 2. If t is NaN, return NaN. - 3. Return msFromTime(LocalTime(t)). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.20"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getMilliseconds()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -addTestCase( TIME_NOW ); -addTestCase( TIME_0000 ); -addTestCase( TIME_1970 ); -addTestCase( TIME_1900 ); -addTestCase( TIME_2000 ); -addTestCase( UTC_FEB_29_2000 ); -addTestCase( UTC_JAN_1_2005 ); - -new TestCase( SECTION, - "(new Date(NaN)).getMilliseconds()", - NaN, - (new Date(NaN)).getMilliseconds() ); - -new TestCase( SECTION, - "Date.prototype.getMilliseconds.length", - 0, - Date.prototype.getMilliseconds.length ); -test(); - -function addTestCase( t ) { - for ( m = 0; m <= 1000; m+=100 ) { - t++; - new TestCase( SECTION, - "(new Date("+t+")).getMilliseconds()", - msFromTime(LocalTime(t)), - (new Date(t)).getMilliseconds() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.21-1.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.21-1.js deleted file mode 100644 index 4eea164305..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.21-1.js +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.21-1.js'; - -/** - File Name: 15.9.5.21.js - ECMA Section: 15.9.5.21 - Description: Date.prototype.getUTCMilliseconds - - 1. Let t be this time value. - 2. If t is NaN, return NaN. - 3. Return msFromTime(t). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.21"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getUTCMilliseconds()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -addTestCase( TIME_NOW ); - -test(); - -function addTestCase( t ) { - new TestCase( SECTION, - "(new Date("+t+")).getUTCMilliseconds()", - msFromTime(t), - (new Date(t)).getUTCMilliseconds() ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.21-2.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.21-2.js deleted file mode 100644 index 37b443117a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.21-2.js +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.21-2.js'; - -/** - File Name: 15.9.5.21.js - ECMA Section: 15.9.5.21 - Description: Date.prototype.getUTCMilliseconds - - 1. Let t be this time value. - 2. If t is NaN, return NaN. - 3. Return msFromTime(t). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.21"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getUTCMilliseconds()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -addTestCase( TIME_0000 ); - -test(); - -function addTestCase( t ) { - new TestCase( SECTION, - "(new Date("+t+")).getUTCMilliseconds()", - msFromTime(t), - (new Date(t)).getUTCMilliseconds() ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.21-3.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.21-3.js deleted file mode 100644 index d1d96cb7a3..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.21-3.js +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.21-3.js'; - -/** - File Name: 15.9.5.21.js - ECMA Section: 15.9.5.21 - Description: Date.prototype.getUTCMilliseconds - - 1. Let t be this time value. - 2. If t is NaN, return NaN. - 3. Return msFromTime(t). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.21"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getUTCMilliseconds()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -addTestCase( TIME_1970 ); - -test(); - -function addTestCase( t ) { - new TestCase( SECTION, - "(new Date("+t+")).getUTCMilliseconds()", - msFromTime(t), - (new Date(t)).getUTCMilliseconds() ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.21-4.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.21-4.js deleted file mode 100644 index b7dfa656ff..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.21-4.js +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.21-4.js'; - -/** - File Name: 15.9.5.21.js - ECMA Section: 15.9.5.21 - Description: Date.prototype.getUTCMilliseconds - - 1. Let t be this time value. - 2. If t is NaN, return NaN. - 3. Return msFromTime(t). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.21"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getUTCMilliseconds()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -addTestCase( TIME_1900 ); - -test(); - -function addTestCase( t ) { - new TestCase( SECTION, - "(new Date("+t+")).getUTCMilliseconds()", - msFromTime(t), - (new Date(t)).getUTCMilliseconds() ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.21-5.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.21-5.js deleted file mode 100644 index ca90b1784a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.21-5.js +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.21-5.js'; - -/** - File Name: 15.9.5.21.js - ECMA Section: 15.9.5.21 - Description: Date.prototype.getUTCMilliseconds - - 1. Let t be this time value. - 2. If t is NaN, return NaN. - 3. Return msFromTime(t). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.21"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getUTCMilliseconds()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -addTestCase( TIME_2000 ); - -test(); - -function addTestCase( t ) { - new TestCase( SECTION, - "(new Date("+t+")).getUTCMilliseconds()", - msFromTime(t), - (new Date(t)).getUTCMilliseconds() ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.21-6.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.21-6.js deleted file mode 100644 index 9178ae76cf..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.21-6.js +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.21-6.js'; - -/** - File Name: 15.9.5.21.js - ECMA Section: 15.9.5.21 - Description: Date.prototype.getUTCMilliseconds - - 1. Let t be this time value. - 2. If t is NaN, return NaN. - 3. Return msFromTime(t). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.21"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getUTCMilliseconds()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -addTestCase( UTC_FEB_29_2000 ); - -test(); - -function addTestCase( t ) { - new TestCase( SECTION, - "(new Date("+t+")).getUTCMilliseconds()", - msFromTime(t), - (new Date(t)).getUTCMilliseconds() ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.21-7.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.21-7.js deleted file mode 100644 index c4d0a4b615..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.21-7.js +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.21-7.js'; - -/** - File Name: 15.9.5.21.js - ECMA Section: 15.9.5.21 - Description: Date.prototype.getUTCMilliseconds - - 1. Let t be this time value. - 2. If t is NaN, return NaN. - 3. Return msFromTime(t). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.21"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getUTCMilliseconds()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -addTestCase( UTC_JAN_1_2005 ); - -test(); - -function addTestCase( t ) { - new TestCase( SECTION, - "(new Date("+t+")).getUTCMilliseconds()", - msFromTime(t), - (new Date(t)).getUTCMilliseconds() ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.21-8.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.21-8.js deleted file mode 100644 index 624d6c6bcb..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.21-8.js +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.21-8.js'; - -/** - File Name: 15.9.5.21.js - ECMA Section: 15.9.5.21 - Description: Date.prototype.getUTCMilliseconds - - 1. Let t be this time value. - 2. If t is NaN, return NaN. - 3. Return msFromTime(t). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.21"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getUTCMilliseconds()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "(new Date(NaN)).getUTCMilliseconds()", - NaN, - (new Date(NaN)).getUTCMilliseconds() ); - -new TestCase( SECTION, - "Date.prototype.getUTCMilliseconds.length", - 0, - Date.prototype.getUTCMilliseconds.length ); -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.22-1.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.22-1.js deleted file mode 100644 index 5d2a6934ab..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.22-1.js +++ /dev/null @@ -1,89 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.22-1.js'; - -/** - File Name: 15.9.5.22.js - ECMA Section: 15.9.5.22 - Description: Date.prototype.getTimezoneOffset - - Returns the difference between local time and UTC time in minutes. - 1. Let t be this time value. - 2. If t is NaN, return NaN. - 3. Return (t - LocalTime(t)) / msPerMinute. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.22"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getTimezoneOffset()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -addTestCase( TIME_0000 ); -addTestCase( TIME_1970 ); -addTestCase( TIME_1900 ); -addTestCase( TIME_2000 ); -addTestCase( UTC_FEB_29_2000 ); -addTestCase( UTC_JAN_1_2005 ); - -new TestCase( SECTION, - "(new Date(NaN)).getTimezoneOffset()", - NaN, - (new Date(NaN)).getTimezoneOffset() ); - -new TestCase( SECTION, - "Date.prototype.getTimezoneOffset.length", - 0, - Date.prototype.getTimezoneOffset.length ); - -test(); - -function addTestCase( t ) { - for ( m = 0; m <= 1000; m+=100 ) { - t++; - new TestCase( SECTION, - "(new Date("+t+")).getTimezoneOffset()", - (t - LocalTime(t)) / msPerMinute, - (new Date(t)).getTimezoneOffset() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.22-2.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.22-2.js deleted file mode 100644 index b828b468d1..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.22-2.js +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.22-2.js'; - -/** - File Name: 15.9.5.22.js - ECMA Section: 15.9.5.22 - Description: Date.prototype.getTimezoneOffset - - Returns the difference between local time and UTC time in minutes. - 1. Let t be this time value. - 2. If t is NaN, return NaN. - 3. Return (t - LocalTime(t)) / msPerMinute. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.22"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getTimezoneOffset()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -addTestCase( TIME_0000 ); - -test(); - -function addTestCase( t ) { - for ( m = 0; m <= 1000; m+=100 ) { - t++; - new TestCase( SECTION, - "(new Date("+t+")).getTimezoneOffset()", - (t - LocalTime(t)) / msPerMinute, - (new Date(t)).getTimezoneOffset() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.22-3.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.22-3.js deleted file mode 100644 index 26c059368d..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.22-3.js +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.22-3.js'; - -/** - File Name: 15.9.5.22.js - ECMA Section: 15.9.5.22 - Description: Date.prototype.getTimezoneOffset - - Returns the difference between local time and UTC time in minutes. - 1. Let t be this time value. - 2. If t is NaN, return NaN. - 3. Return (t - LocalTime(t)) / msPerMinute. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.22"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getTimezoneOffset()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -addTestCase( TIME_1970 ); - -test(); - -function addTestCase( t ) { - for ( m = 0; m <= 1000; m+=100 ) { - t++; - new TestCase( SECTION, - "(new Date("+t+")).getTimezoneOffset()", - (t - LocalTime(t)) / msPerMinute, - (new Date(t)).getTimezoneOffset() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.22-4.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.22-4.js deleted file mode 100644 index 96b9771d59..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.22-4.js +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.22-4.js'; - -/** - File Name: 15.9.5.22.js - ECMA Section: 15.9.5.22 - Description: Date.prototype.getTimezoneOffset - - Returns the difference between local time and UTC time in minutes. - 1. Let t be this time value. - 2. If t is NaN, return NaN. - 3. Return (t - LocalTime(t)) / msPerMinute. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.22"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getTimezoneOffset()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -addTestCase( TIME_1900 ); - -test(); - -function addTestCase( t ) { - for ( m = 0; m <= 1000; m+=100 ) { - t++; - new TestCase( SECTION, - "(new Date("+t+")).getTimezoneOffset()", - (t - LocalTime(t)) / msPerMinute, - (new Date(t)).getTimezoneOffset() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.22-5.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.22-5.js deleted file mode 100644 index a943aa5699..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.22-5.js +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.22-5.js'; - -/** - File Name: 15.9.5.22.js - ECMA Section: 15.9.5.22 - Description: Date.prototype.getTimezoneOffset - - Returns the difference between local time and UTC time in minutes. - 1. Let t be this time value. - 2. If t is NaN, return NaN. - 3. Return (t - LocalTime(t)) / msPerMinute. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.22"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getTimezoneOffset()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -addTestCase( TIME_2000 ); - -test(); - -function addTestCase( t ) { - for ( m = 0; m <= 1000; m+=100 ) { - t++; - new TestCase( SECTION, - "(new Date("+t+")).getTimezoneOffset()", - (t - LocalTime(t)) / msPerMinute, - (new Date(t)).getTimezoneOffset() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.22-6.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.22-6.js deleted file mode 100644 index 96b39d2c43..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.22-6.js +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.22-6.js'; - -/** - File Name: 15.9.5.22.js - ECMA Section: 15.9.5.22 - Description: Date.prototype.getTimezoneOffset - - Returns the difference between local time and UTC time in minutes. - 1. Let t be this time value. - 2. If t is NaN, return NaN. - 3. Return (t - LocalTime(t)) / msPerMinute. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.22"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getTimezoneOffset()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -addTestCase( UTC_FEB_29_2000 ); - -test(); - -function addTestCase( t ) { - for ( m = 0; m <= 1000; m+=100 ) { - t++; - new TestCase( SECTION, - "(new Date("+t+")).getTimezoneOffset()", - (t - LocalTime(t)) / msPerMinute, - (new Date(t)).getTimezoneOffset() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.22-7.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.22-7.js deleted file mode 100644 index 7fa0ecaf14..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.22-7.js +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.22-7.js'; - -/** - File Name: 15.9.5.22.js - ECMA Section: 15.9.5.22 - Description: Date.prototype.getTimezoneOffset - - Returns the difference between local time and UTC time in minutes. - 1. Let t be this time value. - 2. If t is NaN, return NaN. - 3. Return (t - LocalTime(t)) / msPerMinute. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.22"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getTimezoneOffset()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -addTestCase( UTC_JAN_1_2005 ); - -test(); - -function addTestCase( t ) { - for ( m = 0; m <= 1000; m+=100 ) { - t++; - new TestCase( SECTION, - "(new Date("+t+")).getTimezoneOffset()", - (t - LocalTime(t)) / msPerMinute, - (new Date(t)).getTimezoneOffset() ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.22-8.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.22-8.js deleted file mode 100644 index 3eca9d8ec9..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.22-8.js +++ /dev/null @@ -1,72 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.22-8.js'; - -/** - File Name: 15.9.5.22.js - ECMA Section: 15.9.5.22 - Description: Date.prototype.getTimezoneOffset - - Returns the difference between local time and UTC time in minutes. - 1. Let t be this time value. - 2. If t is NaN, return NaN. - 3. Return (t - LocalTime(t)) / msPerMinute. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.22"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getTimezoneOffset()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "(new Date(NaN)).getTimezoneOffset()", - NaN, - (new Date(NaN)).getTimezoneOffset() ); - -new TestCase( SECTION, - "Date.prototype.getTimezoneOffset.length", - 0, - Date.prototype.getTimezoneOffset.length ); -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-1.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-1.js deleted file mode 100644 index e4a228e2cd..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-1.js +++ /dev/null @@ -1,139 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.23-1.js'; - -/** - File Name: 15.9.5.23-1.js - ECMA Section: 15.9.5.23 Date.prototype.setTime(time) - Description: - - 1. If the this value is not a Date object, generate a runtime error. - 2. Call ToNumber(time). - 3. Call TimeClip(Result(1)). - 4. Set the [[Value]] property of the this value to Result(2). - 5. Return the value of the [[Value]] property of the this value. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "15.9.5.23-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.setTime()"; - -writeHeaderToLog( SECTION + " Date.prototype.setTime(time)"); - -var now = "now"; -addTestCase( 0, 0 ); - -test(); - -function addTestCase( startTime, setTime ) { - if ( startTime == "now" ) { - DateCase = new Date(); - } else { - DateCase = new Date( startTime ); - } - - DateCase.setTime( setTime ); - var DateString = "var d = new Date("+startTime+"); d.setTime("+setTime+"); d" ; - var UTCDate = UTCDateFromTime ( Number(setTime) ); - var LocalDate = LocalDateFromTime( Number(setTime) ); - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes, DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds, DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;"+DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} - -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - d.day = WeekDay( d.value ); - return (d); -} - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-10.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-10.js deleted file mode 100644 index d4cb298d19..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-10.js +++ /dev/null @@ -1,139 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.23-10.js'; - -/** - File Name: 15.9.5.23-1.js - ECMA Section: 15.9.5.23 Date.prototype.setTime(time) - Description: - - 1. If the this value is not a Date object, generate a runtime error. - 2. Call ToNumber(time). - 3. Call TimeClip(Result(1)). - 4. Set the [[Value]] property of the this value to Result(2). - 5. Return the value of the [[Value]] property of the this value. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "15.9.5.23-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.setTime()"; - -writeHeaderToLog( SECTION + " Date.prototype.setTime(time)"); - -var now = "now"; -addTestCase( now, -2208988800000 ); - -test(); - -function addTestCase( startTime, setTime ) { - if ( startTime == "now" ) { - DateCase = new Date(); - } else { - DateCase = new Date( startTime ); - } - - DateCase.setTime( setTime ); - var DateString = "var d = new Date("+startTime+"); d.setTime("+setTime+"); d" ; - var UTCDate = UTCDateFromTime ( Number(setTime) ); - var LocalDate = LocalDateFromTime( Number(setTime) ); - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes, DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds, DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;"+DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} - -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - d.day = WeekDay( d.value ); - return (d); -} - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-11.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-11.js deleted file mode 100644 index ca28015766..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-11.js +++ /dev/null @@ -1,140 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.23-11.js'; - -/** - File Name: 15.9.5.23-1.js - ECMA Section: 15.9.5.23 Date.prototype.setTime(time) - Description: - - 1. If the this value is not a Date object, generate a runtime error. - 2. Call ToNumber(time). - 3. Call TimeClip(Result(1)). - 4. Set the [[Value]] property of the this value to Result(2). - 5. Return the value of the [[Value]] property of the this value. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "15.9.5.23-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.setTime()"; - -writeHeaderToLog( SECTION + " Date.prototype.setTime(time)"); - -var now = "now"; -addTestCase( now, -86400000 ); - -test(); - - -function addTestCase( startTime, setTime ) { - if ( startTime == "now" ) { - DateCase = new Date(); - } else { - DateCase = new Date( startTime ); - } - - DateCase.setTime( setTime ); - var DateString = "var d = new Date("+startTime+"); d.setTime("+setTime+"); d" ; - var UTCDate = UTCDateFromTime ( Number(setTime) ); - var LocalDate = LocalDateFromTime( Number(setTime) ); - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes, DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds, DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;"+DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - d.day = WeekDay( d.value ); - return (d); -} - - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-12.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-12.js deleted file mode 100644 index a03f599567..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-12.js +++ /dev/null @@ -1,137 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.23-12.js'; - -/** - File Name: 15.9.5.23-1.js - ECMA Section: 15.9.5.23 Date.prototype.setTime(time) - Description: - - 1. If the this value is not a Date object, generate a runtime error. - 2. Call ToNumber(time). - 3. Call TimeClip(Result(1)). - 4. Set the [[Value]] property of the this value to Result(2). - 5. Return the value of the [[Value]] property of the this value. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "15.9.5.23-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.setTime()"; - -writeHeaderToLog( SECTION + " Date.prototype.setTime(time)"); - -var now = "now"; -addTestCase( now, 946684800000 ); - -test(); - -function addTestCase( startTime, setTime ) { - if ( startTime == "now" ) { - DateCase = new Date(); - } else { - DateCase = new Date( startTime ); - } - - DateCase.setTime( setTime ); - var DateString = "var d = new Date("+startTime+"); d.setTime("+setTime+"); d" ; - var UTCDate = UTCDateFromTime ( Number(setTime) ); - var LocalDate = LocalDateFromTime( Number(setTime) ); - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes, DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds, DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;"+DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - d.day = WeekDay( d.value ); - return (d); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-13.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-13.js deleted file mode 100644 index a68128770c..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-13.js +++ /dev/null @@ -1,137 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.23-13.js'; - -/** - File Name: 15.9.5.23-1.js - ECMA Section: 15.9.5.23 Date.prototype.setTime(time) - Description: - - 1. If the this value is not a Date object, generate a runtime error. - 2. Call ToNumber(time). - 3. Call TimeClip(Result(1)). - 4. Set the [[Value]] property of the this value to Result(2). - 5. Return the value of the [[Value]] property of the this value. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "15.9.5.23-13"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.setTime()"; - -writeHeaderToLog( SECTION + " Date.prototype.setTime(time)"); - -var now = "now"; -addTestCase( now, -2208988800000 ); - -test(); - -function addTestCase( startTime, setTime ) { - if ( startTime == "now" ) { - DateCase = new Date(); - } else { - DateCase = new Date( startTime ); - } - - DateCase.setTime( setTime ); - var DateString = "var d = new Date("+startTime+"); d.setTime("+setTime+"); d" ; - var UTCDate = UTCDateFromTime ( Number(setTime) ); - var LocalDate = LocalDateFromTime( Number(setTime) ); - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes, DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds, DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;"+DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - d.day = WeekDay( d.value ); - return (d); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-14.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-14.js deleted file mode 100644 index 1923d715e3..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-14.js +++ /dev/null @@ -1,137 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.23-14.js'; - -/** - File Name: 15.9.5.23-1.js - ECMA Section: 15.9.5.23 Date.prototype.setTime(time) - Description: - - 1. If the this value is not a Date object, generate a runtime error. - 2. Call ToNumber(time). - 3. Call TimeClip(Result(1)). - 4. Set the [[Value]] property of the this value to Result(2). - 5. Return the value of the [[Value]] property of the this value. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "15.9.5.23-14"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.setTime()"; - -writeHeaderToLog( SECTION + " Date.prototype.setTime(time)"); - -var now = "now"; -addTestCase( now, 946684800000 ); - -test(); - -function addTestCase( startTime, setTime ) { - if ( startTime == "now" ) { - DateCase = new Date(); - } else { - DateCase = new Date( startTime ); - } - - DateCase.setTime( setTime ); - var DateString = "var d = new Date("+startTime+"); d.setTime("+setTime+"); d" ; - var UTCDate = UTCDateFromTime ( Number(setTime) ); - var LocalDate = LocalDateFromTime( Number(setTime) ); - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes, DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds, DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;"+DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - d.day = WeekDay( d.value ); - return (d); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-15.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-15.js deleted file mode 100644 index 31680eb386..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-15.js +++ /dev/null @@ -1,137 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.23-15.js'; - -/** - File Name: 15.9.5.23-1.js - ECMA Section: 15.9.5.23 Date.prototype.setTime(time) - Description: - - 1. If the this value is not a Date object, generate a runtime error. - 2. Call ToNumber(time). - 3. Call TimeClip(Result(1)). - 4. Set the [[Value]] property of the this value to Result(2). - 5. Return the value of the [[Value]] property of the this value. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "15.9.5.23-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.setTime()"; - -writeHeaderToLog( SECTION + " Date.prototype.setTime(time)"); - -var now = "now"; -addTestCase( now, 0 ); - -test(); - -function addTestCase( startTime, setTime ) { - if ( startTime == "now" ) { - DateCase = new Date(); - } else { - DateCase = new Date( startTime ); - } - - DateCase.setTime( setTime ); - var DateString = "var d = new Date("+startTime+"); d.setTime("+setTime+"); d" ; - var UTCDate = UTCDateFromTime ( Number(setTime) ); - var LocalDate = LocalDateFromTime( Number(setTime) ); - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes, DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds, DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;"+DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - d.day = WeekDay( d.value ); - return (d); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-16.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-16.js deleted file mode 100644 index 3dc0726ca8..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-16.js +++ /dev/null @@ -1,137 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.23-16.js'; - -/** - File Name: 15.9.5.23-1.js - ECMA Section: 15.9.5.23 Date.prototype.setTime(time) - Description: - - 1. If the this value is not a Date object, generate a runtime error. - 2. Call ToNumber(time). - 3. Call TimeClip(Result(1)). - 4. Set the [[Value]] property of the this value to Result(2). - 5. Return the value of the [[Value]] property of the this value. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "15.9.5.23-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.setTime()"; - -writeHeaderToLog( SECTION + " Date.prototype.setTime(time)"); - -var now = "now"; -addTestCase( now, String( TIME_1900 ) ); - -test(); - -function addTestCase( startTime, setTime ) { - if ( startTime == "now" ) { - DateCase = new Date(); - } else { - DateCase = new Date( startTime ); - } - - DateCase.setTime( setTime ); - var DateString = "var d = new Date("+startTime+"); d.setTime("+setTime+"); d" ; - var UTCDate = UTCDateFromTime ( Number(setTime) ); - var LocalDate = LocalDateFromTime( Number(setTime) ); - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes, DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds, DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;"+DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - d.day = WeekDay( d.value ); - return (d); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-17.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-17.js deleted file mode 100644 index 605f4cf00b..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-17.js +++ /dev/null @@ -1,137 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.23-17.js'; - -/** - File Name: 15.9.5.23-1.js - ECMA Section: 15.9.5.23 Date.prototype.setTime(time) - Description: - - 1. If the this value is not a Date object, generate a runtime error. - 2. Call ToNumber(time). - 3. Call TimeClip(Result(1)). - 4. Set the [[Value]] property of the this value to Result(2). - 5. Return the value of the [[Value]] property of the this value. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "15.9.5.23-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.setTime()"; - -writeHeaderToLog( SECTION + " Date.prototype.setTime(time)"); - -var now = "now"; -addTestCase( now, String( TZ_DIFF* msPerHour ) ); - -test(); - -function addTestCase( startTime, setTime ) { - if ( startTime == "now" ) { - DateCase = new Date(); - } else { - DateCase = new Date( startTime ); - } - - DateCase.setTime( setTime ); - var DateString = "var d = new Date("+startTime+"); d.setTime("+setTime+"); d" ; - var UTCDate = UTCDateFromTime ( Number(setTime) ); - var LocalDate = LocalDateFromTime( Number(setTime) ); - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes, DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds, DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;"+DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - d.day = WeekDay( d.value ); - return (d); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-18.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-18.js deleted file mode 100644 index e30d0f05c8..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-18.js +++ /dev/null @@ -1,137 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.23-18.js'; - -/** - File Name: 15.9.5.23-1.js - ECMA Section: 15.9.5.23 Date.prototype.setTime(time) - Description: - - 1. If the this value is not a Date object, generate a runtime error. - 2. Call ToNumber(time). - 3. Call TimeClip(Result(1)). - 4. Set the [[Value]] property of the this value to Result(2). - 5. Return the value of the [[Value]] property of the this value. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "15.9.5.23-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.setTime()"; - -writeHeaderToLog( SECTION + " Date.prototype.setTime(time)"); - -var now = "now"; -addTestCase( now, String( TIME_2000 ) ); - -test(); - -function addTestCase( startTime, setTime ) { - if ( startTime == "now" ) { - DateCase = new Date(); - } else { - DateCase = new Date( startTime ); - } - - DateCase.setTime( setTime ); - var DateString = "var d = new Date("+startTime+"); d.setTime("+setTime+"); d" ; - var UTCDate = UTCDateFromTime ( Number(setTime) ); - var LocalDate = LocalDateFromTime( Number(setTime) ); - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes, DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds, DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;"+DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - d.day = WeekDay( d.value ); - return (d); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-2.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-2.js deleted file mode 100644 index 8086af88d9..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-2.js +++ /dev/null @@ -1,109 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.23-2.js'; - -/** - File Name: 15.9.5.23-2.js - ECMA Section: 15.9.5.23 - Description: Date.prototype.setTime - - 1. If the this value is not a Date object, generate a runtime error. - 2. Call ToNumber(time). - 3. Call TimeClip(Result(1)). - 4. Set the [[Value]] property of the this value to Result(2). - 5. Return the value of the [[Value]] property of the this value. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "15.9.5.23-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.setTime()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -test_times = new Array( TIME_NOW, TIME_1970, TIME_1900, TIME_2000 ); - -for ( var j = 0; j < test_times.length; j++ ) { - addTestCase( new Date(TIME_NOW), test_times[j] ); -} - -new TestCase( SECTION, - "(new Date(NaN)).setTime()", - NaN, - (new Date(NaN)).setTime() ); - -new TestCase( SECTION, - "Date.prototype.setTime.length", - 1, - Date.prototype.setTime.length ); -test(); - -function addTestCase( d, t ) { - new TestCase( SECTION, - "( "+d+" ).setTime("+t+")", - t, - d.setTime(t) ); - - new TestCase( SECTION, - "( "+d+" ).setTime("+(t+1.1)+")", - TimeClip(t+1.1), - d.setTime(t+1.1) ); - - new TestCase( SECTION, - "( "+d+" ).setTime("+(t+1)+")", - t+1, - d.setTime(t+1) ); - - new TestCase( SECTION, - "( "+d+" ).setTime("+(t-1)+")", - t-1, - d.setTime(t-1) ); - - new TestCase( SECTION, - "( "+d+" ).setTime("+(t-TZ_ADJUST)+")", - t-TZ_ADJUST, - d.setTime(t-TZ_ADJUST) ); - - new TestCase( SECTION, - "( "+d+" ).setTime("+(t+TZ_ADJUST)+")", - t+TZ_ADJUST, - d.setTime(t+TZ_ADJUST) ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-3-n.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-3-n.js deleted file mode 100644 index 040604bd0e..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-3-n.js +++ /dev/null @@ -1,79 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.23-3-n.js'; - -/** - File Name: 15.9.5.23-3-n.js - ECMA Section: 15.9.5.23 - Description: Date.prototype.setTime - - 1. If the this value is not a Date object, generate a runtime error. - 2. Call ToNumber(time). - 3. Call TimeClip(Result(1)). - 4. Set the [[Value]] property of the this value to Result(2). - 5. Return the value of the [[Value]] property of the this value. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.23-3-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.setTime()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var MYDATE = new MyDate(TIME_1970); - -DESCRIPTION = "MYDATE.setTime(TIME_2000)"; -EXPECTED = "error"; - -new TestCase( SECTION, - "MYDATE.setTime(TIME_2000)", - "error", - eval("MYDATE.setTime(TIME_2000)") ); - -test(); - -function MyDate(value) { - this.value = value; - this.setTime = Date.prototype.setTime; - return this; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-4.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-4.js deleted file mode 100644 index 39e3dec8d4..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-4.js +++ /dev/null @@ -1,112 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.23-4.js'; - -/** - File Name: 15.9.5.23-2.js - ECMA Section: 15.9.5.23 - Description: Date.prototype.setTime - - 1. If the this value is not a Date object, generate a runtime error. - 2. Call ToNumber(time). - 3. Call TimeClip(Result(1)). - 4. Set the [[Value]] property of the this value to Result(2). - 5. Return the value of the [[Value]] property of the this value. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.23-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.setTime()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -test_times = new Array( TIME_NOW, TIME_0000, TIME_1970, TIME_1900, TIME_2000, - UTC_FEB_29_2000, UTC_JAN_1_2005 ); - - -for ( var j = 0; j < test_times.length; j++ ) { - addTestCase( new Date(TIME_0000), test_times[j] ); -} - -new TestCase( SECTION, - "(new Date(NaN)).setTime()", - NaN, - (new Date(NaN)).setTime() ); - -new TestCase( SECTION, - "Date.prototype.setTime.length", - 1, - Date.prototype.setTime.length ); -test(); - -function addTestCase( d, t ) { - new TestCase( SECTION, - "( "+d+" ).setTime("+t+")", - t, - d.setTime(t) ); - - new TestCase( SECTION, - "( "+d+" ).setTime("+(t+1.1)+")", - TimeClip(t+1.1), - d.setTime(t+1.1) ); - - new TestCase( SECTION, - "( "+d+" ).setTime("+(t+1)+")", - t+1, - d.setTime(t+1) ); - - new TestCase( SECTION, - "( "+d+" ).setTime("+(t-1)+")", - t-1, - d.setTime(t-1) ); - - new TestCase( SECTION, - "( "+d+" ).setTime("+(t-TZ_ADJUST)+")", - t-TZ_ADJUST, - d.setTime(t-TZ_ADJUST) ); - - new TestCase( SECTION, - "( "+d+" ).setTime("+(t+TZ_ADJUST)+")", - t+TZ_ADJUST, - d.setTime(t+TZ_ADJUST) ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-5.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-5.js deleted file mode 100644 index b4317e6a55..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-5.js +++ /dev/null @@ -1,113 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.23-5.js'; - -/** - File Name: 15.9.5.23-2.js - ECMA Section: 15.9.5.23 - Description: Date.prototype.setTime - - 1. If the this value is not a Date object, generate a runtime error. - 2. Call ToNumber(time). - 3. Call TimeClip(Result(1)). - 4. Set the [[Value]] property of the this value to Result(2). - 5. Return the value of the [[Value]] property of the this value. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.23-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.setTime()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -test_times = new Array( TIME_NOW, TIME_0000, TIME_1970, TIME_1900, TIME_2000, - UTC_FEB_29_2000, UTC_JAN_1_2005 ); - - -for ( var j = 0; j < test_times.length; j++ ) { - addTestCase( new Date(TIME_1970), test_times[j] ); -} - - -new TestCase( SECTION, - "(new Date(NaN)).setTime()", - NaN, - (new Date(NaN)).setTime() ); - -new TestCase( SECTION, - "Date.prototype.setTime.length", - 1, - Date.prototype.setTime.length ); -test(); - -function addTestCase( d, t ) { - new TestCase( SECTION, - "( "+d+" ).setTime("+t+")", - t, - d.setTime(t) ); - - new TestCase( SECTION, - "( "+d+" ).setTime("+(t+1.1)+")", - TimeClip(t+1.1), - d.setTime(t+1.1) ); - - new TestCase( SECTION, - "( "+d+" ).setTime("+(t+1)+")", - t+1, - d.setTime(t+1) ); - - new TestCase( SECTION, - "( "+d+" ).setTime("+(t-1)+")", - t-1, - d.setTime(t-1) ); - - new TestCase( SECTION, - "( "+d+" ).setTime("+(t-TZ_ADJUST)+")", - t-TZ_ADJUST, - d.setTime(t-TZ_ADJUST) ); - - new TestCase( SECTION, - "( "+d+" ).setTime("+(t+TZ_ADJUST)+")", - t+TZ_ADJUST, - d.setTime(t+TZ_ADJUST) ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-6.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-6.js deleted file mode 100644 index cc9e07b9fd..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-6.js +++ /dev/null @@ -1,112 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.23-6.js'; - -/** - File Name: 15.9.5.23-2.js - ECMA Section: 15.9.5.23 - Description: Date.prototype.setTime - - 1. If the this value is not a Date object, generate a runtime error. - 2. Call ToNumber(time). - 3. Call TimeClip(Result(1)). - 4. Set the [[Value]] property of the this value to Result(2). - 5. Return the value of the [[Value]] property of the this value. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.23-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.setTime()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -test_times = new Array( TIME_NOW, TIME_0000, TIME_1970, TIME_1900, TIME_2000, - UTC_FEB_29_2000, UTC_JAN_1_2005 ); - - -for ( var j = 0; j < test_times.length; j++ ) { - addTestCase( new Date(TIME_1900), test_times[j] ); -} - - -new TestCase( SECTION, - "(new Date(NaN)).setTime()", - NaN, - (new Date(NaN)).setTime() ); - -new TestCase( SECTION, - "Date.prototype.setTime.length", - 1, - Date.prototype.setTime.length ); -test(); -function addTestCase( d, t ) { - new TestCase( SECTION, - "( "+d+" ).setTime("+t+")", - t, - d.setTime(t) ); - - new TestCase( SECTION, - "( "+d+" ).setTime("+(t+1.1)+")", - TimeClip(t+1.1), - d.setTime(t+1.1) ); - - new TestCase( SECTION, - "( "+d+" ).setTime("+(t+1)+")", - t+1, - d.setTime(t+1) ); - - new TestCase( SECTION, - "( "+d+" ).setTime("+(t-1)+")", - t-1, - d.setTime(t-1) ); - - new TestCase( SECTION, - "( "+d+" ).setTime("+(t-TZ_ADJUST)+")", - t-TZ_ADJUST, - d.setTime(t-TZ_ADJUST) ); - - new TestCase( SECTION, - "( "+d+" ).setTime("+(t+TZ_ADJUST)+")", - t+TZ_ADJUST, - d.setTime(t+TZ_ADJUST) ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-7.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-7.js deleted file mode 100644 index 46bb900b18..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-7.js +++ /dev/null @@ -1,113 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.23-7.js'; - -/** - File Name: 15.9.5.23-2.js - ECMA Section: 15.9.5.23 - Description: Date.prototype.setTime - - 1. If the this value is not a Date object, generate a runtime error. - 2. Call ToNumber(time). - 3. Call TimeClip(Result(1)). - 4. Set the [[Value]] property of the this value to Result(2). - 5. Return the value of the [[Value]] property of the this value. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.23-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.setTime()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -test_times = new Array( TIME_NOW, TIME_0000, TIME_1970, TIME_1900, TIME_2000, - UTC_FEB_29_2000, UTC_JAN_1_2005 ); - - -for ( var j = 0; j < test_times.length; j++ ) { - addTestCase( new Date(TIME_2000), test_times[j] ); -} - - -new TestCase( SECTION, - "(new Date(NaN)).setTime()", - NaN, - (new Date(NaN)).setTime() ); - -new TestCase( SECTION, - "Date.prototype.setTime.length", - 1, - Date.prototype.setTime.length ); -test(); - -function addTestCase( d, t ) { - new TestCase( SECTION, - "( "+d+" ).setTime("+t+")", - t, - d.setTime(t) ); - - new TestCase( SECTION, - "( "+d+" ).setTime("+(t+1.1)+")", - TimeClip(t+1.1), - d.setTime(t+1.1) ); - - new TestCase( SECTION, - "( "+d+" ).setTime("+(t+1)+")", - t+1, - d.setTime(t+1) ); - - new TestCase( SECTION, - "( "+d+" ).setTime("+(t-1)+")", - t-1, - d.setTime(t-1) ); - - new TestCase( SECTION, - "( "+d+" ).setTime("+(t-TZ_ADJUST)+")", - t-TZ_ADJUST, - d.setTime(t-TZ_ADJUST) ); - - new TestCase( SECTION, - "( "+d+" ).setTime("+(t+TZ_ADJUST)+")", - t+TZ_ADJUST, - d.setTime(t+TZ_ADJUST) ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-8.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-8.js deleted file mode 100644 index 8072a9cc1f..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-8.js +++ /dev/null @@ -1,103 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.23-8.js'; - -/** - File Name: 15.9.5.23-2.js - ECMA Section: 15.9.5.23 - Description: Date.prototype.setTime - - 1. If the this value is not a Date object, generate a runtime error. - 2. Call ToNumber(time). - 3. Call TimeClip(Result(1)). - 4. Set the [[Value]] property of the this value to Result(2). - 5. Return the value of the [[Value]] property of the this value. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.23-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.setTime()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -test_times = new Array( TIME_NOW, TIME_0000, TIME_1970, TIME_1900, TIME_2000, - UTC_FEB_29_2000, UTC_JAN_1_2005 ); - - -for ( var j = 0; j < test_times.length; j++ ) { - addTestCase( new Date(UTC_FEB_29_2000), test_times[j] ); -} - -test(); - -function addTestCase( d, t ) { - new TestCase( SECTION, - "( "+d+" ).setTime("+t+")", - t, - d.setTime(t) ); - - new TestCase( SECTION, - "( "+d+" ).setTime("+(t+1.1)+")", - TimeClip(t+1.1), - d.setTime(t+1.1) ); - - new TestCase( SECTION, - "( "+d+" ).setTime("+(t+1)+")", - t+1, - d.setTime(t+1) ); - - new TestCase( SECTION, - "( "+d+" ).setTime("+(t-1)+")", - t-1, - d.setTime(t-1) ); - - new TestCase( SECTION, - "( "+d+" ).setTime("+(t-TZ_ADJUST)+")", - t-TZ_ADJUST, - d.setTime(t-TZ_ADJUST) ); - - new TestCase( SECTION, - "( "+d+" ).setTime("+(t+TZ_ADJUST)+")", - t+TZ_ADJUST, - d.setTime(t+TZ_ADJUST) ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-9.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-9.js deleted file mode 100644 index b480791e3d..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.23-9.js +++ /dev/null @@ -1,103 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.23-9.js'; - -/** - File Name: 15.9.5.23-2.js - ECMA Section: 15.9.5.23 - Description: Date.prototype.setTime - - 1. If the this value is not a Date object, generate a runtime error. - 2. Call ToNumber(time). - 3. Call TimeClip(Result(1)). - 4. Set the [[Value]] property of the this value to Result(2). - 5. Return the value of the [[Value]] property of the this value. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.23-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.setTime()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -test_times = new Array( TIME_NOW, TIME_0000, TIME_1970, TIME_1900, TIME_2000, - UTC_FEB_29_2000, UTC_JAN_1_2005 ); - - -for ( var j = 0; j < test_times.length; j++ ) { - addTestCase( new Date(UTC_JAN_1_2005), test_times[j] ); -} - -test(); - -function addTestCase( d, t ) { - new TestCase( SECTION, - "( "+d+" ).setTime("+t+")", - t, - d.setTime(t) ); - - new TestCase( SECTION, - "( "+d+" ).setTime("+(t+1.1)+")", - TimeClip(t+1.1), - d.setTime(t+1.1) ); - - new TestCase( SECTION, - "( "+d+" ).setTime("+(t+1)+")", - t+1, - d.setTime(t+1) ); - - new TestCase( SECTION, - "( "+d+" ).setTime("+(t-1)+")", - t-1, - d.setTime(t-1) ); - - new TestCase( SECTION, - "( "+d+" ).setTime("+(t-TZ_ADJUST)+")", - t-TZ_ADJUST, - d.setTime(t-TZ_ADJUST) ); - - new TestCase( SECTION, - "( "+d+" ).setTime("+(t+TZ_ADJUST)+")", - t+TZ_ADJUST, - d.setTime(t+TZ_ADJUST) ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.24-1.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.24-1.js deleted file mode 100644 index e02aa6150a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.24-1.js +++ /dev/null @@ -1,134 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.24-1.js'; - -/** - File Name: 15.9.5.24-1.js - ECMA Section: 15.9.5.24 Date.prototype.setTime(time) - Description: - 1. If the this value is not a Date object, generate a runtime error. - 2. Call ToNumber(time). - 3. Call TimeClip(Result(1)). - 4. Set the [[Value]] property of the this value to Result(2). - 5. Return the value of the [[Value]] property of the this value. - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var TITLE = "Date.prototype.setTime" - var SECTION = "15.9.5.24-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Date.prototype.setMilliseconds(ms)"); - - -addTestCase( 0, 0 ); - -test(); - -function addTestCase( startms, newms ) { - - var DateCase = new Date( startms ); - DateCase.setMilliseconds( newms ); - var DateString = "var date = new Date("+ startms +"); date.setMilliseconds("+ newms +"); date"; - var UTCDate = UTCDateFromTime( Number(newms) ); - var LocalDate = LocalDateFromTime( Number(newms) ); - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); - - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); - - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;"+DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} - -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - d.day = WeekDay( d.value ); - - return (d); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.24-2.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.24-2.js deleted file mode 100644 index da6261670b..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.24-2.js +++ /dev/null @@ -1,134 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.24-2.js'; - -/** - File Name: 15.9.5.24-1.js - ECMA Section: 15.9.5.24 Date.prototype.setTime(time) - Description: - 1. If the this value is not a Date object, generate a runtime error. - 2. Call ToNumber(time). - 3. Call TimeClip(Result(1)). - 4. Set the [[Value]] property of the this value to Result(2). - 5. Return the value of the [[Value]] property of the this value. - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var TITLE = "Date.prototype.setTime" - var SECTION = "15.9.5.24-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Date.prototype.setMilliseconds(ms)"); - - -addTestCase( 0, -86400000 ); - -test(); - -function addTestCase( startms, newms ) { - - var DateCase = new Date( startms ); - DateCase.setMilliseconds( newms ); - var DateString = "var date = new Date("+ startms +"); date.setMilliseconds("+ newms +"); date"; - var UTCDate = UTCDateFromTime( Number(newms) ); - var LocalDate = LocalDateFromTime( Number(newms) ); - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); - - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); - - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;"+DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} - -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - d.day = WeekDay( d.value ); - - return (d); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.24-3.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.24-3.js deleted file mode 100644 index 8199010953..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.24-3.js +++ /dev/null @@ -1,134 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.24-3.js'; - -/** - File Name: 15.9.5.24-1.js - ECMA Section: 15.9.5.24 Date.prototype.setTime(time) - Description: - 1. If the this value is not a Date object, generate a runtime error. - 2. Call ToNumber(time). - 3. Call TimeClip(Result(1)). - 4. Set the [[Value]] property of the this value to Result(2). - 5. Return the value of the [[Value]] property of the this value. - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var TITLE = "Date.prototype.setTime" - var SECTION = "15.9.5.24-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Date.prototype.setMilliseconds(ms)"); - - -addTestCase( 0, -2208988800000 ); - -test(); - -function addTestCase( startms, newms ) { - - var DateCase = new Date( startms ); - DateCase.setMilliseconds( newms ); - var DateString = "var date = new Date("+ startms +"); date.setMilliseconds("+ newms +"); date"; - var UTCDate = UTCDateFromTime( Number(newms) ); - var LocalDate = LocalDateFromTime( Number(newms) ); - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); - - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); - - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;"+DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} - -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - d.day = WeekDay( d.value ); - - return (d); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.24-4.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.24-4.js deleted file mode 100644 index f6b1dae966..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.24-4.js +++ /dev/null @@ -1,134 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.24-4.js'; - -/** - File Name: 15.9.5.24-1.js - ECMA Section: 15.9.5.24 Date.prototype.setTime(time) - Description: - 1. If the this value is not a Date object, generate a runtime error. - 2. Call ToNumber(time). - 3. Call TimeClip(Result(1)). - 4. Set the [[Value]] property of the this value to Result(2). - 5. Return the value of the [[Value]] property of the this value. - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var TITLE = "Date.prototype.setTime" - var SECTION = "15.9.5.24-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Date.prototype.setMilliseconds(ms)"); - - -addTestCase( 0, 946684800000 ); - -test(); - -function addTestCase( startms, newms ) { - - var DateCase = new Date( startms ); - DateCase.setMilliseconds( newms ); - var DateString = "var date = new Date("+ startms +"); date.setMilliseconds("+ newms +"); date"; - var UTCDate = UTCDateFromTime( Number(newms) ); - var LocalDate = LocalDateFromTime( Number(newms) ); - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); - - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); - - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;"+DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} - -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - d.day = WeekDay( d.value ); - - return (d); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.24-5.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.24-5.js deleted file mode 100644 index 53458028be..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.24-5.js +++ /dev/null @@ -1,134 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.24-5.js'; - -/** - File Name: 15.9.5.24-1.js - ECMA Section: 15.9.5.24 Date.prototype.setTime(time) - Description: - 1. If the this value is not a Date object, generate a runtime error. - 2. Call ToNumber(time). - 3. Call TimeClip(Result(1)). - 4. Set the [[Value]] property of the this value to Result(2). - 5. Return the value of the [[Value]] property of the this value. - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var TITLE = "Date.prototype.setTime" - var SECTION = "15.9.5.24-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Date.prototype.setMilliseconds(ms)"); - - -addTestCase( 0, "0" ); - -test(); - -function addTestCase( startms, newms ) { - - var DateCase = new Date( startms ); - DateCase.setMilliseconds( newms ); - var DateString = "var date = new Date("+ startms +"); date.setMilliseconds("+ newms +"); date"; - var UTCDate = UTCDateFromTime( Number(newms) ); - var LocalDate = LocalDateFromTime( Number(newms) ); - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); - - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); - - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;"+DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} - -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - d.day = WeekDay( d.value ); - - return (d); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.24-6.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.24-6.js deleted file mode 100644 index 188dbacff9..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.24-6.js +++ /dev/null @@ -1,134 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.24-6.js'; - -/** - File Name: 15.9.5.24-1.js - ECMA Section: 15.9.5.24 Date.prototype.setTime(time) - Description: - 1. If the this value is not a Date object, generate a runtime error. - 2. Call ToNumber(time). - 3. Call TimeClip(Result(1)). - 4. Set the [[Value]] property of the this value to Result(2). - 5. Return the value of the [[Value]] property of the this value. - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var TITLE = "Date.prototype.setTime" - var SECTION = "15.9.5.24-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Date.prototype.setMilliseconds(ms)"); - - -addTestCase( 0, "-2208988800000" ); - -test(); - -function addTestCase( startms, newms ) { - - var DateCase = new Date( startms ); - DateCase.setMilliseconds( newms ); - var DateString = "var date = new Date("+ startms +"); date.setMilliseconds("+ newms +"); date"; - var UTCDate = UTCDateFromTime( Number(newms) ); - var LocalDate = LocalDateFromTime( Number(newms) ); - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); - - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); - - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;"+DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} - -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - d.day = WeekDay( d.value ); - - return (d); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.24-7.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.24-7.js deleted file mode 100644 index b2fe8fcff9..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.24-7.js +++ /dev/null @@ -1,134 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.24-7.js'; - -/** - File Name: 15.9.5.24-1.js - ECMA Section: 15.9.5.24 Date.prototype.setTime(time) - Description: - 1. If the this value is not a Date object, generate a runtime error. - 2. Call ToNumber(time). - 3. Call TimeClip(Result(1)). - 4. Set the [[Value]] property of the this value to Result(2). - 5. Return the value of the [[Value]] property of the this value. - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var TITLE = "Date.prototype.setTime" - var SECTION = "15.9.5.24-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Date.prototype.setMilliseconds(ms)"); - - -addTestCase( 0, "-86400000" ); - -test(); - -function addTestCase( startms, newms ) { - - var DateCase = new Date( startms ); - DateCase.setMilliseconds( newms ); - var DateString = "var date = new Date("+ startms +"); date.setMilliseconds("+ newms +"); date"; - var UTCDate = UTCDateFromTime( Number(newms) ); - var LocalDate = LocalDateFromTime( Number(newms) ); - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); - - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); - - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;"+DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} - -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - d.day = WeekDay( d.value ); - - return (d); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.24-8.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.24-8.js deleted file mode 100644 index d6ea2d8d3e..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.24-8.js +++ /dev/null @@ -1,133 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.24-8.js'; - -/** - File Name: 15.9.5.24-1.js - ECMA Section: 15.9.5.24 Date.prototype.setTime(time) - Description: - 1. If the this value is not a Date object, generate a runtime error. - 2. Call ToNumber(time). - 3. Call TimeClip(Result(1)). - 4. Set the [[Value]] property of the this value to Result(2). - 5. Return the value of the [[Value]] property of the this value. - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var TITLE = "Date.prototype.setTime" - var SECTION = "15.9.5.24-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Date.prototype.setMilliseconds(ms)"); - -addTestCase( 0, "946684800000" ); - -test(); - -function addTestCase( startms, newms ) { - - var DateCase = new Date( startms ); - DateCase.setMilliseconds( newms ); - var DateString = "var date = new Date("+ startms +"); date.setMilliseconds("+ newms +"); date"; - var UTCDate = UTCDateFromTime( Number(newms) ); - var LocalDate = LocalDateFromTime( Number(newms) ); - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); - - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); - - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;"+DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} - -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - d.day = WeekDay( d.value ); - - return (d); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.25-1.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.25-1.js deleted file mode 100644 index 0eb7783ec8..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.25-1.js +++ /dev/null @@ -1,174 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.25-1.js'; - -/** - File Name: 15.9.5.25-1.js - ECMA Section: 15.9.5.25 Date.prototype.setUTCMilliseconds(ms) - Description: - 1. Let t be this time value. - 2. Call ToNumber(ms). - 3. Compute MakeTime(HourFromTime(t), MinFromTime(t), SecFromTime(t), Result(2)). - 4. Compute MakeDate(Day(t), Result(3)). - 5. Set the [[Value]] property of the this value to TimeClip(Result(4)). - 6. Return the value of the [[Value]] property of the this value. - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "15.9.5.25-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Date.prototype.setUTCMilliseconds(ms)"); - -addNewTestCase( 0, 0, "TDATE = new Date(0);(TDATE).setUTCMilliseconds(0);TDATE", - UTCDateFromTime(SetUTCMilliseconds(0,0)), - LocalDateFromTime(SetUTCMilliseconds(0,0)) ); -addNewTestCase( 28800000,999, - "TDATE = new Date(28800000);(TDATE).setUTCMilliseconds(999);TDATE", - UTCDateFromTime(SetUTCMilliseconds(28800000,999)), - LocalDateFromTime(SetUTCMilliseconds(28800000,999)) ); -addNewTestCase( 28800000,-28800000, - "TDATE = new Date(28800000);(TDATE).setUTCMilliseconds(-28800000);TDATE", - UTCDateFromTime(SetUTCMilliseconds(28800000,-28800000)), - LocalDateFromTime(SetUTCMilliseconds(28800000,-28800000)) ); -addNewTestCase( 946684800000,1234567, - "TDATE = new Date(946684800000);(TDATE).setUTCMilliseconds(1234567);TDATE", - UTCDateFromTime(SetUTCMilliseconds(946684800000,1234567)), - LocalDateFromTime(SetUTCMilliseconds(946684800000,1234567)) ); -addNewTestCase( 946684800000, 123456789, - "TDATE = new Date(946684800000);(TDATE).setUTCMilliseconds(123456789);TDATE", - UTCDateFromTime(SetUTCMilliseconds(946684800000,123456789)), - LocalDateFromTime(SetUTCMilliseconds(946684800000,123456789)) ); - -addNewTestCase( -2208988800000,123456789, - "TDATE = new Date(-2208988800000);(TDATE).setUTCMilliseconds(123456789);TDATE", - UTCDateFromTime(SetUTCMilliseconds(-2208988800000,123456789)), - LocalDateFromTime(SetUTCMilliseconds(-2208988800000,123456789)) ); - -addNewTestCase( -2208988800000,123456, - "TDATE = new Date(-2208988800000);(TDATE).setUTCMilliseconds(123456);TDATE", - UTCDateFromTime(SetUTCMilliseconds(-2208988800000,123456)), - LocalDateFromTime(SetUTCMilliseconds(-2208988800000,123456)) ); - -addNewTestCase( -2208988800000,-123456, - "TDATE = new Date(-2208988800000);(TDATE).setUTCMilliseconds(-123456);TDATE", - UTCDateFromTime(SetUTCMilliseconds(-2208988800000,-123456)), - LocalDateFromTime(SetUTCMilliseconds(-2208988800000,-123456)) ); - -addNewTestCase( 0,-999, - "TDATE = new Date(0);(TDATE).setUTCMilliseconds(-999);TDATE", - UTCDateFromTime(SetUTCMilliseconds(0,-999)), - LocalDateFromTime(SetUTCMilliseconds(0,-999)) ); - -test(); - -function addNewTestCase( initialTime, ms, DateString, UTCDate, LocalDate) { - DateCase = new Date(initialTime); - DateCase.setUTCMilliseconds(ms); - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); - - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); - - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;"+DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - d.day = WeekDay( d.value ); - - return (d); -} - -function SetUTCMilliseconds( T, MS ) { - T = Number( T ); - TIME = MakeTime( HourFromTime(T), - MinFromTime(T), - SecFromTime(T), - MS ); - return( MakeDate( Day(T), TIME )); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.26-1.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.26-1.js deleted file mode 100644 index 509ec73d33..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.26-1.js +++ /dev/null @@ -1,183 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.26-1.js'; - -/** File Name: 15.9.5.26-1.js - ECMA Section: 15.9.5.26 Date.prototype.setSeconds(sec [,ms]) - Description: - - If ms is not specified, this behaves as if ms were specified with the - value getMilliseconds( ). - - 1. Let t be the result of LocalTime(this time value). - 2. Call ToNumber(sec). - 3. If ms is not specified, compute msFromTime(t); otherwise, call - ToNumber(ms). - 4. Compute MakeTime(HourFromTime(t), MinFromTime(t), Result(2), - Result(3)). - 5. Compute UTC(MakeDate(Day(t), Result(4))). - 6. Set the [[Value]] property of the this value to TimeClip(Result(5)). - 7. Return the value of the [[Value]] property of the this value. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "15.9.5.26-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Date.prototype.setSeconds(sec [,ms] )"); - -addNewTestCase( 0, 0, 0, - "TDATE = new Date(0);(TDATE).setSeconds(0,0);TDATE", - UTCDateFromTime(SetSeconds(0,0,0)), - LocalDateFromTime(SetSeconds(0,0,0)) ); - -addNewTestCase( 28800000,59,999, - "TDATE = new Date(28800000);(TDATE).setSeconds(59,999);TDATE", - UTCDateFromTime(SetSeconds(28800000,59,999)), - LocalDateFromTime(SetSeconds(28800000,59,999)) ); - -addNewTestCase( 28800000,999,999, - "TDATE = new Date(28800000);(TDATE).setSeconds(999,999);TDATE", - UTCDateFromTime(SetSeconds(28800000,999,999)), - LocalDateFromTime(SetSeconds(28800000,999,999)) ); - -addNewTestCase( 28800000,999, void 0, - "TDATE = new Date(28800000);(TDATE).setSeconds(999);TDATE", - UTCDateFromTime(SetSeconds(28800000,999,0)), - LocalDateFromTime(SetSeconds(28800000,999,0)) ); - -addNewTestCase( 28800000,-28800, void 0, - "TDATE = new Date(28800000);(TDATE).setSeconds(-28800);TDATE", - UTCDateFromTime(SetSeconds(28800000,-28800)), - LocalDateFromTime(SetSeconds(28800000,-28800)) ); - -addNewTestCase( 946684800000,1234567,void 0, - "TDATE = new Date(946684800000);(TDATE).setSeconds(1234567);TDATE", - UTCDateFromTime(SetSeconds(946684800000,1234567)), - LocalDateFromTime(SetSeconds(946684800000,1234567)) ); - -addNewTestCase( -2208988800000,59,999, - "TDATE = new Date(-2208988800000);(TDATE).setSeconds(59,999);TDATE", - UTCDateFromTime(SetSeconds(-2208988800000,59,999)), - LocalDateFromTime(SetSeconds(-2208988800000,59,999)) ); - -test(); - -function addNewTestCase( startTime, sec, ms, DateString,UTCDate, LocalDate) { - DateCase = new Date( startTime ); - if ( ms != void 0 ) { - DateCase.setSeconds( sec, ms ); - } else { - DateCase.setSeconds( sec ); - } - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); - - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); - - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;"+DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} - -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - d.day = WeekDay( d.value ); - - return (d); -} -function SetSeconds( t, s, m ) { - var MS = ( m == void 0 ) ? msFromTime(t) : Number( m ); - var TIME = LocalTime( t ); - var SEC = Number(s); - var RESULT4 = MakeTime( HourFromTime( TIME ), - MinFromTime( TIME ), - SEC, - MS ); - var UTC_TIME = UTC(MakeDate(Day(TIME), RESULT4)); - return ( TimeClip(UTC_TIME) ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.27-1.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.27-1.js deleted file mode 100644 index 1b06777332..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.27-1.js +++ /dev/null @@ -1,183 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.27-1.js'; - -/** - File Name: 15.9.5.27-1.js - ECMA Section: 15.9.5.27 Date.prototype.setUTCSeconds(sec [,ms]) - Description: - - If ms is not specified, this behaves as if ms were specified with the - value getUTCMilliseconds( ). - - 1. Let t be this time value. - 2. Call ToNumber(sec). - 3. If ms is not specified, compute msFromTime(t); otherwise, call - ToNumber(ms) - 4. Compute MakeTime(HourFromTime(t), MinFromTime(t), Result(2), Result(3)) - 5. Compute MakeDate(Day(t), Result(4)). - 6. Set the [[Value]] property of the this value to TimeClip(Result(5)). - 7. Return the value of the [[Value]] property of the this value. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "15.9.5.27-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Date.prototype.setUTCSeconds(sec [,ms] )"); - -addNewTestCase( 0, 0, 0, "TDATE = new Date(0);(TDATE).setUTCSeconds(0,0);TDATE", - UTCDateFromTime(SetUTCSeconds(0,0,0)), - LocalDateFromTime(SetUTCSeconds(0,0,0)) ); - -addNewTestCase( 28800000,59,999, - "TDATE = new Date(28800000);(TDATE).setUTCSeconds(59,999);TDATE", - UTCDateFromTime(SetUTCSeconds(28800000,59,999)), - LocalDateFromTime(SetUTCSeconds(28800000,59,999)) ); - -addNewTestCase( 28800000,999,999, - "TDATE = new Date(28800000);(TDATE).setUTCSeconds(999,999);TDATE", - UTCDateFromTime(SetUTCSeconds(28800000,999,999)), - LocalDateFromTime(SetUTCSeconds(28800000,999,999)) ); - -addNewTestCase( 28800000, 999, void 0, - "TDATE = new Date(28800000);(TDATE).setUTCSeconds(999);TDATE", - UTCDateFromTime(SetUTCSeconds(28800000,999,0)), - LocalDateFromTime(SetUTCSeconds(28800000,999,0)) ); - -addNewTestCase( 28800000, -28800, void 0, - "TDATE = new Date(28800000);(TDATE).setUTCSeconds(-28800);TDATE", - UTCDateFromTime(SetUTCSeconds(28800000,-28800)), - LocalDateFromTime(SetUTCSeconds(28800000,-28800)) ); - -addNewTestCase( 946684800000, 1234567, void 0, - "TDATE = new Date(946684800000);(TDATE).setUTCSeconds(1234567);TDATE", - UTCDateFromTime(SetUTCSeconds(946684800000,1234567)), - LocalDateFromTime(SetUTCSeconds(946684800000,1234567)) ); - -addNewTestCase( -2208988800000,59,999, - "TDATE = new Date(-2208988800000);(TDATE).setUTCSeconds(59,999);TDATE", - UTCDateFromTime(SetUTCSeconds(-2208988800000,59,999)), - LocalDateFromTime(SetUTCSeconds(-2208988800000,59,999)) ); - -test(); - -function addNewTestCase( startTime, sec, ms, DateString, UTCDate, LocalDate) { - DateCase = new Date( startTime ); - if ( ms == void 0) { - DateCase.setSeconds( sec ); - } else { - DateCase.setSeconds( sec, ms ); - } - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); - - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); - - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;"+DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} - -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - d.day = WeekDay( d.value ); - - return (d); -} - -function SetUTCSeconds( t, s, m ) { - var TIME = t; - var SEC = Number(s); - var MS = ( m == void 0 ) ? msFromTime(TIME) : Number( m ); - var RESULT4 = MakeTime( HourFromTime( TIME ), - MinFromTime( TIME ), - SEC, - MS ); - return ( TimeClip(MakeDate(Day(TIME), RESULT4)) ); -} - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.28-1.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.28-1.js deleted file mode 100644 index 902d70a873..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.28-1.js +++ /dev/null @@ -1,196 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.28-1.js'; - -/** - File Name: 15.9.5.28-1.js - ECMA Section: 15.9.5.28 Date.prototype.setMinutes(min [, sec [, ms ]] ) - Description: - If sec is not specified, this behaves as if sec were specified with the - value getSeconds ( ). - - If ms is not specified, this behaves as if ms were specified with the - value getMilliseconds( ). - - 1. Let t be the result of LocalTime(this time value). - 2. Call ToNumber(min). - 3. If sec is not specified, compute SecFromTime(t); otherwise, call ToNumber(sec). - 4. If ms is not specified, compute msFromTime(t); otherwise, call ToNumber(ms). - 5. Compute MakeTime(HourFromTime(t), Result(2), Result(3), Result(4)). - 6. Compute UTC(MakeDate(Day(t), Result(5))). - 7. Set the [[Value]] property of the this value to TimeClip(Result(6)). - 8. Return the value of the [[Value]] property of the this value. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "15.9.5.28-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Date.prototype.setMinutes(sec [,ms] )"); - -addNewTestCase( 0, 0, void 0, void 0, - "TDATE = new Date(0);(TDATE).setMinutes(0);TDATE", - UTCDateFromTime(SetMinutes(0,0,0,0)), - LocalDateFromTime(SetMinutes(0,0,0,0)) ); - -addNewTestCase( 28800000, 59, 59, void 0, - "TDATE = new Date(28800000);(TDATE).setMinutes(59,59);TDATE", - UTCDateFromTime(SetMinutes(28800000,59,59)), - LocalDateFromTime(SetMinutes(28800000,59,59)) ); - -addNewTestCase( 28800000, 59, 59, 999, - "TDATE = new Date(28800000);(TDATE).setMinutes(59,59,999);TDATE", - UTCDateFromTime(SetMinutes(28800000,59,59,999)), - LocalDateFromTime(SetMinutes(28800000,59,59,999)) ); - -addNewTestCase( 28800000, 59, void 0, void 0, - "TDATE = new Date(28800000);(TDATE).setMinutes(59);TDATE", - UTCDateFromTime(SetMinutes(28800000,59,0)), - LocalDateFromTime(SetMinutes(28800000,59,0)) ); - -addNewTestCase( 28800000, -480, void 0, void 0, - "TDATE = new Date(28800000);(TDATE).setMinutes(-480);TDATE", - UTCDateFromTime(SetMinutes(28800000,-480)), - LocalDateFromTime(SetMinutes(28800000,-480)) ); - -addNewTestCase( 946684800000, 1234567, void 0, void 0, - "TDATE = new Date(946684800000);(TDATE).setMinutes(1234567);TDATE", - UTCDateFromTime(SetMinutes(946684800000,1234567)), - LocalDateFromTime(SetMinutes(946684800000,1234567)) ); - -addNewTestCase( -2208988800000,59, 59, void 0, - "TDATE = new Date(-2208988800000);(TDATE).setMinutes(59,59);TDATE", - UTCDateFromTime(SetMinutes(-2208988800000,59,59)), - LocalDateFromTime(SetMinutes(-2208988800000,59,59)) ); - -addNewTestCase( -2208988800000, 59, 59, 999, - "TDATE = new Date(-2208988800000);(TDATE).setMinutes(59,59,999);TDATE", - UTCDateFromTime(SetMinutes(-2208988800000,59,59,999)), - LocalDateFromTime(SetMinutes(-2208988800000,59,59,999)) ); - -test(); - -function addNewTestCase( time, min, sec, ms, DateString, UTCDate, LocalDate) { - DateCase = new Date( time ); - - if ( sec == void 0 ) { - DateCase.setMinutes( min ); - } else { - if ( ms == void 0 ) { - DateCase.setMinutes( min, sec ); - } else { - DateCase.setMinutes( min, sec, ms ); - } - } - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); - - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); - - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;"+DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} - -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - d.day = WeekDay( d.value ); - - return (d); -} - -function SetMinutes( t, min, sec, ms ) { - var TIME = LocalTime(t); - var MIN = Number(min); - var SEC = ( sec == void 0) ? SecFromTime(TIME) : Number(sec); - var MS = ( ms == void 0 ) ? msFromTime(TIME) : Number(ms); - var RESULT5 = MakeTime( HourFromTime( TIME ), - MIN, - SEC, - MS ); - return ( TimeClip(UTC( MakeDate(Day(TIME),RESULT5))) ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.29-1.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.29-1.js deleted file mode 100644 index 42fa36e9b5..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.29-1.js +++ /dev/null @@ -1,191 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.29-1.js'; - -/** - File Name: 15.9.5.29-1.js - ECMA Section: 15.9.5.29 Date.prototype.setUTCMinutes(min [, sec [, ms ]] ) - Description: - If sec is not specified, this behaves as if sec were specified with the - value getUTCSeconds ( ). - - If ms is not specified, this behaves as if ms were specified with the value - getUTCMilliseconds( ). - - 1. Let t be this time value. - 2. Call ToNumber(min). - 3. If sec is not specified, compute SecFromTime(t); otherwise, call - ToNumber(sec). - 4. If ms is not specified, compute msFromTime(t); otherwise, call - ToNumber(ms). - 5. Compute MakeTime(HourFromTime(t), Result(2), Result(3), Result(4)). - 6. Compute MakeDate(Day(t), Result(5)). - 7. Set the [[Value]] property of the this value to TimeClip(Result(6)). - 8. Return the value of the [[Value]] property of the this value. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "15.9.5.29-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Date.prototype.setUTCMinutes( min [, sec, ms] )"); - -addNewTestCase( 0, 0, void 0, void 0, - "TDATE = new Date(0);(TDATE).setUTCMinutes(0);TDATE", - UTCDateFromTime(SetUTCMinutes(0,0,0,0)), - LocalDateFromTime(SetUTCMinutes(0,0,0,0)) ); - -addNewTestCase( 28800000, 59, 59, void 0, - "TDATE = new Date(28800000);(TDATE).setUTCMinutes(59,59);TDATE", - UTCDateFromTime(SetUTCMinutes(28800000,59,59)), - LocalDateFromTime(SetUTCMinutes(28800000,59,59)) ); - -addNewTestCase( 28800000, 59, 59, 999, - "TDATE = new Date(28800000);(TDATE).setUTCMinutes(59,59,999);TDATE", - UTCDateFromTime(SetUTCMinutes(28800000,59,59,999)), - LocalDateFromTime(SetUTCMinutes(28800000,59,59,999)) ); - -addNewTestCase( 28800000, 59, void 0, void 0, - "TDATE = new Date(28800000);(TDATE).setUTCMinutes(59);TDATE", - UTCDateFromTime(SetUTCMinutes(28800000,59)), - LocalDateFromTime(SetUTCMinutes(28800000,59)) ); - -addNewTestCase( 28800000, -480, 0, 0, - "TDATE = new Date(28800000);(TDATE).setUTCMinutes(-480);TDATE", - UTCDateFromTime(SetUTCMinutes(28800000,-480)), - LocalDateFromTime(SetUTCMinutes(28800000,-480)) ); - -addNewTestCase( 946684800000, 1234567, void 0, void 0, - "TDATE = new Date(946684800000);(TDATE).setUTCMinutes(1234567);TDATE", - UTCDateFromTime(SetUTCMinutes(946684800000,1234567)), - LocalDateFromTime(SetUTCMinutes(946684800000,1234567)) ); - -addNewTestCase( -2208988800000, 59, 999, void 0, - "TDATE = new Date(-2208988800000);(TDATE).setUTCMinutes(59,999);TDATE", - UTCDateFromTime(SetUTCMinutes(-2208988800000,59,999)), - LocalDateFromTime(SetUTCMinutes(-2208988800000,59,999)) ); - -test(); - -function addNewTestCase( time, min, sec, ms, DateString, UTCDate, LocalDate) { - var DateCase = new Date( time ); - - if ( sec == void 0 ) { - DateCase.setUTCMinutes( min ); - } else { - if ( ms == void 0 ) { - DateCase.setUTCMinutes( min, sec ); - } else { - DateCase.setUTCMinutes( min, sec, ms ); - } - } - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); - - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); - - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;"+DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - d.day = WeekDay( d.value ); - - return (d); -} -function SetUTCMinutes( t, min, sec, ms ) { - var TIME = t; - var MIN = Number(min); - var SEC = ( sec == void 0) ? SecFromTime(TIME) : Number(sec); - var MS = ( ms == void 0 ) ? msFromTime(TIME) : Number(ms); - var RESULT5 = MakeTime( HourFromTime( TIME ), - MIN, - SEC, - MS ); - return ( TimeClip(MakeDate(Day(TIME),RESULT5)) ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.3-1-n.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.3-1-n.js deleted file mode 100644 index e1f227f785..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.3-1-n.js +++ /dev/null @@ -1,80 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.3-1-n.js'; - -/** - File Name: 15.9.5.3-1.js - ECMA Section: 15.9.5.3-1 Date.prototype.valueOf - Description: - - The valueOf function returns a number, which is this time value. - - The valueOf function is not generic; it generates a runtime error if - its this value is not a Date object. Therefore it cannot be transferred - to other kinds of objects for use as a method. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.3-1-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.valueOf"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var OBJ = new MyObject( new Date(0) ); - -DESCRIPTION = "var OBJ = new MyObject( new Date(0) ); OBJ.valueOf()"; -EXPECTED = "error"; - -new TestCase( SECTION, - "var OBJ = new MyObject( new Date(0) ); OBJ.valueOf()", - "error", - eval("OBJ.valueOf()") ); -test(); - -function MyObject( value ) { - this.value = value; - this.valueOf = Date.prototype.valueOf; -// The following line causes an infinte loop -// this.toString = new Function( "return this+\"\";"); - return this; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.3-2.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.3-2.js deleted file mode 100644 index 9f425c3450..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.3-2.js +++ /dev/null @@ -1,104 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.3-2.js'; - -/** - File Name: 15.9.5.3-2.js - ECMA Section: 15.9.5.3-2 Date.prototype.valueOf - Description: - - The valueOf function returns a number, which is this time value. - - The valueOf function is not generic; it generates a runtime error if - its this value is not a Date object. Therefore it cannot be transferred - to other kinds of objects for use as a method. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.3-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.valueOf"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -addTestCase( TIME_NOW ); -addTestCase( TIME_1970 ); -addTestCase( TIME_1900 ); -addTestCase( TIME_2000 ); -addTestCase( UTC_FEB_29_2000 ); -addTestCase( UTC_JAN_1_2005 ); - -test(); - -function addTestCase( t ) { - new TestCase( SECTION, - "(new Date("+t+").valueOf()", - t, - (new Date(t)).valueOf() ); - - new TestCase( SECTION, - "(new Date("+(t+1)+").valueOf()", - t+1, - (new Date(t+1)).valueOf() ); - - new TestCase( SECTION, - "(new Date("+(t-1)+").valueOf()", - t-1, - (new Date(t-1)).valueOf() ); - - new TestCase( SECTION, - "(new Date("+(t-TZ_ADJUST)+").valueOf()", - t-TZ_ADJUST, - (new Date(t-TZ_ADJUST)).valueOf() ); - - new TestCase( SECTION, - "(new Date("+(t+TZ_ADJUST)+").valueOf()", - t+TZ_ADJUST, - (new Date(t+TZ_ADJUST)).valueOf() ); -} - -function MyObject( value ) { - this.value = value; - this.valueOf = Date.prototype.valueOf; - this.toString = new Function( "return this+\"\";"); - return this; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.30-1.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.30-1.js deleted file mode 100644 index 7abb3927d7..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.30-1.js +++ /dev/null @@ -1,192 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.30-1.js'; - -/** - File Name: 15.9.5.30-1.js - ECMA Section: 15.9.5.30 Date.prototype.setHours(hour [, min [, sec [, ms ]]] ) - Description: - If min is not specified, this behaves as if min were specified with the - value getMinutes( ). If sec is not specified, this behaves as if sec were - specified with the value getSeconds ( ). If ms is not specified, this - behaves as if ms were specified with the value getMilliseconds( ). - - 1. Let t be the result of LocalTime(this time value). - 2. Call ToNumber(hour). - 3. If min is not specified, compute MinFromTime(t); otherwise, call - ToNumber(min). - 4. If sec is not specified, compute SecFromTime(t); otherwise, call - ToNumber(sec). - 5. If ms is not specified, compute msFromTime(t); otherwise, call - ToNumber(ms). - 6. Compute MakeTime(Result(2), Result(3), Result(4), Result(5)). - 7. Compute UTC(MakeDate(Day(t), Result(6))). - 8. Set the [[Value]] property of the this value to TimeClip(Result(7)). - 9. Return the value of the [[Value]] property of the this value. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "15.9.5.30-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Date.prototype.setHours( hour [, min, sec, ms] )"); - -addNewTestCase( 0,0,0,0,void 0, - "TDATE = new Date(0);(TDATE).setHours(0);TDATE" ); - -addNewTestCase( 28800000, 23, 59, 999,void 0, - "TDATE = new Date(28800000);(TDATE).setHours(23,59,999);TDATE" ); - -addNewTestCase( 28800000, 999, 999, void 0, void 0, - "TDATE = new Date(28800000);(TDATE).setHours(999,999);TDATE" ); - -addNewTestCase( 28800000,999,0, void 0, void 0, - "TDATE = new Date(28800000);(TDATE).setHours(999);TDATE" ); - -addNewTestCase( 28800000,-8, void 0, void 0, void 0, - "TDATE = new Date(28800000);(TDATE).setHours(-8);TDATE" ); - -addNewTestCase( 946684800000,8760, void 0, void 0, void 0, - "TDATE = new Date(946684800000);(TDATE).setHours(8760);TDATE" ); - -addNewTestCase( TIME_2000 - msPerDay, 23, 59, 59, 999, - "d = new Date( " + (TIME_2000-msPerDay) +"); d.setHours(23,59,59,999)" ); - -addNewTestCase( TIME_2000 - msPerDay, 23, 59, 59, 1000, - "d = new Date( " + (TIME_2000-msPerDay) +"); d.setHours(23,59,59,1000)" ); - -test(); - -function addNewTestCase( time, hours, min, sec, ms, DateString) { - var UTCDate = UTCDateFromTime( SetHours( time, hours, min, sec, ms )); - var LocalDate = LocalDateFromTime( SetHours( time, hours, min, sec, ms )); - - var DateCase = new Date( time ); - - if ( min == void 0 ) { - DateCase.setHours( hours ); - } else { - if ( sec == void 0 ) { - DateCase.setHours( hours, min ); - } else { - if ( ms == void 0 ) { - DateCase.setHours( hours, min, sec ); - } else { - DateCase.setHours( hours, min, sec, ms ); - } - } - } - - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;"+DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} - -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - - d.day = WeekDay( t ); - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - - return (d); -} -function SetHours( t, hour, min, sec, ms ) { - var TIME = LocalTime(t); - var HOUR = Number(hour); - var MIN = ( min == void 0) ? MinFromTime(TIME) : Number(min); - var SEC = ( sec == void 0) ? SecFromTime(TIME) : Number(sec); - var MS = ( ms == void 0 ) ? msFromTime(TIME) : Number(ms); - var RESULT6 = MakeTime( HOUR, - MIN, - SEC, - MS ); - var UTC_TIME = UTC( MakeDate(Day(TIME), RESULT6) ); - return ( TimeClip(UTC_TIME) ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.31-1.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.31-1.js deleted file mode 100644 index 10f0f93e17..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.31-1.js +++ /dev/null @@ -1,221 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.31-1.js'; - -/** - File Name: 15.9.5.31-1.js - - ECMA Section: - 15.9.5.31 Date.prototype.setUTCHours(hour [, min [, sec [, ms ]]] ) - - Description: - - If min is not specified, this behaves as if min were specified with - the value getUTCMinutes( ). If sec is not specified, this behaves - as if sec were specified with the value getUTCSeconds ( ). If ms - is not specified, this behaves as if ms were specified with the - value getUTCMilliseconds( ). - - 1.Let t be this time value. - 2.Call ToNumber(hour). - 3.If min is not specified, compute MinFromTime(t); - otherwise, call ToNumber(min). - 4.If sec is not specified, compute SecFromTime(t); - otherwise, call ToNumber(sec). - 5.If ms is not specified, compute msFromTime(t); - otherwise, call ToNumber(ms). - 6.Compute MakeTime(Result(2), Result(3), Result(4), Result(5)). - 7.Compute MakeDate(Day(t), Result(6)). - 8.Set the [[Value]] property of the this value to TimeClip(Result(7)). - - 1.Return the value of the [[Value]] property of the this value. - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "15.9.5.31-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog(SECTION + - " Date.prototype.setUTCHours(hour [, min [, sec [, ms ]]] )"); - -addNewTestCase( 0, 0, void 0, void 0, void 0, - "TDATE = new Date(0);(TDATE).setUTCHours(0);TDATE", - UTCDateFromTime(SetUTCHours(0,0,0,0)), - LocalDateFromTime(SetUTCHours(0,0,0,0)) ); - -addNewTestCase( 28800000, 23, 59, 999, void 0, - "TDATE = new Date(28800000);(TDATE).setUTCHours(23,59,999);TDATE", - UTCDateFromTime(SetUTCHours(28800000,23,59,999)), - LocalDateFromTime(SetUTCHours(28800000,23,59,999)) ); - -addNewTestCase( 28800000,999,999, void 0, void 0, - "TDATE = new Date(28800000);(TDATE).setUTCHours(999,999);TDATE", - UTCDateFromTime(SetUTCHours(28800000,999,999)), - LocalDateFromTime(SetUTCHours(28800000,999,999)) ); - -addNewTestCase( 28800000, 999, void 0, void 0, void 0, - "TDATE = new Date(28800000);(TDATE).setUTCHours(999);TDATE", - UTCDateFromTime(SetUTCHours(28800000,999,0)), - LocalDateFromTime(SetUTCHours(28800000,999,0)) ); - -addNewTestCase( 28800000, -8670, void 0, void 0, void 0, - "TDATE = new Date(28800000);(TDATE).setUTCHours(-8670);TDATE", - UTCDateFromTime(SetUTCHours(28800000,-8670)), - LocalDateFromTime(SetUTCHours(28800000,-8670)) ); - -addNewTestCase( 946684800000, 1234567, void 0, void 0, void 0, - "TDATE = new Date(946684800000);(TDATE).setUTCHours(1234567);TDATE", - UTCDateFromTime(SetUTCHours(946684800000,1234567)), - LocalDateFromTime(SetUTCHours(946684800000,1234567)) ); - -addNewTestCase( -2208988800000, 59, 999, void 0, void 0, - "TDATE = new Date(-2208988800000);(TDATE).setUTCHours(59,999);TDATE", - UTCDateFromTime(SetUTCHours(-2208988800000,59,999)), - LocalDateFromTime(SetUTCHours(-2208988800000,59,999)) ); - -test(); - -function addNewTestCase( time, hours, min, sec, ms, DateString, UTCDate, LocalDate) { - - DateCase = new Date(time); - if ( min == void 0 ) { - DateCase.setUTCHours( hours ); - } else { - if ( sec == void 0 ) { - DateCase.setUTCHours( hours, min ); - } else { - if ( ms == void 0 ) { - DateCase.setUTCHours( hours, min, sec ); - } else { - DateCase.setUTCHours( hours, min, sec, ms ); - } - } - } - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, - DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, - DateCase.valueOf() ); - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, - DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, - DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, - DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, - DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, - DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes, - DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds, - DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, - DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, - DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, - DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, - DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", LocalDate.day, - DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, - DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, - DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, - DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, - DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;" + - DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - d.day = WeekDay( d.value ); - - return (d); -} -function SetUTCHours( t, hour, min, sec, ms ) { - var TIME = t; - var HOUR = Number(hour); - var MIN = ( min == void 0) ? MinFromTime(TIME) : Number(min); - var SEC = ( sec == void 0) ? SecFromTime(TIME) : Number(sec); - var MS = ( ms == void 0 ) ? msFromTime(TIME) : Number(ms); - var RESULT6 = MakeTime( HOUR, - MIN, - SEC, - MS ); - return ( TimeClip(MakeDate(Day(TIME), RESULT6)) ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.32-1.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.32-1.js deleted file mode 100644 index d277fd9af1..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.32-1.js +++ /dev/null @@ -1,141 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.32-1.js'; - -/** - File Name: 15.9.5.32-1.js - ECMA Section: 15.9.5.32 Date.prototype.setDate(date) - Description: - 1. Let t be the result of LocalTime(this time value). - 2. Call ToNumber(date). - 3. Compute MakeDay(YearFromTime(t), MonthFromTime(t), Result(2)). - 4. Compute UTC(MakeDate(Result(3), TimeWithinDay(t))). - 5. Set the [[Value]] property of the this value to TimeClip(Result(4)). - 6. Return the value of the [[Value]] property of the this value. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "15.9.5.32-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Date.prototype.setDate(date) "); - -addNewTestCase( 0, 1, - "TDATE = new Date(0);(TDATE).setDate(1);TDATE" ); - -test(); - -function addNewTestCase( t, d, DateString ) { - var DateCase = new Date( t ); - DateCase.setDate( d ); - - var UTCDate = UTCDateFromTime(SetDate(t, d)); - var LocalDate=LocalDateFromTime(SetDate(t,d)); - - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;"+DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - d.day = WeekDay( d.value ); - - return (d); -} - -function SetDate( t, date ) { - var T = LocalTime( t ); - var DATE = Number( date ); - var RESULT3 = MakeDay(YearFromTime(T), MonthFromTime(T), DATE ); - var UTC_DATE = UTC( MakeDate(RESULT3, TimeWithinDay(T)) ); - return ( TimeClip(UTC_DATE) ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.33-1.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.33-1.js deleted file mode 100644 index 01e1ff2f94..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.33-1.js +++ /dev/null @@ -1,145 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.33-1.js'; - -/** - File Name: 15.9.5.33-1.js - ECMA Section: 15.9.5.33 Date.prototype.setUTCDate(date) - Description: - 1. Let t be this time value. - 2. Call ToNumber(date). - 3. Compute MakeDay(YearFromTime(t), MonthFromTime(t), Result(2)). - 4. Compute MakeDate(Result(3), TimeWithinDay(t)). - 5. Set the [[Value]] property of the this value to TimeClip(Result(4)). - 6. Return the value of the [[Value]] property of the this value. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "15.9.5.33-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Date.prototype.setUTCDate(date) "); - -addNewTestCase( "TDATE = new Date(0);(TDATE).setUTCDate(31);TDATE", - UTCDateFromTime(SetUTCDate(0,31)), - LocalDateFromTime(SetUTCDate(0,31)) ); - -addNewTestCase( "TDATE = new Date(0);(TDATE).setUTCDate(1);TDATE", - UTCDateFromTime(SetUTCDate(0,1)), - LocalDateFromTime(SetUTCDate(0,1)) ); - -addNewTestCase( "TDATE = new Date(86400000);(TDATE).setUTCDate(1);TDATE", - UTCDateFromTime(SetUTCDate(86400000,1)), - LocalDateFromTime(SetUTCDate(86400000,1)) ); - -test(); - -function addNewTestCase( DateString, UTCDate, LocalDate) { - DateCase = eval( DateString ); - - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;"+DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - d.day = WeekDay( d.value ); - - return (d); -} -function SetUTCDate( t, date ) { - var T = t; - var DATE = Number( date ); - var RESULT3 = MakeDay(YearFromTime(T), MonthFromTime(T), DATE ); - return ( TimeClip(MakeDate(RESULT3, TimeWithinDay(t))) ); -} - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.34-1.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.34-1.js deleted file mode 100644 index de4d8c817b..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.34-1.js +++ /dev/null @@ -1,182 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.34-1.js'; - -/** - File Name: 15.9.5.34-1.js - ECMA Section: 15.9.5.34 Date.prototype.setMonth(mon [, date ] ) - Description: - If date is not specified, this behaves as if date were specified with the - value getDate( ). - - 1. Let t be the result of LocalTime(this time value). - 2. Call ToNumber(date). - 3. If date is not specified, compute DateFromTime(t); otherwise, call ToNumber(date). - 4. Compute MakeDay(YearFromTime(t), Result(2), Result(3)). - 5. Compute UTC(MakeDate(Result(4), TimeWithinDay(t))). - 6. Set the [[Value]] property of the this value to TimeClip(Result(5)). - 7. Return the value of the [[Value]] property of the this value. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "15.9.5.34-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Date.prototype.setMonth(mon [, date ] )"); - -getFunctionCases(); - -// regression test for http://scopus.mcom.com/bugsplat/show_bug.cgi?id=112404 -d = new Date(0); -d.setMonth(1,1,1,1,1,1); - -addNewTestCase( - "TDATE = new Date(0); TDATE.setMonth(1,1,1,1,1,1); TDATE", - UTCDateFromTime(SetMonth(0,1,1)), - LocalDateFromTime(SetMonth(0,1,1)) ); - - -// whatever today is - -addNewTestCase( "TDATE = new Date(TIME_NOW); (TDATE).setMonth(11,31); TDATE", - UTCDateFromTime(SetMonth(TIME_NOW,11,31)), - LocalDateFromTime(SetMonth(TIME_NOW,11,31)) ); - -// 1970 - -addNewTestCase( "TDATE = new Date(0);(TDATE).setMonth(0,1);TDATE", - UTCDateFromTime(SetMonth(0,0,1)), - LocalDateFromTime(SetMonth(0,0,1)) ); - -addNewTestCase( "TDATE = new Date("+TIME_1900+"); "+ - "(TDATE).setMonth(11,31); TDATE", - UTCDateFromTime( SetMonth(TIME_1900,11,31) ), - LocalDateFromTime( SetMonth(TIME_1900,11,31) ) ); - -test(); - -function addNewTestCase( DateString, UTCDate, LocalDate) { - DateCase = eval( DateString ); - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;"+DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} - -function getFunctionCases() { - // some tests for all functions - new TestCase( - SECTION, - "Date.prototype.setMonth.length", - 2, - Date.prototype.setMonth.length ); - - new TestCase( - SECTION, - "typeof Date.prototype.setMonth", - "function", - typeof Date.prototype.setMonth ); - -} - -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - d.day = WeekDay( d.value ); - - return (d); -} -function SetMonth( t, mon, date ) { - var TIME = LocalTime(t); - var MONTH = Number( mon ); - var DATE = ( date == void 0 ) ? DateFromTime(TIME) : Number( date ); - var DAY = MakeDay( YearFromTime(TIME), MONTH, DATE ); - return ( TimeClip (UTC(MakeDate( DAY, TimeWithinDay(TIME) ))) ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.35-1.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.35-1.js deleted file mode 100644 index 427657cb47..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.35-1.js +++ /dev/null @@ -1,139 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.35-1.js'; - -/** - File Name: 15.9.5.35-1.js - ECMA Section: 15.9.5.35 Date.prototype.setUTCMonth(mon [,date]) - Description: - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "15.9.5.35-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Date.prototype.setUTCMonth(mon [,date] ) "); -addNewTestCase( "TDATE = new Date(0);(TDATE).setUTCMonth(0);TDATE", - UTCDateFromTime(SetUTCMonth(0,0)), - LocalDateFromTime(SetUTCMonth(0,0)) ); - -addNewTestCase( "TDATE = new Date(0);(TDATE).setUTCMonth(11);TDATE", - UTCDateFromTime(SetUTCMonth(0,11)), - LocalDateFromTime(SetUTCMonth(0,11)) ); - -addNewTestCase( "TDATE = new Date(0);(TDATE).setUTCMonth(3,4);TDATE", - UTCDateFromTime(SetUTCMonth(0,3,4)), - LocalDateFromTime(SetUTCMonth(0,3,4)) ); - -test(); - -function addNewTestCase( DateString, UTCDate, LocalDate) { - DateCase = eval( DateString ); - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes, DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds, DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;"+DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - d.day = WeekDay( d.value ); - - return (d); -} -function SetUTCMonth( t, month, date ) { - var T = t; - var MONTH = Number( month ); - var DATE = ( date == void 0) ? DateFromTime(T) : Number( date ); - - var RESULT4 = MakeDay(YearFromTime(T), MONTH, DATE ); - var RESULT5 = MakeDate( RESULT4, TimeWithinDay(T)); - - return ( TimeClip(RESULT5) ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.36-1.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.36-1.js deleted file mode 100644 index f4cd44c2c2..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.36-1.js +++ /dev/null @@ -1,165 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.36-1.js'; - -/** - File Name: 15.9.5.36-1.js - ECMA Section: 15.9.5.36 Date.prototype.setFullYear(year [, mon [, date ]] ) - Description: - - If mon is not specified, this behaves as if mon were specified with the - value getMonth( ). If date is not specified, this behaves as if date were - specified with the value getDate( ). - - 1. Let t be the result of LocalTime(this time value); but if this time - value is NaN, let t be +0. - 2. Call ToNumber(year). - 3. If mon is not specified, compute MonthFromTime(t); otherwise, call - ToNumber(mon). - 4. If date is not specified, compute DateFromTime(t); otherwise, call - ToNumber(date). - 5. Compute MakeDay(Result(2), Result(3), Result(4)). - 6. Compute UTC(MakeDate(Result(5), TimeWithinDay(t))). - 7. Set the [[Value]] property of the this value to TimeClip(Result(6)). - 8. Return the value of the [[Value]] property of the this value. - - Author: christine@netscape.com - Date: 12 november 1997 - - Added test cases for Year 2000 Compatilibity Testing. - -*/ -var SECTION = "15.9.5.36-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Date.prototype.setFullYear(year [, mon [, date ]] )"); - - -// 1969 - -addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1969);TDATE", - UTCDateFromTime(SetFullYear(0,1969)), - LocalDateFromTime(SetFullYear(0,1969)) ); - -addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1969,11);TDATE", - UTCDateFromTime(SetFullYear(0,1969,11)), - LocalDateFromTime(SetFullYear(0,1969,11)) ); - -addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1969,11,31);TDATE", - UTCDateFromTime(SetFullYear(0,1969,11,31)), - LocalDateFromTime(SetFullYear(0,1969,11,31)) ); - -test(); - -function addNewTestCase( DateString, UTCDate, LocalDate) { - DateCase = eval( DateString ); - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;"+DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} - -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - d.day = WeekDay( d.value ); - - return (d); -} -function SetFullYear( t, year, mon, date ) { - var T = ( isNaN(t) ) ? 0 : LocalTime(t) ; - var YEAR = Number( year ); - var MONTH = ( mon == void 0 ) ? MonthFromTime(T) : Number( mon ); - var DATE = ( date == void 0 ) ? DateFromTime(T) : Number( date ); - - var DAY = MakeDay( YEAR, MONTH, DATE ); - var UTC_DATE = UTC(MakeDate( DAY, TimeWithinDay(T))); - - return ( TimeClip(UTC_DATE) ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.36-2.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.36-2.js deleted file mode 100644 index a0ce018d0f..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.36-2.js +++ /dev/null @@ -1,164 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.36-2.js'; - -/** - File Name: 15.9.5.36-1.js - ECMA Section: 15.9.5.36 Date.prototype.setFullYear(year [, mon [, date ]] ) - Description: - - If mon is not specified, this behaves as if mon were specified with the - value getMonth( ). If date is not specified, this behaves as if date were - specified with the value getDate( ). - - 1. Let t be the result of LocalTime(this time value); but if this time - value is NaN, let t be +0. - 2. Call ToNumber(year). - 3. If mon is not specified, compute MonthFromTime(t); otherwise, call - ToNumber(mon). - 4. If date is not specified, compute DateFromTime(t); otherwise, call - ToNumber(date). - 5. Compute MakeDay(Result(2), Result(3), Result(4)). - 6. Compute UTC(MakeDate(Result(5), TimeWithinDay(t))). - 7. Set the [[Value]] property of the this value to TimeClip(Result(6)). - 8. Return the value of the [[Value]] property of the this value. - - Author: christine@netscape.com - Date: 12 november 1997 - - Added test cases for Year 2000 Compatilibity Testing. - -*/ -var SECTION = "15.9.5.36-2"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Date.prototype.setFullYear(year [, mon [, date ]] )"); - -// 1970 - -addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1970);TDATE", - UTCDateFromTime(SetFullYear(0,1970)), - LocalDateFromTime(SetFullYear(0,1970)) ); - -addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1970,0);TDATE", - UTCDateFromTime(SetFullYear(0,1970,0)), - LocalDateFromTime(SetFullYear(0,1970,0)) ); - -addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1970,0,1);TDATE", - UTCDateFromTime(SetFullYear(0,1970,0,1)), - LocalDateFromTime(SetFullYear(0,1970,0,1)) ); - -test(); - -function addNewTestCase( DateString, UTCDate, LocalDate) { - DateCase = eval( DateString ); - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;"+DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} - -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - d.day = WeekDay( d.value ); - - return (d); -} -function SetFullYear( t, year, mon, date ) { - var T = ( isNaN(t) ) ? 0 : LocalTime(t) ; - var YEAR = Number( year ); - var MONTH = ( mon == void 0 ) ? MonthFromTime(T) : Number( mon ); - var DATE = ( date == void 0 ) ? DateFromTime(T) : Number( date ); - - var DAY = MakeDay( YEAR, MONTH, DATE ); - var UTC_DATE = UTC(MakeDate( DAY, TimeWithinDay(T))); - - return ( TimeClip(UTC_DATE) ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.36-3.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.36-3.js deleted file mode 100644 index f0849f28e7..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.36-3.js +++ /dev/null @@ -1,163 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.36-3.js'; - -/** - File Name: 15.9.5.36-1.js - ECMA Section: 15.9.5.36 Date.prototype.setFullYear(year [, mon [, date ]] ) - Description: - - If mon is not specified, this behaves as if mon were specified with the - value getMonth( ). If date is not specified, this behaves as if date were - specified with the value getDate( ). - - 1. Let t be the result of LocalTime(this time value); but if this time - value is NaN, let t be +0. - 2. Call ToNumber(year). - 3. If mon is not specified, compute MonthFromTime(t); otherwise, call - ToNumber(mon). - 4. If date is not specified, compute DateFromTime(t); otherwise, call - ToNumber(date). - 5. Compute MakeDay(Result(2), Result(3), Result(4)). - 6. Compute UTC(MakeDate(Result(5), TimeWithinDay(t))). - 7. Set the [[Value]] property of the this value to TimeClip(Result(6)). - 8. Return the value of the [[Value]] property of the this value. - - Author: christine@netscape.com - Date: 12 november 1997 - - Added test cases for Year 2000 Compatilibity Testing. - -*/ -var SECTION = "15.9.5.36-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Date.prototype.setFullYear(year [, mon [, date ]] )"); - -// 1971 -addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1971);TDATE", - UTCDateFromTime(SetFullYear(0,1971)), - LocalDateFromTime(SetFullYear(0,1971)) ); - -addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1971,0);TDATE", - UTCDateFromTime(SetFullYear(0,1971,0)), - LocalDateFromTime(SetFullYear(0,1971,0)) ); - -addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1971,0,1);TDATE", - UTCDateFromTime(SetFullYear(0,1971,0,1)), - LocalDateFromTime(SetFullYear(0,1971,0,1)) ); - -test(); - -function addNewTestCase( DateString, UTCDate, LocalDate) { - DateCase = eval( DateString ); - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;"+DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} - -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - d.day = WeekDay( d.value ); - - return (d); -} -function SetFullYear( t, year, mon, date ) { - var T = ( isNaN(t) ) ? 0 : LocalTime(t) ; - var YEAR = Number( year ); - var MONTH = ( mon == void 0 ) ? MonthFromTime(T) : Number( mon ); - var DATE = ( date == void 0 ) ? DateFromTime(T) : Number( date ); - - var DAY = MakeDay( YEAR, MONTH, DATE ); - var UTC_DATE = UTC(MakeDate( DAY, TimeWithinDay(T))); - - return ( TimeClip(UTC_DATE) ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.36-4.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.36-4.js deleted file mode 100644 index 0ca872f8db..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.36-4.js +++ /dev/null @@ -1,163 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.36-4.js'; - -/** - File Name: 15.9.5.36-1.js - ECMA Section: 15.9.5.36 Date.prototype.setFullYear(year [, mon [, date ]] ) - Description: - - If mon is not specified, this behaves as if mon were specified with the - value getMonth( ). If date is not specified, this behaves as if date were - specified with the value getDate( ). - - 1. Let t be the result of LocalTime(this time value); but if this time - value is NaN, let t be +0. - 2. Call ToNumber(year). - 3. If mon is not specified, compute MonthFromTime(t); otherwise, call - ToNumber(mon). - 4. If date is not specified, compute DateFromTime(t); otherwise, call - ToNumber(date). - 5. Compute MakeDay(Result(2), Result(3), Result(4)). - 6. Compute UTC(MakeDate(Result(5), TimeWithinDay(t))). - 7. Set the [[Value]] property of the this value to TimeClip(Result(6)). - 8. Return the value of the [[Value]] property of the this value. - - Author: christine@netscape.com - Date: 12 november 1997 - - Added test cases for Year 2000 Compatilibity Testing. - -*/ -var SECTION = "15.9.5.36-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Date.prototype.setFullYear(year [, mon [, date ]] )"); - -// 1999 -addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1999);TDATE", - UTCDateFromTime(SetFullYear(0,1999)), - LocalDateFromTime(SetFullYear(0,1999)) ); - -addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1999,11);TDATE", - UTCDateFromTime(SetFullYear(0,1999,11)), - LocalDateFromTime(SetFullYear(0,1999,11)) ); - -addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(1999,11,31);TDATE", - UTCDateFromTime(SetFullYear(0,1999,11,31)), - LocalDateFromTime(SetFullYear(0,1999,11,31)) ); - -test(); - -function addNewTestCase( DateString, UTCDate, LocalDate) { - DateCase = eval( DateString ); - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;"+DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} - -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - d.day = WeekDay( d.value ); - - return (d); -} -function SetFullYear( t, year, mon, date ) { - var T = ( isNaN(t) ) ? 0 : LocalTime(t) ; - var YEAR = Number( year ); - var MONTH = ( mon == void 0 ) ? MonthFromTime(T) : Number( mon ); - var DATE = ( date == void 0 ) ? DateFromTime(T) : Number( date ); - - var DAY = MakeDay( YEAR, MONTH, DATE ); - var UTC_DATE = UTC(MakeDate( DAY, TimeWithinDay(T))); - - return ( TimeClip(UTC_DATE) ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.36-5.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.36-5.js deleted file mode 100644 index 2496548b1d..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.36-5.js +++ /dev/null @@ -1,163 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.36-5.js'; - -/** - File Name: 15.9.5.36-1.js - ECMA Section: 15.9.5.36 Date.prototype.setFullYear(year [, mon [, date ]] ) - Description: - - If mon is not specified, this behaves as if mon were specified with the - value getMonth( ). If date is not specified, this behaves as if date were - specified with the value getDate( ). - - 1. Let t be the result of LocalTime(this time value); but if this time - value is NaN, let t be +0. - 2. Call ToNumber(year). - 3. If mon is not specified, compute MonthFromTime(t); otherwise, call - ToNumber(mon). - 4. If date is not specified, compute DateFromTime(t); otherwise, call - ToNumber(date). - 5. Compute MakeDay(Result(2), Result(3), Result(4)). - 6. Compute UTC(MakeDate(Result(5), TimeWithinDay(t))). - 7. Set the [[Value]] property of the this value to TimeClip(Result(6)). - 8. Return the value of the [[Value]] property of the this value. - - Author: christine@netscape.com - Date: 12 november 1997 - - Added test cases for Year 2000 Compatilibity Testing. - -*/ -var SECTION = "15.9.5.36-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Date.prototype.setFullYear(year [, mon [, date ]] )"); - -// 2000 -addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2000);TDATE", - UTCDateFromTime(SetFullYear(0,2000)), - LocalDateFromTime(SetFullYear(0,2000)) ); - -addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2000,0);TDATE", - UTCDateFromTime(SetFullYear(0,2000,0)), - LocalDateFromTime(SetFullYear(0,2000,0)) ); - -addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2000,0,1);TDATE", - UTCDateFromTime(SetFullYear(0,2000,0,1)), - LocalDateFromTime(SetFullYear(0,2000,0,1)) ); - -test(); - -function addNewTestCase( DateString, UTCDate, LocalDate) { - DateCase = eval( DateString ); - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;"+DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} - -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - d.day = WeekDay( d.value ); - - return (d); -} -function SetFullYear( t, year, mon, date ) { - var T = ( isNaN(t) ) ? 0 : LocalTime(t) ; - var YEAR = Number( year ); - var MONTH = ( mon == void 0 ) ? MonthFromTime(T) : Number( mon ); - var DATE = ( date == void 0 ) ? DateFromTime(T) : Number( date ); - - var DAY = MakeDay( YEAR, MONTH, DATE ); - var UTC_DATE = UTC(MakeDate( DAY, TimeWithinDay(T))); - - return ( TimeClip(UTC_DATE) ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.36-6.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.36-6.js deleted file mode 100644 index 9a05c3130e..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.36-6.js +++ /dev/null @@ -1,163 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.36-6.js'; - -/** - File Name: 15.9.5.36-1.js - ECMA Section: 15.9.5.36 Date.prototype.setFullYear(year [, mon [, date ]] ) - Description: - - If mon is not specified, this behaves as if mon were specified with the - value getMonth( ). If date is not specified, this behaves as if date were - specified with the value getDate( ). - - 1. Let t be the result of LocalTime(this time value); but if this time - value is NaN, let t be +0. - 2. Call ToNumber(year). - 3. If mon is not specified, compute MonthFromTime(t); otherwise, call - ToNumber(mon). - 4. If date is not specified, compute DateFromTime(t); otherwise, call - ToNumber(date). - 5. Compute MakeDay(Result(2), Result(3), Result(4)). - 6. Compute UTC(MakeDate(Result(5), TimeWithinDay(t))). - 7. Set the [[Value]] property of the this value to TimeClip(Result(6)). - 8. Return the value of the [[Value]] property of the this value. - - Author: christine@netscape.com - Date: 12 november 1997 - - Added test cases for Year 2000 Compatilibity Testing. - -*/ -var SECTION = "15.9.5.36-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Date.prototype.setFullYear(year [, mon [, date ]] )"); - -// feb 29, 2000 -addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2000);TDATE", - UTCDateFromTime(SetFullYear(0,2000)), - LocalDateFromTime(SetFullYear(0,2000)) ); - -addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2000,1);TDATE", - UTCDateFromTime(SetFullYear(0,2000,1)), - LocalDateFromTime(SetFullYear(0,2000,1)) ); - -addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2000,1,29);TDATE", - UTCDateFromTime(SetFullYear(0,2000,1,29)), - LocalDateFromTime(SetFullYear(0,2000,1,29)) ); - -test(); - -function addNewTestCase( DateString, UTCDate, LocalDate) { - DateCase = eval( DateString ); - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;"+DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} - -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - d.day = WeekDay( d.value ); - - return (d); -} -function SetFullYear( t, year, mon, date ) { - var T = ( isNaN(t) ) ? 0 : LocalTime(t) ; - var YEAR = Number( year ); - var MONTH = ( mon == void 0 ) ? MonthFromTime(T) : Number( mon ); - var DATE = ( date == void 0 ) ? DateFromTime(T) : Number( date ); - - var DAY = MakeDay( YEAR, MONTH, DATE ); - var UTC_DATE = UTC(MakeDate( DAY, TimeWithinDay(T))); - - return ( TimeClip(UTC_DATE) ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.36-7.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.36-7.js deleted file mode 100644 index 5bc330bbea..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.36-7.js +++ /dev/null @@ -1,163 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.36-7.js'; - -/** - File Name: 15.9.5.36-1.js - ECMA Section: 15.9.5.36 Date.prototype.setFullYear(year [, mon [, date ]] ) - Description: - - If mon is not specified, this behaves as if mon were specified with the - value getMonth( ). If date is not specified, this behaves as if date were - specified with the value getDate( ). - - 1. Let t be the result of LocalTime(this time value); but if this time - value is NaN, let t be +0. - 2. Call ToNumber(year). - 3. If mon is not specified, compute MonthFromTime(t); otherwise, call - ToNumber(mon). - 4. If date is not specified, compute DateFromTime(t); otherwise, call - ToNumber(date). - 5. Compute MakeDay(Result(2), Result(3), Result(4)). - 6. Compute UTC(MakeDate(Result(5), TimeWithinDay(t))). - 7. Set the [[Value]] property of the this value to TimeClip(Result(6)). - 8. Return the value of the [[Value]] property of the this value. - - Author: christine@netscape.com - Date: 12 november 1997 - - Added test cases for Year 2000 Compatilibity Testing. - -*/ -var SECTION = "15.9.5.36-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Date.prototype.setFullYear(year [, mon [, date ]] )"); - -// Jan 1, 2005 -addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2005);TDATE", - UTCDateFromTime(SetFullYear(0,2005)), - LocalDateFromTime(SetFullYear(0,2005)) ); - -addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2005,0);TDATE", - UTCDateFromTime(SetFullYear(0,2005,0)), - LocalDateFromTime(SetFullYear(0,2005,0)) ); - -addNewTestCase( "TDATE = new Date(0);(TDATE).setFullYear(2005,0,1);TDATE", - UTCDateFromTime(SetFullYear(0,2005,0,1)), - LocalDateFromTime(SetFullYear(0,2005,0,1)) ); - -test(); - -function addNewTestCase( DateString, UTCDate, LocalDate) { - DateCase = eval( DateString ); - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;"+DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} - -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - d.day = WeekDay( d.value ); - - return (d); -} -function SetFullYear( t, year, mon, date ) { - var T = ( isNaN(t) ) ? 0 : LocalTime(t) ; - var YEAR = Number( year ); - var MONTH = ( mon == void 0 ) ? MonthFromTime(T) : Number( mon ); - var DATE = ( date == void 0 ) ? DateFromTime(T) : Number( date ); - - var DAY = MakeDay( YEAR, MONTH, DATE ); - var UTC_DATE = UTC(MakeDate( DAY, TimeWithinDay(T))); - - return ( TimeClip(UTC_DATE) ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.37-1.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.37-1.js deleted file mode 100644 index a6acd3d10a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.37-1.js +++ /dev/null @@ -1,173 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.37-1.js'; - -/** - File Name: 15.9.5.37-1.js - ECMA Section: 15.9.5.37 Date.prototype.setUTCFullYear(year [, mon [, date ]] ) - Description: - - If mon is not specified, this behaves as if mon were specified with the - value getUTCMonth( ). If date is not specified, this behaves as if date - were specified with the value getUTCDate( ). - - 1. Let t be this time value; but if this time value is NaN, let t be +0. - 2. Call ToNumber(year). - 3. If mon is not specified, compute MonthFromTime(t); otherwise, call - ToNumber(mon). - 4. If date is not specified, compute DateFromTime(t); otherwise, call - ToNumber(date). - 5. Compute MakeDay(Result(2), Result(3), Result(4)). - 6. Compute MakeDate(Result(5), TimeWithinDay(t)). - 7. Set the [[Value]] property of the this value to TimeClip(Result(6)). - 8. Return the value of the [[Value]] property of the this value. - - Author: christine@netscape.com - Date: 12 november 1997 - - Added some Year 2000 test cases. -*/ -var SECTION = "15.9.5.37-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Date.prototype.setUTCFullYear(year [, mon [, date ]] )"); - - -// Dates around 1970 - -addNewTestCase( "TDATE = new Date(0);(TDATE).setUTCFullYear(1970);TDATE", - UTCDateFromTime(SetUTCFullYear(0,1970)), - LocalDateFromTime(SetUTCFullYear(0,1970)) ); - -addNewTestCase( "TDATE = new Date(0);(TDATE).setUTCFullYear(1971);TDATE", - UTCDateFromTime(SetUTCFullYear(0,1971)), - LocalDateFromTime(SetUTCFullYear(0,1971)) ); - -addNewTestCase( "TDATE = new Date(0);(TDATE).setUTCFullYear(1972);TDATE", - UTCDateFromTime(SetUTCFullYear(0,1972)), - LocalDateFromTime(SetUTCFullYear(0,1972)) ); - -addNewTestCase( "TDATE = new Date(0);(TDATE).setUTCFullYear(1968);TDATE", - UTCDateFromTime(SetUTCFullYear(0,1968)), - LocalDateFromTime(SetUTCFullYear(0,1968)) ); - -addNewTestCase( "TDATE = new Date(0);(TDATE).setUTCFullYear(1969);TDATE", - UTCDateFromTime(SetUTCFullYear(0,1969)), - LocalDateFromTime(SetUTCFullYear(0,1969)) ); - -addNewTestCase( "TDATE = new Date(0);(TDATE).setUTCFullYear(1969);TDATE", - UTCDateFromTime(SetUTCFullYear(0,1969)), - LocalDateFromTime(SetUTCFullYear(0,1969)) ); - -test(); - -function addNewTestCase( DateString, UTCDate, LocalDate) { - DateCase = eval( DateString ); - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;"+DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} - -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - d.day = WeekDay( d.value ); - - return (d); -} -function SetUTCFullYear( t, year, mon, date ) { - var T = ( t != t ) ? 0 : t; - var YEAR = Number(year); - var MONTH = ( mon == void 0 ) ? MonthFromTime(T) : Number( mon ); - var DATE = ( date == void 0 ) ? DateFromTime(T) : Number( date ); - var DAY = MakeDay( YEAR, MONTH, DATE ); - - return ( TimeClip(MakeDate(DAY, TimeWithinDay(T))) ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.37-2.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.37-2.js deleted file mode 100644 index e5ec78ea72..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.37-2.js +++ /dev/null @@ -1,161 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.37-2.js'; - -/** - File Name: 15.9.5.37-1.js - ECMA Section: 15.9.5.37 Date.prototype.setUTCFullYear(year [, mon [, date ]] ) - Description: - - If mon is not specified, this behaves as if mon were specified with the - value getUTCMonth( ). If date is not specified, this behaves as if date - were specified with the value getUTCDate( ). - - 1. Let t be this time value; but if this time value is NaN, let t be +0. - 2. Call ToNumber(year). - 3. If mon is not specified, compute MonthFromTime(t); otherwise, call - ToNumber(mon). - 4. If date is not specified, compute DateFromTime(t); otherwise, call - ToNumber(date). - 5. Compute MakeDay(Result(2), Result(3), Result(4)). - 6. Compute MakeDate(Result(5), TimeWithinDay(t)). - 7. Set the [[Value]] property of the this value to TimeClip(Result(6)). - 8. Return the value of the [[Value]] property of the this value. - - Author: christine@netscape.com - Date: 12 november 1997 - - Added some Year 2000 test cases. -*/ -var SECTION = "15.9.5.37-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Date.prototype.setUTCFullYear(year [, mon [, date ]] )"); - - -// Dates around 2000 - -addNewTestCase( "TDATE = new Date(0); TDATE.setUTCFullYear(2000);TDATE", - UTCDateFromTime(SetUTCFullYear(0,2000)), - LocalDateFromTime(SetUTCFullYear(0,2000)) ); - -addNewTestCase( "TDATE = new Date(0); TDATE.setUTCFullYear(2001);TDATE", - UTCDateFromTime(SetUTCFullYear(0,2001)), - LocalDateFromTime(SetUTCFullYear(0,2001)) ); - -addNewTestCase( "TDATE = new Date(0); TDATE.setUTCFullYear(1999);TDATE", - UTCDateFromTime(SetUTCFullYear(0,1999)), - LocalDateFromTime(SetUTCFullYear(0,1999)) ); - -test(); - -function addNewTestCase( DateString, UTCDate, LocalDate) { - DateCase = eval( DateString ); - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;"+DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} - -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - d.day = WeekDay( d.value ); - - return (d); -} -function SetUTCFullYear( t, year, mon, date ) { - var T = ( t != t ) ? 0 : t; - var YEAR = Number(year); - var MONTH = ( mon == void 0 ) ? MonthFromTime(T) : Number( mon ); - var DATE = ( date == void 0 ) ? DateFromTime(T) : Number( date ); - var DAY = MakeDay( YEAR, MONTH, DATE ); - - return ( TimeClip(MakeDate(DAY, TimeWithinDay(T))) ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.37-3.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.37-3.js deleted file mode 100644 index d256511459..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.37-3.js +++ /dev/null @@ -1,164 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.37-3.js'; - -/** - File Name: 15.9.5.37-1.js - ECMA Section: 15.9.5.37 Date.prototype.setUTCFullYear(year [, mon [, date ]] ) - Description: - - If mon is not specified, this behaves as if mon were specified with the - value getUTCMonth( ). If date is not specified, this behaves as if date - were specified with the value getUTCDate( ). - - 1. Let t be this time value; but if this time value is NaN, let t be +0. - 2. Call ToNumber(year). - 3. If mon is not specified, compute MonthFromTime(t); otherwise, call - ToNumber(mon). - 4. If date is not specified, compute DateFromTime(t); otherwise, call - ToNumber(date). - 5. Compute MakeDay(Result(2), Result(3), Result(4)). - 6. Compute MakeDate(Result(5), TimeWithinDay(t)). - 7. Set the [[Value]] property of the this value to TimeClip(Result(6)). - 8. Return the value of the [[Value]] property of the this value. - - Author: christine@netscape.com - Date: 12 november 1997 - - Added some Year 2000 test cases. -*/ -var SECTION = "15.9.5.37-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Date.prototype.setUTCFullYear(year [, mon [, date ]] )"); - - -// Dates around 29 February 2000 - -var UTC_FEB_29_1972 = TIME_1970 + TimeInYear(1970) + TimeInYear(1971) + - 31*msPerDay + 28*msPerDay; - -var PST_FEB_29_1972 = UTC_FEB_29_1972 - TZ_DIFF * msPerHour; - -addNewTestCase( "TDATE = new Date("+UTC_FEB_29_1972+"); "+ - "TDATE.setUTCFullYear(2000);TDATE", - UTCDateFromTime(SetUTCFullYear(UTC_FEB_29_1972,2000)), - LocalDateFromTime(SetUTCFullYear(UTC_FEB_29_1972,2000)) ); - -addNewTestCase( "TDATE = new Date("+PST_FEB_29_1972+"); "+ - "TDATE.setUTCFullYear(2000);TDATE", - UTCDateFromTime(SetUTCFullYear(PST_FEB_29_1972,2000)), - LocalDateFromTime(SetUTCFullYear(PST_FEB_29_1972,2000)) ); - -test(); - -function addNewTestCase( DateString, UTCDate, LocalDate) { - DateCase = eval( DateString ); - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;"+DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} - -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - d.day = WeekDay( d.value ); - - return (d); -} -function SetUTCFullYear( t, year, mon, date ) { - var T = ( t != t ) ? 0 : t; - var YEAR = Number(year); - var MONTH = ( mon == void 0 ) ? MonthFromTime(T) : Number( mon ); - var DATE = ( date == void 0 ) ? DateFromTime(T) : Number( date ); - var DAY = MakeDay( YEAR, MONTH, DATE ); - - return ( TimeClip(MakeDate(DAY, TimeWithinDay(T))) ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.37-4.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.37-4.js deleted file mode 100644 index 017afd6389..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.37-4.js +++ /dev/null @@ -1,163 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.37-4.js'; - -/** - File Name: 15.9.5.37-1.js - ECMA Section: 15.9.5.37 Date.prototype.setUTCFullYear(year [, mon [, date ]] ) - Description: - - If mon is not specified, this behaves as if mon were specified with the - value getUTCMonth( ). If date is not specified, this behaves as if date - were specified with the value getUTCDate( ). - - 1. Let t be this time value; but if this time value is NaN, let t be +0. - 2. Call ToNumber(year). - 3. If mon is not specified, compute MonthFromTime(t); otherwise, call - ToNumber(mon). - 4. If date is not specified, compute DateFromTime(t); otherwise, call - ToNumber(date). - 5. Compute MakeDay(Result(2), Result(3), Result(4)). - 6. Compute MakeDate(Result(5), TimeWithinDay(t)). - 7. Set the [[Value]] property of the this value to TimeClip(Result(6)). - 8. Return the value of the [[Value]] property of the this value. - - Author: christine@netscape.com - Date: 12 november 1997 - - Added some Year 2000 test cases. -*/ -var SECTION = "15.9.5.37-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Date.prototype.setUTCFullYear(year [, mon [, date ]] )"); - -// Dates around 2005 - -addNewTestCase( "TDATE = new Date(0); TDATE.setUTCFullYear(2005);TDATE", - UTCDateFromTime(SetUTCFullYear(0,2005)), - LocalDateFromTime(SetUTCFullYear(0,2005)) ); - -addNewTestCase( "TDATE = new Date(0); TDATE.setUTCFullYear(2004);TDATE", - UTCDateFromTime(SetUTCFullYear(0,2004)), - LocalDateFromTime(SetUTCFullYear(0,2004)) ); - -addNewTestCase( "TDATE = new Date(0); TDATE.setUTCFullYear(2006);TDATE", - UTCDateFromTime(SetUTCFullYear(0,2006)), - LocalDateFromTime(SetUTCFullYear(0,2006)) ); - -test(); - -function addNewTestCase( DateString, UTCDate, LocalDate) { - DateCase = eval( DateString ); - - -// fixed_year = ( ExpectDate.year >=1900 || ExpectDate.year < 2000 ) ? ExpectDate.year - 1900 : ExpectDate.year; - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;"+DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} - -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - d.day = WeekDay( d.value ); - - return (d); -} -function SetUTCFullYear( t, year, mon, date ) { - var T = ( t != t ) ? 0 : t; - var YEAR = Number(year); - var MONTH = ( mon == void 0 ) ? MonthFromTime(T) : Number( mon ); - var DATE = ( date == void 0 ) ? DateFromTime(T) : Number( date ); - var DAY = MakeDay( YEAR, MONTH, DATE ); - - return ( TimeClip(MakeDate(DAY, TimeWithinDay(T))) ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.37-5.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.37-5.js deleted file mode 100644 index 046f3095df..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.37-5.js +++ /dev/null @@ -1,159 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.37-5.js'; - -/** - File Name: 15.9.5.37-1.js - ECMA Section: 15.9.5.37 Date.prototype.setUTCFullYear(year [, mon [, date ]] ) - Description: - - If mon is not specified, this behaves as if mon were specified with the - value getUTCMonth( ). If date is not specified, this behaves as if date - were specified with the value getUTCDate( ). - - 1. Let t be this time value; but if this time value is NaN, let t be +0. - 2. Call ToNumber(year). - 3. If mon is not specified, compute MonthFromTime(t); otherwise, call - ToNumber(mon). - 4. If date is not specified, compute DateFromTime(t); otherwise, call - ToNumber(date). - 5. Compute MakeDay(Result(2), Result(3), Result(4)). - 6. Compute MakeDate(Result(5), TimeWithinDay(t)). - 7. Set the [[Value]] property of the this value to TimeClip(Result(6)). - 8. Return the value of the [[Value]] property of the this value. - - Author: christine@netscape.com - Date: 12 november 1997 - - Added some Year 2000 test cases. -*/ -var SECTION = "15.9.5.37-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Date.prototype.setUTCFullYear(year [, mon [, date ]] )"); - -// Dates around 1900 -addNewTestCase( "TDATE = new Date(0); TDATE.setUTCFullYear(1900);TDATE", - UTCDateFromTime(SetUTCFullYear(0,1900)), - LocalDateFromTime(SetUTCFullYear(0,1900)) ); - -addNewTestCase( "TDATE = new Date(0); TDATE.setUTCFullYear(1899);TDATE", - UTCDateFromTime(SetUTCFullYear(0,1899)), - LocalDateFromTime(SetUTCFullYear(0,1899)) ); - -addNewTestCase( "TDATE = new Date(0); TDATE.setUTCFullYear(1901);TDATE", - UTCDateFromTime(SetUTCFullYear(0,1901)), - LocalDateFromTime(SetUTCFullYear(0,1901)) ); - -test(); - -function addNewTestCase( DateString, UTCDate, LocalDate) { - DateCase = eval( DateString ); - - new TestCase( SECTION, DateString+".getTime()", UTCDate.value, DateCase.getTime() ); - new TestCase( SECTION, DateString+".valueOf()", UTCDate.value, DateCase.valueOf() ); - - new TestCase( SECTION, DateString+".getUTCFullYear()", UTCDate.year, DateCase.getUTCFullYear() ); - new TestCase( SECTION, DateString+".getUTCMonth()", UTCDate.month, DateCase.getUTCMonth() ); - new TestCase( SECTION, DateString+".getUTCDate()", UTCDate.date, DateCase.getUTCDate() ); - new TestCase( SECTION, DateString+".getUTCDay()", UTCDate.day, DateCase.getUTCDay() ); - new TestCase( SECTION, DateString+".getUTCHours()", UTCDate.hours, DateCase.getUTCHours() ); - new TestCase( SECTION, DateString+".getUTCMinutes()", UTCDate.minutes,DateCase.getUTCMinutes() ); - new TestCase( SECTION, DateString+".getUTCSeconds()", UTCDate.seconds,DateCase.getUTCSeconds() ); - new TestCase( SECTION, DateString+".getUTCMilliseconds()", UTCDate.ms, DateCase.getUTCMilliseconds() ); - - new TestCase( SECTION, DateString+".getFullYear()", LocalDate.year, DateCase.getFullYear() ); - new TestCase( SECTION, DateString+".getMonth()", LocalDate.month, DateCase.getMonth() ); - new TestCase( SECTION, DateString+".getDate()", LocalDate.date, DateCase.getDate() ); - new TestCase( SECTION, DateString+".getDay()", LocalDate.day, DateCase.getDay() ); - new TestCase( SECTION, DateString+".getHours()", LocalDate.hours, DateCase.getHours() ); - new TestCase( SECTION, DateString+".getMinutes()", LocalDate.minutes, DateCase.getMinutes() ); - new TestCase( SECTION, DateString+".getSeconds()", LocalDate.seconds, DateCase.getSeconds() ); - new TestCase( SECTION, DateString+".getMilliseconds()", LocalDate.ms, DateCase.getMilliseconds() ); - - DateCase.toString = Object.prototype.toString; - - new TestCase( SECTION, - DateString+".toString=Object.prototype.toString;"+DateString+".toString()", - "[object Date]", - DateCase.toString() ); -} - -function MyDate() { - this.year = 0; - this.month = 0; - this.date = 0; - this.hours = 0; - this.minutes = 0; - this.seconds = 0; - this.ms = 0; -} -function LocalDateFromTime(t) { - t = LocalTime(t); - return ( MyDateFromTime(t) ); -} -function UTCDateFromTime(t) { - return ( MyDateFromTime(t) ); -} -function MyDateFromTime( t ) { - var d = new MyDate(); - d.year = YearFromTime(t); - d.month = MonthFromTime(t); - d.date = DateFromTime(t); - d.hours = HourFromTime(t); - d.minutes = MinFromTime(t); - d.seconds = SecFromTime(t); - d.ms = msFromTime(t); - - d.time = MakeTime( d.hours, d.minutes, d.seconds, d.ms ); - d.value = TimeClip( MakeDate( MakeDay( d.year, d.month, d.date ), d.time ) ); - d.day = WeekDay( d.value ); - - return (d); -} -function SetUTCFullYear( t, year, mon, date ) { - var T = ( t != t ) ? 0 : t; - var YEAR = Number(year); - var MONTH = ( mon == void 0 ) ? MonthFromTime(T) : Number( mon ); - var DATE = ( date == void 0 ) ? DateFromTime(T) : Number( date ); - var DAY = MakeDay( YEAR, MONTH, DATE ); - - return ( TimeClip(MakeDate(DAY, TimeWithinDay(T))) ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.4-1.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.4-1.js deleted file mode 100644 index 6ad06931f8..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.4-1.js +++ /dev/null @@ -1,93 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.4-1.js'; - -/** - File Name: 15.9.5.4-1.js - ECMA Section: 15.9.5.4-1 Date.prototype.getTime - Description: - - 1. If the this value is not an object whose [[Class]] property is "Date", - generate a runtime error. - 2. Return this time value. - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "15.9.5.4-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getTime"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -addTestCase( TIME_NOW ); -addTestCase( TIME_1970 ); -addTestCase( TIME_1900 ); -addTestCase( TIME_2000 ); -addTestCase( UTC_FEB_29_2000 ); -addTestCase( UTC_JAN_1_2005 ); - -test(); - -function addTestCase( t ) { - new TestCase( SECTION, - "(new Date("+t+").getTime()", - t, - (new Date(t)).getTime() ); - - new TestCase( SECTION, - "(new Date("+(t+1)+").getTime()", - t+1, - (new Date(t+1)).getTime() ); - - new TestCase( SECTION, - "(new Date("+(t-1)+").getTime()", - t-1, - (new Date(t-1)).getTime() ); - - new TestCase( SECTION, - "(new Date("+(t-TZ_ADJUST)+").getTime()", - t-TZ_ADJUST, - (new Date(t-TZ_ADJUST)).getTime() ); - - new TestCase( SECTION, - "(new Date("+(t+TZ_ADJUST)+").getTime()", - t+TZ_ADJUST, - (new Date(t+TZ_ADJUST)).getTime() ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.4-2-n.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.4-2-n.js deleted file mode 100644 index 1cd98dd801..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.4-2-n.js +++ /dev/null @@ -1,76 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.4-2-n.js'; - -/** - File Name: 15.9.5.4-2-n.js - ECMA Section: 15.9.5.4-1 Date.prototype.getTime - Description: - - 1. If the this value is not an object whose [[Class]] property is "Date", - generate a runtime error. - 2. Return this time value. - Author: christine@netscape.com - Date: 12 november 1997 -*/ - - -var SECTION = "15.9.5.4-2-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getTime"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var MYDATE = new MyDate( TIME_2000 ); - -DESCRIPTION = "MYDATE.getTime()"; -EXPECTED = "error"; - -new TestCase( SECTION, - "MYDATE.getTime()", - "error", - eval("MYDATE.getTime()") ); - -test(); - -function MyDate( value ) { - this.value = value; - this.getTime = Date.prototype.getTime; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.5.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.5.js deleted file mode 100644 index f0136b00ad..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.5.js +++ /dev/null @@ -1,112 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.5.js'; - -/** - File Name: 15.9.5.5.js - ECMA Section: 15.9.5.5 - Description: Date.prototype.getYear - - This function is specified here for backwards compatibility only. The - function getFullYear is much to be preferred for nearly all purposes, - because it avoids the "year 2000 problem." - - 1. Let t be this time value. - 2. If t is NaN, return NaN. - 3. Return YearFromTime(LocalTime(t)) 1900. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.5"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getYear()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -addTestCase( TIME_NOW ); -addTestCase( TIME_0000 ); -addTestCase( TIME_1970 ); -addTestCase( TIME_1900 ); -addTestCase( TIME_2000 ); -addTestCase( UTC_FEB_29_2000 ); - -new TestCase( SECTION, - "(new Date(NaN)).getYear()", - NaN, - (new Date(NaN)).getYear() ); - -new TestCase( SECTION, - "Date.prototype.getYear.length", - 0, - Date.prototype.getYear.length ); - -test(); - -function addTestCase( t ) { - new TestCase( SECTION, - "(new Date("+t+")).getYear()", - GetYear(YearFromTime(LocalTime(t))), - (new Date(t)).getYear() ); - - new TestCase( SECTION, - "(new Date("+(t+1)+")).getYear()", - GetYear(YearFromTime(LocalTime(t+1))), - (new Date(t+1)).getYear() ); - - new TestCase( SECTION, - "(new Date("+(t-1)+")).getYear()", - GetYear(YearFromTime(LocalTime(t-1))), - (new Date(t-1)).getYear() ); - - new TestCase( SECTION, - "(new Date("+(t-TZ_ADJUST)+")).getYear()", - GetYear(YearFromTime(LocalTime(t-TZ_ADJUST))), - (new Date(t-TZ_ADJUST)).getYear() ); - - new TestCase( SECTION, - "(new Date("+(t+TZ_ADJUST)+")).getYear()", - GetYear(YearFromTime(LocalTime(t+TZ_ADJUST))), - (new Date(t+TZ_ADJUST)).getYear() ); -} -function GetYear( year ) { - return year - 1900; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.6.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.6.js deleted file mode 100644 index 9ae804ebb9..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.6.js +++ /dev/null @@ -1,104 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.6.js'; - -/** - File Name: 15.9.5.6.js - ECMA Section: 15.9.5.6 - Description: Date.prototype.getFullYear - - 1. Let t be this time value. - 2. If t is NaN, return NaN. - 3. Return YearFromTime(LocalTime(t)). - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.6"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getFullYear()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -addTestCase( TIME_NOW ); -addTestCase( TIME_0000 ); -addTestCase( TIME_1970 ); -addTestCase( TIME_1900 ); -addTestCase( TIME_2000 ); -addTestCase( UTC_FEB_29_2000 ); -addTestCase( UTC_JAN_1_2005 ); - -new TestCase( SECTION, - "(new Date(NaN)).getFullYear()", - NaN, - (new Date(NaN)).getFullYear() ); - -new TestCase( SECTION, - "Date.prototype.getFullYear.length", - 0, - Date.prototype.getFullYear.length ); - -test(); -function addTestCase( t ) { - new TestCase( SECTION, - "(new Date("+t+")).getFullYear()", - YearFromTime(LocalTime(t)), - (new Date(t)).getFullYear() ); - - new TestCase( SECTION, - "(new Date("+(t+1)+")).getFullYear()", - YearFromTime(LocalTime(t+1)), - (new Date(t+1)).getFullYear() ); - - new TestCase( SECTION, - "(new Date("+(t-1)+")).getFullYear()", - YearFromTime(LocalTime(t-1)), - (new Date(t-1)).getFullYear() ); - - new TestCase( SECTION, - "(new Date("+(t-TZ_ADJUST)+")).getFullYear()", - YearFromTime(LocalTime(t-TZ_ADJUST)), - (new Date(t-TZ_ADJUST)).getFullYear() ); - - new TestCase( SECTION, - "(new Date("+(t+TZ_ADJUST)+")).getFullYear()", - YearFromTime(LocalTime(t+TZ_ADJUST)), - (new Date(t+TZ_ADJUST)).getFullYear() ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.7.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.7.js deleted file mode 100644 index c4c83a2c38..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.7.js +++ /dev/null @@ -1,105 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.7.js'; - -/** - File Name: 15.9.5.7.js - ECMA Section: 15.9.5.7 - Description: Date.prototype.getUTCFullYear - - 1.Let t be this time value. - 2.If t is NaN, return NaN. - 3.Return YearFromTime(t). - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.7"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getUTCFullYear()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -addTestCase( TIME_NOW ); -addTestCase( TIME_0000 ); -addTestCase( TIME_1970 ); -addTestCase( TIME_1900 ); -addTestCase( TIME_2000 ); -addTestCase( UTC_FEB_29_2000 ); -addTestCase( UTC_JAN_1_2005 ); - -new TestCase( SECTION, - "(new Date(NaN)).getUTCFullYear()", - NaN, - (new Date(NaN)).getUTCFullYear() ); - -new TestCase( SECTION, - "Date.prototype.getUTCFullYear.length", - 0, - Date.prototype.getUTCFullYear.length ); - -test(); - -function addTestCase( t ) { - new TestCase( SECTION, - "(new Date("+t+")).getUTCFullYear()", - YearFromTime(t), - (new Date(t)).getUTCFullYear() ); - - new TestCase( SECTION, - "(new Date("+(t+1)+")).getUTCFullYear()", - YearFromTime(t+1), - (new Date(t+1)).getUTCFullYear() ); - - new TestCase( SECTION, - "(new Date("+(t-1)+")).getUTCFullYear()", - YearFromTime(t-1), - (new Date(t-1)).getUTCFullYear() ); - - new TestCase( SECTION, - "(new Date("+(t-TZ_ADJUST)+")).getUTCFullYear()", - YearFromTime(t-TZ_ADJUST), - (new Date(t-TZ_ADJUST)).getUTCFullYear() ); - - new TestCase( SECTION, - "(new Date("+(t+TZ_ADJUST)+")).getUTCFullYear()", - YearFromTime(t+TZ_ADJUST), - (new Date(t+TZ_ADJUST)).getUTCFullYear() ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.8.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.8.js deleted file mode 100644 index 572e293960..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.8.js +++ /dev/null @@ -1,113 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.8.js'; - -/** - File Name: 15.9.5.8.js - ECMA Section: 15.9.5.8 - Description: Date.prototype.getMonth - - 1. Let t be this time value. - 2. If t is NaN, return NaN. - 3. Return MonthFromTime(LocalTime(t)). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.8"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getMonth()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -addTestCase( TIME_NOW ); -addTestCase( TIME_0000 ); -addTestCase( TIME_1970 ); -addTestCase( TIME_1900 ); -addTestCase( TIME_2000 ); -addTestCase( UTC_FEB_29_2000 ); -addTestCase( UTC_JAN_1_2005 ); - -new TestCase( SECTION, - "(new Date(NaN)).getMonth()", - NaN, - (new Date(NaN)).getMonth() ); - -new TestCase( SECTION, - "Date.prototype.getMonth.length", - 0, - Date.prototype.getMonth.length ); -test(); - -function addTestCase( t ) { - var leap = InLeapYear(t); - - for ( var m = 0; m < 12; m++ ) { - - t += TimeInMonth(m, leap); - - new TestCase( SECTION, - "(new Date("+t+")).getMonth()", - MonthFromTime(LocalTime(t)), - (new Date(t)).getMonth() ); - - new TestCase( SECTION, - "(new Date("+(t+1)+")).getMonth()", - MonthFromTime(LocalTime(t+1)), - (new Date(t+1)).getMonth() ); - - new TestCase( SECTION, - "(new Date("+(t-1)+")).getMonth()", - MonthFromTime(LocalTime(t-1)), - (new Date(t-1)).getMonth() ); - - new TestCase( SECTION, - "(new Date("+(t-TZ_ADJUST)+")).getMonth()", - MonthFromTime(LocalTime(t-TZ_ADJUST)), - (new Date(t-TZ_ADJUST)).getMonth() ); - - new TestCase( SECTION, - "(new Date("+(t+TZ_ADJUST)+")).getMonth()", - MonthFromTime(LocalTime(t+TZ_ADJUST)), - (new Date(t+TZ_ADJUST)).getMonth() ); - - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.9.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.9.js deleted file mode 100644 index 9f0fc124af..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.9.js +++ /dev/null @@ -1,113 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.9.js'; - -/** - File Name: 15.9.5.9.js - ECMA Section: 15.9.5.9 - Description: Date.prototype.getUTCMonth - - 1. Let t be this time value. - 2. If t is NaN, return NaN. - 3. Return MonthFromTime(t). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5.9"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Date.prototype.getUTCMonth()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -addTestCase( TIME_NOW ); -addTestCase( TIME_0000 ); -addTestCase( TIME_1970 ); -addTestCase( TIME_1900 ); -addTestCase( TIME_2000 ); -addTestCase( UTC_FEB_29_2000 ); -addTestCase( UTC_JAN_1_2005 ); - -new TestCase( SECTION, - "(new Date(NaN)).getUTCMonth()", - NaN, - (new Date(NaN)).getUTCMonth() ); - -new TestCase( SECTION, - "Date.prototype.getUTCMonth.length", - 0, - Date.prototype.getUTCMonth.length ); -test(); - -function addTestCase( t ) { - var leap = InLeapYear(t); - - for ( var m = 0; m < 12; m++ ) { - - t += TimeInMonth(m, leap); - - new TestCase( SECTION, - "(new Date("+t+")).getUTCMonth()", - MonthFromTime(t), - (new Date(t)).getUTCMonth() ); - - new TestCase( SECTION, - "(new Date("+(t+1)+")).getUTCMonth()", - MonthFromTime(t+1), - (new Date(t+1)).getUTCMonth() ); - - new TestCase( SECTION, - "(new Date("+(t-1)+")).getUTCMonth()", - MonthFromTime(t-1), - (new Date(t-1)).getUTCMonth() ); - - new TestCase( SECTION, - "(new Date("+(t-TZ_ADJUST)+")).getUTCMonth()", - MonthFromTime(t-TZ_ADJUST), - (new Date(t-TZ_ADJUST)).getUTCMonth() ); - - new TestCase( SECTION, - "(new Date("+(t+TZ_ADJUST)+")).getUTCMonth()", - MonthFromTime(t+TZ_ADJUST), - (new Date(t+TZ_ADJUST)).getUTCMonth() ); - - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.js b/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.js deleted file mode 100644 index 9e3bd94080..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/15.9.5.js +++ /dev/null @@ -1,83 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.js'; - -/** - File Name: 15.9.5.js - ECMA Section: 15.9.5 Properties of the Date prototype object - Description: - - The Date prototype object is itself a Date object (its [[Class]] is - "Date") whose value is NaN. - - The value of the internal [[Prototype]] property of the Date prototype - object is the Object prototype object (15.2.3.1). - - In following descriptions of functions that are properties of the Date - prototype object, the phrase "this Date 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 "Date". Also, the phrase "this time value" refers - to the number value for the time represented by this Date object, that is, - the value of the internal [[Value]] property of this Date object. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Properties of the Date Prototype Object"; - -writeHeaderToLog( SECTION + " "+ TITLE); - - -Date.prototype.getClass = Object.prototype.toString; - -new TestCase( SECTION, - "Date.prototype.getClass", - "[object Date]", - Date.prototype.getClass() ); -new TestCase( SECTION, - "Date.prototype.valueOf()", - NaN, - Date.prototype.valueOf() ); -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/browser.js b/tests/auto/declarative/parserstress/tests/ecma/Date/browser.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/auto/declarative/parserstress/tests/ecma/Date/shell.js b/tests/auto/declarative/parserstress/tests/ecma/Date/shell.js deleted file mode 100644 index 0beb78e064..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Date/shell.js +++ /dev/null @@ -1 +0,0 @@ -gTestsubsuite = 'Date'; diff --git a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.3-1.js b/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.3-1.js deleted file mode 100644 index 699296d6b1..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.3-1.js +++ /dev/null @@ -1,107 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '10.1.3-1.js'; - -/** - File Name: 10.1.3-1.js - ECMA Section: 10.1.3 - Description: - - For each formal parameter, as defined in the FormalParameterList, create - a property of the variable object whose name is the Identifier and whose - attributes are determined by the type of code. The values of the - parameters are supplied by the caller. If the caller supplies fewer - parameter values than there are formal parameters, the extra formal - parameters have value undefined. If two or more formal parameters share - the same name, hence the same property, the corresponding property is - given the value that was supplied for the last parameter with this name. - If the value of this last parameter was not supplied by the caller, - the value of the corresponding property is undefined. - - - http://scopus.mcom.com/bugsplat/show_bug.cgi?id=104191 - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "10.1.3-1"; -var VERSION = "ECMA_1"; -var TITLE = "Variable Instantiation: Formal Parameters"; -var BUGNUMBER="104191"; -startTest(); - -writeHeaderToLog( SECTION + " "+ TITLE); - -var myfun1 = new Function( "a", "a", "return a" ); -var myfun2 = new Function( "a", "b", "a", "return a" ); - -function myfun3(a, b, a) { - return a; -} - -// myfun1, myfun2, myfun3 tostring - - -new TestCase( - SECTION, - String(myfun2) +"; myfun2(2,4,8)", - 8, - myfun2(2,4,8) ); - -new TestCase( - SECTION, - "myfun2(2,4)", - void 0, - myfun2(2,4)); - -new TestCase( - SECTION, - String(myfun3) +"; myfun3(2,4,8)", - 8, - myfun3(2,4,8) ); - -new TestCase( - SECTION, - "myfun3(2,4)", - void 0, - myfun3(2,4) ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.3-2.js b/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.3-2.js deleted file mode 100755 index 3762842461..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.3-2.js +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): mozilla@florian.loitsch.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '10.1.3-2.js'; - -/** - File Name: 10.1.3-1.js - ECMA Section: 10.1.3 - Description: - - Author: mozilla@florian.loitsch.com - Date: 27 July 2005 -*/ - -var SECTION = "10.1.3-2"; -var VERSION = "ECMA_1"; -var TITLE = "Variable Instantiation: Function Declarations"; -var BUGNUMBER="299639"; -startTest(); - -writeHeaderToLog( SECTION + " "+ TITLE); - -function f(g) -{ - function g() { - return "g"; - }; - return g; -} - -new TestCase( - SECTION, - "typeof f(\"parameter\")", - "function", - typeof f("parameter") ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.3.js b/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.3.js deleted file mode 100644 index fd466de210..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.3.js +++ /dev/null @@ -1,170 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '10.1.3.js'; - -/** - File Name: 10.1.3.js - ECMA Section: 10.1.3.js Variable Instantiation - Description: - Author: christine@netscape.com - Date: 11 september 1997 -*/ - -var SECTION = "10.1.3"; -var VERSION = "ECMA_1"; -var TITLE = "Variable instantiation"; -var BUGNUMBER = "20256"; -startTest(); - -writeHeaderToLog( SECTION + " "+ TITLE); - - -// overriding a variable or function name with a function should succeed - -new TestCase(SECTION, - "function t() { return \"first\" };" + - "function t() { return \"second\" };t() ", - "second", - eval("function t() { return \"first\" };" + - "function t() { return \"second\" };t()")); - - -new TestCase(SECTION, - "var t; function t(){}; typeof(t)", - "function", - eval("var t; function t(){}; typeof(t)")); - - -// formal parameter tests - -new TestCase(SECTION, - "function t1(a,b) { return b; }; t1( 4 );", - void 0, - eval("function t1(a,b) { return b; }; t1( 4 );") ); - -new TestCase(SECTION, - "function t1(a,b) { return a; }; t1(4);", - 4, - eval("function t1(a,b) { return a; }; t1(4)")); - -new TestCase(SECTION, - "function t1(a,b) { return a; }; t1();", - void 0, - eval("function t1(a,b) { return a; }; t1()")); - -new TestCase(SECTION, - "function t1(a,b) { return a; }; t1(1,2,4);", - 1, - eval("function t1(a,b) { return a; }; t1(1,2,4)")); -/* - -new TestCase(SECTION, "function t1(a,a) { return a; }; t1( 4 );", -void 0, -eval("function t1(a,a) { return a; }; t1( 4 )")); - -new TestCase(SECTION, -"function t1(a,a) { return a; }; t1( 1,2 );", -2, -eval("function t1(a,a) { return a; }; t1( 1,2 )")); -*/ -// variable declarations - -new TestCase(SECTION, - "function t1(a,b) { return a; }; t1( false, true );", - false, - eval("function t1(a,b) { return a; }; t1( false, true );")); - -new TestCase(SECTION, - "function t1(a,b) { return b; }; t1( false, true );", - true, - eval("function t1(a,b) { return b; }; t1( false, true );")); - -new TestCase(SECTION, - "function t1(a,b) { return a+b; }; t1( 4, 2 );", - 6, - eval("function t1(a,b) { return a+b; }; t1( 4, 2 );")); - -new TestCase(SECTION, - "function t1(a,b) { return a+b; }; t1( 4 );", - Number.NaN, - eval("function t1(a,b) { return a+b; }; t1( 4 );")); - -// overriding a function name with a variable should fail - -new TestCase(SECTION, - "function t() { return 'function' };" + - "var t = 'variable'; typeof(t)", - "string", - eval("function t() { return 'function' };" + - "var t = 'variable'; typeof(t)")); - -// function as a constructor - -new TestCase(SECTION, - "function t1(a,b) { var a = b; return a; } t1(1,3);", - 3, - eval("function t1(a, b){ var a = b; return a;}; t1(1,3)")); - -new TestCase(SECTION, - "function t2(a,b) { this.a = b; } x = new t2(1,3); x.a", - 3, - eval("function t2(a,b) { this.a = b; };" + - "x = new t2(1,3); x.a")); - -new TestCase(SECTION, - "function t2(a,b) { this.a = a; } x = new t2(1,3); x.a", - 1, - eval("function t2(a,b) { this.a = a; };" + - "x = new t2(1,3); x.a")); - -new TestCase(SECTION, - "function t2(a,b) { this.a = b; this.b = a; } " + - "x = new t2(1,3);x.a;", - 3, - eval("function t2(a,b) { this.a = b; this.b = a; };" + - "x = new t2(1,3);x.a;")); - -new TestCase(SECTION, - "function t2(a,b) { this.a = b; this.b = a; }" + - "x = new t2(1,3);x.b;", - 1, - eval("function t2(a,b) { this.a = b; this.b = a; };" + - "x = new t2(1,3);x.b;") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.4-1.js b/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.4-1.js deleted file mode 100644 index ec49f20596..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.4-1.js +++ /dev/null @@ -1,111 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '10.1.4-1.js'; - -/** - File Name: 10.1.4-1.js - ECMA Section: 10.1.4 Scope Chain and Identifier Resolution - Description: - Every execution context has associated with it a scope chain. This is - logically a list of objects that are searched when binding an Identifier. - When control enters an execution context, the scope chain is created and - is populated with an initial set of objects, depending on the type of - code. When control leaves the execution context, the scope chain is - destroyed. - - During execution, the scope chain of the execution context is affected - only by WithStatement. When execution enters a with block, the object - specified in the with statement is added to the front of the scope chain. - When execution leaves a with block, whether normally or via a break or - continue statement, the object is removed from the scope chain. The object - being removed will always be the first object in the scope chain. - - During execution, the syntactic production PrimaryExpression : Identifier - is evaluated using the following algorithm: - - 1. Get the next object in the scope chain. If there isn't one, go to step 5. - 2. Call the [[HasProperty]] method of Result(l), passing the Identifier as - the property. - 3. If Result(2) is true, return a value of type Reference whose base object - is Result(l) and whose property name is the Identifier. - 4. Go to step 1. - 5. Return a value of type Reference whose base object is null and whose - property name is the Identifier. - The result of binding an identifier is always a value of type Reference with - its member name component equal to the identifier string. - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "10.1.4-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Scope Chain and Identifier Resolution"); - -new TestCase( "SECTION", "with MyObject, eval should return square of " ); - -test(); - -function test() { - for ( gTc=0; gTc < gTestcases.length; gTc++ ) { - - var MYOBJECT = new MyObject(); - var INPUT = 2; - gTestcases[gTc].description += "( " + INPUT +" )" ; - - with ( MYOBJECT ) { - gTestcases[gTc].actual = eval( INPUT ); - gTestcases[gTc].expect = Math.pow(INPUT,2); - } - - gTestcases[gTc].passed = writeTestCaseResult( - gTestcases[gTc].expect, - gTestcases[gTc].actual, - gTestcases[gTc].description +" = "+ - gTestcases[gTc].actual ); - - gTestcases[gTc].reason += ( gTestcases[gTc].passed ) ? "" : "wrong value "; - } - stopTest(); - return ( gTestcases ); -} - -function MyObject() { - this.eval = new Function( "x", "return(Math.pow(Number(x),2))" ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.4-10.js b/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.4-10.js deleted file mode 100644 index 218031c83f..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.4-10.js +++ /dev/null @@ -1,105 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '10.1.4-10.js'; - -/** - File Name: 10.1.4-10.js - ECMA Section: 10.1.4 Scope Chain and Identifier Resolution - Description: - Every execution context has associated with it a scope chain. This is - logically a list of objects that are searched when binding an Identifier. - When control enters an execution context, the scope chain is created and - is populated with an initial set of objects, depending on the type of - code. When control leaves the execution context, the scope chain is - destroyed. - - During execution, the scope chain of the execution context is affected - only by WithStatement. When execution enters a with block, the object - specified in the with statement is added to the front of the scope chain. - When execution leaves a with block, whether normally or via a break or - continue statement, the object is removed from the scope chain. The object - being removed will always be the first object in the scope chain. - - During execution, the syntactic production PrimaryExpression : Identifier - is evaluated using the following algorithm: - - 1. Get the next object in the scope chain. If there isn't one, go to step 5. - 2. Call the [[HasProperty]] method of Result(l), passing the Identifier as - the property. - 3. If Result(2) is true, return a value of type Reference whose base object - is Result(l) and whose property name is the Identifier. - 4. Go to step 1. - 5. Return a value of type Reference whose base object is null and whose - property name is the Identifier. - The result of binding an identifier is always a value of type Reference with - its member name component equal to the identifier string. - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "10.1.4-10"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Scope Chain and Identifier Resolution"); - -new TestCase( "SECTION", "MYOBJECT.toString()" ); - -test(); - -function test() { - for ( gTc=0; gTc < gTestcases.length; gTc++ ) { - var VALUE = 12345; - var MYOBJECT = new Number( VALUE ); - - with ( MYOBJECT ) { - gTestcases[gTc].actual = toString(); - gTestcases[gTc].expect = String(VALUE); - } - - gTestcases[gTc].passed = writeTestCaseResult( - gTestcases[gTc].expect, - gTestcases[gTc].actual, - gTestcases[gTc].description +" = "+ - gTestcases[gTc].actual ); - - gTestcases[gTc].reason += ( gTestcases[gTc].passed ) ? "" : "wrong value "; - } - stopTest(); - return ( gTestcases ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.4-2.js b/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.4-2.js deleted file mode 100644 index 2aee831b45..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.4-2.js +++ /dev/null @@ -1,113 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '10.1.4-2.js'; - -/** - File Name: 10.1.4-1.js - ECMA Section: 10.1.4 Scope Chain and Identifier Resolution - Description: - Every execution context has associated with it a scope chain. This is - logically a list of objects that are searched when binding an Identifier. - When control enters an execution context, the scope chain is created and - is populated with an initial set of objects, depending on the type of - code. When control leaves the execution context, the scope chain is - destroyed. - - During execution, the scope chain of the execution context is affected - only by WithStatement. When execution enters a with block, the object - specified in the with statement is added to the front of the scope chain. - When execution leaves a with block, whether normally or via a break or - continue statement, the object is removed from the scope chain. The object - being removed will always be the first object in the scope chain. - - During execution, the syntactic production PrimaryExpression : Identifier - is evaluated using the following algorithm: - - 1. Get the next object in the scope chain. If there isn't one, go to step 5. - 2. Call the [[HasProperty]] method of Result(l), passing the Identifier as - the property. - 3. If Result(2) is true, return a value of type Reference whose base object - is Result(l) and whose property name is the Identifier. - 4. Go to step 1. - 5. Return a value of type Reference whose base object is null and whose - property name is the Identifier. - The result of binding an identifier is always a value of type Reference with - its member name component equal to the identifier string. - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "10.1.4-2"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Scope Chain and Identifier Resolution"); - -new TestCase( "SECTION", "with MyObject, eval should return square of " ); - -test(); - -function test() { - for ( gTc=0; gTc < gTestcases.length; gTc++ ) { - - var MYOBJECT = new MyObject(); - var INPUT = 2; - gTestcases[gTc].description += "( "+INPUT +" )" ; - - with ( this ) { - with ( MYOBJECT ) { - gTestcases[gTc].actual = eval( INPUT ); - gTestcases[gTc].expect = Math.pow(INPUT,2); - } - } - - gTestcases[gTc].passed = writeTestCaseResult( - gTestcases[gTc].expect, - gTestcases[gTc].actual, - gTestcases[gTc].description +" = "+ - gTestcases[gTc].actual ); - - gTestcases[gTc].reason += ( gTestcases[gTc].passed ) ? "" : "wrong value "; - } - stopTest(); - return ( gTestcases ); -} - -function MyObject() { - this.eval = new Function( "x", "return(Math.pow(Number(x),2))" ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.4-3.js b/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.4-3.js deleted file mode 100644 index a3ae0ffdec..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.4-3.js +++ /dev/null @@ -1,111 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '10.1.4-3.js'; - -/** - File Name: 10.1.4-1.js - ECMA Section: 10.1.4 Scope Chain and Identifier Resolution - Description: - Every execution context has associated with it a scope chain. This is - logically a list of objects that are searched when binding an Identifier. - When control enters an execution context, the scope chain is created and - is populated with an initial set of objects, depending on the type of - code. When control leaves the execution context, the scope chain is - destroyed. - - During execution, the scope chain of the execution context is affected - only by WithStatement. When execution enters a with block, the object - specified in the with statement is added to the front of the scope chain. - When execution leaves a with block, whether normally or via a break or - continue statement, the object is removed from the scope chain. The object - being removed will always be the first object in the scope chain. - - During execution, the syntactic production PrimaryExpression : Identifier - is evaluated using the following algorithm: - - 1. Get the next object in the scope chain. If there isn't one, go to step 5. - 2. Call the [[HasProperty]] method of Result(l), passing the Identifier as - the property. - 3. If Result(2) is true, return a value of type Reference whose base object - is Result(l) and whose property name is the Identifier. - 4. Go to step 1. - 5. Return a value of type Reference whose base object is null and whose - property name is the Identifier. - The result of binding an identifier is always a value of type Reference with - its member name component equal to the identifier string. - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "10.1.4-3"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Scope Chain and Identifier Resolution"); - -new TestCase( "SECTION", - "with MyObject, eval should be [object Global].eval " ); - -test(); - -function test() { - for ( gTc=0; gTc < gTestcases.length; gTc++ ) { - - var MYOBJECT = new MyObject(); - var INPUT = 2; - gTestcases[gTc].description += ( INPUT +"" ); - - with ( MYOBJECT ) { - eval( INPUT ); - } - - gTestcases[gTc].passed = writeTestCaseResult( - gTestcases[gTc].expect, - gTestcases[gTc].actual, - gTestcases[gTc].description +" = "+ - gTestcases[gTc].actual ); - - gTestcases[gTc].reason += ( gTestcases[gTc].passed ) ? "" : "wrong value "; - } - stopTest(); - return ( gTestcases ); -} - -function MyObject() { - this.eval = new Function( "x", "return(Math.pow(Number(x),2))" ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.4-4.js b/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.4-4.js deleted file mode 100644 index 31274a0209..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.4-4.js +++ /dev/null @@ -1,113 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '10.1.4-4.js'; - -/** - File Name: 10.1.4-1.js - ECMA Section: 10.1.4 Scope Chain and Identifier Resolution - Description: - Every execution context has associated with it a scope chain. This is - logically a list of objects that are searched when binding an Identifier. - When control enters an execution context, the scope chain is created and - is populated with an initial set of objects, depending on the type of - code. When control leaves the execution context, the scope chain is - destroyed. - - During execution, the scope chain of the execution context is affected - only by WithStatement. When execution enters a with block, the object - specified in the with statement is added to the front of the scope chain. - When execution leaves a with block, whether normally or via a break or - continue statement, the object is removed from the scope chain. The object - being removed will always be the first object in the scope chain. - - During execution, the syntactic production PrimaryExpression : Identifier - is evaluated using the following algorithm: - - 1. Get the next object in the scope chain. If there isn't one, go to step 5. - 2. Call the [[HasProperty]] method of Result(l), passing the Identifier as - the property. - 3. If Result(2) is true, return a value of type Reference whose base object - is Result(l) and whose property name is the Identifier. - 4. Go to step 1. - 5. Return a value of type Reference whose base object is null and whose - property name is the Identifier. - The result of binding an identifier is always a value of type Reference with - its member name component equal to the identifier string. - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "10.1.4-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Scope Chain and Identifier Resolution"); - -new TestCase( "SECTION", - "with MyObject, eval should be [object Global].eval " ); -test(); - -function test() { - for ( gTc=0; gTc < gTestcases.length; gTc++ ) { - - var MYOBJECT = new MyObject(); - var INPUT = 2; - gTestcases[gTc].description += ( INPUT +"" ); - - with ( MYOBJECT ) { - eval( INPUT ); - } - - gTestcases[gTc].actual = eval( INPUT ); - gTestcases[gTc].expect = INPUT; - - gTestcases[gTc].passed = writeTestCaseResult( - gTestcases[gTc].expect, - gTestcases[gTc].actual, - gTestcases[gTc].description +" = "+ - gTestcases[gTc].actual ); - - gTestcases[gTc].reason += ( gTestcases[gTc].passed ) ? "" : "wrong value "; - } - stopTest(); - return ( gTestcases ); -} - -function MyObject() { - this.eval = new Function( "x", "return(Math.pow(Number(x),2))" ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.4-5.js b/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.4-5.js deleted file mode 100644 index c36d2db8cc..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.4-5.js +++ /dev/null @@ -1,112 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '10.1.4-5.js'; - -/** - File Name: 10.1.4-1.js - ECMA Section: 10.1.4 Scope Chain and Identifier Resolution - Description: - Every execution context has associated with it a scope chain. This is - logically a list of objects that are searched when binding an Identifier. - When control enters an execution context, the scope chain is created and - is populated with an initial set of objects, depending on the type of - code. When control leaves the execution context, the scope chain is - destroyed. - - During execution, the scope chain of the execution context is affected - only by WithStatement. When execution enters a with block, the object - specified in the with statement is added to the front of the scope chain. - When execution leaves a with block, whether normally or via a break or - continue statement, the object is removed from the scope chain. The object - being removed will always be the first object in the scope chain. - - During execution, the syntactic production PrimaryExpression : Identifier - is evaluated using the following algorithm: - - 1. Get the next object in the scope chain. If there isn't one, go to step 5. - 2. Call the [[HasProperty]] method of Result(l), passing the Identifier as - the property. - 3. If Result(2) is true, return a value of type Reference whose base object - is Result(l) and whose property name is the Identifier. - 4. Go to step 1. - 5. Return a value of type Reference whose base object is null and whose - property name is the Identifier. - The result of binding an identifier is always a value of type Reference with - its member name component equal to the identifier string. - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "10.1.4-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Scope Chain and Identifier Resolution"); - -new TestCase( "SECTION", - "with MyObject, eval should be [object Global].eval " ); -test(); - -function test() { - for ( gTc=0; gTc < gTestcases.length; gTc++ ) { - - var MYOBJECT = new MyObject(); - var INPUT = 2; - gTestcases[gTc].description += ( INPUT +"" ); - - with ( MYOBJECT ) { - eval = null; - } - - gTestcases[gTc].actual = eval( INPUT ); - gTestcases[gTc].expect = INPUT; - - gTestcases[gTc].passed = writeTestCaseResult( - gTestcases[gTc].expect, - gTestcases[gTc].actual, - gTestcases[gTc].description +" = "+ - gTestcases[gTc].actual ); - - gTestcases[gTc].reason += ( gTestcases[gTc].passed ) ? "" : "wrong value "; - } - stopTest(); - return ( gTestcases ); -} -function MyObject() { - this.eval = new Function( "x", "return(Math.pow(Number(x),2))" ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.4-6.js b/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.4-6.js deleted file mode 100644 index da11110cc5..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.4-6.js +++ /dev/null @@ -1,100 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '10.1.4-6.js'; - -/** - File Name: 10.1.4-1.js - ECMA Section: 10.1.4 Scope Chain and Identifier Resolution - Description: - Every execution context has associated with it a scope chain. This is - logically a list of objects that are searched when binding an Identifier. - When control enters an execution context, the scope chain is created and - is populated with an initial set of objects, depending on the type of - code. When control leaves the execution context, the scope chain is - destroyed. - - During execution, the scope chain of the execution context is affected - only by WithStatement. When execution enters a with block, the object - specified in the with statement is added to the front of the scope chain. - When execution leaves a with block, whether normally or via a break or - continue statement, the object is removed from the scope chain. The object - being removed will always be the first object in the scope chain. - - During execution, the syntactic production PrimaryExpression : Identifier - is evaluated using the following algorithm: - - 1. Get the next object in the scope chain. If there isn't one, go to step 5. - 2. Call the [[HasProperty]] method of Result(l), passing the Identifier as - the property. - 3. If Result(2) is true, return a value of type Reference whose base object - is Result(l) and whose property name is the Identifier. - 4. Go to step 1. - 5. Return a value of type Reference whose base object is null and whose - property name is the Identifier. - The result of binding an identifier is always a value of type Reference with - its member name component equal to the identifier string. - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "10.1.4-6"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Scope Chain and Identifier Resolution"); - - -var testcase = new TestCase( "SECTION", - "with MyObject, eval should be [object Global].eval " ); - -var MYOBJECT = new MyObject(); -var INPUT = 2; -testcase.description += ( INPUT +"" ); - -with ( MYOBJECT ) { - ; -} -testcase.actual = eval( INPUT ); -testcase.expect = INPUT; - -test(); - - -function MyObject() { - this.eval = new Function( "x", "return(Math.pow(Number(x),2))" ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.4-7.js b/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.4-7.js deleted file mode 100644 index f1a0db4569..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.4-7.js +++ /dev/null @@ -1,112 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '10.1.4-7.js'; - -/** - File Name: 10.1.4-7.js - ECMA Section: 10.1.4 Scope Chain and Identifier Resolution - Description: - Every execution context has associated with it a scope chain. This is - logically a list of objects that are searched when binding an Identifier. - When control enters an execution context, the scope chain is created and - is populated with an initial set of objects, depending on the type of - code. When control leaves the execution context, the scope chain is - destroyed. - - During execution, the scope chain of the execution context is affected - only by WithStatement. When execution enters a with block, the object - specified in the with statement is added to the front of the scope chain. - When execution leaves a with block, whether normally or via a break or - continue statement, the object is removed from the scope chain. The object - being removed will always be the first object in the scope chain. - - During execution, the syntactic production PrimaryExpression : Identifier - is evaluated using the following algorithm: - - 1. Get the next object in the scope chain. If there isn't one, go to step 5. - 2. Call the [[HasProperty]] method of Result(l), passing the Identifier as - the property. - 3. If Result(2) is true, return a value of type Reference whose base object - is Result(l) and whose property name is the Identifier. - 4. Go to step 1. - 5. Return a value of type Reference whose base object is null and whose - property name is the Identifier. - The result of binding an identifier is always a value of type Reference with - its member name component equal to the identifier string. - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "10.1.4-7"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Scope Chain and Identifier Resolution"); - -new TestCase( "SECTION", - "with MyObject, eval should be [object Global].eval " ); -test(); - -function test() { - for ( gTc=0; gTc < gTestcases.length; gTc++ ) { - - var MYOBJECT = new MyObject(); - var INPUT = 2; - gTestcases[gTc].description += ( INPUT +"" ); - - with ( MYOBJECT ) { - delete( eval ); - gTestcases[gTc].actual = eval( INPUT ); - gTestcases[gTc].expect = INPUT; - } - - gTestcases[gTc].passed = writeTestCaseResult( - gTestcases[gTc].expect, - gTestcases[gTc].actual, - gTestcases[gTc].description +" = "+ - gTestcases[gTc].actual ); - - gTestcases[gTc].reason += ( gTestcases[gTc].passed ) ? "" : "wrong value "; - } - stopTest(); - return ( gTestcases ); -} - -function MyObject() { - this.eval = new Function( "x", "return(Math.pow(Number(x),2))" ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.4-8.js b/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.4-8.js deleted file mode 100644 index 1eee8da4fb..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.4-8.js +++ /dev/null @@ -1,113 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '10.1.4-8.js'; - -/** - File Name: 10.1.4-1.js - ECMA Section: 10.1.4 Scope Chain and Identifier Resolution - Description: - Every execution context has associated with it a scope chain. This is - logically a list of objects that are searched when binding an Identifier. - When control enters an execution context, the scope chain is created and - is populated with an initial set of objects, depending on the type of - code. When control leaves the execution context, the scope chain is - destroyed. - - During execution, the scope chain of the execution context is affected - only by WithStatement. When execution enters a with block, the object - specified in the with statement is added to the front of the scope chain. - When execution leaves a with block, whether normally or via a break or - continue statement, the object is removed from the scope chain. The object - being removed will always be the first object in the scope chain. - - During execution, the syntactic production PrimaryExpression : Identifier - is evaluated using the following algorithm: - - 1. Get the next object in the scope chain. If there isn't one, go to step 5. - 2. Call the [[HasProperty]] method of Result(l), passing the Identifier as - the property. - 3. If Result(2) is true, return a value of type Reference whose base object - is Result(l) and whose property name is the Identifier. - 4. Go to step 1. - 5. Return a value of type Reference whose base object is null and whose - property name is the Identifier. - The result of binding an identifier is always a value of type Reference with - its member name component equal to the identifier string. - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "10.1.4-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Scope Chain and Identifier Resolution"); - -new TestCase( "SECTION", - "with MyObject, eval should cube INPUT: " ); -test(); - -function test() { - for ( gTc=0; gTc < gTestcases.length; gTc++ ) { - - var MYOBJECT = new MyObject(); - var INPUT = 2; - gTestcases[gTc].description += ( INPUT +"" ); - - with ( MYOBJECT ) { - eval = new Function ( "x", "return(Math.pow(Number(x),3))" ); - - gTestcases[gTc].actual = eval( INPUT ); - gTestcases[gTc].expect = Math.pow(INPUT,3); - } - - gTestcases[gTc].passed = writeTestCaseResult( - gTestcases[gTc].expect, - gTestcases[gTc].actual, - gTestcases[gTc].description +" = "+ - gTestcases[gTc].actual ); - - gTestcases[gTc].reason += ( gTestcases[gTc].passed ) ? "" : "wrong value "; - } - stopTest(); - return ( gTestcases ); -} - -function MyObject() { - this.eval = new Function( "x", "return(Math.pow(Number(x),2))" ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.5-1.js b/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.5-1.js deleted file mode 100644 index 363581eff6..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.5-1.js +++ /dev/null @@ -1,118 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '10.1.5-1.js'; - -/** - File Name: 10.1.5-1.js - ECMA Section: 10.1.5 Global Object - Description: - There is a unique global object which is created before control enters - any execution context. Initially the global object has the following - properties: - - Built-in objects such as Math, String, Date, parseInt, etc. These have - attributes { DontEnum }. - - Additional host defined properties. This may include a property whose - value is the global object itself, for example window in HTML. - - As control enters execution contexts, and as ECMAScript code is executed, - additional properties may be added to the global object and the initial - properties may be changed. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "10.5.1-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Global Object"); - - -new TestCase( "SECTION", "Global Code check" ); - -if ( Object == null ) { - gTestcases[0].reason += " Object == null" ; -} -if ( Function == null ) { - gTestcases[0].reason += " Function == null"; -} -if ( String == null ) { - gTestcases[0].reason += " String == null"; -} -if ( Array == null ) { - gTestcases[0].reason += " Array == null"; -} -if ( Number == null ) { - gTestcases[0].reason += " Function == null"; -} -if ( Math == null ) { - gTestcases[0].reason += " Math == null"; -} -if ( Boolean == null ) { - gTestcases[0].reason += " Boolean == null"; -} -if ( Date == null ) { - gTestcases[0].reason += " Date == null"; -} -/* - if ( NaN == null ) { - gTestcases[0].reason += " NaN == null"; - } - if ( Infinity == null ) { - gTestcases[0].reason += " Infinity == null"; - } -*/ -if ( eval == null ) { - gTestcases[0].reason += " eval == null"; -} -if ( parseInt == null ) { - gTestcases[0].reason += " parseInt == null"; -} - -if ( gTestcases[0].reason != "" ) { - gTestcases[0].actual = "fail"; -} else { - gTestcases[0].actual = "pass"; -} -gTestcases[0].expect = "pass"; - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.5-2.js b/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.5-2.js deleted file mode 100644 index cfba3b5c73..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.5-2.js +++ /dev/null @@ -1,100 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '10.1.5-2.js'; - -/** - File Name: 10.1.5-2.js - ECMA Section: 10.1.5 Global Object - Description: - There is a unique global object which is created before control enters - any execution context. Initially the global object has the following - properties: - - Built-in objects such as Math, String, Date, parseInt, etc. These have - attributes { DontEnum }. - - Additional host defined properties. This may include a property whose - value is the global object itself, for example window in HTML. - - As control enters execution contexts, and as ECMAScript code is executed, - additional properties may be added to the global object and the initial - properties may be changed. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "10.5.1-2"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Global Object"); - -new TestCase( "SECTION", "Eval Code check" ); - -var EVAL_STRING = 'if ( Object == null ) { gTestcases[0].reason += " Object == null" ; }' + - 'if ( Function == null ) { gTestcases[0].reason += " Function == null"; }' + - 'if ( String == null ) { gTestcases[0].reason += " String == null"; }' + - 'if ( Array == null ) { gTestcases[0].reason += " Array == null"; }' + - 'if ( Number == null ) { gTestcases[0].reason += " Function == null";}' + - 'if ( Math == null ) { gTestcases[0].reason += " Math == null"; }' + - 'if ( Boolean == null ) { gTestcases[0].reason += " Boolean == null"; }' + - 'if ( Date == null ) { gTestcases[0].reason += " Date == null"; }' + - 'if ( eval == null ) { gTestcases[0].reason += " eval == null"; }' + - 'if ( parseInt == null ) { gTestcases[0].reason += " parseInt == null"; }' ; - -eval( EVAL_STRING ); - -/* - if ( NaN == null ) { - gTestcases[0].reason += " NaN == null"; - } - if ( Infinity == null ) { - gTestcases[0].reason += " Infinity == null"; - } -*/ - -if ( gTestcases[0].reason != "" ) { - gTestcases[0].actual = "fail"; -} else { - gTestcases[0].actual = "pass"; -} -gTestcases[0].expect = "pass"; - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.5-3.js b/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.5-3.js deleted file mode 100644 index f5234cb13b..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.5-3.js +++ /dev/null @@ -1,130 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '10.1.5-3.js'; - -/** - File Name: 10.1.5-3.js - ECMA Section: 10.1.5 Global Object - Description: - There is a unique global object which is created before control enters - any execution context. Initially the global object has the following - properties: - - Built-in objects such as Math, String, Date, parseInt, etc. These have - attributes { DontEnum }. - - Additional host defined properties. This may include a property whose - value is the global object itself, for example window in HTML. - - As control enters execution contexts, and as ECMAScript code is executed, - additional properties may be added to the global object and the initial - properties may be changed. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "10.5.1-3"; -var VERSION = "ECMA_1"; -startTest(); -writeHeaderToLog( SECTION + " Global Object"); - -new TestCase( "SECTION", "Function Code check" ); - -test(); - -function test() { - if ( Object == null ) { - gTestcases[0].reason += " Object == null" ; - } - if ( Function == null ) { - gTestcases[0].reason += " Function == null"; - } - if ( String == null ) { - gTestcases[0].reason += " String == null"; - } - if ( Array == null ) { - gTestcases[0].reason += " Array == null"; - } - if ( Number == null ) { - gTestcases[0].reason += " Function == null"; - } - if ( Math == null ) { - gTestcases[0].reason += " Math == null"; - } - if ( Boolean == null ) { - gTestcases[0].reason += " Boolean == null"; - } - if ( Date == null ) { - gTestcases[0].reason += " Date == null"; - } -/* - if ( NaN == null ) { - gTestcases[0].reason += " NaN == null"; - } - if ( Infinity == null ) { - gTestcases[0].reason += " Infinity == null"; - } -*/ - if ( eval == null ) { - gTestcases[0].reason += " eval == null"; - } - if ( parseInt == null ) { - gTestcases[0].reason += " parseInt == null"; - } - - if ( gTestcases[0].reason != "" ) { - gTestcases[0].actual = "fail"; - } else { - gTestcases[0].actual = "pass"; - } - gTestcases[0].expect = "pass"; - - for ( gTc=0; gTc < gTestcases.length; gTc++ ) { - - gTestcases[gTc].passed = writeTestCaseResult( - gTestcases[gTc].expect, - gTestcases[gTc].actual, - gTestcases[gTc].description +" = "+ - gTestcases[gTc].actual ); - - gTestcases[gTc].reason += ( gTestcases[gTc].passed ) ? "" : "wrong value "; - } - stopTest(); - return ( gTestcases ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.5-4.js b/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.5-4.js deleted file mode 100644 index 953e6a8feb..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.5-4.js +++ /dev/null @@ -1,91 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '10.1.5-4.js'; - -/** - File Name: 10.1.5-4.js - ECMA Section: 10.1.5 Global Object - Description: - There is a unique global object which is created before control enters - any execution context. Initially the global object has the following - properties: - - Built-in objects such as Math, String, Date, parseInt, etc. These have - attributes { DontEnum }. - - Additional host defined properties. This may include a property whose - value is the global object itself, for example window in HTML. - - As control enters execution contexts, and as ECMAScript code is executed, - additional properties may be added to the global object and the initial - properties may be changed. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "10.5.1-4"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Global Object"); - -new TestCase( "SECTION", "Anonymous Code check" ); - - -var EVAL_STRING = 'if ( Object == null ) { gTestcases[0].reason += " Object == null" ; }' + - 'if ( Function == null ) { gTestcases[0].reason += " Function == null"; }' + - 'if ( String == null ) { gTestcases[0].reason += " String == null"; }' + - 'if ( Array == null ) { gTestcases[0].reason += " Array == null"; }' + - 'if ( Number == null ) { gTestcases[0].reason += " Function == null";}' + - 'if ( Math == null ) { gTestcases[0].reason += " Math == null"; }' + - 'if ( Boolean == null ) { gTestcases[0].reason += " Boolean == null"; }' + - 'if ( Date == null ) { gTestcases[0].reason += " Date == null"; }' + - 'if ( eval == null ) { gTestcases[0].reason += " eval == null"; }' + - 'if ( parseInt == null ) { gTestcases[0].reason += " parseInt == null"; }' ; - -var NEW_FUNCTION = new Function( EVAL_STRING ); - -if ( gTestcases[0].reason != "" ) { - gTestcases[0].actual = "fail"; -} else { - gTestcases[0].actual = "pass"; -} -gTestcases[0].expect = "pass"; - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.8-2.js b/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.8-2.js deleted file mode 100644 index 40e6f0ee8f..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.8-2.js +++ /dev/null @@ -1,120 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '10.1.8-2.js'; - -/** - File Name: 10.1.8-2 - ECMA Section: Arguments Object - Description: - - When control enters an execution context for declared function code, - anonymous code, or implementation-supplied code, an arguments object is - created and initialized as follows: - - The [[Prototype]] of the arguments object is to the original Object - prototype object, the one that is the initial value of Object.prototype - (section 15.2.3.1). - - A property is created with name callee and property attributes {DontEnum}. - The initial value of this property is the function object being executed. - This allows anonymous functions to be recursive. - - A property is created with name length and property attributes {DontEnum}. - The initial value of this property is the number of actual parameter values - supplied by the caller. - - For each non-negative integer, iarg, less than the value of the length - property, a property is created with name ToString(iarg) and property - attributes { DontEnum }. The initial value of this property is the value - of the corresponding actual parameter supplied by the caller. The first - actual parameter value corresponds to iarg = 0, the second to iarg = 1 and - so on. In the case when iarg is less than the number of formal parameters - for the function object, this property shares its value with the - corresponding property of the activation object. This means that changing - this property changes the corresponding property of the activation object - and vice versa. The value sharing mechanism depends on the implementation. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "10.1.8-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Arguments Object"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -// Tests for anonymous functions - -var GetCallee = new Function( "var c = arguments.callee; return c" ); -var GetArguments = new Function( "var a = arguments; return a" ); -var GetLength = new Function( "var l = arguments.length; return l" ); - -var ARG_STRING = "value of the argument property"; - -new TestCase( SECTION, - "GetCallee()", - GetCallee, - GetCallee() ); - -var LIMIT = 100; - -for ( var i = 0, args = "" ; i < LIMIT; i++ ) { - args += String(i) + ( i+1 < LIMIT ? "," : "" ); - -} - -var LENGTH = eval( "GetLength("+ args +")" ); - -new TestCase( SECTION, - "GetLength("+args+")", - 100, - LENGTH ); - -var ARGUMENTS = eval( "GetArguments( " +args+")" ); - -for ( var i = 0; i < 100; i++ ) { - new TestCase( SECTION, - "GetArguments("+args+")["+i+"]", - i, - ARGUMENTS[i] ); -} - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.8-3.js b/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.8-3.js deleted file mode 100644 index 71aa876f02..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.1.8-3.js +++ /dev/null @@ -1,66 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Norris Boyd - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '10.1.8-3.js'; - -/** - File Name: 10.1.8-3 - ECMA Section: Arguments Object - Description: - - The [[Prototype]] of the arguments object is to the original Object - prototype object, the one that is the initial value of Object.prototype - (section 15.2.3.1). - - ... - - Test that "typeof arguments" is thus "object". - -*/ - -var SECTION = "10.1.8-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Arguments Object"; -writeHeaderToLog( SECTION + " "+ TITLE); - -var expected = "object"; -var actual = (function () { return typeof arguments; })(); -reportCompare(expected, actual, "typeof arguments == object"); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.2.1.js b/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.2.1.js deleted file mode 100644 index 5384da4f83..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.2.1.js +++ /dev/null @@ -1,85 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '10.2.1.js'; - -/** - File Name: 10.2.1.js - ECMA Section: 10.2.1 Global Code - Description: - - The scope chain is created and initialized to contain the global object and - no others. - - Variable instantiation is performed using the global object as the variable - object and using empty property attributes. - - The this value is the global object. - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "10.2.1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Global Code"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var THIS = this; - -new TestCase( SECTION, - "this +''", - GLOBAL, - THIS + "" ); - -var GLOBAL_PROPERTIES = new Array(); -var i = 0; - -for ( p in this ) { - GLOBAL_PROPERTIES[i++] = p; -} - -for ( i = 0; i < GLOBAL_PROPERTIES.length; i++ ) { - new TestCase( SECTION, - GLOBAL_PROPERTIES[i] +" == void 0", - false, - eval("GLOBAL_PROPERTIES["+i+"] == void 0")); -} - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.2.2-1.js b/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.2.2-1.js deleted file mode 100644 index 787ef9e5b3..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.2.2-1.js +++ /dev/null @@ -1,122 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '10.2.2-1.js'; - -/** - File Name: 10.2.2-1.js - ECMA Section: 10.2.2 Eval Code - Description: - - When control enters an execution context for eval code, the previous - active execution context, referred to as the calling context, is used to - determine the scope chain, the variable object, and the this value. If - there is no calling context, then initializing the scope chain, variable - instantiation, and determination of the this value are performed just as - for global code. - - The scope chain is initialized to contain the same objects, in the same - order, as the calling context's scope chain. This includes objects added - to the calling context's scope chain by WithStatement. - - Variable instantiation is performed using the calling context's variable - object and using empty property attributes. - - The this value is the same as the this value of the calling context. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "10.2.2-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Eval Code"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var THIS = eval("this"); - -new TestCase( SECTION, - "this +''", - GLOBAL, - THIS + "" ); - -var GLOBAL_PROPERTIES = new Array(); -var i = 0; - -for ( p in THIS ) { - GLOBAL_PROPERTIES[i++] = p; -} - -for ( i = 0; i < GLOBAL_PROPERTIES.length; i++ ) { - new TestCase( SECTION, - GLOBAL_PROPERTIES[i] +" == THIS["+GLOBAL_PROPERTIES[i]+"]", - true, - eval(GLOBAL_PROPERTIES[i]) == eval( "THIS[GLOBAL_PROPERTIES[i]]") ); -} - -// this in eval statements is the same as this value of the calling context - -var RESULT = THIS == this; - -new TestCase( SECTION, - "eval( 'this == THIS' )", - true, - RESULT ); - -var RESULT = THIS +''; - -new TestCase( SECTION, - "eval( 'this + \"\"' )", - GLOBAL, - RESULT ); - - -new TestCase( SECTION, - "eval( 'this == THIS' )", - true, - eval( "this == THIS" ) ); - -new TestCase( SECTION, - "eval( 'this + \"\"' )", - GLOBAL, - eval( "this +''") ); - - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.2.2-2.js b/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.2.2-2.js deleted file mode 100644 index 8048c45575..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.2.2-2.js +++ /dev/null @@ -1,133 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '10.2.2-2.js'; - -/** - File Name: 10.2.2-2.js - ECMA Section: 10.2.2 Eval Code - Description: - - When control enters an execution context for eval code, the previous - active execution context, referred to as the calling context, is used to - determine the scope chain, the variable object, and the this value. If - there is no calling context, then initializing the scope chain, variable - instantiation, and determination of the this value are performed just as - for global code. - - The scope chain is initialized to contain the same objects, in the same - order, as the calling context's scope chain. This includes objects added - to the calling context's scope chain by WithStatement. - - Variable instantiation is performed using the calling context's variable - object and using empty property attributes. - - The this value is the same as the this value of the calling context. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "10.2.2-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Eval Code"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -// Test Objects - -var OBJECT = new MyObject( "hello" ); -var GLOBAL_PROPERTIES = new Array(); -var i = 0; - -for ( p in this ) { - GLOBAL_PROPERTIES[i++] = p; -} - -with ( OBJECT ) { - var THIS = this; - new TestCase( SECTION, - "eval( 'this == THIS' )", - true, - eval("this == THIS") ); - new TestCase( SECTION, - "this in a with() block", - GLOBAL, - this+"" ); - new TestCase( SECTION, - "new MyObject('hello').value", - "hello", - value ); - new TestCase( SECTION, - "eval(new MyObject('hello').value)", - "hello", - eval("value") ); - new TestCase( SECTION, - "new MyObject('hello').getClass()", - "[object Object]", - getClass() ); - new TestCase( SECTION, - "eval(new MyObject('hello').getClass())", - "[object Object]", - eval("getClass()") ); - new TestCase( SECTION, - "eval(new MyObject('hello').toString())", - "hello", - eval("toString()") ); - new TestCase( SECTION, - "eval('getClass') == Object.prototype.toString", - true, - eval("getClass") == Object.prototype.toString ); - - for ( i = 0; i < GLOBAL_PROPERTIES.length; i++ ) { - new TestCase( SECTION, GLOBAL_PROPERTIES[i] + - " == THIS["+GLOBAL_PROPERTIES[i]+"]", true, - eval(GLOBAL_PROPERTIES[i]) == eval( "THIS[GLOBAL_PROPERTIES[i]]") ); - } - -} - -test(); - -function MyObject( value ) { - this.value = value; - this.getClass = Object.prototype.toString; - this.toString = new Function( "return this.value+''" ); - return this; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.2.3-1.js b/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.2.3-1.js deleted file mode 100644 index a1977c66d6..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.2.3-1.js +++ /dev/null @@ -1,86 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '10.2.3-1.js'; - -/** - File Name: 10.2.3-1.js - ECMA Section: 10.2.3 Function and Anonymous Code - Description: - - The scope chain is initialized to contain the activation object followed - by the global object. Variable instantiation is performed using the - activation by the global object. Variable instantiation is performed using - the activation object as the variable object and using property attributes - { DontDelete }. The caller provides the this value. If the this value - provided by the caller is not an object (including the case where it is - null), then the this value is the global object. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "10.2.3-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Eval Code"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var o = new MyObject("hello") - - new TestCase( SECTION, - "var o = new MyObject('hello'); o.THIS == x", - true, - o.THIS == o ); - -var o = MyFunction(); - -new TestCase( SECTION, - "var o = MyFunction(); o == this", - true, - o == this ); - -test(); - -function MyFunction( value ) { - return this; -} -function MyObject( value ) { - this.THIS = this; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.2.3-2.js b/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.2.3-2.js deleted file mode 100644 index e1aa78c5da..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/10.2.3-2.js +++ /dev/null @@ -1,92 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '10.2.3-2.js'; - -/** - File Name: 10.2.3-2.js - ECMA Section: 10.2.3 Function and Anonymous Code - Description: - - The scope chain is initialized to contain the activation object followed - by the global object. Variable instantiation is performed using the - activation by the global object. Variable instantiation is performed using - the activation object as the variable object and using property attributes - { DontDelete }. The caller provides the this value. If the this value - provided by the caller is not an object (including the case where it is - null), then the this value is the global object. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "10.2.3-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Function and Anonymous Code"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var o = new MyObject("hello"); - -new TestCase( SECTION, - "MyFunction(\"PASSED!\")", - "PASSED!", - MyFunction("PASSED!") ); - -var o = MyFunction(); - -new TestCase( SECTION, - "MyOtherFunction(true);", - false, - MyOtherFunction(true) ); - -test(); - -function MyFunction( value ) { - var x = value; - delete x; - return x; -} -function MyOtherFunction(value) { - var x = value; - return delete x; -} -function MyObject( value ) { - this.THIS = this; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/browser.js b/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/browser.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/shell.js b/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/shell.js deleted file mode 100644 index 1d353cff74..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/ExecutionContexts/shell.js +++ /dev/null @@ -1 +0,0 @@ -gTestsubsuite = 'ExecutionContexts'; diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.1.1.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.1.1.js deleted file mode 100644 index 18f0ec7f13..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.1.1.js +++ /dev/null @@ -1,137 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.1.1.js'; - -/** - File Name: 11.1.1.js - ECMA Section: 11.1.1 The this keyword - Description: - - The this keyword evaluates to the this value of the execution context. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.1.1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " The this keyword"); - -var GLOBAL_OBJECT = this.toString(); - -// this in global code and eval(this) in global code should return the global object. - -new TestCase( SECTION, - "Global Code: this.toString()", - GLOBAL_OBJECT, - this.toString() ); - -new TestCase( SECTION, - "Global Code: eval('this.toString()')", - GLOBAL_OBJECT, - eval('this.toString()') ); - -// this in anonymous code called as a function should return the global object. - -new TestCase( SECTION, - "Anonymous Code: var MYFUNC = new Function('return this.toString()'); MYFUNC()", - GLOBAL_OBJECT, - eval("var MYFUNC = new Function('return this.toString()'); MYFUNC()") ); - -// eval( this ) in anonymous code called as a function should return that function's activation object - -new TestCase( SECTION, - "Anonymous Code: var MYFUNC = new Function('return (eval(\"this.toString()\")'); (MYFUNC()).toString()", - GLOBAL_OBJECT, - eval("var MYFUNC = new Function('return eval(\"this.toString()\")'); (MYFUNC()).toString()") ); - -// this and eval( this ) in anonymous code called as a constructor should return the object - -new TestCase( SECTION, - "Anonymous Code: var MYFUNC = new Function('this.THIS = this'); ((new MYFUNC()).THIS).toString()", - "[object Object]", - eval("var MYFUNC = new Function('this.THIS = this'); ((new MYFUNC()).THIS).toString()") ); - -new TestCase( SECTION, - "Anonymous Code: var MYFUNC = new Function('this.THIS = this'); var FUN1 = new MYFUNC(); FUN1.THIS == FUN1", - true, - eval("var MYFUNC = new Function('this.THIS = this'); var FUN1 = new MYFUNC(); FUN1.THIS == FUN1") ); - -new TestCase( SECTION, - "Anonymous Code: var MYFUNC = new Function('this.THIS = eval(\"this\")'); ((new MYFUNC().THIS).toString()", - "[object Object]", - eval("var MYFUNC = new Function('this.THIS = eval(\"this\")'); ((new MYFUNC()).THIS).toString()") ); - -new TestCase( SECTION, - "Anonymous Code: var MYFUNC = new Function('this.THIS = eval(\"this\")'); var FUN1 = new MYFUNC(); FUN1.THIS == FUN1", - true, - eval("var MYFUNC = new Function('this.THIS = eval(\"this\")'); var FUN1 = new MYFUNC(); FUN1.THIS == FUN1") ); - -// this and eval(this) in function code called as a function should return the global object. -new TestCase( SECTION, - "Function Code: ReturnThis()", - GLOBAL_OBJECT, - ReturnThis() ); - -new TestCase( SECTION, - "Function Code: ReturnEvalThis()", - GLOBAL_OBJECT, - ReturnEvalThis() ); - -// this and eval(this) in function code called as a contructor should return the object. -new TestCase( SECTION, - "var MYOBJECT = new ReturnThis(); MYOBJECT.toString()", - "[object Object]", - eval("var MYOBJECT = new ReturnThis(); MYOBJECT.toString()") ); - -new TestCase( SECTION, - "var MYOBJECT = new ReturnEvalThis(); MYOBJECT.toString()", - "[object Object]", - eval("var MYOBJECT = new ReturnEvalThis(); MYOBJECT.toString()") ); - -test(); - -function ReturnThis() { - return this.toString(); -} - -function ReturnEvalThis() { - return( eval("this.toString()") ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.10-1.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.10-1.js deleted file mode 100644 index 5b70334ff5..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.10-1.js +++ /dev/null @@ -1,270 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.10-1.js'; - -/** - File Name: 11.10-1.js - ECMA Section: 11.10-1 Binary Bitwise Operators: & - Description: - Semantics - - The production A : A @ B, where @ is one of the bitwise operators in the - productions &, ^, | , is evaluated as follows: - - 1. Evaluate A. - 2. Call GetValue(Result(1)). - 3. Evaluate B. - 4. Call GetValue(Result(3)). - 5. Call ToInt32(Result(2)). - 6. Call ToInt32(Result(4)). - 7. Apply the bitwise operator @ to Result(5) and Result(6). The result is - a signed 32 bit integer. - 8. Return Result(7). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.10-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Binary Bitwise Operators: &"); - -var shiftexp = 0; -var addexp = 0; - -// for ( shiftpow = 0; shiftpow < 33; shiftpow++ ) { -for ( shiftpow = 0; shiftpow < 1; shiftpow++ ) { - shiftexp += Math.pow( 2, shiftpow ); - - for ( addpow = 0; addpow < 33; addpow++ ) { - addexp += Math.pow(2, addpow); - - new TestCase( SECTION, - shiftexp + " & " + addexp, - And( shiftexp, addexp ), - shiftexp & addexp ); - } -} - -test(); - -function ToInteger( n ) { - n = Number( n ); - var sign = ( n < 0 ) ? -1 : 1; - - if ( n != n ) { - return 0; - } - if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY ) { - return n; - } - return ( sign * Math.floor(Math.abs(n)) ); -} -function ToInt32( 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) )) % Math.pow(2,32); - n = ( n >= Math.pow(2,31) ) ? n - Math.pow(2,32) : n; - - return ( n ); -} -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 ); -} -function ToUint16( 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) ) ) % Math.pow(2,16); - - if (n <0) { - n += Math.pow(2,16); - } - - return ( n ); -} -function Mask( b, n ) { - b = ToUint32BitString( b ); - b = b.substring( b.length - n ); - b = ToUint32Decimal( b ); - return ( b ); -} -function ToUint32BitString( n ) { - var b = ""; - for ( p = 31; p >=0; p-- ) { - if ( n >= Math.pow(2,p) ) { - b += "1"; - n -= Math.pow(2,p); - } else { - b += "0"; - } - } - return b; -} -function ToInt32BitString( n ) { - var b = ""; - var sign = ( n < 0 ) ? -1 : 1; - - b += ( sign == 1 ) ? "0" : "1"; - - for ( p = 30; p >=0; p-- ) { - if ( (sign == 1 ) ? sign * n >= Math.pow(2,p) : sign * n > Math.pow(2,p) ) { - b += ( sign == 1 ) ? "1" : "0"; - n -= sign * Math.pow( 2, p ); - } else { - b += ( sign == 1 ) ? "0" : "1"; - } - } - - return b; -} -function ToInt32Decimal( bin ) { - var r = 0; - var sign; - - if ( Number(bin.charAt(0)) == 0 ) { - sign = 1; - r = 0; - } else { - sign = -1; - r = -(Math.pow(2,31)); - } - - for ( var j = 0; j < 31; j++ ) { - r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); - } - - return r; -} -function ToUint32Decimal( bin ) { - var r = 0; - - - for ( l = bin.length; l < 32; l++ ) { - bin = "0" + bin; - } - - for ( j = 0; j < 31; j++ ) { - r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); - - } - - return r; -} -function And( s, a ) { - s = ToInt32( s ); - a = ToInt32( a ); - - var bs = ToInt32BitString( s ); - var ba = ToInt32BitString( a ); - - var result = ""; - - for ( var bit = 0; bit < bs.length; bit++ ) { - if ( bs.charAt(bit) == "1" && ba.charAt(bit) == "1" ) { - result += "1"; - } else { - result += "0"; - } - } - return ToInt32Decimal(result); -} -function Xor( s, a ) { - s = ToInt32( s ); - a = ToInt32( a ); - - var bs = ToInt32BitString( s ); - var ba = ToInt32BitString( a ); - - var result = ""; - - for ( var bit = 0; bit < bs.length; bit++ ) { - if ( (bs.charAt(bit) == "1" && ba.charAt(bit) == "0") || - (bs.charAt(bit) == "0" && ba.charAt(bit) == "1") - ) { - result += "1"; - } else { - result += "0"; - } - } - - return ToInt32Decimal(result); -} -function Or( s, a ) { - s = ToInt32( s ); - a = ToInt32( a ); - - var bs = ToInt32BitString( s ); - var ba = ToInt32BitString( a ); - - var result = ""; - - for ( var bit = 0; bit < bs.length; bit++ ) { - if ( bs.charAt(bit) == "1" || ba.charAt(bit) == "1" ) { - result += "1"; - } else { - result += "0"; - } - } - - return ToInt32Decimal(result); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.10-2.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.10-2.js deleted file mode 100644 index 27bde196e0..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.10-2.js +++ /dev/null @@ -1,269 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.10-2.js'; - -/** - File Name: 11.10-2.js - ECMA Section: 11.10-2 Binary Bitwise Operators: | - Description: - Semantics - - The production A : A @ B, where @ is one of the bitwise operators in the - productions &, ^, | , is evaluated as follows: - - 1. Evaluate A. - 2. Call GetValue(Result(1)). - 3. Evaluate B. - 4. Call GetValue(Result(3)). - 5. Call ToInt32(Result(2)). - 6. Call ToInt32(Result(4)). - 7. Apply the bitwise operator @ to Result(5) and Result(6). The result is - a signed 32 bit integer. - 8. Return Result(7). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.10-2"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Binary Bitwise Operators: |"); - -var shiftexp = 0; -var addexp = 0; - -for ( shiftpow = 0; shiftpow < 33; shiftpow++ ) { - shiftexp += Math.pow( 2, shiftpow ); - - for ( addpow = 0; addpow < 33; addpow++ ) { - addexp += Math.pow(2, addpow); - - new TestCase( SECTION, - shiftexp + " | " + addexp, - Or( shiftexp, addexp ), - shiftexp | addexp ); - } -} - -test(); - -function ToInteger( n ) { - n = Number( n ); - var sign = ( n < 0 ) ? -1 : 1; - - if ( n != n ) { - return 0; - } - if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY ) { - return n; - } - return ( sign * Math.floor(Math.abs(n)) ); -} -function ToInt32( 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) )) % Math.pow(2,32); - n = ( n >= Math.pow(2,31) ) ? n - Math.pow(2,32) : n; - - return ( n ); -} -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 ); -} -function ToUint16( 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) ) ) % Math.pow(2,16); - - if (n <0) { - n += Math.pow(2,16); - } - - return ( n ); -} -function Mask( b, n ) { - b = ToUint32BitString( b ); - b = b.substring( b.length - n ); - b = ToUint32Decimal( b ); - return ( b ); -} -function ToUint32BitString( n ) { - var b = ""; - for ( p = 31; p >=0; p-- ) { - if ( n >= Math.pow(2,p) ) { - b += "1"; - n -= Math.pow(2,p); - } else { - b += "0"; - } - } - return b; -} -function ToInt32BitString( n ) { - var b = ""; - var sign = ( n < 0 ) ? -1 : 1; - - b += ( sign == 1 ) ? "0" : "1"; - - for ( p = 30; p >=0; p-- ) { - if ( (sign == 1 ) ? sign * n >= Math.pow(2,p) : sign * n > Math.pow(2,p) ) { - b += ( sign == 1 ) ? "1" : "0"; - n -= sign * Math.pow( 2, p ); - } else { - b += ( sign == 1 ) ? "0" : "1"; - } - } - - return b; -} -function ToInt32Decimal( bin ) { - var r = 0; - var sign; - - if ( Number(bin.charAt(0)) == 0 ) { - sign = 1; - r = 0; - } else { - sign = -1; - r = -(Math.pow(2,31)); - } - - for ( var j = 0; j < 31; j++ ) { - r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); - } - - return r; -} -function ToUint32Decimal( bin ) { - var r = 0; - - - for ( l = bin.length; l < 32; l++ ) { - bin = "0" + bin; - } - - for ( j = 0; j < 31; j++ ) { - r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); - - } - - return r; -} -function And( s, a ) { - s = ToInt32( s ); - a = ToInt32( a ); - - var bs = ToInt32BitString( s ); - var ba = ToInt32BitString( a ); - - var result = ""; - - for ( var bit = 0; bit < bs.length; bit++ ) { - if ( bs.charAt(bit) == "1" && ba.charAt(bit) == "1" ) { - result += "1"; - } else { - result += "0"; - } - } - return ToInt32Decimal(result); -} -function Xor( s, a ) { - s = ToInt32( s ); - a = ToInt32( a ); - - var bs = ToInt32BitString( s ); - var ba = ToInt32BitString( a ); - - var result = ""; - - for ( var bit = 0; bit < bs.length; bit++ ) { - if ( (bs.charAt(bit) == "1" && ba.charAt(bit) == "0") || - (bs.charAt(bit) == "0" && ba.charAt(bit) == "1") - ) { - result += "1"; - } else { - result += "0"; - } - } - - return ToInt32Decimal(result); -} -function Or( s, a ) { - s = ToInt32( s ); - a = ToInt32( a ); - - var bs = ToInt32BitString( s ); - var ba = ToInt32BitString( a ); - - var result = ""; - - for ( var bit = 0; bit < bs.length; bit++ ) { - if ( bs.charAt(bit) == "1" || ba.charAt(bit) == "1" ) { - result += "1"; - } else { - result += "0"; - } - } - - return ToInt32Decimal(result); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.10-3.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.10-3.js deleted file mode 100644 index 3da6963255..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.10-3.js +++ /dev/null @@ -1,268 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.10-3.js'; - -/** - File Name: 11.10-3.js - ECMA Section: 11.10-3 Binary Bitwise Operators: ^ - Description: - Semantics - - The production A : A @ B, where @ is one of the bitwise operators in the - productions &, ^, | , is evaluated as follows: - - 1. Evaluate A. - 2. Call GetValue(Result(1)). - 3. Evaluate B. - 4. Call GetValue(Result(3)). - 5. Call ToInt32(Result(2)). - 6. Call ToInt32(Result(4)). - 7. Apply the bitwise operator @ to Result(5) and Result(6). The result is - a signed 32 bit integer. - 8. Return Result(7). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.10-3"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Binary Bitwise Operators: ^"); - -var shiftexp = 0; -var addexp = 0; - -for ( shiftpow = 0; shiftpow < 33; shiftpow++ ) { - shiftexp += Math.pow( 2, shiftpow ); - - for ( addpow = 0; addpow < 33; addpow++ ) { - addexp += Math.pow(2, addpow); - - new TestCase( SECTION, - shiftexp + " ^ " + addexp, - Xor( shiftexp, addexp ), - shiftexp ^ addexp ); - } -} - -test(); - -function ToInteger( n ) { - n = Number( n ); - var sign = ( n < 0 ) ? -1 : 1; - - if ( n != n ) { - return 0; - } - if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY ) { - return n; - } - return ( sign * Math.floor(Math.abs(n)) ); -} -function ToInt32( 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) )) % Math.pow(2,32); - n = ( n >= Math.pow(2,31) ) ? n - Math.pow(2,32) : n; - - return ( n ); -} -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 ); -} -function ToUint16( 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) ) ) % Math.pow(2,16); - - if (n <0) { - n += Math.pow(2,16); - } - - return ( n ); -} -function Mask( b, n ) { - b = ToUint32BitString( b ); - b = b.substring( b.length - n ); - b = ToUint32Decimal( b ); - return ( b ); -} -function ToUint32BitString( n ) { - var b = ""; - for ( p = 31; p >=0; p-- ) { - if ( n >= Math.pow(2,p) ) { - b += "1"; - n -= Math.pow(2,p); - } else { - b += "0"; - } - } - return b; -} -function ToInt32BitString( n ) { - var b = ""; - var sign = ( n < 0 ) ? -1 : 1; - - b += ( sign == 1 ) ? "0" : "1"; - - for ( p = 30; p >=0; p-- ) { - if ( (sign == 1 ) ? sign * n >= Math.pow(2,p) : sign * n > Math.pow(2,p) ) { - b += ( sign == 1 ) ? "1" : "0"; - n -= sign * Math.pow( 2, p ); - } else { - b += ( sign == 1 ) ? "0" : "1"; - } - } - - return b; -} -function ToInt32Decimal( bin ) { - var r = 0; - var sign; - - if ( Number(bin.charAt(0)) == 0 ) { - sign = 1; - r = 0; - } else { - sign = -1; - r = -(Math.pow(2,31)); - } - - for ( var j = 0; j < 31; j++ ) { - r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); - } - - return r; -} -function ToUint32Decimal( bin ) { - var r = 0; - - for ( l = bin.length; l < 32; l++ ) { - bin = "0" + bin; - } - - for ( j = 0; j < 31; j++ ) { - r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); - - } - - return r; -} -function And( s, a ) { - s = ToInt32( s ); - a = ToInt32( a ); - - var bs = ToInt32BitString( s ); - var ba = ToInt32BitString( a ); - - var result = ""; - - for ( var bit = 0; bit < bs.length; bit++ ) { - if ( bs.charAt(bit) == "1" && ba.charAt(bit) == "1" ) { - result += "1"; - } else { - result += "0"; - } - } - return ToInt32Decimal(result); -} -function Xor( s, a ) { - s = ToInt32( s ); - a = ToInt32( a ); - - var bs = ToInt32BitString( s ); - var ba = ToInt32BitString( a ); - - var result = ""; - - for ( var bit = 0; bit < bs.length; bit++ ) { - if ( (bs.charAt(bit) == "1" && ba.charAt(bit) == "0") || - (bs.charAt(bit) == "0" && ba.charAt(bit) == "1") - ) { - result += "1"; - } else { - result += "0"; - } - } - - return ToInt32Decimal(result); -} -function Or( s, a ) { - s = ToInt32( s ); - a = ToInt32( a ); - - var bs = ToInt32BitString( s ); - var ba = ToInt32BitString( a ); - - var result = ""; - - for ( var bit = 0; bit < bs.length; bit++ ) { - if ( bs.charAt(bit) == "1" || ba.charAt(bit) == "1" ) { - result += "1"; - } else { - result += "0"; - } - } - - return ToInt32Decimal(result); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.12-1.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.12-1.js deleted file mode 100644 index ff131b672e..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.12-1.js +++ /dev/null @@ -1,110 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.12-1.js'; - -/** - File Name: 11.12.js - ECMA Section: 11.12 Conditional Operator - Description: - Logi - - calORExpression ? AssignmentExpression : AssignmentExpression - - Semantics - - The production ConditionalExpression : - LogicalORExpression ? AssignmentExpression : AssignmentExpression - is evaluated as follows: - - 1. Evaluate LogicalORExpression. - 2. Call GetValue(Result(1)). - 3. Call ToBoolean(Result(2)). - 4. If Result(3) is false, go to step 8. - 5. Evaluate the first AssignmentExpression. - 6. Call GetValue(Result(5)). - 7. Return Result(6). - 8. Evaluate the second AssignmentExpression. - 9. Call GetValue(Result(8)). - 10. Return Result(9). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.12"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Conditional operator( ? : )"); - -new TestCase( SECTION, - "true ? 'PASSED' : 'FAILED'", - "PASSED", - (true?"PASSED":"FAILED")); - -new TestCase( SECTION, - "false ? 'FAILED' : 'PASSED'", - "PASSED", - (false?"FAILED":"PASSED")); - -new TestCase( SECTION, - "1 ? 'PASSED' : 'FAILED'", - "PASSED", - (true?"PASSED":"FAILED")); - -new TestCase( SECTION, - "0 ? 'FAILED' : 'PASSED'", - "PASSED", - (false?"FAILED":"PASSED")); - -new TestCase( SECTION, - "-1 ? 'PASSED' : 'FAILED'", - "PASSED", - (true?"PASSED":"FAILED")); - -new TestCase( SECTION, - "NaN ? 'FAILED' : 'PASSED'", - "PASSED", - (Number.NaN?"FAILED":"PASSED")); - -new TestCase( SECTION, - "var VAR = true ? , : 'FAILED'", - "PASSED", - (VAR = true ? "PASSED" : "FAILED") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.12-2-n.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.12-2-n.js deleted file mode 100644 index c2a1e894e0..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.12-2-n.js +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.12-2-n.js'; - -/** - File Name: 11.12-2-n.js - ECMA Section: 11.12 - Description: - - The grammar for a ConditionalExpression in ECMAScript is a little bit - different from that in C and Java, which each allow the second - subexpression to be an Expression but restrict the third expression to - be a ConditionalExpression. The motivation for this difference in - ECMAScript is to allow an assignment expression to be governed by either - arm of a conditional and to eliminate the confusing and fairly useless - case of a comma expression as the center expression. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "11.12-2-n"; -var VERSION = "ECMA_1"; -startTest(); -writeHeaderToLog( SECTION + " Conditional operator ( ? : )"); - -// the following expression should be an error in JS. - -DESCRIPTION = "var MYVAR = true ? 'EXPR1', 'EXPR2' : 'EXPR3'; MYVAR"; -EXPECTED = "error"; - -new TestCase( SECTION, - "var MYVAR = true ? 'EXPR1', 'EXPR2' : 'EXPR3'; MYVAR", - "error", - eval("var MYVAR = true ? 'EXPR1', 'EXPR2' : 'EXPR3'; MYVAR") ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.12-3.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.12-3.js deleted file mode 100644 index 11dde79fb3..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.12-3.js +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.12-3.js'; - -/** - File Name: 11.12-3.js - ECMA Section: 11.12 - Description: - - The grammar for a ConditionalExpression in ECMAScript is a little bit - different from that in C and Java, which each allow the second - subexpression to be an Expression but restrict the third expression to - be a ConditionalExpression. The motivation for this difference in - ECMAScript is to allow an assignment expression to be governed by either - arm of a conditional and to eliminate the confusing and fairly useless - case of a comma expression as the center expression. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "11.12-3"; -var VERSION = "ECMA_1"; -startTest(); -writeHeaderToLog( SECTION + " Conditional operator ( ? : )"); - -// the following expression should NOT be an error in JS. - -new TestCase( SECTION, - "var MYVAR = true ? ('FAIL1', 'PASSED') : 'FAIL2'; MYVAR", - "PASSED", - eval("var MYVAR = true ? ('FAIL1', 'PASSED') : 'FAIL2'; MYVAR")); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.12-4.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.12-4.js deleted file mode 100644 index 861692c4e8..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.12-4.js +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.12-4.js'; - -/** - File Name: 11.12-4.js - ECMA Section: 11.12 - Description: - - The grammar for a ConditionalExpression in ECMAScript is a little bit - different from that in C and Java, which each allow the second - subexpression to be an Expression but restrict the third expression to - be a ConditionalExpression. The motivation for this difference in - ECMAScript is to allow an assignment expression to be governed by either - arm of a conditional and to eliminate the confusing and fairly useless - case of a comma expression as the center expression. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "11.12-4"; -var VERSION = "ECMA_1"; -startTest(); -writeHeaderToLog( SECTION + " Conditional operator ( ? : )"); - -// the following expression should NOT be an error in JS. - -new TestCase( SECTION, - "true ? MYVAR1 = 'PASSED' : MYVAR1 = 'FAILED'; MYVAR1", - "PASSED", - eval("true ? MYVAR1 = 'PASSED' : MYVAR1 = 'FAILED'; MYVAR1") ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.13.1.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.13.1.js deleted file mode 100644 index 5e548a3e76..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.13.1.js +++ /dev/null @@ -1,72 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.13.1.js'; - -/** - File Name: 11.13.1.js - ECMA Section: 11.13.1 Simple assignment - Description: - - 11.13.1 Simple Assignment ( = ) - - The production AssignmentExpression : - LeftHandSideExpression = AssignmentExpression is evaluated as follows: - - 1. Evaluate LeftHandSideExpression. - 2. Evaluate AssignmentExpression. - 3. Call GetValue(Result(2)). - 4. Call PutValue(Result(1), Result(3)). - 5. Return Result(3). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.13.1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Simple Assignment ( = )"); - -new TestCase( SECTION, - "SOMEVAR = true", - true, - SOMEVAR = true ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.13.2-1.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.13.2-1.js deleted file mode 100644 index 41402b77ce..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.13.2-1.js +++ /dev/null @@ -1,231 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.13.2-1.js'; - -/** - File Name: 11.13.2-1.js - ECMA Section: 11.13.2 Compound Assignment: *= - Description: - - *= /= %= += -= <<= >>= >>>= &= ^= |= - - 11.13.2 Compound assignment ( op= ) - - The production AssignmentExpression : - LeftHandSideExpression @ = AssignmentExpression, where @ represents one of - the operators indicated above, is evaluated as follows: - - 1. Evaluate LeftHandSideExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate AssignmentExpression. - 4. Call GetValue(Result(3)). - 5. Apply operator @ to Result(2) and Result(4). - 6. Call PutValue(Result(1), Result(5)). - 7. Return Result(5). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.13.2-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Compound Assignment: *="); - - -// NaN cases - -new TestCase( SECTION, - "VAR1 = NaN; VAR2=1; VAR1 *= VAR2", - Number.NaN, - eval("VAR1 = Number.NaN; VAR2=1; VAR1 *= VAR2") ); - -new TestCase( SECTION, - "VAR1 = NaN; VAR2=1; VAR1 *= VAR2; VAR1", - Number.NaN, - eval("VAR1 = Number.NaN; VAR2=1; VAR1 *= VAR2; VAR1") ); - -// number cases -new TestCase( SECTION, - "VAR1 = 0; VAR2=1; VAR1 *= VAR2", - 0, - eval("VAR1 = 0; VAR2=1; VAR1 *= VAR2") ); - -new TestCase( SECTION, - "VAR1 = 0; VAR2=1; VAR1 *= VAR2;VAR1", - 0, - eval("VAR1 = 0; VAR2=1; VAR1 *= VAR2;VAR1") ); - -new TestCase( SECTION, - "VAR1 = 0xFF; VAR2 = 0xA, VAR1 *= VAR2", - 2550, - eval("VAR1 = 0XFF; VAR2 = 0XA, VAR1 *= VAR2") ); - -// special multiplication cases - -new TestCase( SECTION, - "VAR1 = 0; VAR2= Infinity; VAR1 *= VAR2", - Number.NaN, - eval("VAR1 = 0; VAR2 = Number.POSITIVE_INFINITY; VAR1 *= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = -0; VAR2= Infinity; VAR1 *= VAR2", - Number.NaN, - eval("VAR1 = -0; VAR2 = Number.POSITIVE_INFINITY; VAR1 *= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = -0; VAR2= -Infinity; VAR1 *= VAR2", - Number.NaN, - eval("VAR1 = -0; VAR2 = Number.NEGATIVE_INFINITY; VAR1 *= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = 0; VAR2= -Infinity; VAR1 *= VAR2", - Number.NaN, - eval("VAR1 = 0; VAR2 = Number.NEGATIVE_INFINITY; VAR1 *= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = 0; VAR2= Infinity; VAR2 *= VAR1", - Number.NaN, - eval("VAR1 = 0; VAR2 = Number.POSITIVE_INFINITY; VAR2 *= VAR1; VAR2") ); - -new TestCase( SECTION, - "VAR1 = -0; VAR2= Infinity; VAR2 *= VAR1", - Number.NaN, - eval("VAR1 = -0; VAR2 = Number.POSITIVE_INFINITY; VAR2 *= VAR1; VAR2") ); - -new TestCase( SECTION, - "VAR1 = -0; VAR2= -Infinity; VAR2 *= VAR1", - Number.NaN, - eval("VAR1 = -0; VAR2 = Number.NEGATIVE_INFINITY; VAR2 *= VAR1; VAR2") ); - -new TestCase( SECTION, - "VAR1 = 0; VAR2= -Infinity; VAR2 *= VAR1", - Number.NaN, - eval("VAR1 = 0; VAR2 = Number.NEGATIVE_INFINITY; VAR2 *= VAR1; VAR2") ); - -new TestCase( SECTION, - "VAR1 = Infinity; VAR2= Infinity; VAR1 *= VAR2", - Number.POSITIVE_INFINITY, - eval("VAR1 = Number.POSITIVE_INFINITY; VAR2 = Number.POSITIVE_INFINITY; VAR1 *= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = Infinity; VAR2= -Infinity; VAR1 *= VAR2", - Number.NEGATIVE_INFINITY, - eval("VAR1 = Number.POSITIVE_INFINITY; VAR2 = Number.NEGATIVE_INFINITY; VAR1 *= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 =-Infinity; VAR2= Infinity; VAR1 *= VAR2", - Number.NEGATIVE_INFINITY, - eval("VAR1 = Number.NEGATIVE_INFINITY; VAR2 = Number.POSITIVE_INFINITY; VAR1 *= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 =-Infinity; VAR2=-Infinity; VAR1 *= VAR2", - Number.POSITIVE_INFINITY, - eval("VAR1 = Number.NEGATIVE_INFINITY; VAR2 = Number.NEGATIVE_INFINITY; VAR1 *= VAR2; VAR1") ); - -// string cases -new TestCase( SECTION, - "VAR1 = 10; VAR2 = '255', VAR1 *= VAR2", - 2550, - eval("VAR1 = 10; VAR2 = '255', VAR1 *= VAR2") ); - -new TestCase( SECTION, - "VAR1 = '255'; VAR2 = 10, VAR1 *= VAR2", - 2550, - eval("VAR1 = '255'; VAR2 = 10, VAR1 *= VAR2") ); - -new TestCase( SECTION, - "VAR1 = 10; VAR2 = '0XFF', VAR1 *= VAR2", - 2550, - eval("VAR1 = 10; VAR2 = '0XFF', VAR1 *= VAR2") ); - -new TestCase( SECTION, - "VAR1 = '0xFF'; VAR2 = 0xA, VAR1 *= VAR2", - 2550, - eval("VAR1 = '0XFF'; VAR2 = 0XA, VAR1 *= VAR2") ); - -new TestCase( SECTION, - "VAR1 = '10'; VAR2 = '255', VAR1 *= VAR2", - 2550, - eval("VAR1 = '10'; VAR2 = '255', VAR1 *= VAR2") ); - -new TestCase( SECTION, - "VAR1 = '10'; VAR2 = '0XFF', VAR1 *= VAR2", - 2550, - eval("VAR1 = '10'; VAR2 = '0XFF', VAR1 *= VAR2") ); - -new TestCase( SECTION, - "VAR1 = '0xFF'; VAR2 = 0xA, VAR1 *= VAR2", - 2550, - eval("VAR1 = '0XFF'; VAR2 = 0XA, VAR1 *= VAR2") ); - -// boolean cases -new TestCase( SECTION, - "VAR1 = true; VAR2 = false; VAR1 *= VAR2", - 0, - eval("VAR1 = true; VAR2 = false; VAR1 *= VAR2") ); - -new TestCase( SECTION, - "VAR1 = true; VAR2 = true; VAR1 *= VAR2", - 1, - eval("VAR1 = true; VAR2 = true; VAR1 *= VAR2") ); - -// object cases -new TestCase( SECTION, - "VAR1 = new Boolean(true); VAR2 = 10; VAR1 *= VAR2;VAR1", - 10, - eval("VAR1 = new Boolean(true); VAR2 = 10; VAR1 *= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = new Number(11); VAR2 = 10; VAR1 *= VAR2; VAR1", - 110, - eval("VAR1 = new Number(11); VAR2 = 10; VAR1 *= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = new Number(11); VAR2 = new Number(10); VAR1 *= VAR2", - 110, - eval("VAR1 = new Number(11); VAR2 = new Number(10); VAR1 *= VAR2") ); - -new TestCase( SECTION, - "VAR1 = new String('15'); VAR2 = new String('0xF'); VAR1 *= VAR2", - 225, - eval("VAR1 = String('15'); VAR2 = new String('0xF'); VAR1 *= VAR2") ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.13.2-2.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.13.2-2.js deleted file mode 100644 index 2d3b53630b..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.13.2-2.js +++ /dev/null @@ -1,253 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.13.2-2.js'; - -/** - File Name: 11.13.2-2js - ECMA Section: 11.13.2 Compound Assignment: /= - Description: - - *= /= %= += -= <<= >>= >>>= &= ^= |= - - 11.13.2 Compound assignment ( op= ) - - The production AssignmentExpression : - LeftHandSideExpression @ = AssignmentExpression, where @ represents one of - the operators indicated above, is evaluated as follows: - - 1. Evaluate LeftHandSideExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate AssignmentExpression. - 4. Call GetValue(Result(3)). - 5. Apply operator @ to Result(2) and Result(4). - 6. Call PutValue(Result(1), Result(5)). - 7. Return Result(5). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.13.2-2"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Compound Assignment: /="); - - -// NaN cases - -new TestCase( SECTION, - "VAR1 = NaN; VAR2=1; VAR1 /= VAR2", - Number.NaN, - eval("VAR1 = Number.NaN; VAR2=1; VAR1 /= VAR2") ); - -new TestCase( SECTION, - "VAR1 = NaN; VAR2=1; VAR1 /= VAR2; VAR1", - Number.NaN, - eval("VAR1 = Number.NaN; VAR2=1; VAR1 /= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = NaN; VAR2=0; VAR1 /= VAR2", - Number.NaN, - eval("VAR1 = Number.NaN; VAR2=0; VAR1 /= VAR2") ); - -new TestCase( SECTION, - "VAR1 = NaN; VAR2=0; VAR1 /= VAR2; VAR1", - Number.NaN, - eval("VAR1 = Number.NaN; VAR2=0; VAR1 /= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = 0; VAR2=NaN; VAR1 /= VAR2", - Number.NaN, - eval("VAR1 = 0; VAR2=Number.NaN; VAR1 /= VAR2") ); - -new TestCase( SECTION, - "VAR1 = 0; VAR2=NaN; VAR1 /= VAR2; VAR1", - Number.NaN, - eval("VAR1 = 0; VAR2=Number.NaN; VAR1 /= VAR2; VAR1") ); - -// number cases -new TestCase( SECTION, - "VAR1 = 0; VAR2=1; VAR1 /= VAR2", - 0, - eval("VAR1 = 0; VAR2=1; VAR1 /= VAR2") ); - -new TestCase( SECTION, - "VAR1 = 0; VAR2=1; VAR1 /= VAR2;VAR1", - 0, - eval("VAR1 = 0; VAR2=1; VAR1 /= VAR2;VAR1") ); - -new TestCase( SECTION, - "VAR1 = 0xFF; VAR2 = 0xA, VAR1 /= VAR2", - 25.5, - eval("VAR1 = 0XFF; VAR2 = 0XA, VAR1 /= VAR2") ); - -// special division cases - -new TestCase( SECTION, - "VAR1 = 0; VAR2= Infinity; VAR1 /= VAR2", - 0, - eval("VAR1 = 0; VAR2 = Number.POSITIVE_INFINITY; VAR1 /= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = -0; VAR2= Infinity; VAR1 /= VAR2", - 0, - eval("VAR1 = -0; VAR2 = Number.POSITIVE_INFINITY; VAR1 /= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = -0; VAR2= -Infinity; VAR1 /= VAR2", - 0, - eval("VAR1 = -0; VAR2 = Number.NEGATIVE_INFINITY; VAR1 /= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = 0; VAR2= -Infinity; VAR1 /= VAR2", - 0, - eval("VAR1 = 0; VAR2 = Number.NEGATIVE_INFINITY; VAR1 /= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = 0; VAR2= Infinity; VAR2 /= VAR1", - Number.POSITIVE_INFINITY, - eval("VAR1 = 0; VAR2 = Number.POSITIVE_INFINITY; VAR2 /= VAR1; VAR2") ); - -new TestCase( SECTION, - "VAR1 = -0; VAR2= Infinity; VAR2 /= VAR1", - Number.NEGATIVE_INFINITY, - eval("VAR1 = -0; VAR2 = Number.POSITIVE_INFINITY; VAR2 /= VAR1; VAR2") ); - -new TestCase( SECTION, - "VAR1 = -0; VAR2= -Infinity; VAR2 /= VAR1", - Number.POSITIVE_INFINITY, - eval("VAR1 = -0; VAR2 = Number.NEGATIVE_INFINITY; VAR2 /= VAR1; VAR2") ); - -new TestCase( SECTION, - "VAR1 = 0; VAR2= -Infinity; VAR2 /= VAR1", - Number.NEGATIVE_INFINITY, - eval("VAR1 = 0; VAR2 = Number.NEGATIVE_INFINITY; VAR2 /= VAR1; VAR2") ); - -new TestCase( SECTION, - "VAR1 = Infinity; VAR2= Infinity; VAR1 /= VAR2", - Number.NaN, - eval("VAR1 = Number.POSITIVE_INFINITY; VAR2 = Number.POSITIVE_INFINITY; VAR1 /= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = Infinity; VAR2= -Infinity; VAR1 /= VAR2", - Number.NaN, - eval("VAR1 = Number.POSITIVE_INFINITY; VAR2 = Number.NEGATIVE_INFINITY; VAR1 /= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 =-Infinity; VAR2= Infinity; VAR1 /= VAR2", - Number.NaN, - eval("VAR1 = Number.NEGATIVE_INFINITY; VAR2 = Number.POSITIVE_INFINITY; VAR1 /= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 =-Infinity; VAR2=-Infinity; VAR1 /= VAR2", - Number.NaN, - eval("VAR1 = Number.NEGATIVE_INFINITY; VAR2 = Number.NEGATIVE_INFINITY; VAR1 /= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = 0; VAR2= 0; VAR1 /= VAR2", - Number.NaN, - eval("VAR1 = 0; VAR2 = 0; VAR1 /= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = 0; VAR2= -0; VAR1 /= VAR2", - Number.NaN, - eval("VAR1 = 0; VAR2 = -0; VAR1 /= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = -0; VAR2= 0; VAR1 /= VAR2", - Number.NaN, - eval("VAR1 = -0; VAR2 = 0; VAR1 /= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = -0; VAR2= -0; VAR1 /= VAR2", - Number.NaN, - eval("VAR1 = -0; VAR2 = -0; VAR1 /= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = 1; VAR2= 0; VAR1 /= VAR2", - Number.POSITIVE_INFINITY, - eval("VAR1 = 1; VAR2 = 0; VAR1 /= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = 1; VAR2= -0; VAR1 /= VAR2", - Number.NEGATIVE_INFINITY, - eval("VAR1 = 1; VAR2 = -0; VAR1 /= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = -1; VAR2= 0; VAR1 /= VAR2", - Number.NEGATIVE_INFINITY, - eval("VAR1 = -1; VAR2 = 0; VAR1 /= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = -1; VAR2= -0; VAR1 /= VAR2", - Number.POSITIVE_INFINITY, - eval("VAR1 = -1; VAR2 = -0; VAR1 /= VAR2; VAR1") ); - -// string cases -new TestCase( SECTION, - "VAR1 = 1000; VAR2 = '10', VAR1 /= VAR2; VAR1", - 100, - eval("VAR1 = 1000; VAR2 = '10', VAR1 /= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = '1000'; VAR2 = 10, VAR1 /= VAR2; VAR1", - 100, - eval("VAR1 = '1000'; VAR2 = 10, VAR1 /= VAR2; VAR1") ); -/* - new TestCase( SECTION, "VAR1 = 10; VAR2 = '0XFF', VAR1 /= VAR2", 2550, eval("VAR1 = 10; VAR2 = '0XFF', VAR1 /= VAR2") ); - new TestCase( SECTION, "VAR1 = '0xFF'; VAR2 = 0xA, VAR1 /= VAR2", 2550, eval("VAR1 = '0XFF'; VAR2 = 0XA, VAR1 /= VAR2") ); - - new TestCase( SECTION, "VAR1 = '10'; VAR2 = '255', VAR1 /= VAR2", 2550, eval("VAR1 = '10'; VAR2 = '255', VAR1 /= VAR2") ); - new TestCase( SECTION, "VAR1 = '10'; VAR2 = '0XFF', VAR1 /= VAR2", 2550, eval("VAR1 = '10'; VAR2 = '0XFF', VAR1 /= VAR2") ); - new TestCase( SECTION, "VAR1 = '0xFF'; VAR2 = 0xA, VAR1 /= VAR2", 2550, eval("VAR1 = '0XFF'; VAR2 = 0XA, VAR1 /= VAR2") ); - - // boolean cases - new TestCase( SECTION, "VAR1 = true; VAR2 = false; VAR1 /= VAR2", 0, eval("VAR1 = true; VAR2 = false; VAR1 /= VAR2") ); - new TestCase( SECTION, "VAR1 = true; VAR2 = true; VAR1 /= VAR2", 1, eval("VAR1 = true; VAR2 = true; VAR1 /= VAR2") ); - - // object cases - new TestCase( SECTION, "VAR1 = new Boolean(true); VAR2 = 10; VAR1 /= VAR2;VAR1", 10, eval("VAR1 = new Boolean(true); VAR2 = 10; VAR1 /= VAR2; VAR1") ); - new TestCase( SECTION, "VAR1 = new Number(11); VAR2 = 10; VAR1 /= VAR2; VAR1", 110, eval("VAR1 = new Number(11); VAR2 = 10; VAR1 /= VAR2; VAR1") ); - new TestCase( SECTION, "VAR1 = new Number(11); VAR2 = new Number(10); VAR1 /= VAR2", 110, eval("VAR1 = new Number(11); VAR2 = new Number(10); VAR1 /= VAR2") ); - new TestCase( SECTION, "VAR1 = new String('15'); VAR2 = new String('0xF'); VAR1 /= VAR2", 255, eval("VAR1 = String('15'); VAR2 = new String('0xF'); VAR1 /= VAR2") ); - -*/ - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.13.2-3.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.13.2-3.js deleted file mode 100644 index c432934a30..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.13.2-3.js +++ /dev/null @@ -1,300 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.13.2-3.js'; - -/** - File Name: 11.13.2-4.js - ECMA Section: 11.13.2 Compound Assignment: %= - Description: - - *= /= %= += -= <<= >>= >>>= &= ^= |= - - 11.13.2 Compound assignment ( op= ) - - The production AssignmentExpression : - LeftHandSideExpression @ = AssignmentExpression, where @ represents one of - the operators indicated above, is evaluated as follows: - - 1. Evaluate LeftHandSideExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate AssignmentExpression. - 4. Call GetValue(Result(3)). - 5. Apply operator @ to Result(2) and Result(4). - 6. Call PutValue(Result(1), Result(5)). - 7. Return Result(5). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.13.2-3"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Compound Assignment: +="); - -// If either operand is NaN, result is NaN - -new TestCase( SECTION, - "VAR1 = NaN; VAR2=1; VAR1 %= VAR2", - Number.NaN, - eval("VAR1 = Number.NaN; VAR2=1; VAR1 %= VAR2") ); - -new TestCase( SECTION, - "VAR1 = NaN; VAR2=1; VAR1 %= VAR2; VAR1", - Number.NaN, - eval("VAR1 = Number.NaN; VAR2=1; VAR1 %= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = NaN; VAR2=0; VAR1 %= VAR2", - Number.NaN, - eval("VAR1 = Number.NaN; VAR2=0; VAR1 %= VAR2") ); - -new TestCase( SECTION, - "VAR1 = NaN; VAR2=0; VAR1 %= VAR2; VAR1", - Number.NaN, - eval("VAR1 = Number.NaN; VAR2=0; VAR1 %= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = 0; VAR2=NaN; VAR1 %= VAR2", - Number.NaN, - eval("VAR1 = 0; VAR2=Number.NaN; VAR1 %= VAR2") ); - -new TestCase( SECTION, - "VAR1 = 0; VAR2=NaN; VAR1 %= VAR2; VAR1", - Number.NaN, - eval("VAR1 = 0; VAR2=Number.NaN; VAR1 %= VAR2; VAR1") ); - -// if the dividend is infinity or the divisor is zero or both, the result is NaN - -new TestCase( SECTION, - "VAR1 = Infinity; VAR2= Infinity; VAR1 %= VAR2; VAR1", - Number.NaN, - eval("VAR1 = Number.POSITIVE_INFINITY; VAR2 = Number.POSITIVE_INFINITY; VAR1 %= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = Infinity; VAR2= -Infinity; VAR1 %= VAR2; VAR1", - Number.NaN, - eval("VAR1 = Number.POSITIVE_INFINITY; VAR2 = Number.NEGATIVE_INFINITY; VAR1 %= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 =-Infinity; VAR2= Infinity; VAR1 %= VAR2; VAR1", - Number.NaN, - eval("VAR1 = Number.NEGATIVE_INFINITY; VAR2 = Number.POSITIVE_INFINITY; VAR1 %= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 =-Infinity; VAR2=-Infinity; VAR1 %= VAR2; VAR1", - Number.NaN, - eval("VAR1 = Number.NEGATIVE_INFINITY; VAR2 = Number.NEGATIVE_INFINITY; VAR1 %= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = 0; VAR2= Infinity; VAR2 %= VAR1", - Number.NaN, - eval("VAR1 = 0; VAR2 = Number.POSITIVE_INFINITY; VAR2 %= VAR1; VAR2") ); - -new TestCase( SECTION, - "VAR1 = -0; VAR2= Infinity; VAR2 %= VAR1", - Number.NaN, - eval("VAR1 = -0; VAR2 = Number.POSITIVE_INFINITY; VAR2 %= VAR1; VAR2") ); - -new TestCase( SECTION, - "VAR1 = -0; VAR2= -Infinity; VAR2 %= VAR1", - Number.NaN, - eval("VAR1 = -0; VAR2 = Number.NEGATIVE_INFINITY; VAR2 %= VAR1; VAR2") ); - -new TestCase( SECTION, - "VAR1 = 0; VAR2= -Infinity; VAR2 %= VAR1", - Number.NaN, - eval("VAR1 = 0; VAR2 = Number.NEGATIVE_INFINITY; VAR2 %= VAR1; VAR2") ); - -new TestCase( SECTION, - "VAR1 = 1; VAR2= Infinity; VAR2 %= VAR1", - Number.NaN, - eval("VAR1 = 1; VAR2 = Number.POSITIVE_INFINITY; VAR2 %= VAR1; VAR2") ); - -new TestCase( SECTION, - "VAR1 = -1; VAR2= Infinity; VAR2 %= VAR1", - Number.NaN, - eval("VAR1 = -1; VAR2 = Number.POSITIVE_INFINITY; VAR2 %= VAR1; VAR2") ); - -new TestCase( SECTION, - "VAR1 = -1; VAR2= -Infinity; VAR2 %= VAR1", - Number.NaN, - eval("VAR1 = -1; VAR2 = Number.NEGATIVE_INFINITY; VAR2 %= VAR1; VAR2") ); - -new TestCase( SECTION, - "VAR1 = 1; VAR2= -Infinity; VAR2 %= VAR1", - Number.NaN, - eval("VAR1 = 1; VAR2 = Number.NEGATIVE_INFINITY; VAR2 %= VAR1; VAR2") ); - -new TestCase( SECTION, - "VAR1 = 0; VAR2= 0; VAR1 %= VAR2", - Number.NaN, - eval("VAR1 = 0; VAR2 = 0; VAR1 %= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = 0; VAR2= -0; VAR1 %= VAR2", - Number.NaN, - eval("VAR1 = 0; VAR2 = -0; VAR1 %= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = -0; VAR2= 0; VAR1 %= VAR2", - Number.NaN, - eval("VAR1 = -0; VAR2 = 0; VAR1 %= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = -0; VAR2= -0; VAR1 %= VAR2", - Number.NaN, - eval("VAR1 = -0; VAR2 = -0; VAR1 %= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = 1; VAR2= 0; VAR1 %= VAR2", - Number.NaN, - eval("VAR1 = 1; VAR2 = 0; VAR1 %= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = 1; VAR2= -0; VAR1 %= VAR2", - Number.NaN, - eval("VAR1 = 1; VAR2 = -0; VAR1 %= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = -1; VAR2= 0; VAR1 %= VAR2", - Number.NaN, - eval("VAR1 = -1; VAR2 = 0; VAR1 %= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = -1; VAR2= -0; VAR1 %= VAR2", - Number.NaN, - eval("VAR1 = -1; VAR2 = -0; VAR1 %= VAR2; VAR1") ); - -// if the dividend is finite and the divisor is an infinity, the result equals the dividend. - -new TestCase( SECTION, - "VAR1 = 0; VAR2= Infinity; VAR1 %= VAR2;VAR1", - 0, - eval("VAR1 = 0; VAR2 = Number.POSITIVE_INFINITY; VAR1 %= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = -0; VAR2= Infinity; VAR1 %= VAR2;VAR1", - -0, - eval("VAR1 = -0; VAR2 = Number.POSITIVE_INFINITY; VAR1 %= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = -0; VAR2= -Infinity; VAR1 %= VAR2;VAR1", - -0, - eval("VAR1 = -0; VAR2 = Number.NEGATIVE_INFINITY; VAR1 %= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = 0; VAR2= -Infinity; VAR1 %= VAR2;VAR1", - 0, - eval("VAR1 = 0; VAR2 = Number.NEGATIVE_INFINITY; VAR1 %= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = 1; VAR2= Infinity; VAR1 %= VAR2;VAR1", - 1, - eval("VAR1 = 1; VAR2 = Number.POSITIVE_INFINITY; VAR1 %= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = -1; VAR2= Infinity; VAR1 %= VAR2;VAR1", - -1, - eval("VAR1 = -1; VAR2 = Number.POSITIVE_INFINITY; VAR1 %= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = -1; VAR2= -Infinity; VAR1 %= VAR2;VAR1", - -1, - eval("VAR1 = -1; VAR2 = Number.NEGATIVE_INFINITY; VAR1 %= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = 1; VAR2= -Infinity; VAR1 %= VAR2;VAR1", - 1, - eval("VAR1 = 1; VAR2 = Number.NEGATIVE_INFINITY; VAR1 %= VAR2; VAR1") ); - -// if the dividend is a zero and the divisor is finite, the result is the same as the dividend - -new TestCase( SECTION, - "VAR1 = 0; VAR2= 1; VAR1 %= VAR2; VAR1", - 0, - eval("VAR1 = 0; VAR2 = 1; VAR1 %= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = -0; VAR2= 1; VAR1 %= VAR2; VAR1", - -0, - eval("VAR1 = -0; VAR2 = 1; VAR1 %= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = -0; VAR2= -1; VAR1 %= VAR2; VAR1", - -0, - eval("VAR1 = -0; VAR2 = -1; VAR1 %= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = 0; VAR2= -1; VAR1 %= VAR2; VAR1", - 0, - eval("VAR1 = 0; VAR2 = -1; VAR1 %= VAR2; VAR1") ); - -// string cases -new TestCase( SECTION, - "VAR1 = 1000; VAR2 = '10', VAR1 %= VAR2; VAR1", - 0, - eval("VAR1 = 1000; VAR2 = '10', VAR1 %= VAR2; VAR1") ); - -new TestCase( SECTION, - "VAR1 = '1000'; VAR2 = 10, VAR1 %= VAR2; VAR1", - 0, - eval("VAR1 = '1000'; VAR2 = 10, VAR1 %= VAR2; VAR1") ); -/* - new TestCase( SECTION, "VAR1 = 10; VAR2 = '0XFF', VAR1 %= VAR2", 2550, eval("VAR1 = 10; VAR2 = '0XFF', VAR1 %= VAR2") ); - new TestCase( SECTION, "VAR1 = '0xFF'; VAR2 = 0xA, VAR1 %= VAR2", 2550, eval("VAR1 = '0XFF'; VAR2 = 0XA, VAR1 %= VAR2") ); - - new TestCase( SECTION, "VAR1 = '10'; VAR2 = '255', VAR1 %= VAR2", 2550, eval("VAR1 = '10'; VAR2 = '255', VAR1 %= VAR2") ); - new TestCase( SECTION, "VAR1 = '10'; VAR2 = '0XFF', VAR1 %= VAR2", 2550, eval("VAR1 = '10'; VAR2 = '0XFF', VAR1 %= VAR2") ); - new TestCase( SECTION, "VAR1 = '0xFF'; VAR2 = 0xA, VAR1 %= VAR2", 2550, eval("VAR1 = '0XFF'; VAR2 = 0XA, VAR1 %= VAR2") ); - - // boolean cases - new TestCase( SECTION, "VAR1 = true; VAR2 = false; VAR1 %= VAR2", 0, eval("VAR1 = true; VAR2 = false; VAR1 %= VAR2") ); - new TestCase( SECTION, "VAR1 = true; VAR2 = true; VAR1 %= VAR2", 1, eval("VAR1 = true; VAR2 = true; VAR1 %= VAR2") ); - - // object cases - new TestCase( SECTION, "VAR1 = new Boolean(true); VAR2 = 10; VAR1 %= VAR2;VAR1", 10, eval("VAR1 = new Boolean(true); VAR2 = 10; VAR1 %= VAR2; VAR1") ); - new TestCase( SECTION, "VAR1 = new Number(11); VAR2 = 10; VAR1 %= VAR2; VAR1", 110, eval("VAR1 = new Number(11); VAR2 = 10; VAR1 %= VAR2; VAR1") ); - new TestCase( SECTION, "VAR1 = new Number(11); VAR2 = new Number(10); VAR1 %= VAR2", 110, eval("VAR1 = new Number(11); VAR2 = new Number(10); VAR1 %= VAR2") ); - new TestCase( SECTION, "VAR1 = new String('15'); VAR2 = new String('0xF'); VAR1 %= VAR2", 255, eval("VAR1 = String('15'); VAR2 = new String('0xF'); VAR1 %= VAR2") ); - -*/ - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.13.2-4.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.13.2-4.js deleted file mode 100644 index 8514dd8c9c..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.13.2-4.js +++ /dev/null @@ -1,137 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.13.2-4.js'; - -/** - File Name: 11.13.2-4.js - ECMA Section: 11.13.2 Compound Assignment:+= - Description: - - *= /= %= += -= <<= >>= >>>= &= ^= |= - - 11.13.2 Compound assignment ( op= ) - - The production AssignmentExpression : - LeftHandSideExpression @ = AssignmentExpression, where @ represents one of - the operators indicated above, is evaluated as follows: - - 1. Evaluate LeftHandSideExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate AssignmentExpression. - 4. Call GetValue(Result(3)). - 5. Apply operator @ to Result(2) and Result(4). - 6. Call PutValue(Result(1), Result(5)). - 7. Return Result(5). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.13.2-4"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Compound Assignment: +="); - -// If either operand is NaN, result is NaN - -new TestCase( SECTION, "VAR1 = NaN; VAR2=1; VAR1 += VAR2", Number.NaN, eval("VAR1 = Number.NaN; VAR2=1; VAR1 += VAR2") ); -new TestCase( SECTION, "VAR1 = NaN; VAR2=1; VAR1 += VAR2; VAR1", Number.NaN, eval("VAR1 = Number.NaN; VAR2=1; VAR1 += VAR2; VAR1") ); -new TestCase( SECTION, "VAR1 = NaN; VAR2=0; VAR1 += VAR2", Number.NaN, eval("VAR1 = Number.NaN; VAR2=0; VAR1 += VAR2") ); -new TestCase( SECTION, "VAR1 = NaN; VAR2=0; VAR1 += VAR2; VAR1", Number.NaN, eval("VAR1 = Number.NaN; VAR2=0; VAR1 += VAR2; VAR1") ); -new TestCase( SECTION, "VAR1 = 0; VAR2=NaN; VAR1 += VAR2", Number.NaN, eval("VAR1 = 0; VAR2=Number.NaN; VAR1 += VAR2") ); -new TestCase( SECTION, "VAR1 = 0; VAR2=NaN; VAR1 += VAR2; VAR1", Number.NaN, eval("VAR1 = 0; VAR2=Number.NaN; VAR1 += VAR2; VAR1") ); - -// the sum of two Infinities the same sign is the infinity of that sign -// the sum of two Infinities of opposite sign is NaN - -new TestCase( SECTION, "VAR1 = Infinity; VAR2= Infinity; VAR1 += VAR2; VAR1", Number.POSITIVE_INFINITY, eval("VAR1 = Number.POSITIVE_INFINITY; VAR2 = Number.POSITIVE_INFINITY; VAR1 += VAR2; VAR1") ); -new TestCase( SECTION, "VAR1 = Infinity; VAR2= -Infinity; VAR1 += VAR2; VAR1", Number.NaN, eval("VAR1 = Number.POSITIVE_INFINITY; VAR2 = Number.NEGATIVE_INFINITY; VAR1 += VAR2; VAR1") ); -new TestCase( SECTION, "VAR1 =-Infinity; VAR2= Infinity; VAR1 += VAR2; VAR1", Number.NaN, eval("VAR1 = Number.NEGATIVE_INFINITY; VAR2 = Number.POSITIVE_INFINITY; VAR1 += VAR2; VAR1") ); -new TestCase( SECTION, "VAR1 =-Infinity; VAR2=-Infinity; VAR1 += VAR2; VAR1", Number.NEGATIVE_INFINITY, eval("VAR1 = Number.NEGATIVE_INFINITY; VAR2 = Number.NEGATIVE_INFINITY; VAR1 += VAR2; VAR1") ); - -// the sum of an infinity and a finite value is equal to the infinite operand - -new TestCase( SECTION, "VAR1 = 0; VAR2= Infinity; VAR1 += VAR2;VAR1", Number.POSITIVE_INFINITY, eval("VAR1 = 0; VAR2 = Number.POSITIVE_INFINITY; VAR1 += VAR2; VAR1") ); -new TestCase( SECTION, "VAR1 = -0; VAR2= Infinity; VAR1 += VAR2;VAR1", Number.POSITIVE_INFINITY, eval("VAR1 = -0; VAR2 = Number.POSITIVE_INFINITY; VAR1 += VAR2; VAR1") ); -new TestCase( SECTION, "VAR1 = -0; VAR2= -Infinity; VAR1 += VAR2;VAR1", Number.NEGATIVE_INFINITY, eval("VAR1 = -0; VAR2 = Number.NEGATIVE_INFINITY; VAR1 += VAR2; VAR1") ); -new TestCase( SECTION, "VAR1 = 0; VAR2= -Infinity; VAR1 += VAR2;VAR1", Number.NEGATIVE_INFINITY, eval("VAR1 = 0; VAR2 = Number.NEGATIVE_INFINITY; VAR1 += VAR2; VAR1") ); - -// the sum of two negative zeros is -0. the sum of two positive zeros, or of two zeros of opposite sign, is +0 - -new TestCase( SECTION, "VAR1 = 0; VAR2= 0; VAR1 += VAR2", 0, eval("VAR1 = 0; VAR2 = 0; VAR1 += VAR2; VAR1") ); -new TestCase( SECTION, "VAR1 = 0; VAR2= -0; VAR1 += VAR2", 0, eval("VAR1 = 0; VAR2 = -0; VAR1 += VAR2; VAR1") ); -new TestCase( SECTION, "VAR1 = -0; VAR2= 0; VAR1 += VAR2", 0, eval("VAR1 = -0; VAR2 = 0; VAR1 += VAR2; VAR1") ); -new TestCase( SECTION, "VAR1 = -0; VAR2= -0; VAR1 += VAR2", -0, eval("VAR1 = -0; VAR2 = -0; VAR1 += VAR2; VAR1") ); - -// the sum of a zero and a nonzero finite value is eqal to the nonzero operand - -new TestCase( SECTION, "VAR1 = 0; VAR2= 1; VAR2 += VAR1; VAR2", 1, eval("VAR1 = 0; VAR2 = 1; VAR2 += VAR1; VAR2") ); -new TestCase( SECTION, "VAR1 = -0; VAR2= 1; VAR2 += VAR1; VAR2", 1, eval("VAR1 = -0; VAR2 = 1; VAR2 += VAR1; VAR2") ); -new TestCase( SECTION, "VAR1 = -0; VAR2= -1; VAR2 += VAR1; VAR2", -1, eval("VAR1 = -0; VAR2 = -1; VAR2 += VAR1; VAR2") ); -new TestCase( SECTION, "VAR1 = 0; VAR2= -1; VAR2 += VAR1; VAR2", -1, eval("VAR1 = 0; VAR2 = -1; VAR2 += VAR1; VAR2") ); - -// the sum of a zero and a nozero finite value is equal to the nonzero operand. -new TestCase( SECTION, "VAR1 = 0; VAR2=1; VAR1 += VAR2", 1, eval("VAR1 = 0; VAR2=1; VAR1 += VAR2") ); -new TestCase( SECTION, "VAR1 = 0; VAR2=1; VAR1 += VAR2;VAR1", 1, eval("VAR1 = 0; VAR2=1; VAR1 += VAR2;VAR1") ); - -// the sum of two nonzero finite values of the same magnitude and opposite sign is +0 -new TestCase( SECTION, "VAR1 = Number.MAX_VALUE; VAR2= -Number.MAX_VALUE; VAR1 += VAR2; VAR1", 0, eval("VAR1 = Number.MAX_VALUE; VAR2= -Number.MAX_VALUE; VAR1 += VAR2; VAR1") ); -new TestCase( SECTION, "VAR1 = Number.MIN_VALUE; VAR2= -Number.MIN_VALUE; VAR1 += VAR2; VAR1", 0, eval("VAR1 = Number.MIN_VALUE; VAR2= -Number.MIN_VALUE; VAR1 += VAR2; VAR1") ); - -/* - new TestCase( SECTION, "VAR1 = 10; VAR2 = '0XFF', VAR1 += VAR2", 2550, eval("VAR1 = 10; VAR2 = '0XFF', VAR1 += VAR2") ); - new TestCase( SECTION, "VAR1 = '0xFF'; VAR2 = 0xA, VAR1 += VAR2", 2550, eval("VAR1 = '0XFF'; VAR2 = 0XA, VAR1 += VAR2") ); - - new TestCase( SECTION, "VAR1 = '10'; VAR2 = '255', VAR1 += VAR2", 2550, eval("VAR1 = '10'; VAR2 = '255', VAR1 += VAR2") ); - new TestCase( SECTION, "VAR1 = '10'; VAR2 = '0XFF', VAR1 += VAR2", 2550, eval("VAR1 = '10'; VAR2 = '0XFF', VAR1 += VAR2") ); - new TestCase( SECTION, "VAR1 = '0xFF'; VAR2 = 0xA, VAR1 += VAR2", 2550, eval("VAR1 = '0XFF'; VAR2 = 0XA, VAR1 += VAR2") ); - - // boolean cases - new TestCase( SECTION, "VAR1 = true; VAR2 = false; VAR1 += VAR2", 0, eval("VAR1 = true; VAR2 = false; VAR1 += VAR2") ); - new TestCase( SECTION, "VAR1 = true; VAR2 = true; VAR1 += VAR2", 1, eval("VAR1 = true; VAR2 = true; VAR1 += VAR2") ); - - // object cases - new TestCase( SECTION, "VAR1 = new Boolean(true); VAR2 = 10; VAR1 += VAR2;VAR1", 10, eval("VAR1 = new Boolean(true); VAR2 = 10; VAR1 += VAR2; VAR1") ); - new TestCase( SECTION, "VAR1 = new Number(11); VAR2 = 10; VAR1 += VAR2; VAR1", 110, eval("VAR1 = new Number(11); VAR2 = 10; VAR1 += VAR2; VAR1") ); - new TestCase( SECTION, "VAR1 = new Number(11); VAR2 = new Number(10); VAR1 += VAR2", 110, eval("VAR1 = new Number(11); VAR2 = new Number(10); VAR1 += VAR2") ); - new TestCase( SECTION, "VAR1 = new String('15'); VAR2 = new String('0xF'); VAR1 += VAR2", 255, eval("VAR1 = String('15'); VAR2 = new String('0xF'); VAR1 += VAR2") ); - -*/ - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.13.2-5.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.13.2-5.js deleted file mode 100644 index 99d227b80f..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.13.2-5.js +++ /dev/null @@ -1,137 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.13.2-5.js'; - -/** - File Name: 11.13.2-5.js - ECMA Section: 11.13.2 Compound Assignment: -= - Description: - - *= /= %= -= -= <<= >>= >>>= &= ^= |= - - 11.13.2 Compound assignment ( op= ) - - The production AssignmentExpression : - LeftHandSideExpression @ = AssignmentExpression, where @ represents one of - the operators indicated above, is evaluated as follows: - - 1. Evaluate LeftHandSideExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate AssignmentExpression. - 4. Call GetValue(Result(3)). - 5. Apply operator @ to Result(2) and Result(4). - 6. Call PutValue(Result(1), Result(5)). - 7. Return Result(5). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.13.2-5"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Compound Assignment: -="); - -// If either operand is NaN, result is NaN - -new TestCase( SECTION, "VAR1 = NaN; VAR2=1; VAR1 -= VAR2", Number.NaN, eval("VAR1 = Number.NaN; VAR2=1; VAR1 -= VAR2") ); -new TestCase( SECTION, "VAR1 = NaN; VAR2=1; VAR1 -= VAR2; VAR1", Number.NaN, eval("VAR1 = Number.NaN; VAR2=1; VAR1 -= VAR2; VAR1") ); -new TestCase( SECTION, "VAR1 = NaN; VAR2=0; VAR1 -= VAR2", Number.NaN, eval("VAR1 = Number.NaN; VAR2=0; VAR1 -= VAR2") ); -new TestCase( SECTION, "VAR1 = NaN; VAR2=0; VAR1 -= VAR2; VAR1", Number.NaN, eval("VAR1 = Number.NaN; VAR2=0; VAR1 -= VAR2; VAR1") ); -new TestCase( SECTION, "VAR1 = 0; VAR2=NaN; VAR1 -= VAR2", Number.NaN, eval("VAR1 = 0; VAR2=Number.NaN; VAR1 -= VAR2") ); -new TestCase( SECTION, "VAR1 = 0; VAR2=NaN; VAR1 -= VAR2; VAR1", Number.NaN, eval("VAR1 = 0; VAR2=Number.NaN; VAR1 -= VAR2; VAR1") ); - -// the sum of two Infinities the same sign is the infinity of that sign -// the sum of two Infinities of opposite sign is NaN - -new TestCase( SECTION, "VAR1 = Infinity; VAR2= Infinity; VAR1 -= VAR2; VAR1", Number.NaN, eval("VAR1 = Number.POSITIVE_INFINITY; VAR2 = Number.POSITIVE_INFINITY; VAR1 -= VAR2; VAR1") ); -new TestCase( SECTION, "VAR1 = Infinity; VAR2= -Infinity; VAR1 -= VAR2; VAR1", Number.POSITIVE_INFINITY, eval("VAR1 = Number.POSITIVE_INFINITY; VAR2 = Number.NEGATIVE_INFINITY; VAR1 -= VAR2; VAR1") ); -new TestCase( SECTION, "VAR1 =-Infinity; VAR2= Infinity; VAR1 -= VAR2; VAR1", Number.NEGATIVE_INFINITY, eval("VAR1 = Number.NEGATIVE_INFINITY; VAR2 = Number.POSITIVE_INFINITY; VAR1 -= VAR2; VAR1") ); -new TestCase( SECTION, "VAR1 =-Infinity; VAR2=-Infinity; VAR1 -= VAR2; VAR1", Number.NaN, eval("VAR1 = Number.NEGATIVE_INFINITY; VAR2 = Number.NEGATIVE_INFINITY; VAR1 -= VAR2; VAR1") ); - -// the sum of an infinity and a finite value is equal to the infinite operand - -new TestCase( SECTION, "VAR1 = 0; VAR2= Infinity; VAR1 -= VAR2;VAR1", Number.NEGATIVE_INFINITY, eval("VAR1 = 0; VAR2 = Number.POSITIVE_INFINITY; VAR1 -= VAR2; VAR1") ); -new TestCase( SECTION, "VAR1 = -0; VAR2= Infinity; VAR1 -= VAR2;VAR1", Number.NEGATIVE_INFINITY, eval("VAR1 = -0; VAR2 = Number.POSITIVE_INFINITY; VAR1 -= VAR2; VAR1") ); -new TestCase( SECTION, "VAR1 = 0; VAR2= -Infinity; VAR1 -= VAR2;VAR1", Number.POSITIVE_INFINITY, eval("VAR1 = 0; VAR2 = Number.NEGATIVE_INFINITY; VAR1 -= VAR2; VAR1") ); -new TestCase( SECTION, "VAR1 = -0; VAR2= -Infinity; VAR1 -= VAR2;VAR1", Number.POSITIVE_INFINITY, eval("VAR1 = -0; VAR2 = Number.NEGATIVE_INFINITY; VAR1 -= VAR2; VAR1") ); - -// the sum of two negative zeros is -0. the sum of two positive zeros, or of two zeros of opposite sign, is +0 - -new TestCase( SECTION, "VAR1 = 0; VAR2= -0; VAR1 -= VAR2", 0, eval("VAR1 = 0; VAR2 = 0; VAR1 -= VAR2; VAR1") ); -new TestCase( SECTION, "VAR1 = 0; VAR2= 0; VAR1 -= VAR2", 0, eval("VAR1 = 0; VAR2 = -0; VAR1 -= VAR2; VAR1") ); -new TestCase( SECTION, "VAR1 = -0; VAR2= -0; VAR1 -= VAR2", 0, eval("VAR1 = -0; VAR2 = 0; VAR1 -= VAR2; VAR1") ); -new TestCase( SECTION, "VAR1 = -0; VAR2= 0; VAR1 -= VAR2", -0, eval("VAR1 = -0; VAR2 = -0; VAR1 -= VAR2; VAR1") ); - -// the sum of a zero and a nonzero finite value is eqal to the nonzero operand - -new TestCase( SECTION, "VAR1 = 0; VAR2= -1; VAR1 -= VAR2; VAR1", 1, eval("VAR1 = 0; VAR2 = -1; VAR1 -= VAR2; VAR1") ); -new TestCase( SECTION, "VAR1 = -0; VAR2= -1; VAR1 -= VAR2; VAR1", 1, eval("VAR1 = -0; VAR2 = -1; VAR1 -= VAR2; VAR1") ); -new TestCase( SECTION, "VAR1 = -0; VAR2= 1; VAR1 -= VAR2; VAR1", -1, eval("VAR1 = -0; VAR2 = 1; VAR1 -= VAR2; VAR1") ); -new TestCase( SECTION, "VAR1 = 0; VAR2= 1; VAR1 -= VAR2; VAR1", -1, eval("VAR1 = 0; VAR2 = 1; VAR1 -= VAR2; VAR1") ); - -// the sum of a zero and a nozero finite value is equal to the nonzero operand. -new TestCase( SECTION, "VAR1 = 0; VAR2=-1; VAR1 -= VAR2", 1, eval("VAR1 = 0; VAR2=-1; VAR1 -= VAR2;VAR1") ); -new TestCase( SECTION, "VAR1 = 0; VAR2=-1; VAR1 -= VAR2;VAR1", 1, eval("VAR1 = 0; VAR2=-1; VAR1 -= VAR2;VAR1") ); - -// the sum of two nonzero finite values of the same magnitude and opposite sign is +0 -new TestCase( SECTION, "VAR1 = Number.MAX_VALUE; VAR2= Number.MAX_VALUE; VAR1 -= VAR2; VAR1", 0, eval("VAR1 = Number.MAX_VALUE; VAR2= Number.MAX_VALUE; VAR1 -= VAR2; VAR1") ); -new TestCase( SECTION, "VAR1 = Number.MIN_VALUE; VAR2= Number.MIN_VALUE; VAR1 -= VAR2; VAR1", 0, eval("VAR1 = Number.MIN_VALUE; VAR2= Number.MIN_VALUE; VAR1 -= VAR2; VAR1") ); - -/* - new TestCase( SECTION, "VAR1 = 10; VAR2 = '0XFF', VAR1 -= VAR2", 2550, eval("VAR1 = 10; VAR2 = '0XFF', VAR1 -= VAR2") ); - new TestCase( SECTION, "VAR1 = '0xFF'; VAR2 = 0xA, VAR1 -= VAR2", 2550, eval("VAR1 = '0XFF'; VAR2 = 0XA, VAR1 -= VAR2") ); - - new TestCase( SECTION, "VAR1 = '10'; VAR2 = '255', VAR1 -= VAR2", 2550, eval("VAR1 = '10'; VAR2 = '255', VAR1 -= VAR2") ); - new TestCase( SECTION, "VAR1 = '10'; VAR2 = '0XFF', VAR1 -= VAR2", 2550, eval("VAR1 = '10'; VAR2 = '0XFF', VAR1 -= VAR2") ); - new TestCase( SECTION, "VAR1 = '0xFF'; VAR2 = 0xA, VAR1 -= VAR2", 2550, eval("VAR1 = '0XFF'; VAR2 = 0XA, VAR1 -= VAR2") ); - - // boolean cases - new TestCase( SECTION, "VAR1 = true; VAR2 = false; VAR1 -= VAR2", 0, eval("VAR1 = true; VAR2 = false; VAR1 -= VAR2") ); - new TestCase( SECTION, "VAR1 = true; VAR2 = true; VAR1 -= VAR2", 1, eval("VAR1 = true; VAR2 = true; VAR1 -= VAR2") ); - - // object cases - new TestCase( SECTION, "VAR1 = new Boolean(true); VAR2 = 10; VAR1 -= VAR2;VAR1", 10, eval("VAR1 = new Boolean(true); VAR2 = 10; VAR1 -= VAR2; VAR1") ); - new TestCase( SECTION, "VAR1 = new Number(11); VAR2 = 10; VAR1 -= VAR2; VAR1", 110, eval("VAR1 = new Number(11); VAR2 = 10; VAR1 -= VAR2; VAR1") ); - new TestCase( SECTION, "VAR1 = new Number(11); VAR2 = new Number(10); VAR1 -= VAR2", 110, eval("VAR1 = new Number(11); VAR2 = new Number(10); VAR1 -= VAR2") ); - new TestCase( SECTION, "VAR1 = new String('15'); VAR2 = new String('0xF'); VAR1 -= VAR2", 255, eval("VAR1 = String('15'); VAR2 = new String('0xF'); VAR1 -= VAR2") ); - -*/ - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.13.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.13.js deleted file mode 100644 index bf5f172d36..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.13.js +++ /dev/null @@ -1,86 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.13.js'; - -/** - File Name: 11.12.js - ECMA Section: 11.12 Conditional Operator - Description: - Logi - - calORExpression ? AssignmentExpression : AssignmentExpression - - Semantics - - The production ConditionalExpression : - LogicalORExpression ? AssignmentExpression : AssignmentExpression - is evaluated as follows: - - 1. Evaluate LogicalORExpression. - 2. Call GetValue(Result(1)). - 3. Call ToBoolean(Result(2)). - 4. If Result(3) is false, go to step 8. - 5. Evaluate the first AssignmentExpression. - 6. Call GetValue(Result(5)). - 7. Return Result(6). - 8. Evaluate the second AssignmentExpression. - 9. Call GetValue(Result(8)). - 10. Return Result(9). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.12"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Conditional operator( ? : )"); - -new TestCase( SECTION, "true ? 'PASSED' : 'FAILED'", "PASSED", (true?"PASSED":"FAILED")); -new TestCase( SECTION, "false ? 'FAILED' : 'PASSED'", "PASSED", (false?"FAILED":"PASSED")); - -new TestCase( SECTION, "1 ? 'PASSED' : 'FAILED'", "PASSED", (true?"PASSED":"FAILED")); -new TestCase( SECTION, "0 ? 'FAILED' : 'PASSED'", "PASSED", (false?"FAILED":"PASSED")); -new TestCase( SECTION, "-1 ? 'PASSED' : 'FAILED'", "PASSED", (true?"PASSED":"FAILED")); - -new TestCase( SECTION, "NaN ? 'FAILED' : 'PASSED'", "PASSED", (Number.NaN?"FAILED":"PASSED")); - -new TestCase( SECTION, "var VAR = true ? , : 'FAILED'", "PASSED", (VAR = true ? "PASSED" : "FAILED") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.14-1.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.14-1.js deleted file mode 100644 index c2f30afb6a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.14-1.js +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.14-1.js'; - -/** - File Name: 11.14-1.js - ECMA Section: 11.14 Comma operator (,) - Description: - Expression : - - AssignmentExpression - Expression , AssignmentExpression - - Semantics - - The production Expression : Expression , AssignmentExpression is evaluated as follows: - - 1. Evaluate Expression. - 2. Call GetValue(Result(1)). - 3. Evaluate AssignmentExpression. - 4. Call GetValue(Result(3)). - 5. Return Result(4). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.14-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Comma operator (,)"); - -new TestCase( SECTION, "true, false", false, eval("true, false") ); -new TestCase( SECTION, "VAR1=true, VAR2=false", false, eval("VAR1=true, VAR2=false") ); -new TestCase( SECTION, "VAR1=true, VAR2=false;VAR1", true, eval("VAR1=true, VAR2=false; VAR1") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.1-1.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.1-1.js deleted file mode 100644 index 91e25b01f1..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.1-1.js +++ /dev/null @@ -1,272 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.2.1-1.js'; - -/** - File Name: 11.2.1-1.js - ECMA Section: 11.2.1 Property Accessors - Description: - - Properties are accessed by name, using either the dot notation: - MemberExpression . Identifier - CallExpression . Identifier - - or the bracket notation: MemberExpression [ Expression ] - CallExpression [ Expression ] - - The dot notation is explained by the following syntactic conversion: - MemberExpression . Identifier - is identical in its behavior to - MemberExpression [ ] - and similarly - CallExpression . Identifier - is identical in its behavior to - CallExpression [ ] - where is a string literal containing the same sequence - of characters as the Identifier. - - The production MemberExpression : MemberExpression [ Expression ] is - evaluated as follows: - - 1. Evaluate MemberExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate Expression. - 4. Call GetValue(Result(3)). - 5. Call ToObject(Result(2)). - 6. Call ToString(Result(4)). - 7. Return a value of type Reference whose base object is Result(5) and - whose property name is Result(6). - - The production CallExpression : CallExpression [ Expression ] is evaluated - in exactly the same manner, except that the contained CallExpression is - evaluated in step 1. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.2.1-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Property Accessors"; -writeHeaderToLog( SECTION + " "+TITLE ); - -// go through all Native Function objects, methods, and properties and get their typeof. - -var PROPERTY = new Array(); -var p = 0; - -// properties and functions of the global object - -PROPERTY[p++] = new Property( "this", "NaN", "number" ); -PROPERTY[p++] = new Property( "this", "Infinity", "number" ); -PROPERTY[p++] = new Property( "this", "eval", "function" ); -PROPERTY[p++] = new Property( "this", "parseInt", "function" ); -PROPERTY[p++] = new Property( "this", "parseFloat", "function" ); -PROPERTY[p++] = new Property( "this", "escape", "function" ); -PROPERTY[p++] = new Property( "this", "unescape", "function" ); -PROPERTY[p++] = new Property( "this", "isNaN", "function" ); -PROPERTY[p++] = new Property( "this", "isFinite", "function" ); -PROPERTY[p++] = new Property( "this", "Object", "function" ); -PROPERTY[p++] = new Property( "this", "Number", "function" ); -PROPERTY[p++] = new Property( "this", "Function", "function" ); -PROPERTY[p++] = new Property( "this", "Array", "function" ); -PROPERTY[p++] = new Property( "this", "String", "function" ); -PROPERTY[p++] = new Property( "this", "Boolean", "function" ); -PROPERTY[p++] = new Property( "this", "Date", "function" ); -PROPERTY[p++] = new Property( "this", "Math", "object" ); - -// properties and methods of Object objects - -PROPERTY[p++] = new Property( "Object", "prototype", "object" ); -PROPERTY[p++] = new Property( "Object", "toString", "function" ); -PROPERTY[p++] = new Property( "Object", "valueOf", "function" ); -PROPERTY[p++] = new Property( "Object", "constructor", "function" ); - -// properties of the Function object - -PROPERTY[p++] = new Property( "Function", "prototype", "function" ); -PROPERTY[p++] = new Property( "Function.prototype", "toString", "function" ); -PROPERTY[p++] = new Property( "Function.prototype", "length", "number" ); -PROPERTY[p++] = new Property( "Function.prototype", "valueOf", "function" ); - -Function.prototype.myProperty = "hi"; - -PROPERTY[p++] = new Property( "Function.prototype", "myProperty", "string" ); - -// properties of the Array object -PROPERTY[p++] = new Property( "Array", "prototype", "object" ); -PROPERTY[p++] = new Property( "Array", "length", "number" ); -PROPERTY[p++] = new Property( "Array.prototype", "constructor", "function" ); -PROPERTY[p++] = new Property( "Array.prototype", "toString", "function" ); -PROPERTY[p++] = new Property( "Array.prototype", "join", "function" ); -PROPERTY[p++] = new Property( "Array.prototype", "reverse", "function" ); -PROPERTY[p++] = new Property( "Array.prototype", "sort", "function" ); - -// properties of the String object -PROPERTY[p++] = new Property( "String", "prototype", "object" ); -PROPERTY[p++] = new Property( "String", "fromCharCode", "function" ); -PROPERTY[p++] = new Property( "String.prototype", "toString", "function" ); -PROPERTY[p++] = new Property( "String.prototype", "constructor", "function" ); -PROPERTY[p++] = new Property( "String.prototype", "valueOf", "function" ); -PROPERTY[p++] = new Property( "String.prototype", "charAt", "function" ); -PROPERTY[p++] = new Property( "String.prototype", "charCodeAt", "function" ); -PROPERTY[p++] = new Property( "String.prototype", "indexOf", "function" ); -PROPERTY[p++] = new Property( "String.prototype", "lastIndexOf", "function" ); -PROPERTY[p++] = new Property( "String.prototype", "split", "function" ); -PROPERTY[p++] = new Property( "String.prototype", "substring", "function" ); -PROPERTY[p++] = new Property( "String.prototype", "toLowerCase", "function" ); -PROPERTY[p++] = new Property( "String.prototype", "toUpperCase", "function" ); -PROPERTY[p++] = new Property( "String.prototype", "length", "number" ); - -// properties of the Boolean object -PROPERTY[p++] = new Property( "Boolean", "prototype", "object" ); -PROPERTY[p++] = new Property( "Boolean", "constructor", "function" ); -PROPERTY[p++] = new Property( "Boolean.prototype", "valueOf", "function" ); -PROPERTY[p++] = new Property( "Boolean.prototype", "toString", "function" ); - -// properties of the Number object - -PROPERTY[p++] = new Property( "Number", "MAX_VALUE", "number" ); -PROPERTY[p++] = new Property( "Number", "MIN_VALUE", "number" ); -PROPERTY[p++] = new Property( "Number", "NaN", "number" ); -PROPERTY[p++] = new Property( "Number", "NEGATIVE_INFINITY", "number" ); -PROPERTY[p++] = new Property( "Number", "POSITIVE_INFINITY", "number" ); -PROPERTY[p++] = new Property( "Number.prototype", "toString", "function" ); -PROPERTY[p++] = new Property( "Number.prototype", "constructor", "function" ); -PROPERTY[p++] = new Property( "Number.prototype", "valueOf", "function" ); - -// properties of the Math Object. -PROPERTY[p++] = new Property( "Math", "E", "number" ); -PROPERTY[p++] = new Property( "Math", "LN10", "number" ); -PROPERTY[p++] = new Property( "Math", "LN2", "number" ); -PROPERTY[p++] = new Property( "Math", "LOG2E", "number" ); -PROPERTY[p++] = new Property( "Math", "LOG10E", "number" ); -PROPERTY[p++] = new Property( "Math", "PI", "number" ); -PROPERTY[p++] = new Property( "Math", "SQRT1_2", "number" ); -PROPERTY[p++] = new Property( "Math", "SQRT2", "number" ); -PROPERTY[p++] = new Property( "Math", "abs", "function" ); -PROPERTY[p++] = new Property( "Math", "acos", "function" ); -PROPERTY[p++] = new Property( "Math", "asin", "function" ); -PROPERTY[p++] = new Property( "Math", "atan", "function" ); -PROPERTY[p++] = new Property( "Math", "atan2", "function" ); -PROPERTY[p++] = new Property( "Math", "ceil", "function" ); -PROPERTY[p++] = new Property( "Math", "cos", "function" ); -PROPERTY[p++] = new Property( "Math", "exp", "function" ); -PROPERTY[p++] = new Property( "Math", "floor", "function" ); -PROPERTY[p++] = new Property( "Math", "log", "function" ); -PROPERTY[p++] = new Property( "Math", "max", "function" ); -PROPERTY[p++] = new Property( "Math", "min", "function" ); -PROPERTY[p++] = new Property( "Math", "pow", "function" ); -PROPERTY[p++] = new Property( "Math", "random", "function" ); -PROPERTY[p++] = new Property( "Math", "round", "function" ); -PROPERTY[p++] = new Property( "Math", "sin", "function" ); -PROPERTY[p++] = new Property( "Math", "sqrt", "function" ); -PROPERTY[p++] = new Property( "Math", "tan", "function" ); - -// properties of the Date object -PROPERTY[p++] = new Property( "Date", "parse", "function" ); -PROPERTY[p++] = new Property( "Date", "prototype", "object" ); -PROPERTY[p++] = new Property( "Date", "UTC", "function" ); -PROPERTY[p++] = new Property( "Date.prototype", "constructor", "function" ); -PROPERTY[p++] = new Property( "Date.prototype", "toString", "function" ); -PROPERTY[p++] = new Property( "Date.prototype", "valueOf", "function" ); -PROPERTY[p++] = new Property( "Date.prototype", "getTime", "function" ); -PROPERTY[p++] = new Property( "Date.prototype", "getYear", "function" ); -PROPERTY[p++] = new Property( "Date.prototype", "getFullYear", "function" ); -PROPERTY[p++] = new Property( "Date.prototype", "getUTCFullYear", "function" ); -PROPERTY[p++] = new Property( "Date.prototype", "getMonth", "function" ); -PROPERTY[p++] = new Property( "Date.prototype", "getUTCMonth", "function" ); -PROPERTY[p++] = new Property( "Date.prototype", "getDate", "function" ); -PROPERTY[p++] = new Property( "Date.prototype", "getUTCDate", "function" ); -PROPERTY[p++] = new Property( "Date.prototype", "getDay", "function" ); -PROPERTY[p++] = new Property( "Date.prototype", "getUTCDay", "function" ); -PROPERTY[p++] = new Property( "Date.prototype", "getHours", "function" ); -PROPERTY[p++] = new Property( "Date.prototype", "getUTCHours", "function" ); -PROPERTY[p++] = new Property( "Date.prototype", "getMinutes", "function" ); -PROPERTY[p++] = new Property( "Date.prototype", "getUTCMinutes", "function" ); -PROPERTY[p++] = new Property( "Date.prototype", "getSeconds", "function" ); -PROPERTY[p++] = new Property( "Date.prototype", "getUTCSeconds", "function" ); -PROPERTY[p++] = new Property( "Date.prototype", "getMilliseconds","function" ); -PROPERTY[p++] = new Property( "Date.prototype", "getUTCMilliseconds", "function" ); -PROPERTY[p++] = new Property( "Date.prototype", "setTime", "function" ); -PROPERTY[p++] = new Property( "Date.prototype", "setMilliseconds","function" ); -PROPERTY[p++] = new Property( "Date.prototype", "setUTCMilliseconds", "function" ); -PROPERTY[p++] = new Property( "Date.prototype", "setSeconds", "function" ); -PROPERTY[p++] = new Property( "Date.prototype", "setUTCSeconds", "function" ); -PROPERTY[p++] = new Property( "Date.prototype", "setMinutes", "function" ); -PROPERTY[p++] = new Property( "Date.prototype", "setUTCMinutes", "function" ); -PROPERTY[p++] = new Property( "Date.prototype", "setHours", "function" ); -PROPERTY[p++] = new Property( "Date.prototype", "setUTCHours", "function" ); -PROPERTY[p++] = new Property( "Date.prototype", "setDate", "function" ); -PROPERTY[p++] = new Property( "Date.prototype", "setUTCDate", "function" ); -PROPERTY[p++] = new Property( "Date.prototype", "setMonth", "function" ); -PROPERTY[p++] = new Property( "Date.prototype", "setUTCMonth", "function" ); -PROPERTY[p++] = new Property( "Date.prototype", "setFullYear", "function" ); -PROPERTY[p++] = new Property( "Date.prototype", "setUTCFullYear", "function" ); -PROPERTY[p++] = new Property( "Date.prototype", "setYear", "function" ); -PROPERTY[p++] = new Property( "Date.prototype", "toLocaleString", "function" ); -PROPERTY[p++] = new Property( "Date.prototype", "toUTCString", "function" ); -PROPERTY[p++] = new Property( "Date.prototype", "toGMTString", "function" ); - -for ( var i = 0, RESULT; i < PROPERTY.length; i++ ) { - RESULT = eval("typeof " + PROPERTY[i].object + "." + PROPERTY[i].name ); - - new TestCase( SECTION, - "typeof " + PROPERTY[i].object + "." + PROPERTY[i].name, - PROPERTY[i].type, - RESULT ); - - RESULT = eval("typeof " + PROPERTY[i].object + "['" + PROPERTY[i].name +"']"); - - new TestCase( SECTION, - "typeof " + PROPERTY[i].object + "['" + PROPERTY[i].name +"']", - PROPERTY[i].type, - RESULT ); -} - -test(); - -function MyObject( arg0, arg1, arg2, arg3, arg4 ) { - this.name = arg0; -} -function Property( object, name, type ) { - this.object = object; - this.name = name; - this.type = type; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.1-2.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.1-2.js deleted file mode 100644 index eda8168c0f..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.1-2.js +++ /dev/null @@ -1,128 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.2.1-2.js'; - -/** - File Name: 11.2.1-2.js - ECMA Section: 11.2.1 Property Accessors - Description: - - Properties are accessed by name, using either the dot notation: - MemberExpression . Identifier - CallExpression . Identifier - - or the bracket notation: MemberExpression [ Expression ] - CallExpression [ Expression ] - - The dot notation is explained by the following syntactic conversion: - MemberExpression . Identifier - is identical in its behavior to - MemberExpression [ ] - and similarly - CallExpression . Identifier - is identical in its behavior to - CallExpression [ ] - where is a string literal containing the same sequence - of characters as the Identifier. - - The production MemberExpression : MemberExpression [ Expression ] is - evaluated as follows: - - 1. Evaluate MemberExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate Expression. - 4. Call GetValue(Result(3)). - 5. Call ToObject(Result(2)). - 6. Call ToString(Result(4)). - 7. Return a value of type Reference whose base object is Result(5) and - whose property name is Result(6). - - The production CallExpression : CallExpression [ Expression ] is evaluated - in exactly the same manner, except that the contained CallExpression is - evaluated in step 1. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.2.1-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Property Accessors"; -writeHeaderToLog( SECTION + " "+TITLE ); - -// go through all Native Function objects, methods, and properties and get their typeof. - -var PROPERTY = new Array(); -var p = 0; - -// try to access properties of primitive types - -PROPERTY[p++] = new Property( "\"hi\"", "hi", "hi", NaN ); -PROPERTY[p++] = new Property( NaN, NaN, "NaN", NaN ); -// PROPERTY[p++] = new Property( 3, 3, "3", 3 ); -PROPERTY[p++] = new Property( true, true, "true", 1 ); -PROPERTY[p++] = new Property( false, false, "false", 0 ); - -for ( var i = 0, RESULT; i < PROPERTY.length; i++ ) { - new TestCase( SECTION, - PROPERTY[i].object + ".valueOf()", - PROPERTY[i].value, - eval( PROPERTY[i].object+ ".valueOf()" ) ); - - new TestCase( SECTION, - PROPERTY[i].object + ".toString()", - PROPERTY[i].string, - eval( PROPERTY[i].object+ ".toString()" ) ); - -} - -test(); - -function MyObject( value ) { - this.value = value; - this.stringValue = value +""; - this.numberValue = Number(value); - return this; -} -function Property( object, value, string, number ) { - this.object = object; - this.string = String(value); - this.number = Number(value); - this.value = value; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.1-3-n.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.1-3-n.js deleted file mode 100644 index 0732aa0378..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.1-3-n.js +++ /dev/null @@ -1,128 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.2.1-3-n.js'; - -/** - File Name: 11.2.1-2.js - ECMA Section: 11.2.1 Property Accessors - Description: - - Properties are accessed by name, using either the dot notation: - MemberExpression . Identifier - CallExpression . Identifier - - or the bracket notation: MemberExpression [ Expression ] - CallExpression [ Expression ] - - The dot notation is explained by the following syntactic conversion: - MemberExpression . Identifier - is identical in its behavior to - MemberExpression [ ] - and similarly - CallExpression . Identifier - is identical in its behavior to - CallExpression [ ] - where is a string literal containing the same sequence - of characters as the Identifier. - - The production MemberExpression : MemberExpression [ Expression ] is - evaluated as follows: - - 1. Evaluate MemberExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate Expression. - 4. Call GetValue(Result(3)). - 5. Call ToObject(Result(2)). - 6. Call ToString(Result(4)). - 7. Return a value of type Reference whose base object is Result(5) and - whose property name is Result(6). - - The production CallExpression : CallExpression [ Expression ] is evaluated - in exactly the same manner, except that the contained CallExpression is - evaluated in step 1. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.2.1-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Property Accessors"; -writeHeaderToLog( SECTION + " "+TITLE ); - -// go through all Native Function objects, methods, and properties and get their typeof. - -var PROPERTY = new Array(); -var p = 0; - -// try to access properties of primitive types - -PROPERTY[p++] = new Property( "undefined", void 0, "undefined", NaN ); - -for ( var i = 0, RESULT; i < PROPERTY.length; i++ ) { - - DESCRIPTION = PROPERTY[i].object + ".valueOf()"; - EXPECTED = "error"; - - new TestCase( SECTION, - PROPERTY[i].object + ".valueOf()", - PROPERTY[i].value, - eval( PROPERTY[i].object+ ".valueOf()" ) ); - - new TestCase( SECTION, - PROPERTY[i].object + ".toString()", - PROPERTY[i].string, - eval(PROPERTY[i].object+ ".toString()") ); -} -test(); - - -function MyObject( value ) { - this.value = value; - this.stringValue = value +""; - this.numberValue = Number(value); - return this; -} - -function Property( object, value, string, number ) { - this.object = object; - this.string = String(value); - this.number = Number(value); - this.value = value; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.1-4-n.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.1-4-n.js deleted file mode 100644 index 110684c9c6..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.1-4-n.js +++ /dev/null @@ -1,128 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.2.1-4-n.js'; - -/** - File Name: 11.2.1-4-n.js - ECMA Section: 11.2.1 Property Accessors - Description: - - Properties are accessed by name, using either the dot notation: - MemberExpression . Identifier - CallExpression . Identifier - - or the bracket notation: MemberExpression [ Expression ] - CallExpression [ Expression ] - - The dot notation is explained by the following syntactic conversion: - MemberExpression . Identifier - is identical in its behavior to - MemberExpression [ ] - and similarly - CallExpression . Identifier - is identical in its behavior to - CallExpression [ ] - where is a string literal containing the same sequence - of characters as the Identifier. - - The production MemberExpression : MemberExpression [ Expression ] is - evaluated as follows: - - 1. Evaluate MemberExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate Expression. - 4. Call GetValue(Result(3)). - 5. Call ToObject(Result(2)). - 6. Call ToString(Result(4)). - 7. Return a value of type Reference whose base object is Result(5) and - whose property name is Result(6). - - The production CallExpression : CallExpression [ Expression ] is evaluated - in exactly the same manner, except that the contained CallExpression is - evaluated in step 1. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.2.1-4-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Property Accessors"; -writeHeaderToLog( SECTION + " "+TITLE ); - -// go through all Native Function objects, methods, and properties and get their typeof. - -var PROPERTY = new Array(); -var p = 0; - -// try to access properties of primitive types - -PROPERTY[p++] = new Property( "null", null, "null", 0 ); - -for ( var i = 0, RESULT; i < PROPERTY.length; i++ ) { - - DESCRIPTION = PROPERTY[i].object + ".valueOf()"; - EXPECTED = "error"; - - new TestCase( SECTION, - PROPERTY[i].object + ".valueOf()", - PROPERTY[i].value, - eval( PROPERTY[i].object+ ".valueOf()" ) ); - - new TestCase( SECTION, - PROPERTY[i].object + ".toString()", - PROPERTY[i].string, - eval(PROPERTY[i].object+ ".toString()") ); - -} - -test(); - -function MyObject( value ) { - this.value = value; - this.stringValue = value +""; - this.numberValue = Number(value); - return this; -} -function Property( object, value, string, number ) { - this.object = object; - this.string = String(value); - this.number = Number(value); - this.value = value; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.1-5.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.1-5.js deleted file mode 100644 index 2d9f0f1632..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.1-5.js +++ /dev/null @@ -1,128 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.2.1-5.js'; - -/** - File Name: 11.2.1-5.js - ECMA Section: 11.2.1 Property Accessors - Description: - - Properties are accessed by name, using either the dot notation: - MemberExpression . Identifier - CallExpression . Identifier - - or the bracket notation: MemberExpression [ Expression ] - CallExpression [ Expression ] - - The dot notation is explained by the following syntactic conversion: - MemberExpression . Identifier - is identical in its behavior to - MemberExpression [ ] - and similarly - CallExpression . Identifier - is identical in its behavior to - CallExpression [ ] - where is a string literal containing the same sequence - of characters as the Identifier. - - The production MemberExpression : MemberExpression [ Expression ] is - evaluated as follows: - - 1. Evaluate MemberExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate Expression. - 4. Call GetValue(Result(3)). - 5. Call ToObject(Result(2)). - 6. Call ToString(Result(4)). - 7. Return a value of type Reference whose base object is Result(5) and - whose property name is Result(6). - - The production CallExpression : CallExpression [ Expression ] is evaluated - in exactly the same manner, except that the contained CallExpression is - evaluated in step 1. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.2.1-5"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Property Accessors"; -writeHeaderToLog( SECTION + " "+TITLE ); - -// go through all Native Function objects, methods, and properties and get their typeof. - -var PROPERTY = new Array(); -var p = 0; - -// try to access properties of primitive types - -PROPERTY[p++] = new Property( new String("hi"), "hi", "hi", NaN ); -PROPERTY[p++] = new Property( new Number(NaN), NaN, "NaN", NaN ); -PROPERTY[p++] = new Property( new Number(3), 3, "3", 3 ); -PROPERTY[p++] = new Property( new Boolean(true), true, "true", 1 ); -PROPERTY[p++] = new Property( new Boolean(false), false, "false", 0 ); - -for ( var i = 0, RESULT; i < PROPERTY.length; i++ ) { - new TestCase( SECTION, - PROPERTY[i].object + ".valueOf()", - PROPERTY[i].value, - eval( "PROPERTY[i].object.valueOf()" ) ); - - new TestCase( SECTION, - PROPERTY[i].object + ".toString()", - PROPERTY[i].string, - eval( "PROPERTY[i].object.toString()" ) ); - -} - -test(); - -function MyObject( value ) { - this.value = value; - this.stringValue = value +""; - this.numberValue = Number(value); - return this; -} -function Property( object, value, string, number ) { - this.object = object; - this.string = String(value); - this.number = Number(value); - this.value = value; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-1-n.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-1-n.js deleted file mode 100644 index 3603892114..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-1-n.js +++ /dev/null @@ -1,104 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.2.2-1-n.js'; - -/** - File Name: 11.2.2-1.js - ECMA Section: 11.2.2. The new operator - Description: - - MemberExpression: - PrimaryExpression - MemberExpression[Expression] - MemberExpression.Identifier - new MemberExpression Arguments - - new NewExpression - - The production NewExpression : new NewExpression is evaluated as follows: - - 1. Evaluate NewExpression. - 2. Call GetValue(Result(1)). - 3. If Type(Result(2)) is not Object, generate a runtime error. - 4. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 5. Call the [[Construct]] method on Result(2), providing no arguments - (that is, an empty list of arguments). - 6. If Type(Result(5)) is not Object, generate a runtime error. - 7. Return Result(5). - - The production MemberExpression : new MemberExpression Arguments is evaluated as follows: - - 1. Evaluate MemberExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate Arguments, producing an internal list of argument values - (section 0). - 4. If Type(Result(2)) is not Object, generate a runtime error. - 5. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 6. Call the [[Construct]] method on Result(2), providing the list - Result(3) as the argument values. - 7. If Type(Result(6)) is not Object, generate a runtime error. - 8 .Return Result(6). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "11.2.2-1-n.js"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The new operator"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var OBJECT = new Object(); - -DESCRIPTION = "OBJECT = new Object; var o = new OBJECT()"; -EXPECTED = "error"; - -new TestCase( SECTION, - "OBJECT = new Object; var o = new OBJECT()", - "error", - eval("o = new OBJECT()") ); -test(); - -function TestFunction() { - return arguments; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-1.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-1.js deleted file mode 100644 index 7105f17071..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-1.js +++ /dev/null @@ -1,100 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.2.2-1.js'; - -/** - File Name: 11.2.2-1.js - ECMA Section: 11.2.2. The new operator - Description: - - MemberExpression: - PrimaryExpression - MemberExpression[Expression] - MemberExpression.Identifier - new MemberExpression Arguments - - new NewExpression - - The production NewExpression : new NewExpression is evaluated as follows: - - 1. Evaluate NewExpression. - 2. Call GetValue(Result(1)). - 3. If Type(Result(2)) is not Object, generate a runtime error. - 4. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 5. Call the [[Construct]] method on Result(2), providing no arguments - (that is, an empty list of arguments). - 6. If Type(Result(5)) is not Object, generate a runtime error. - 7. Return Result(5). - - The production MemberExpression : new MemberExpression Arguments is evaluated as follows: - - 1. Evaluate MemberExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate Arguments, producing an internal list of argument values - (section 0). - 4. If Type(Result(2)) is not Object, generate a runtime error. - 5. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 6. Call the [[Construct]] method on Result(2), providing the list - Result(3) as the argument values. - 7. If Type(Result(6)) is not Object, generate a runtime error. - 8 .Return Result(6). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "11.2.2-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The new operator"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "(new TestFunction(0,1,2,3,4,5)).length", - 6, - (new TestFunction(0,1,2,3,4,5)).length ); - -test(); - -function TestFunction() { - return arguments; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-10-n.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-10-n.js deleted file mode 100644 index 36781503d9..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-10-n.js +++ /dev/null @@ -1,102 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.2.2-10-n.js'; - -/** - File Name: 11.2.2-9-n.js - ECMA Section: 11.2.2. The new operator - Description: - - MemberExpression: - PrimaryExpression - MemberExpression[Expression] - MemberExpression.Identifier - new MemberExpression Arguments - - new NewExpression - - The production NewExpression : new NewExpression is evaluated as follows: - - 1. Evaluate NewExpression. - 2. Call GetValue(Result(1)). - 3. If Type(Result(2)) is not Object, generate a runtime error. - 4. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 5. Call the [[Construct]] method on Result(2), providing no arguments - (that is, an empty list of arguments). - 6. If Type(Result(5)) is not Object, generate a runtime error. - 7. Return Result(5). - - The production MemberExpression : new MemberExpression Arguments is evaluated as follows: - - 1. Evaluate MemberExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate Arguments, producing an internal list of argument values - (section 0). - 4. If Type(Result(2)) is not Object, generate a runtime error. - 5. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 6. Call the [[Construct]] method on Result(2), providing the list - Result(3) as the argument values. - 7. If Type(Result(6)) is not Object, generate a runtime error. - 8 .Return Result(6). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "11.2.2-9-n.js"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The new operator"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "var m = new Math()"; -EXPECTED = "error"; - -new TestCase( SECTION, - "var m = new Math()", - "error", - eval("m = new Math()") ); -test(); - -function TestFunction() { - return arguments; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-11.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-11.js deleted file mode 100644 index 03a0f8c436..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-11.js +++ /dev/null @@ -1,104 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.2.2-11.js'; - -/** - File Name: 11.2.2-9-n.js - ECMA Section: 11.2.2. The new operator - Description: - - MemberExpression: - PrimaryExpression - MemberExpression[Expression] - MemberExpression.Identifier - new MemberExpression Arguments - - new NewExpression - - The production NewExpression : new NewExpression is evaluated as follows: - - 1. Evaluate NewExpression. - 2. Call GetValue(Result(1)). - 3. If Type(Result(2)) is not Object, generate a runtime error. - 4. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 5. Call the [[Construct]] method on Result(2), providing no arguments - (that is, an empty list of arguments). - 6. If Type(Result(5)) is not Object, generate a runtime error. - 7. Return Result(5). - - The production MemberExpression : new MemberExpression Arguments is evaluated as follows: - - 1. Evaluate MemberExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate Arguments, producing an internal list of argument values - (section 0). - 4. If Type(Result(2)) is not Object, generate a runtime error. - 5. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 6. Call the [[Construct]] method on Result(2), providing the list - Result(3) as the argument values. - 7. If Type(Result(6)) is not Object, generate a runtime error. - 8 Return Result(6). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "11.2.2-9-n.js"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The new operator"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var FUNCTION = new Function(); - -new TestCase( SECTION, - "var FUNCTION = new Function(); f = new FUNCTION(); typeof f", - "object", - eval("var FUNCTION = new Function(); f = new FUNCTION(); typeof f") ); - -new TestCase( SECTION, - "var FUNCTION = new Function('return this'); f = new FUNCTION(); typeof f", - "object", - eval("var FUNCTION = new Function('return this'); f = new FUNCTION(); typeof f") ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-2-n.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-2-n.js deleted file mode 100644 index 7fbea97ca1..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-2-n.js +++ /dev/null @@ -1,104 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.2.2-2-n.js'; - -/** - File Name: 11.2.2-2.js - ECMA Section: 11.2.2. The new operator - Description: - - MemberExpression: - PrimaryExpression - MemberExpression[Expression] - MemberExpression.Identifier - new MemberExpression Arguments - - new NewExpression - - The production NewExpression : new NewExpression is evaluated as follows: - - 1. Evaluate NewExpression. - 2. Call GetValue(Result(1)). - 3. If Type(Result(2)) is not Object, generate a runtime error. - 4. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 5. Call the [[Construct]] method on Result(2), providing no arguments - (that is, an empty list of arguments). - 6. If Type(Result(5)) is not Object, generate a runtime error. - 7. Return Result(5). - - The production MemberExpression : new MemberExpression Arguments is evaluated as follows: - - 1. Evaluate MemberExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate Arguments, producing an internal list of argument values - (section 0). - 4. If Type(Result(2)) is not Object, generate a runtime error. - 5. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 6. Call the [[Construct]] method on Result(2), providing the list - Result(3) as the argument values. - 7. If Type(Result(6)) is not Object, generate a runtime error. - 8 .Return Result(6). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "11.2.2-2-n.js"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The new operator"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var UNDEFINED = void 0; - -DESCRIPTION = "UNDEFINED = void 0; var o = new UNDEFINED()"; -EXPECTED = "error"; - -new TestCase( SECTION, - "UNDEFINED = void 0; var o = new UNDEFINED()", - "error", - eval("o = new UNDEFINED()") ); -test(); - -function TestFunction() { - return arguments; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-3-n.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-3-n.js deleted file mode 100644 index 8b344a3dda..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-3-n.js +++ /dev/null @@ -1,100 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.2.2-3-n.js'; - -/** - File Name: 11.2.2-3-n.js - ECMA Section: 11.2.2. The new operator - Description: - - MemberExpression: - PrimaryExpression - MemberExpression[Expression] - MemberExpression.Identifier - new MemberExpression Arguments - - new NewExpression - - The production NewExpression : new NewExpression is evaluated as follows: - - 1. Evaluate NewExpression. - 2. Call GetValue(Result(1)). - 3. If Type(Result(2)) is not Object, generate a runtime error. - 4. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 5. Call the [[Construct]] method on Result(2), providing no arguments - (that is, an empty list of arguments). - 6. If Type(Result(5)) is not Object, generate a runtime error. - 7. Return Result(5). - - The production MemberExpression : new MemberExpression Arguments is evaluated as follows: - - 1. Evaluate MemberExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate Arguments, producing an internal list of argument values - (section 0). - 4. If Type(Result(2)) is not Object, generate a runtime error. - 5. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 6. Call the [[Construct]] method on Result(2), providing the list - Result(3) as the argument values. - 7. If Type(Result(6)) is not Object, generate a runtime error. - 8 .Return Result(6). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "11.2.2-3-n.js"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The new operator"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var DESCRIPTION = "NULL = null; var o = new NULL()"; -var EXPECTED = "error"; -var NULL = null; - -new TestCase( SECTION, - "NULL = null; var o = new NULL()", - "error", - eval("o = new NULL()") ); -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-4-n.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-4-n.js deleted file mode 100644 index c2ff538b9f..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-4-n.js +++ /dev/null @@ -1,104 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.2.2-4-n.js'; - -/** - File Name: 11.2.2-4-n.js - ECMA Section: 11.2.2. The new operator - Description: - - MemberExpression: - PrimaryExpression - MemberExpression[Expression] - MemberExpression.Identifier - new MemberExpression Arguments - - new NewExpression - - The production NewExpression : new NewExpression is evaluated as follows: - - 1. Evaluate NewExpression. - 2. Call GetValue(Result(1)). - 3. If Type(Result(2)) is not Object, generate a runtime error. - 4. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 5. Call the [[Construct]] method on Result(2), providing no arguments - (that is, an empty list of arguments). - 6. If Type(Result(5)) is not Object, generate a runtime error. - 7. Return Result(5). - - The production MemberExpression : new MemberExpression Arguments is evaluated as follows: - - 1. Evaluate MemberExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate Arguments, producing an internal list of argument values - (section 0). - 4. If Type(Result(2)) is not Object, generate a runtime error. - 5. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 6. Call the [[Construct]] method on Result(2), providing the list - Result(3) as the argument values. - 7. If Type(Result(6)) is not Object, generate a runtime error. - 8 .Return Result(6). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "11.2.2-4-n.js"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The new operator"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var STRING = ""; - -DESCRIPTION = "STRING = '', var s = new STRING()"; -EXPECTED = "error"; - -new TestCase( SECTION, - "STRING = '', var s = new STRING()", - "error", - eval("s = new STRING()") ); -test(); - -function TestFunction() { - return arguments; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-5-n.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-5-n.js deleted file mode 100644 index ba8d0756fb..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-5-n.js +++ /dev/null @@ -1,104 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.2.2-5-n.js'; - -/** - File Name: 11.2.2-5-n.js - ECMA Section: 11.2.2. The new operator - Description: - - MemberExpression: - PrimaryExpression - MemberExpression[Expression] - MemberExpression.Identifier - new MemberExpression Arguments - - new NewExpression - - The production NewExpression : new NewExpression is evaluated as follows: - - 1. Evaluate NewExpression. - 2. Call GetValue(Result(1)). - 3. If Type(Result(2)) is not Object, generate a runtime error. - 4. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 5. Call the [[Construct]] method on Result(2), providing no arguments - (that is, an empty list of arguments). - 6. If Type(Result(5)) is not Object, generate a runtime error. - 7. Return Result(5). - - The production MemberExpression : new MemberExpression Arguments is evaluated as follows: - - 1. Evaluate MemberExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate Arguments, producing an internal list of argument values - (section 0). - 4. If Type(Result(2)) is not Object, generate a runtime error. - 5. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 6. Call the [[Construct]] method on Result(2), providing the list - Result(3) as the argument values. - 7. If Type(Result(6)) is not Object, generate a runtime error. - 8 .Return Result(6). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "11.2.2-5-n.js"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The new operator"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var NUMBER = 0; - -DESCRIPTION = "NUMBER=0, var n = new NUMBER()"; -EXPECTED = "error"; - -new TestCase( SECTION, - "NUMBER=0, var n = new NUMBER()", - "error", - eval("n = new NUMBER()") ); -test(); - -function TestFunction() { - return arguments; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-6-n.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-6-n.js deleted file mode 100644 index f89b4009e3..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-6-n.js +++ /dev/null @@ -1,103 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.2.2-6-n.js'; - -/** - File Name: 11.2.2-6-n.js - ECMA Section: 11.2.2. The new operator - Description: - - MemberExpression: - PrimaryExpression - MemberExpression[Expression] - MemberExpression.Identifier - new MemberExpression Arguments - - new NewExpression - - The production NewExpression : new NewExpression is evaluated as follows: - - 1. Evaluate NewExpression. - 2. Call GetValue(Result(1)). - 3. If Type(Result(2)) is not Object, generate a runtime error. - 4. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 5. Call the [[Construct]] method on Result(2), providing no arguments - (that is, an empty list of arguments). - 6. If Type(Result(5)) is not Object, generate a runtime error. - 7. Return Result(5). - - The production MemberExpression : new MemberExpression Arguments is evaluated as follows: - - 1. Evaluate MemberExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate Arguments, producing an internal list of argument values - (section 0). - 4. If Type(Result(2)) is not Object, generate a runtime error. - 5. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 6. Call the [[Construct]] method on Result(2), providing the list - Result(3) as the argument values. - 7. If Type(Result(6)) is not Object, generate a runtime error. - 8 .Return Result(6). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.2.2-6-n.js"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The new operator"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var BOOLEAN = true; -DESCRIPTION = "BOOLEAN = true; var b = new BOOLEAN()"; -EXPECTED = "error"; - -new TestCase( SECTION, - "BOOLEAN = true; var b = new BOOLEAN()", - "error", - eval("b = new BOOLEAN()") ); -test(); - -function TestFunction() { - return arguments; -} - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-7-n.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-7-n.js deleted file mode 100644 index 97ae43e810..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-7-n.js +++ /dev/null @@ -1,104 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.2.2-7-n.js'; - -/** - File Name: 11.2.2-6-n.js - ECMA Section: 11.2.2. The new operator - Description: - - MemberExpression: - PrimaryExpression - MemberExpression[Expression] - MemberExpression.Identifier - new MemberExpression Arguments - - new NewExpression - - The production NewExpression : new NewExpression is evaluated as follows: - - 1. Evaluate NewExpression. - 2. Call GetValue(Result(1)). - 3. If Type(Result(2)) is not Object, generate a runtime error. - 4. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 5. Call the [[Construct]] method on Result(2), providing no arguments - (that is, an empty list of arguments). - 6. If Type(Result(5)) is not Object, generate a runtime error. - 7. Return Result(5). - - The production MemberExpression : new MemberExpression Arguments is evaluated as follows: - - 1. Evaluate MemberExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate Arguments, producing an internal list of argument values - (section 0). - 4. If Type(Result(2)) is not Object, generate a runtime error. - 5. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 6. Call the [[Construct]] method on Result(2), providing the list - Result(3) as the argument values. - 7. If Type(Result(6)) is not Object, generate a runtime error. - 8 .Return Result(6). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "11.2.2-6-n.js"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The new operator"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var STRING = new String("hi"); - -DESCRIPTION = "var STRING = new String('hi'); var s = new STRING()"; -EXPECTED = "error"; - -new TestCase( SECTION, - "var STRING = new String('hi'); var s = new STRING()", - "error", - eval("s = new STRING()") ); -test(); - -function TestFunction() { - return arguments; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-8-n.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-8-n.js deleted file mode 100644 index 10117c726e..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-8-n.js +++ /dev/null @@ -1,104 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.2.2-8-n.js'; - -/** - File Name: 11.2.2-8-n.js - ECMA Section: 11.2.2. The new operator - Description: - - MemberExpression: - PrimaryExpression - MemberExpression[Expression] - MemberExpression.Identifier - new MemberExpression Arguments - - new NewExpression - - The production NewExpression : new NewExpression is evaluated as follows: - - 1. Evaluate NewExpression. - 2. Call GetValue(Result(1)). - 3. If Type(Result(2)) is not Object, generate a runtime error. - 4. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 5. Call the [[Construct]] method on Result(2), providing no arguments - (that is, an empty list of arguments). - 6. If Type(Result(5)) is not Object, generate a runtime error. - 7. Return Result(5). - - The production MemberExpression : new MemberExpression Arguments is evaluated as follows: - - 1. Evaluate MemberExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate Arguments, producing an internal list of argument values - (section 0). - 4. If Type(Result(2)) is not Object, generate a runtime error. - 5. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 6. Call the [[Construct]] method on Result(2), providing the list - Result(3) as the argument values. - 7. If Type(Result(6)) is not Object, generate a runtime error. - 8 .Return Result(6). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "11.2.2-8-n.js"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The new operator"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var NUMBER = new Number(1); - -DESCRIPTION = "var NUMBER = new Number(1); var n = new NUMBER()"; -EXPECTED = "error"; - -new TestCase( SECTION, - "var NUMBER = new Number(1); var n = new NUMBER()", - "error", - eval("n = new NUMBER()") ); -test(); - -function TestFunction() { - return arguments; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-9-n.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-9-n.js deleted file mode 100644 index 6099754ca3..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.2-9-n.js +++ /dev/null @@ -1,104 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.2.2-9-n.js'; - -/** - File Name: 11.2.2-9-n.js - ECMA Section: 11.2.2. The new operator - Description: - - MemberExpression: - PrimaryExpression - MemberExpression[Expression] - MemberExpression.Identifier - new MemberExpression Arguments - - new NewExpression - - The production NewExpression : new NewExpression is evaluated as follows: - - 1. Evaluate NewExpression. - 2. Call GetValue(Result(1)). - 3. If Type(Result(2)) is not Object, generate a runtime error. - 4. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 5. Call the [[Construct]] method on Result(2), providing no arguments - (that is, an empty list of arguments). - 6. If Type(Result(5)) is not Object, generate a runtime error. - 7. Return Result(5). - - The production MemberExpression : new MemberExpression Arguments is evaluated as follows: - - 1. Evaluate MemberExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate Arguments, producing an internal list of argument values - (section 0). - 4. If Type(Result(2)) is not Object, generate a runtime error. - 5. If Result(2) does not implement the internal [[Construct]] method, - generate a runtime error. - 6. Call the [[Construct]] method on Result(2), providing the list - Result(3) as the argument values. - 7. If Type(Result(6)) is not Object, generate a runtime error. - 8 .Return Result(6). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "11.2.2-9-n.js"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The new operator"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var BOOLEAN = new Boolean(); - -DESCRIPTION = "var BOOLEAN = new Boolean(); var b = new BOOLEAN()"; -EXPECTED = "error"; - -new TestCase( SECTION, - "var BOOLEAN = new Boolean(); var b = new BOOLEAN()", - "error", - eval("b = new BOOLEAN()") ); -test(); - -function TestFunction() { - return arguments; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.3-1.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.3-1.js deleted file mode 100644 index 6e36ba8d3f..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.3-1.js +++ /dev/null @@ -1,125 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.2.3-1.js'; - -/** - File Name: 11.2.3-1.js - ECMA Section: 11.2.3. Function Calls - Description: - - The production CallExpression : MemberExpression Arguments is evaluated as - follows: - - 1.Evaluate MemberExpression. - 2.Evaluate Arguments, producing an internal list of argument values - (section 0). - 3.Call GetValue(Result(1)). - 4.If Type(Result(3)) is not Object, generate a runtime error. - 5.If Result(3) does not implement the internal [[Call]] method, generate a - runtime error. - 6.If Type(Result(1)) is Reference, Result(6) is GetBase(Result(1)). Otherwise, - Result(6) is null. - 7.If Result(6) is an activation object, Result(7) is null. Otherwise, Result(7) is - the same as Result(6). - 8.Call the [[Call]] method on Result(3), providing Result(7) as the this value - and providing the list Result(2) as the argument values. - 9.Return Result(8). - - The production CallExpression : CallExpression Arguments is evaluated in - exactly the same manner, except that the contained CallExpression is - evaluated in step 1. - - Note: Result(8) will never be of type Reference if Result(3) is a native - ECMAScript object. Whether calling a host object can return a value of - type Reference is implementation-dependent. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "11.2.3-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Function Calls"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -/* this.eval() is no longer legal syntax. -// MemberExpression : this - -new TestCase( SECTION, -"this.eval()", -void 0, -this.eval() ); - -new TestCase( SECTION, -"this.eval('NaN')", -NaN, -this.eval("NaN") ); -*/ -// MemberExpression: Identifier - -var OBJECT = true; - -new TestCase( SECTION, - "OBJECT.toString()", - "true", - OBJECT.toString() ); - -// MemberExpression[ Expression] - -new TestCase( SECTION, - "(new Array())['length'].valueOf()", - 0, - (new Array())["length"].valueOf() ); - -// MemberExpression . Identifier -new TestCase( SECTION, - "(new Array()).length.valueOf()", - 0, - (new Array()).length.valueOf() ); -// new MemberExpression Arguments - -new TestCase( SECTION, - "(new Array(20))['length'].valueOf()", - 20, - (new Array(20))["length"].valueOf() ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.3-2-n.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.3-2-n.js deleted file mode 100644 index c3539e817a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.3-2-n.js +++ /dev/null @@ -1,94 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.2.3-2-n.js'; - -/** - File Name: 11.2.3-2-n.js - ECMA Section: 11.2.3. Function Calls - Description: - - The production CallExpression : MemberExpression Arguments is evaluated as - follows: - - 1.Evaluate MemberExpression. - 2.Evaluate Arguments, producing an internal list of argument values - (section 0). - 3.Call GetValue(Result(1)). - 4.If Type(Result(3)) is not Object, generate a runtime error. - 5.If Result(3) does not implement the internal [[Call]] method, generate a - runtime error. - 6.If Type(Result(1)) is Reference, Result(6) is GetBase(Result(1)). Otherwise, - Result(6) is null. - 7.If Result(6) is an activation object, Result(7) is null. Otherwise, Result(7) is - the same as Result(6). - 8.Call the [[Call]] method on Result(3), providing Result(7) as the this value - and providing the list Result(2) as the argument values. - 9.Return Result(8). - - The production CallExpression : CallExpression Arguments is evaluated in - exactly the same manner, except that the contained CallExpression is - evaluated in step 1. - - Note: Result(8) will never be of type Reference if Result(3) is a native - ECMAScript object. Whether calling a host object can return a value of - type Reference is implementation-dependent. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "11.2.3-2-n.js"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Function Calls"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "3.valueOf()", - 3, - eval("3.valueOf()") ); - -new TestCase( SECTION, - "(3).valueOf()", - 3, - eval("(3).valueOf()") ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.3-3-n.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.3-3-n.js deleted file mode 100644 index 3023fee16b..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.3-3-n.js +++ /dev/null @@ -1,91 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.2.3-3-n.js'; - -/** - File Name: 11.2.3-3-n.js - ECMA Section: 11.2.3. Function Calls - Description: - - The production CallExpression : MemberExpression Arguments is evaluated as - follows: - - 1.Evaluate MemberExpression. - 2.Evaluate Arguments, producing an internal list of argument values - (section 0). - 3.Call GetValue(Result(1)). - 4.If Type(Result(3)) is not Object, generate a runtime error. - 5.If Result(3) does not implement the internal [[Call]] method, generate a - runtime error. - 6.If Type(Result(1)) is Reference, Result(6) is GetBase(Result(1)). Otherwise, - Result(6) is null. - 7.If Result(6) is an activation object, Result(7) is null. Otherwise, Result(7) is - the same as Result(6). - 8.Call the [[Call]] method on Result(3), providing Result(7) as the this value - and providing the list Result(2) as the argument values. - 9.Return Result(8). - - The production CallExpression : CallExpression Arguments is evaluated in - exactly the same manner, except that the contained CallExpression is - evaluated in step 1. - - Note: Result(8) will never be of type Reference if Result(3) is a native - ECMAScript object. Whether calling a host object can return a value of - type Reference is implementation-dependent. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "11.2.3-3-n.js"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Function Calls"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "(void 0).valueOf()"; -EXPECTED = "error"; - -new TestCase( SECTION, - "(void 0).valueOf()", - "error", - eval("(void 0).valueOf()") ); -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.3-4-n.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.3-4-n.js deleted file mode 100644 index 3c0ac1a4b3..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.3-4-n.js +++ /dev/null @@ -1,91 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.2.3-4-n.js'; - -/** - File Name: 11.2.3-4-n.js - ECMA Section: 11.2.3. Function Calls - Description: - - The production CallExpression : MemberExpression Arguments is evaluated as - follows: - - 1.Evaluate MemberExpression. - 2.Evaluate Arguments, producing an internal list of argument values - (section 0). - 3.Call GetValue(Result(1)). - 4.If Type(Result(3)) is not Object, generate a runtime error. - 5.If Result(3) does not implement the internal [[Call]] method, generate a - runtime error. - 6.If Type(Result(1)) is Reference, Result(6) is GetBase(Result(1)). Otherwise, - Result(6) is null. - 7.If Result(6) is an activation object, Result(7) is null. Otherwise, Result(7) is - the same as Result(6). - 8.Call the [[Call]] method on Result(3), providing Result(7) as the this value - and providing the list Result(2) as the argument values. - 9.Return Result(8). - - The production CallExpression : CallExpression Arguments is evaluated in - exactly the same manner, except that the contained CallExpression is - evaluated in step 1. - - Note: Result(8) will never be of type Reference if Result(3) is a native - ECMAScript object. Whether calling a host object can return a value of - type Reference is implementation-dependent. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "11.2.3-4-n.js"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Function Calls"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "null.valueOf()"; -EXPECTED = "error"; - -new TestCase( SECTION, - "null.valueOf()", - "error", - eval("null.valueOf()") ); -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.3-5.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.3-5.js deleted file mode 100644 index 92b356c1dd..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.2.3-5.js +++ /dev/null @@ -1,85 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.2.3-5.js'; - -/** - File Name: 11.2.3-5-n.js - ECMA Section: 11.2.3. Function Calls - Description: - - The production CallExpression : MemberExpression Arguments is evaluated as - follows: - - 1. Evaluate MemberExpression. - 2. Evaluate Arguments, producing an internal list of argument values - (section 0). - 3. Call GetValue(Result(1)). - 4. If Type(Result(3)) is not Object, generate a runtime error. - 5. If Result(3) does not implement the internal [[Call]] method, generate a - runtime error. - 6. If Type(Result(1)) is Reference, Result(6) is GetBase(Result(1)). Otherwise, - Result(6) is null. - 7. If Result(6) is an activation object, Result(7) is null. Otherwise, Result(7) is - the same as Result(6). - 8. Call the [[Call]] method on Result(3), providing Result(7) as the this value - and providing the list Result(2) as the argument values. - 9. Return Result(8). - - The production CallExpression : CallExpression Arguments is evaluated in - exactly the same manner, except that the contained CallExpression is - evaluated in step 1. - - Note: Result(8) will never be of type Reference if Result(3) is a native - ECMAScript object. Whether calling a host object can return a value of - type Reference is implementation-dependent. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "11.2.3-5"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Function Calls"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "true.valueOf()", true, true.valueOf() ); -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.3.1.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.3.1.js deleted file mode 100644 index 29235f1107..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.3.1.js +++ /dev/null @@ -1,153 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.3.1.js'; - -/** - File Name: 11.3.1.js - ECMA Section: 11.3.1 Postfix increment operator - Description: - The production MemberExpression : MemberExpression ++ is evaluated as - follows: - - 1. Evaluate MemberExpression. - 2. Call GetValue(Result(1)). - 3. Call ToNumber(Result(2)). - 4. Add the value 1 to Result(3), using the same rules as for the + - operator (section 0). - 5. Call PutValue(Result(1), Result(4)). - 6. Return Result(3). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.3.1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Postfix increment operator"); - -// special numbers -new TestCase( SECTION, "var MYVAR; MYVAR++", NaN, eval("var MYVAR; MYVAR++") ); -new TestCase( SECTION, "var MYVAR= void 0; MYVAR++", NaN, eval("var MYVAR=void 0; MYVAR++") ); -new TestCase( SECTION, "var MYVAR=null; MYVAR++", 0, eval("var MYVAR=null; MYVAR++") ); -new TestCase( SECTION, "var MYVAR=true; MYVAR++", 1, eval("var MYVAR=true; MYVAR++") ); -new TestCase( SECTION, "var MYVAR=false; MYVAR++", 0, eval("var MYVAR=false; MYVAR++") ); - -// verify return value - -new TestCase( SECTION, "var MYVAR=Number.POSITIVE_INFINITY;MYVAR++", Number.POSITIVE_INFINITY, eval("var MYVAR=Number.POSITIVE_INFINITY;MYVAR++") ); -new TestCase( SECTION, "var MYVAR=Number.NEGATIVE_INFINITY;MYVAR++", Number.NEGATIVE_INFINITY, eval("var MYVAR=Number.NEGATIVE_INFINITY;MYVAR++") ); -new TestCase( SECTION, "var MYVAR=Number.NaN;MYVAR++", Number.NaN, eval("var MYVAR=Number.NaN;MYVAR++") ); - -// verify value of variable - -new TestCase( SECTION, "var MYVAR=Number.POSITIVE_INFINITY;MYVAR++;MYVAR", Number.POSITIVE_INFINITY, eval("var MYVAR=Number.POSITIVE_INFINITY;MYVAR++;MYVAR") ); -new TestCase( SECTION, "var MYVAR=Number.NEGATIVE_INFINITY;MYVAR++;MYVAR", Number.NEGATIVE_INFINITY, eval("var MYVAR=Number.NEGATIVE_INFINITY;MYVAR++;MYVAR") ); -new TestCase( SECTION, "var MYVAR=Number.NaN;MYVAR++;MYVAR", Number.NaN, eval("var MYVAR=Number.NaN;MYVAR++;MYVAR") ); - -// number primitives -new TestCase( SECTION, "var MYVAR=0;MYVAR++", 0, eval("var MYVAR=0;MYVAR++") ); -new TestCase( SECTION, "var MYVAR=0.2345;MYVAR++", 0.2345, eval("var MYVAR=0.2345;MYVAR++") ); -new TestCase( SECTION, "var MYVAR=-0.2345;MYVAR++", -0.2345, eval("var MYVAR=-0.2345;MYVAR++") ); - -// verify value of variable - -new TestCase( SECTION, "var MYVAR=0;MYVAR++;MYVAR", 1, eval("var MYVAR=0;MYVAR++;MYVAR") ); -new TestCase( SECTION, "var MYVAR=0.2345;MYVAR++;MYVAR", 1.2345, eval("var MYVAR=0.2345;MYVAR++;MYVAR") ); -new TestCase( SECTION, "var MYVAR=-0.2345;MYVAR++;MYVAR", 0.7655, eval("var MYVAR=-0.2345;MYVAR++;MYVAR") ); -new TestCase( SECTION, "var MYVAR=0;MYVAR++;MYVAR", 1, eval("var MYVAR=0;MYVAR++;MYVAR") ); -new TestCase( SECTION, "var MYVAR=0;MYVAR++;MYVAR", 1, eval("var MYVAR=0;MYVAR++;MYVAR") ); -new TestCase( SECTION, "var MYVAR=0;MYVAR++;MYVAR", 1, eval("var MYVAR=0;MYVAR++;MYVAR") ); - -// boolean values -// verify return value - -new TestCase( SECTION, "var MYVAR=true;MYVAR++", 1, eval("var MYVAR=true;MYVAR++") ); -new TestCase( SECTION, "var MYVAR=false;MYVAR++", 0, eval("var MYVAR=false;MYVAR++") ); -// verify value of variable - -new TestCase( SECTION, "var MYVAR=true;MYVAR++;MYVAR", 2, eval("var MYVAR=true;MYVAR++;MYVAR") ); -new TestCase( SECTION, "var MYVAR=false;MYVAR++;MYVAR", 1, eval("var MYVAR=false;MYVAR++;MYVAR") ); - -// boolean objects -// verify return value - -new TestCase( SECTION, "var MYVAR=new Boolean(true);MYVAR++", 1, eval("var MYVAR=true;MYVAR++") ); -new TestCase( SECTION, "var MYVAR=new Boolean(false);MYVAR++", 0, eval("var MYVAR=false;MYVAR++") ); -// verify value of variable - -new TestCase( SECTION, "var MYVAR=new Boolean(true);MYVAR++;MYVAR", 2, eval("var MYVAR=new Boolean(true);MYVAR++;MYVAR") ); -new TestCase( SECTION, "var MYVAR=new Boolean(false);MYVAR++;MYVAR", 1, eval("var MYVAR=new Boolean(false);MYVAR++;MYVAR") ); - -// string primitives -new TestCase( SECTION, "var MYVAR='string';MYVAR++", Number.NaN, eval("var MYVAR='string';MYVAR++") ); -new TestCase( SECTION, "var MYVAR='12345';MYVAR++", 12345, eval("var MYVAR='12345';MYVAR++") ); -new TestCase( SECTION, "var MYVAR='-12345';MYVAR++", -12345, eval("var MYVAR='-12345';MYVAR++") ); -new TestCase( SECTION, "var MYVAR='0Xf';MYVAR++", 15, eval("var MYVAR='0Xf';MYVAR++") ); -new TestCase( SECTION, "var MYVAR='077';MYVAR++", 77, eval("var MYVAR='077';MYVAR++") ); -new TestCase( SECTION, "var MYVAR=''; MYVAR++", 0, eval("var MYVAR='';MYVAR++") ); - -// verify value of variable - -new TestCase( SECTION, "var MYVAR='string';MYVAR++;MYVAR", Number.NaN, eval("var MYVAR='string';MYVAR++;MYVAR") ); -new TestCase( SECTION, "var MYVAR='12345';MYVAR++;MYVAR", 12346, eval("var MYVAR='12345';MYVAR++;MYVAR") ); -new TestCase( SECTION, "var MYVAR='-12345';MYVAR++;MYVAR", -12344, eval("var MYVAR='-12345';MYVAR++;MYVAR") ); -new TestCase( SECTION, "var MYVAR='0xf';MYVAR++;MYVAR", 16, eval("var MYVAR='0xf';MYVAR++;MYVAR") ); -new TestCase( SECTION, "var MYVAR='077';MYVAR++;MYVAR", 78, eval("var MYVAR='077';MYVAR++;MYVAR") ); -new TestCase( SECTION, "var MYVAR='';MYVAR++;MYVAR", 1, eval("var MYVAR='';MYVAR++;MYVAR") ); - -// string objects -new TestCase( SECTION, "var MYVAR=new String('string');MYVAR++", Number.NaN, eval("var MYVAR=new String('string');MYVAR++") ); -new TestCase( SECTION, "var MYVAR=new String('12345');MYVAR++", 12345, eval("var MYVAR=new String('12345');MYVAR++") ); -new TestCase( SECTION, "var MYVAR=new String('-12345');MYVAR++", -12345, eval("var MYVAR=new String('-12345');MYVAR++") ); -new TestCase( SECTION, "var MYVAR=new String('0Xf');MYVAR++", 15, eval("var MYVAR=new String('0Xf');MYVAR++") ); -new TestCase( SECTION, "var MYVAR=new String('077');MYVAR++", 77, eval("var MYVAR=new String('077');MYVAR++") ); -new TestCase( SECTION, "var MYVAR=new String(''); MYVAR++", 0, eval("var MYVAR=new String('');MYVAR++") ); - -// verify value of variable - -new TestCase( SECTION, "var MYVAR=new String('string');MYVAR++;MYVAR", Number.NaN, eval("var MYVAR=new String('string');MYVAR++;MYVAR") ); -new TestCase( SECTION, "var MYVAR=new String('12345');MYVAR++;MYVAR", 12346, eval("var MYVAR=new String('12345');MYVAR++;MYVAR") ); -new TestCase( SECTION, "var MYVAR=new String('-12345');MYVAR++;MYVAR", -12344, eval("var MYVAR=new String('-12345');MYVAR++;MYVAR") ); -new TestCase( SECTION, "var MYVAR=new String('0xf');MYVAR++;MYVAR", 16, eval("var MYVAR=new String('0xf');MYVAR++;MYVAR") ); -new TestCase( SECTION, "var MYVAR=new String('077');MYVAR++;MYVAR", 78, eval("var MYVAR=new String('077');MYVAR++;MYVAR") ); -new TestCase( SECTION, "var MYVAR=new String('');MYVAR++;MYVAR", 1, eval("var MYVAR=new String('');MYVAR++;MYVAR") ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.3.2.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.3.2.js deleted file mode 100644 index 2d6f6c6770..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.3.2.js +++ /dev/null @@ -1,153 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.3.2.js'; - -/** - File Name: 11.3.2.js - ECMA Section: 11.3.2 Postfix decrement operator - Description: - - 11.3.2 Postfix decrement operator - - The production MemberExpression : MemberExpression -- is evaluated as follows: - 1. Evaluate MemberExpression. - 2. Call GetValue(Result(1)). - 3. Call ToNumber(Result(2)). - 4. Subtract the value 1 from Result(3), using the same rules as for the - - operator (section 0). - 5. Call PutValue(Result(1), Result(4)). - 6. Return Result(3). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.3.2"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Postfix decrement operator"); - -// special numbers -new TestCase( SECTION, "var MYVAR; MYVAR--", NaN, eval("var MYVAR; MYVAR--") ); -new TestCase( SECTION, "var MYVAR= void 0; MYVAR--", NaN, eval("var MYVAR=void 0; MYVAR--") ); -new TestCase( SECTION, "var MYVAR=null; MYVAR--", 0, eval("var MYVAR=null; MYVAR--") ); -new TestCase( SECTION, "var MYVAR=true; MYVAR--", 1, eval("var MYVAR=true; MYVAR--") ); -new TestCase( SECTION, "var MYVAR=false; MYVAR--", 0, eval("var MYVAR=false; MYVAR--") ); - -// verify return value - -new TestCase( SECTION, "var MYVAR=Number.POSITIVE_INFINITY;MYVAR--", Number.POSITIVE_INFINITY, eval("var MYVAR=Number.POSITIVE_INFINITY;MYVAR--") ); -new TestCase( SECTION, "var MYVAR=Number.NEGATIVE_INFINITY;MYVAR--", Number.NEGATIVE_INFINITY, eval("var MYVAR=Number.NEGATIVE_INFINITY;MYVAR--") ); -new TestCase( SECTION, "var MYVAR=Number.NaN;MYVAR--", Number.NaN, eval("var MYVAR=Number.NaN;MYVAR--") ); - -// verify value of variable - -new TestCase( SECTION, "var MYVAR=Number.POSITIVE_INFINITY;MYVAR--;MYVAR", Number.POSITIVE_INFINITY, eval("var MYVAR=Number.POSITIVE_INFINITY;MYVAR--;MYVAR") ); -new TestCase( SECTION, "var MYVAR=Number.NEGATIVE_INFINITY;MYVAR--;MYVAR", Number.NEGATIVE_INFINITY, eval("var MYVAR=Number.NEGATIVE_INFINITY;MYVAR--;MYVAR") ); -new TestCase( SECTION, "var MYVAR=Number.NaN;MYVAR--;MYVAR", Number.NaN, eval("var MYVAR=Number.NaN;MYVAR--;MYVAR") ); - -// number primitives -new TestCase( SECTION, "var MYVAR=0;MYVAR--", 0, eval("var MYVAR=0;MYVAR--") ); -new TestCase( SECTION, "var MYVAR=0.2345;MYVAR--", 0.2345, eval("var MYVAR=0.2345;MYVAR--") ); -new TestCase( SECTION, "var MYVAR=-0.2345;MYVAR--", -0.2345, eval("var MYVAR=-0.2345;MYVAR--") ); - -// verify value of variable - -new TestCase( SECTION, "var MYVAR=0;MYVAR--;MYVAR", -1, eval("var MYVAR=0;MYVAR--;MYVAR") ); -new TestCase( SECTION, "var MYVAR=0.2345;MYVAR--;MYVAR", -0.7655, eval("var MYVAR=0.2345;MYVAR--;MYVAR") ); -new TestCase( SECTION, "var MYVAR=-0.2345;MYVAR--;MYVAR", -1.2345, eval("var MYVAR=-0.2345;MYVAR--;MYVAR") ); -new TestCase( SECTION, "var MYVAR=0;MYVAR--;MYVAR", -1, eval("var MYVAR=0;MYVAR--;MYVAR") ); -new TestCase( SECTION, "var MYVAR=0;MYVAR--;MYVAR", -1, eval("var MYVAR=0;MYVAR--;MYVAR") ); -new TestCase( SECTION, "var MYVAR=0;MYVAR--;MYVAR", -1, eval("var MYVAR=0;MYVAR--;MYVAR") ); - -// boolean values -// verify return value - -new TestCase( SECTION, "var MYVAR=true;MYVAR--", 1, eval("var MYVAR=true;MYVAR--") ); -new TestCase( SECTION, "var MYVAR=false;MYVAR--", 0, eval("var MYVAR=false;MYVAR--") ); -// verify value of variable - -new TestCase( SECTION, "var MYVAR=true;MYVAR--;MYVAR", 0, eval("var MYVAR=true;MYVAR--;MYVAR") ); -new TestCase( SECTION, "var MYVAR=false;MYVAR--;MYVAR", -1, eval("var MYVAR=false;MYVAR--;MYVAR") ); - -// boolean objects -// verify return value - -new TestCase( SECTION, "var MYVAR=new Boolean(true);MYVAR--", 1, eval("var MYVAR=true;MYVAR--") ); -new TestCase( SECTION, "var MYVAR=new Boolean(false);MYVAR--", 0, eval("var MYVAR=false;MYVAR--") ); -// verify value of variable - -new TestCase( SECTION, "var MYVAR=new Boolean(true);MYVAR--;MYVAR", 0, eval("var MYVAR=new Boolean(true);MYVAR--;MYVAR") ); -new TestCase( SECTION, "var MYVAR=new Boolean(false);MYVAR--;MYVAR", -1, eval("var MYVAR=new Boolean(false);MYVAR--;MYVAR") ); - -// string primitives -new TestCase( SECTION, "var MYVAR='string';MYVAR--", Number.NaN, eval("var MYVAR='string';MYVAR--") ); -new TestCase( SECTION, "var MYVAR='12345';MYVAR--", 12345, eval("var MYVAR='12345';MYVAR--") ); -new TestCase( SECTION, "var MYVAR='-12345';MYVAR--", -12345, eval("var MYVAR='-12345';MYVAR--") ); -new TestCase( SECTION, "var MYVAR='0Xf';MYVAR--", 15, eval("var MYVAR='0Xf';MYVAR--") ); -new TestCase( SECTION, "var MYVAR='077';MYVAR--", 77, eval("var MYVAR='077';MYVAR--") ); -new TestCase( SECTION, "var MYVAR=''; MYVAR--", 0, eval("var MYVAR='';MYVAR--") ); - -// verify value of variable - -new TestCase( SECTION, "var MYVAR='string';MYVAR--;MYVAR", Number.NaN, eval("var MYVAR='string';MYVAR--;MYVAR") ); -new TestCase( SECTION, "var MYVAR='12345';MYVAR--;MYVAR", 12344, eval("var MYVAR='12345';MYVAR--;MYVAR") ); -new TestCase( SECTION, "var MYVAR='-12345';MYVAR--;MYVAR", -12346, eval("var MYVAR='-12345';MYVAR--;MYVAR") ); -new TestCase( SECTION, "var MYVAR='0xf';MYVAR--;MYVAR", 14, eval("var MYVAR='0xf';MYVAR--;MYVAR") ); -new TestCase( SECTION, "var MYVAR='077';MYVAR--;MYVAR", 76, eval("var MYVAR='077';MYVAR--;MYVAR") ); -new TestCase( SECTION, "var MYVAR='';MYVAR--;MYVAR", -1, eval("var MYVAR='';MYVAR--;MYVAR") ); - -// string objects -new TestCase( SECTION, "var MYVAR=new String('string');MYVAR--", Number.NaN, eval("var MYVAR=new String('string');MYVAR--") ); -new TestCase( SECTION, "var MYVAR=new String('12345');MYVAR--", 12345, eval("var MYVAR=new String('12345');MYVAR--") ); -new TestCase( SECTION, "var MYVAR=new String('-12345');MYVAR--", -12345, eval("var MYVAR=new String('-12345');MYVAR--") ); -new TestCase( SECTION, "var MYVAR=new String('0Xf');MYVAR--", 15, eval("var MYVAR=new String('0Xf');MYVAR--") ); -new TestCase( SECTION, "var MYVAR=new String('077');MYVAR--", 77, eval("var MYVAR=new String('077');MYVAR--") ); -new TestCase( SECTION, "var MYVAR=new String(''); MYVAR--", 0, eval("var MYVAR=new String('');MYVAR--") ); - -// verify value of variable - -new TestCase( SECTION, "var MYVAR=new String('string');MYVAR--;MYVAR", Number.NaN, eval("var MYVAR=new String('string');MYVAR--;MYVAR") ); -new TestCase( SECTION, "var MYVAR=new String('12345');MYVAR--;MYVAR", 12344, eval("var MYVAR=new String('12345');MYVAR--;MYVAR") ); -new TestCase( SECTION, "var MYVAR=new String('-12345');MYVAR--;MYVAR", -12346, eval("var MYVAR=new String('-12345');MYVAR--;MYVAR") ); -new TestCase( SECTION, "var MYVAR=new String('0xf');MYVAR--;MYVAR", 14, eval("var MYVAR=new String('0xf');MYVAR--;MYVAR") ); -new TestCase( SECTION, "var MYVAR=new String('077');MYVAR--;MYVAR", 76, eval("var MYVAR=new String('077');MYVAR--;MYVAR") ); -new TestCase( SECTION, "var MYVAR=new String('');MYVAR--;MYVAR", -1, eval("var MYVAR=new String('');MYVAR--;MYVAR") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.4.1.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.4.1.js deleted file mode 100644 index 62354e17bc..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.4.1.js +++ /dev/null @@ -1,92 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.4.1.js'; - -/** - File Name: 11.4.1.js - ECMA Section: 11.4.1 the Delete Operator - Description: returns true if the property could be deleted - returns false if it could not be deleted - Author: christine@netscape.com - Date: 7 july 1997 - -*/ - - -var SECTION = "11.4.1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The delete operator"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -// new TestCase( SECTION, "x=[9,8,7];delete(x[2]);x.length", 2, eval("x=[9,8,7];delete(x[2]);x.length") ); -// new TestCase( SECTION, "x=[9,8,7];delete(x[2]);x.toString()", "9,8", eval("x=[9,8,7];delete(x[2]);x.toString()") ); -new TestCase( SECTION, "x=new Date();delete x;typeof(x)", "undefined", eval("x=new Date();delete x;typeof(x)") ); - -// array[item++] = new TestCase( SECTION, "delete(x=new Date())", true, delete(x=new Date()) ); -// array[item++] = new TestCase( SECTION, "delete('string primitive')", true, delete("string primitive") ); -// array[item++] = new TestCase( SECTION, "delete(new String( 'string object' ) )", true, delete(new String("string object")) ); -// array[item++] = new TestCase( SECTION, "delete(new Number(12345) )", true, delete(new Number(12345)) ); -new TestCase( SECTION, "delete(Math.PI)", false, delete(Math.PI) ); -// array[item++] = new TestCase( SECTION, "delete(null)", true, delete(null) ); -// array[item++] = new TestCase( SECTION, "delete(void(0))", true, delete(void(0)) ); - -// variables declared with the var statement are not deletable. - -var abc; -new TestCase( SECTION, "var abc; delete(abc)", false, delete abc ); - -new TestCase( SECTION, - "var OB = new MyObject(); for ( p in OB ) { delete p }", - true, - eval("var OB = new MyObject(); for ( p in OB ) { delete p }") ); - -test(); - -function MyObject() { - this.prop1 = true; - this.prop2 = false; - this.prop3 = null; - this.prop4 = void 0; - this.prop5 = "hi"; - this.prop6 = 42; - this.prop7 = new Date(); - this.prop8 = Math.PI; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.4.2.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.4.2.js deleted file mode 100644 index b89d9145c9..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.4.2.js +++ /dev/null @@ -1,83 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.4.2.js'; - -/** - File Name: 11.4.2.js - ECMA Section: 11.4.2 the Void Operator - Description: always returns undefined (?) - Author: christine@netscape.com - Date: 7 july 1997 - -*/ -var SECTION = "11.4.2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The void operator"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "void(new String('string object'))", void 0, void(new String( 'string object' )) ); -new TestCase( SECTION, "void('string primitive')", void 0, void("string primitive") ); -new TestCase( SECTION, "void(Number.NaN)", void 0, void(Number.NaN) ); -new TestCase( SECTION, "void(Number.POSITIVE_INFINITY)", void 0, void(Number.POSITIVE_INFINITY) ); -new TestCase( SECTION, "void(1)", void 0, void(1) ); -new TestCase( SECTION, "void(0)", void 0, void(0) ); -new TestCase( SECTION, "void(-1)", void 0, void(-1) ); -new TestCase( SECTION, "void(Number.NEGATIVE_INFINITY)", void 0, void(Number.NEGATIVE_INFINITY) ); -new TestCase( SECTION, "void(Math.PI)", void 0, void(Math.PI) ); -new TestCase( SECTION, "void(true)", void 0, void(true) ); -new TestCase( SECTION, "void(false)", void 0, void(false) ); -new TestCase( SECTION, "void(null)", void 0, void(null) ); -new TestCase( SECTION, "void new String('string object')", void 0, void new String( 'string object' ) ); -new TestCase( SECTION, "void 'string primitive'", void 0, void "string primitive" ); -new TestCase( SECTION, "void Number.NaN", void 0, void Number.NaN ); -new TestCase( SECTION, "void Number.POSITIVE_INFINITY", void 0, void Number.POSITIVE_INFINITY ); -new TestCase( SECTION, "void 1", void 0, void 1 ); -new TestCase( SECTION, "void 0", void 0, void 0 ); -new TestCase( SECTION, "void -1", void 0, void -1 ); -new TestCase( SECTION, "void Number.NEGATIVE_INFINITY", void 0, void Number.NEGATIVE_INFINITY ); -new TestCase( SECTION, "void Math.PI", void 0, void Math.PI ); -new TestCase( SECTION, "void true", void 0, void true ); -new TestCase( SECTION, "void false", void 0, void false ); -new TestCase( SECTION, "void null", void 0, void null ); - -// array[item++] = new TestCase( SECTION, "void()", void 0, void() ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.4.3.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.4.3.js deleted file mode 100644 index b746fbe8b5..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.4.3.js +++ /dev/null @@ -1,111 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.4.3.js'; - -/** - File Name: typeof_1.js - ECMA Section: 11.4.3 typeof operator - Description: typeof evaluates unary expressions: - undefined "undefined" - null "object" - Boolean "boolean" - Number "number" - String "string" - Object "object" [native, doesn't implement Call] - Object "function" [native, implements [Call]] - Object implementation dependent - [not sure how to test this] - Author: christine@netscape.com - Date: june 30, 1997 - -*/ - -var SECTION = "11.4.3"; - -var VERSION = "ECMA_1"; -startTest(); -var TITLE = " The typeof operator"; -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "typeof(void(0))", "undefined", typeof(void(0)) ); -new TestCase( SECTION, "typeof(null)", "object", typeof(null) ); -new TestCase( SECTION, "typeof(true)", "boolean", typeof(true) ); -new TestCase( SECTION, "typeof(false)", "boolean", typeof(false) ); -new TestCase( SECTION, "typeof(new Boolean())", "object", typeof(new Boolean()) ); -new TestCase( SECTION, "typeof(new Boolean(true))", "object", typeof(new Boolean(true)) ); -new TestCase( SECTION, "typeof(Boolean())", "boolean", typeof(Boolean()) ); -new TestCase( SECTION, "typeof(Boolean(false))", "boolean", typeof(Boolean(false)) ); -new TestCase( SECTION, "typeof(Boolean(true))", "boolean", typeof(Boolean(true)) ); -new TestCase( SECTION, "typeof(NaN)", "number", typeof(Number.NaN) ); -new TestCase( SECTION, "typeof(Infinity)", "number", typeof(Number.POSITIVE_INFINITY) ); -new TestCase( SECTION, "typeof(-Infinity)", "number", typeof(Number.NEGATIVE_INFINITY) ); -new TestCase( SECTION, "typeof(Math.PI)", "number", typeof(Math.PI) ); -new TestCase( SECTION, "typeof(0)", "number", typeof(0) ); -new TestCase( SECTION, "typeof(1)", "number", typeof(1) ); -new TestCase( SECTION, "typeof(-1)", "number", typeof(-1) ); -new TestCase( SECTION, "typeof('0')", "string", typeof("0") ); -new TestCase( SECTION, "typeof(Number())", "number", typeof(Number()) ); -new TestCase( SECTION, "typeof(Number(0))", "number", typeof(Number(0)) ); -new TestCase( SECTION, "typeof(Number(1))", "number", typeof(Number(1)) ); -new TestCase( SECTION, "typeof(Nubmer(-1))", "number", typeof(Number(-1)) ); -new TestCase( SECTION, "typeof(new Number())", "object", typeof(new Number()) ); -new TestCase( SECTION, "typeof(new Number(0))", "object", typeof(new Number(0)) ); -new TestCase( SECTION, "typeof(new Number(1))", "object", typeof(new Number(1)) ); - -// Math does not implement [[Construct]] or [[Call]] so its type is object. - -new TestCase( SECTION, "typeof(Math)", "object", typeof(Math) ); - -new TestCase( SECTION, "typeof(Number.prototype.toString)", "function", typeof(Number.prototype.toString) ); - -new TestCase( SECTION, "typeof('a string')", "string", typeof("a string") ); -new TestCase( SECTION, "typeof('')", "string", typeof("") ); -new TestCase( SECTION, "typeof(new Date())", "object", typeof(new Date()) ); -new TestCase( SECTION, "typeof(new Array(1,2,3))", "object", typeof(new Array(1,2,3)) ); -new TestCase( SECTION, "typeof(new String('string object'))", "object", typeof(new String("string object")) ); -new TestCase( SECTION, "typeof(String('string primitive'))", "string", typeof(String("string primitive")) ); -new TestCase( SECTION, "typeof(['array', 'of', 'strings'])", "object", typeof(["array", "of", "strings"]) ); -new TestCase( SECTION, "typeof(new Function())", "function", typeof( new Function() ) ); -new TestCase( SECTION, "typeof(parseInt)", "function", typeof( parseInt ) ); -new TestCase( SECTION, "typeof(test)", "function", typeof( test ) ); -new TestCase( SECTION, "typeof(String.fromCharCode)", "function", typeof( String.fromCharCode ) ); - - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.4.4.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.4.4.js deleted file mode 100644 index cbacf869e4..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.4.4.js +++ /dev/null @@ -1,156 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.4.4.js'; - -/** - File Name: 11.4.4.js - ECMA Section: 11.4.4 Prefix increment operator - Description: - The production UnaryExpression : ++ UnaryExpression is evaluated as - follows: - - 1. Evaluate UnaryExpression. - 2. Call GetValue(Result(1)). - 3. Call ToNumber(Result(2)). - 4. Add the value 1 to Result(3), using the same rules as for the + - operator (section 11.6.3). - 5. Call PutValue(Result(1), Result(4)). - 6. Return Result(4). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.4.4"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Prefix increment operator"); - -// special case: var is not defined - -new TestCase( SECTION, "var MYVAR; ++MYVAR", NaN, eval("var MYVAR; ++MYVAR") ); -new TestCase( SECTION, "var MYVAR= void 0; ++MYVAR", NaN, eval("var MYVAR=void 0; ++MYVAR") ); -new TestCase( SECTION, "var MYVAR=null; ++MYVAR", 1, eval("var MYVAR=null; ++MYVAR") ); -new TestCase( SECTION, "var MYVAR=true; ++MYVAR", 2, eval("var MYVAR=true; ++MYVAR") ); -new TestCase( SECTION, "var MYVAR=false; ++MYVAR", 1, eval("var MYVAR=false; ++MYVAR") ); - -// special numbers -// verify return value - -new TestCase( SECTION, "var MYVAR=Number.POSITIVE_INFINITY;++MYVAR", Number.POSITIVE_INFINITY, eval("var MYVAR=Number.POSITIVE_INFINITY;++MYVAR") ); -new TestCase( SECTION, "var MYVAR=Number.NEGATIVE_INFINITY;++MYVAR", Number.NEGATIVE_INFINITY, eval("var MYVAR=Number.NEGATIVE_INFINITY;++MYVAR") ); -new TestCase( SECTION, "var MYVAR=Number.NaN;++MYVAR", Number.NaN, eval("var MYVAR=Number.NaN;++MYVAR") ); - -// verify value of variable - -new TestCase( SECTION, "var MYVAR=Number.POSITIVE_INFINITY;++MYVAR;MYVAR", Number.POSITIVE_INFINITY, eval("var MYVAR=Number.POSITIVE_INFINITY;++MYVAR;MYVAR") ); -new TestCase( SECTION, "var MYVAR=Number.NEGATIVE_INFINITY;++MYVAR;MYVAR", Number.NEGATIVE_INFINITY, eval("var MYVAR=Number.NEGATIVE_INFINITY;++MYVAR;MYVAR") ); -new TestCase( SECTION, "var MYVAR=Number.NaN;++MYVAR;MYVAR", Number.NaN, eval("var MYVAR=Number.NaN;++MYVAR;MYVAR") ); - - -// number primitives -new TestCase( SECTION, "var MYVAR=0;++MYVAR", 1, eval("var MYVAR=0;++MYVAR") ); -new TestCase( SECTION, "var MYVAR=0.2345;++MYVAR", 1.2345, eval("var MYVAR=0.2345;++MYVAR") ); -new TestCase( SECTION, "var MYVAR=-0.2345;++MYVAR", 0.7655, eval("var MYVAR=-0.2345;++MYVAR") ); - -// verify value of variable - -new TestCase( SECTION, "var MYVAR=0;++MYVAR;MYVAR", 1, eval("var MYVAR=0;++MYVAR;MYVAR") ); -new TestCase( SECTION, "var MYVAR=0.2345;++MYVAR;MYVAR", 1.2345, eval("var MYVAR=0.2345;++MYVAR;MYVAR") ); -new TestCase( SECTION, "var MYVAR=-0.2345;++MYVAR;MYVAR", 0.7655, eval("var MYVAR=-0.2345;++MYVAR;MYVAR") ); -new TestCase( SECTION, "var MYVAR=0;++MYVAR;MYVAR", 1, eval("var MYVAR=0;++MYVAR;MYVAR") ); -new TestCase( SECTION, "var MYVAR=0;++MYVAR;MYVAR", 1, eval("var MYVAR=0;++MYVAR;MYVAR") ); -new TestCase( SECTION, "var MYVAR=0;++MYVAR;MYVAR", 1, eval("var MYVAR=0;++MYVAR;MYVAR") ); - -// boolean values -// verify return value - -new TestCase( SECTION, "var MYVAR=true;++MYVAR", 2, eval("var MYVAR=true;++MYVAR") ); -new TestCase( SECTION, "var MYVAR=false;++MYVAR", 1, eval("var MYVAR=false;++MYVAR") ); -// verify value of variable - -new TestCase( SECTION, "var MYVAR=true;++MYVAR;MYVAR", 2, eval("var MYVAR=true;++MYVAR;MYVAR") ); -new TestCase( SECTION, "var MYVAR=false;++MYVAR;MYVAR", 1, eval("var MYVAR=false;++MYVAR;MYVAR") ); - -// boolean objects -// verify return value - -new TestCase( SECTION, "var MYVAR=new Boolean(true);++MYVAR", 2, eval("var MYVAR=true;++MYVAR") ); -new TestCase( SECTION, "var MYVAR=new Boolean(false);++MYVAR", 1, eval("var MYVAR=false;++MYVAR") ); -// verify value of variable - -new TestCase( SECTION, "var MYVAR=new Boolean(true);++MYVAR;MYVAR", 2, eval("var MYVAR=new Boolean(true);++MYVAR;MYVAR") ); -new TestCase( SECTION, "var MYVAR=new Boolean(false);++MYVAR;MYVAR", 1, eval("var MYVAR=new Boolean(false);++MYVAR;MYVAR") ); - -// string primitives -new TestCase( SECTION, "var MYVAR='string';++MYVAR", Number.NaN, eval("var MYVAR='string';++MYVAR") ); -new TestCase( SECTION, "var MYVAR='12345';++MYVAR", 12346, eval("var MYVAR='12345';++MYVAR") ); -new TestCase( SECTION, "var MYVAR='-12345';++MYVAR", -12344, eval("var MYVAR='-12345';++MYVAR") ); -new TestCase( SECTION, "var MYVAR='0Xf';++MYVAR", 16, eval("var MYVAR='0Xf';++MYVAR") ); -new TestCase( SECTION, "var MYVAR='077';++MYVAR", 78, eval("var MYVAR='077';++MYVAR") ); -new TestCase( SECTION, "var MYVAR=''; ++MYVAR", 1, eval("var MYVAR='';++MYVAR") ); - -// verify value of variable - -new TestCase( SECTION, "var MYVAR='string';++MYVAR;MYVAR", Number.NaN, eval("var MYVAR='string';++MYVAR;MYVAR") ); -new TestCase( SECTION, "var MYVAR='12345';++MYVAR;MYVAR", 12346, eval("var MYVAR='12345';++MYVAR;MYVAR") ); -new TestCase( SECTION, "var MYVAR='-12345';++MYVAR;MYVAR", -12344, eval("var MYVAR='-12345';++MYVAR;MYVAR") ); -new TestCase( SECTION, "var MYVAR='0xf';++MYVAR;MYVAR", 16, eval("var MYVAR='0xf';++MYVAR;MYVAR") ); -new TestCase( SECTION, "var MYVAR='077';++MYVAR;MYVAR", 78, eval("var MYVAR='077';++MYVAR;MYVAR") ); -new TestCase( SECTION, "var MYVAR='';++MYVAR;MYVAR", 1, eval("var MYVAR='';++MYVAR;MYVAR") ); - -// string objects -new TestCase( SECTION, "var MYVAR=new String('string');++MYVAR", Number.NaN, eval("var MYVAR=new String('string');++MYVAR") ); -new TestCase( SECTION, "var MYVAR=new String('12345');++MYVAR", 12346, eval("var MYVAR=new String('12345');++MYVAR") ); -new TestCase( SECTION, "var MYVAR=new String('-12345');++MYVAR", -12344, eval("var MYVAR=new String('-12345');++MYVAR") ); -new TestCase( SECTION, "var MYVAR=new String('0Xf');++MYVAR", 16, eval("var MYVAR=new String('0Xf');++MYVAR") ); -new TestCase( SECTION, "var MYVAR=new String('077');++MYVAR", 78, eval("var MYVAR=new String('077');++MYVAR") ); -new TestCase( SECTION, "var MYVAR=new String(''); ++MYVAR", 1, eval("var MYVAR=new String('');++MYVAR") ); - -// verify value of variable - -new TestCase( SECTION, "var MYVAR=new String('string');++MYVAR;MYVAR", Number.NaN, eval("var MYVAR=new String('string');++MYVAR;MYVAR") ); -new TestCase( SECTION, "var MYVAR=new String('12345');++MYVAR;MYVAR", 12346, eval("var MYVAR=new String('12345');++MYVAR;MYVAR") ); -new TestCase( SECTION, "var MYVAR=new String('-12345');++MYVAR;MYVAR", -12344, eval("var MYVAR=new String('-12345');++MYVAR;MYVAR") ); -new TestCase( SECTION, "var MYVAR=new String('0xf');++MYVAR;MYVAR", 16, eval("var MYVAR=new String('0xf');++MYVAR;MYVAR") ); -new TestCase( SECTION, "var MYVAR=new String('077');++MYVAR;MYVAR", 78, eval("var MYVAR=new String('077');++MYVAR;MYVAR") ); -new TestCase( SECTION, "var MYVAR=new String('');++MYVAR;MYVAR", 1, eval("var MYVAR=new String('');++MYVAR;MYVAR") ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.4.5.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.4.5.js deleted file mode 100644 index ee761c5d96..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.4.5.js +++ /dev/null @@ -1,154 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.4.5.js'; - -/** - File Name: 11.4.5.js - ECMA Section: 11.4.5 Prefix decrement operator - Description: - - The production UnaryExpression : -- UnaryExpression is evaluated as follows: - - 1.Evaluate UnaryExpression. - 2.Call GetValue(Result(1)). - 3.Call ToNumber(Result(2)). - 4.Subtract the value 1 from Result(3), using the same rules as for the - operator (section 11.6.3). - 5.Call PutValue(Result(1), Result(4)). - - 1.Return Result(4). - Author: christine@netscape.com - Date: \ 12 november 1997 -*/ -var SECTION = "11.4.5"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Prefix decrement operator"); - -// -new TestCase( SECTION, "var MYVAR; --MYVAR", NaN, eval("var MYVAR; --MYVAR") ); -new TestCase( SECTION, "var MYVAR= void 0; --MYVAR", NaN, eval("var MYVAR=void 0; --MYVAR") ); -new TestCase( SECTION, "var MYVAR=null; --MYVAR", -1, eval("var MYVAR=null; --MYVAR") ); -new TestCase( SECTION, "var MYVAR=true; --MYVAR", 0, eval("var MYVAR=true; --MYVAR") ); -new TestCase( SECTION, "var MYVAR=false; --MYVAR", -1, eval("var MYVAR=false; --MYVAR") ); - -// special numbers -// verify return value - -new TestCase( SECTION, "var MYVAR=Number.POSITIVE_INFINITY;--MYVAR", Number.POSITIVE_INFINITY, eval("var MYVAR=Number.POSITIVE_INFINITY;--MYVAR") ); -new TestCase( SECTION, "var MYVAR=Number.NEGATIVE_INFINITY;--MYVAR", Number.NEGATIVE_INFINITY, eval("var MYVAR=Number.NEGATIVE_INFINITY;--MYVAR") ); -new TestCase( SECTION, "var MYVAR=Number.NaN;--MYVAR", Number.NaN, eval("var MYVAR=Number.NaN;--MYVAR") ); - -// verify value of variable - -new TestCase( SECTION, "var MYVAR=Number.POSITIVE_INFINITY;--MYVAR;MYVAR", Number.POSITIVE_INFINITY, eval("var MYVAR=Number.POSITIVE_INFINITY;--MYVAR;MYVAR") ); -new TestCase( SECTION, "var MYVAR=Number.NEGATIVE_INFINITY;--MYVAR;MYVAR", Number.NEGATIVE_INFINITY, eval("var MYVAR=Number.NEGATIVE_INFINITY;--MYVAR;MYVAR") ); -new TestCase( SECTION, "var MYVAR=Number.NaN;--MYVAR;MYVAR", Number.NaN, eval("var MYVAR=Number.NaN;--MYVAR;MYVAR") ); - - -// number primitives -new TestCase( SECTION, "var MYVAR=0;--MYVAR", -1, eval("var MYVAR=0;--MYVAR") ); -new TestCase( SECTION, "var MYVAR=0.2345;--MYVAR", -0.7655, eval("var MYVAR=0.2345;--MYVAR") ); -new TestCase( SECTION, "var MYVAR=-0.2345;--MYVAR", -1.2345, eval("var MYVAR=-0.2345;--MYVAR") ); - -// verify value of variable - -new TestCase( SECTION, "var MYVAR=0;--MYVAR;MYVAR", -1, eval("var MYVAR=0;--MYVAR;MYVAR") ); -new TestCase( SECTION, "var MYVAR=0.2345;--MYVAR;MYVAR", -0.7655, eval("var MYVAR=0.2345;--MYVAR;MYVAR") ); -new TestCase( SECTION, "var MYVAR=-0.2345;--MYVAR;MYVAR", -1.2345, eval("var MYVAR=-0.2345;--MYVAR;MYVAR") ); -new TestCase( SECTION, "var MYVAR=0;--MYVAR;MYVAR", -1, eval("var MYVAR=0;--MYVAR;MYVAR") ); -new TestCase( SECTION, "var MYVAR=0;--MYVAR;MYVAR", -1, eval("var MYVAR=0;--MYVAR;MYVAR") ); -new TestCase( SECTION, "var MYVAR=0;--MYVAR;MYVAR", -1, eval("var MYVAR=0;--MYVAR;MYVAR") ); - -// boolean values -// verify return value - -new TestCase( SECTION, "var MYVAR=true;--MYVAR", 0, eval("var MYVAR=true;--MYVAR") ); -new TestCase( SECTION, "var MYVAR=false;--MYVAR", -1, eval("var MYVAR=false;--MYVAR") ); -// verify value of variable - -new TestCase( SECTION, "var MYVAR=true;--MYVAR;MYVAR", 0, eval("var MYVAR=true;--MYVAR;MYVAR") ); -new TestCase( SECTION, "var MYVAR=false;--MYVAR;MYVAR", -1, eval("var MYVAR=false;--MYVAR;MYVAR") ); - -// boolean objects -// verify return value - -new TestCase( SECTION, "var MYVAR=new Boolean(true);--MYVAR", 0, eval("var MYVAR=true;--MYVAR") ); -new TestCase( SECTION, "var MYVAR=new Boolean(false);--MYVAR", -1, eval("var MYVAR=false;--MYVAR") ); -// verify value of variable - -new TestCase( SECTION, "var MYVAR=new Boolean(true);--MYVAR;MYVAR", 0, eval("var MYVAR=new Boolean(true);--MYVAR;MYVAR") ); -new TestCase( SECTION, "var MYVAR=new Boolean(false);--MYVAR;MYVAR", -1, eval("var MYVAR=new Boolean(false);--MYVAR;MYVAR") ); - -// string primitives -new TestCase( SECTION, "var MYVAR='string';--MYVAR", Number.NaN, eval("var MYVAR='string';--MYVAR") ); -new TestCase( SECTION, "var MYVAR='12345';--MYVAR", 12344, eval("var MYVAR='12345';--MYVAR") ); -new TestCase( SECTION, "var MYVAR='-12345';--MYVAR", -12346, eval("var MYVAR='-12345';--MYVAR") ); -new TestCase( SECTION, "var MYVAR='0Xf';--MYVAR", 14, eval("var MYVAR='0Xf';--MYVAR") ); -new TestCase( SECTION, "var MYVAR='077';--MYVAR", 76, eval("var MYVAR='077';--MYVAR") ); -new TestCase( SECTION, "var MYVAR=''; --MYVAR", -1, eval("var MYVAR='';--MYVAR") ); - -// verify value of variable - -new TestCase( SECTION, "var MYVAR='string';--MYVAR;MYVAR", Number.NaN, eval("var MYVAR='string';--MYVAR;MYVAR") ); -new TestCase( SECTION, "var MYVAR='12345';--MYVAR;MYVAR", 12344, eval("var MYVAR='12345';--MYVAR;MYVAR") ); -new TestCase( SECTION, "var MYVAR='-12345';--MYVAR;MYVAR", -12346, eval("var MYVAR='-12345';--MYVAR;MYVAR") ); -new TestCase( SECTION, "var MYVAR='0xf';--MYVAR;MYVAR", 14, eval("var MYVAR='0xf';--MYVAR;MYVAR") ); -new TestCase( SECTION, "var MYVAR='077';--MYVAR;MYVAR", 76, eval("var MYVAR='077';--MYVAR;MYVAR") ); -new TestCase( SECTION, "var MYVAR='';--MYVAR;MYVAR", -1, eval("var MYVAR='';--MYVAR;MYVAR") ); - -// string objects -new TestCase( SECTION, "var MYVAR=new String('string');--MYVAR", Number.NaN, eval("var MYVAR=new String('string');--MYVAR") ); -new TestCase( SECTION, "var MYVAR=new String('12345');--MYVAR", 12344, eval("var MYVAR=new String('12345');--MYVAR") ); -new TestCase( SECTION, "var MYVAR=new String('-12345');--MYVAR", -12346, eval("var MYVAR=new String('-12345');--MYVAR") ); -new TestCase( SECTION, "var MYVAR=new String('0Xf');--MYVAR", 14, eval("var MYVAR=new String('0Xf');--MYVAR") ); -new TestCase( SECTION, "var MYVAR=new String('077');--MYVAR", 76, eval("var MYVAR=new String('077');--MYVAR") ); -new TestCase( SECTION, "var MYVAR=new String(''); --MYVAR", -1, eval("var MYVAR=new String('');--MYVAR") ); - -// verify value of variable - -new TestCase( SECTION, "var MYVAR=new String('string');--MYVAR;MYVAR", Number.NaN, eval("var MYVAR=new String('string');--MYVAR;MYVAR") ); -new TestCase( SECTION, "var MYVAR=new String('12345');--MYVAR;MYVAR", 12344, eval("var MYVAR=new String('12345');--MYVAR;MYVAR") ); -new TestCase( SECTION, "var MYVAR=new String('-12345');--MYVAR;MYVAR", -12346, eval("var MYVAR=new String('-12345');--MYVAR;MYVAR") ); -new TestCase( SECTION, "var MYVAR=new String('0xf');--MYVAR;MYVAR", 14, eval("var MYVAR=new String('0xf');--MYVAR;MYVAR") ); -new TestCase( SECTION, "var MYVAR=new String('077');--MYVAR;MYVAR", 76, eval("var MYVAR=new String('077');--MYVAR;MYVAR") ); -new TestCase( SECTION, "var MYVAR=new String('');--MYVAR;MYVAR", -1, eval("var MYVAR=new String('');--MYVAR;MYVAR") ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.4.6.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.4.6.js deleted file mode 100644 index 9b100d9d50..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.4.6.js +++ /dev/null @@ -1,299 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.4.6.js'; - -/** - File Name: 11.4.6.js - ECMA Section: 11.4.6 Unary + Operator - Description: convert operand to Number type - Author: christine@netscape.com - Date: 7 july 1997 -*/ - -var SECTION = "11.4.6"; -var VERSION = "ECMA_1"; -var BUGNUMBER="77391"; - -startTest(); - -writeHeaderToLog( SECTION + " Unary + operator"); - -new TestCase( SECTION, "+('')", 0, +("") ); -new TestCase( SECTION, "+(' ')", 0, +(" ") ); -new TestCase( SECTION, "+(\\t)", 0, +("\t") ); -new TestCase( SECTION, "+(\\n)", 0, +("\n") ); -new TestCase( SECTION, "+(\\r)", 0, +("\r") ); -new TestCase( SECTION, "+(\\f)", 0, +("\f") ); - -new TestCase( SECTION, "+(String.fromCharCode(0x0009)", 0, +(String.fromCharCode(0x0009)) ); -new TestCase( SECTION, "+(String.fromCharCode(0x0020)", 0, +(String.fromCharCode(0x0020)) ); -new TestCase( SECTION, "+(String.fromCharCode(0x000C)", 0, +(String.fromCharCode(0x000C)) ); -new TestCase( SECTION, "+(String.fromCharCode(0x000B)", 0, +(String.fromCharCode(0x000B)) ); -new TestCase( SECTION, "+(String.fromCharCode(0x000D)", 0, +(String.fromCharCode(0x000D)) ); -new TestCase( SECTION, "+(String.fromCharCode(0x000A)", 0, +(String.fromCharCode(0x000A)) ); - -// a StringNumericLiteral may be preceeded or followed by whitespace and/or -// line terminators - -new TestCase( SECTION, "+( ' ' + 999 )", 999, +( ' '+999) ); -new TestCase( SECTION, "+( '\\n' + 999 )", 999, +( '\n' +999) ); -new TestCase( SECTION, "+( '\\r' + 999 )", 999, +( '\r' +999) ); -new TestCase( SECTION, "+( '\\t' + 999 )", 999, +( '\t' +999) ); -new TestCase( SECTION, "+( '\\f' + 999 )", 999, +( '\f' +999) ); - -new TestCase( SECTION, "+( 999 + ' ' )", 999, +( 999+' ') ); -new TestCase( SECTION, "+( 999 + '\\n' )", 999, +( 999+'\n' ) ); -new TestCase( SECTION, "+( 999 + '\\r' )", 999, +( 999+'\r' ) ); -new TestCase( SECTION, "+( 999 + '\\t' )", 999, +( 999+'\t' ) ); -new TestCase( SECTION, "+( 999 + '\\f' )", 999, +( 999+'\f' ) ); - -new TestCase( SECTION, "+( '\\n' + 999 + '\\n' )", 999, +( '\n' +999+'\n' ) ); -new TestCase( SECTION, "+( '\\r' + 999 + '\\r' )", 999, +( '\r' +999+'\r' ) ); -new TestCase( SECTION, "+( '\\t' + 999 + '\\t' )", 999, +( '\t' +999+'\t' ) ); -new TestCase( SECTION, "+( '\\f' + 999 + '\\f' )", 999, +( '\f' +999+'\f' ) ); - -new TestCase( SECTION, "+( ' ' + '999' )", 999, +( ' '+'999') ); -new TestCase( SECTION, "+( '\\n' + '999' )", 999, +( '\n' +'999') ); -new TestCase( SECTION, "+( '\\r' + '999' )", 999, +( '\r' +'999') ); -new TestCase( SECTION, "+( '\\t' + '999' )", 999, +( '\t' +'999') ); -new TestCase( SECTION, "+( '\\f' + '999' )", 999, +( '\f' +'999') ); - -new TestCase( SECTION, "+( '999' + ' ' )", 999, +( '999'+' ') ); -new TestCase( SECTION, "+( '999' + '\\n' )", 999, +( '999'+'\n' ) ); -new TestCase( SECTION, "+( '999' + '\\r' )", 999, +( '999'+'\r' ) ); -new TestCase( SECTION, "+( '999' + '\\t' )", 999, +( '999'+'\t' ) ); -new TestCase( SECTION, "+( '999' + '\\f' )", 999, +( '999'+'\f' ) ); - -new TestCase( SECTION, "+( '\\n' + '999' + '\\n' )", 999, +( '\n' +'999'+'\n' ) ); -new TestCase( SECTION, "+( '\\r' + '999' + '\\r' )", 999, +( '\r' +'999'+'\r' ) ); -new TestCase( SECTION, "+( '\\t' + '999' + '\\t' )", 999, +( '\t' +'999'+'\t' ) ); -new TestCase( SECTION, "+( '\\f' + '999' + '\\f' )", 999, +( '\f' +'999'+'\f' ) ); - -new TestCase( SECTION, "+( String.fromCharCode(0x0009) + '99' )", 99, +( String.fromCharCode(0x0009) + '99' ) ); -new TestCase( SECTION, "+( String.fromCharCode(0x0020) + '99' )", 99, +( String.fromCharCode(0x0020) + '99' ) ); -new TestCase( SECTION, "+( String.fromCharCode(0x000C) + '99' )", 99, +( String.fromCharCode(0x000C) + '99' ) ); -new TestCase( SECTION, "+( String.fromCharCode(0x000B) + '99' )", 99, +( String.fromCharCode(0x000B) + '99' ) ); -new TestCase( SECTION, "+( String.fromCharCode(0x000D) + '99' )", 99, +( String.fromCharCode(0x000D) + '99' ) ); -new TestCase( SECTION, "+( String.fromCharCode(0x000A) + '99' )", 99, +( String.fromCharCode(0x000A) + '99' ) ); - -new TestCase( SECTION, "+( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x0009)", 99, +( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x0009)) ); -new TestCase( SECTION, "+( String.fromCharCode(0x0020) + '99' + String.fromCharCode(0x0020)", 99, +( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x0020)) ); -new TestCase( SECTION, "+( String.fromCharCode(0x000C) + '99' + String.fromCharCode(0x000C)", 99, +( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x000C)) ); -new TestCase( SECTION, "+( String.fromCharCode(0x000D) + '99' + String.fromCharCode(0x000D)", 99, +( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x000D)) ); -new TestCase( SECTION, "+( String.fromCharCode(0x000B) + '99' + String.fromCharCode(0x000B)", 99, +( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x000B)) ); -new TestCase( SECTION, "+( String.fromCharCode(0x000A) + '99' + String.fromCharCode(0x000A)", 99, +( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x000A)) ); - -new TestCase( SECTION, "+( '99' + String.fromCharCode(0x0009)", 99, +( '99' + String.fromCharCode(0x0009)) ); -new TestCase( SECTION, "+( '99' + String.fromCharCode(0x0020)", 99, +( '99' + String.fromCharCode(0x0020)) ); -new TestCase( SECTION, "+( '99' + String.fromCharCode(0x000C)", 99, +( '99' + String.fromCharCode(0x000C)) ); -new TestCase( SECTION, "+( '99' + String.fromCharCode(0x000D)", 99, +( '99' + String.fromCharCode(0x000D)) ); -new TestCase( SECTION, "+( '99' + String.fromCharCode(0x000B)", 99, +( '99' + String.fromCharCode(0x000B)) ); -new TestCase( SECTION, "+( '99' + String.fromCharCode(0x000A)", 99, +( '99' + String.fromCharCode(0x000A)) ); - -new TestCase( SECTION, "+( String.fromCharCode(0x0009) + 99 )", 99, +( String.fromCharCode(0x0009) + 99 ) ); -new TestCase( SECTION, "+( String.fromCharCode(0x0020) + 99 )", 99, +( String.fromCharCode(0x0020) + 99 ) ); -new TestCase( SECTION, "+( String.fromCharCode(0x000C) + 99 )", 99, +( String.fromCharCode(0x000C) + 99 ) ); -new TestCase( SECTION, "+( String.fromCharCode(0x000B) + 99 )", 99, +( String.fromCharCode(0x000B) + 99 ) ); -new TestCase( SECTION, "+( String.fromCharCode(0x000D) + 99 )", 99, +( String.fromCharCode(0x000D) + 99 ) ); -new TestCase( SECTION, "+( String.fromCharCode(0x000A) + 99 )", 99, +( String.fromCharCode(0x000A) + 99 ) ); - -new TestCase( SECTION, "+( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x0009)", 99, +( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x0009)) ); -new TestCase( SECTION, "+( String.fromCharCode(0x0020) + 99 + String.fromCharCode(0x0020)", 99, +( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x0020)) ); -new TestCase( SECTION, "+( String.fromCharCode(0x000C) + 99 + String.fromCharCode(0x000C)", 99, +( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x000C)) ); -new TestCase( SECTION, "+( String.fromCharCode(0x000D) + 99 + String.fromCharCode(0x000D)", 99, +( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x000D)) ); -new TestCase( SECTION, "+( String.fromCharCode(0x000B) + 99 + String.fromCharCode(0x000B)", 99, +( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x000B)) ); -new TestCase( SECTION, "+( String.fromCharCode(0x000A) + 99 + String.fromCharCode(0x000A)", 99, +( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x000A)) ); - -new TestCase( SECTION, "+( 99 + String.fromCharCode(0x0009)", 99, +( 99 + String.fromCharCode(0x0009)) ); -new TestCase( SECTION, "+( 99 + String.fromCharCode(0x0020)", 99, +( 99 + String.fromCharCode(0x0020)) ); -new TestCase( SECTION, "+( 99 + String.fromCharCode(0x000C)", 99, +( 99 + String.fromCharCode(0x000C)) ); -new TestCase( SECTION, "+( 99 + String.fromCharCode(0x000D)", 99, +( 99 + String.fromCharCode(0x000D)) ); -new TestCase( SECTION, "+( 99 + String.fromCharCode(0x000B)", 99, +( 99 + String.fromCharCode(0x000B)) ); -new TestCase( SECTION, "+( 99 + String.fromCharCode(0x000A)", 99, +( 99 + String.fromCharCode(0x000A)) ); - - -// StrNumericLiteral:::StrDecimalLiteral:::Infinity - -new TestCase( SECTION, "+('Infinity')", Math.pow(10,10000), +("Infinity") ); -new TestCase( SECTION, "+('-Infinity')", -Math.pow(10,10000), +("-Infinity") ); -new TestCase( SECTION, "+('+Infinity')", Math.pow(10,10000), +("+Infinity") ); - -// StrNumericLiteral::: StrDecimalLiteral ::: DecimalDigits . DecimalDigits opt ExponentPart opt - -new TestCase( SECTION, "+('0')", 0, +("0") ); -new TestCase( SECTION, "+('-0')", -0, +("-0") ); -new TestCase( SECTION, "+('+0')", 0, +("+0") ); - -new TestCase( SECTION, "+('1')", 1, +("1") ); -new TestCase( SECTION, "+('-1')", -1, +("-1") ); -new TestCase( SECTION, "+('+1')", 1, +("+1") ); - -new TestCase( SECTION, "+('2')", 2, +("2") ); -new TestCase( SECTION, "+('-2')", -2, +("-2") ); -new TestCase( SECTION, "+('+2')", 2, +("+2") ); - -new TestCase( SECTION, "+('3')", 3, +("3") ); -new TestCase( SECTION, "+('-3')", -3, +("-3") ); -new TestCase( SECTION, "+('+3')", 3, +("+3") ); - -new TestCase( SECTION, "+('4')", 4, +("4") ); -new TestCase( SECTION, "+('-4')", -4, +("-4") ); -new TestCase( SECTION, "+('+4')", 4, +("+4") ); - -new TestCase( SECTION, "+('5')", 5, +("5") ); -new TestCase( SECTION, "+('-5')", -5, +("-5") ); -new TestCase( SECTION, "+('+5')", 5, +("+5") ); - -new TestCase( SECTION, "+('6')", 6, +("6") ); -new TestCase( SECTION, "+('-6')", -6, +("-6") ); -new TestCase( SECTION, "+('+6')", 6, +("+6") ); - -new TestCase( SECTION, "+('7')", 7, +("7") ); -new TestCase( SECTION, "+('-7')", -7, +("-7") ); -new TestCase( SECTION, "+('+7')", 7, +("+7") ); - -new TestCase( SECTION, "+('8')", 8, +("8") ); -new TestCase( SECTION, "+('-8')", -8, +("-8") ); -new TestCase( SECTION, "+('+8')", 8, +("+8") ); - -new TestCase( SECTION, "+('9')", 9, +("9") ); -new TestCase( SECTION, "+('-9')", -9, +("-9") ); -new TestCase( SECTION, "+('+9')", 9, +("+9") ); - -new TestCase( SECTION, "+('3.14159')", 3.14159, +("3.14159") ); -new TestCase( SECTION, "+('-3.14159')", -3.14159, +("-3.14159") ); -new TestCase( SECTION, "+('+3.14159')", 3.14159, +("+3.14159") ); - -new TestCase( SECTION, "+('3.')", 3, +("3.") ); -new TestCase( SECTION, "+('-3.')", -3, +("-3.") ); -new TestCase( SECTION, "+('+3.')", 3, +("+3.") ); - -new TestCase( SECTION, "+('3.e1')", 30, +("3.e1") ); -new TestCase( SECTION, "+('-3.e1')", -30, +("-3.e1") ); -new TestCase( SECTION, "+('+3.e1')", 30, +("+3.e1") ); - -new TestCase( SECTION, "+('3.e+1')", 30, +("3.e+1") ); -new TestCase( SECTION, "+('-3.e+1')", -30, +("-3.e+1") ); -new TestCase( SECTION, "+('+3.e+1')", 30, +("+3.e+1") ); - -new TestCase( SECTION, "+('3.e-1')", .30, +("3.e-1") ); -new TestCase( SECTION, "+('-3.e-1')", -.30, +("-3.e-1") ); -new TestCase( SECTION, "+('+3.e-1')", .30, +("+3.e-1") ); - -// StrDecimalLiteral::: .DecimalDigits ExponentPart opt - -new TestCase( SECTION, "+('.00001')", 0.00001, +(".00001") ); -new TestCase( SECTION, "+('+.00001')", 0.00001, +("+.00001") ); -new TestCase( SECTION, "+('-0.0001')", -0.00001, +("-.00001") ); - -new TestCase( SECTION, "+('.01e2')", 1, +(".01e2") ); -new TestCase( SECTION, "+('+.01e2')", 1, +("+.01e2") ); -new TestCase( SECTION, "+('-.01e2')", -1, +("-.01e2") ); - -new TestCase( SECTION, "+('.01e+2')", 1, +(".01e+2") ); -new TestCase( SECTION, "+('+.01e+2')", 1, +("+.01e+2") ); -new TestCase( SECTION, "+('-.01e+2')", -1, +("-.01e+2") ); - -new TestCase( SECTION, "+('.01e-2')", 0.0001, +(".01e-2") ); -new TestCase( SECTION, "+('+.01e-2')", 0.0001, +("+.01e-2") ); -new TestCase( SECTION, "+('-.01e-2')", -0.0001, +("-.01e-2") ); - -// StrDecimalLiteral::: DecimalDigits ExponentPart opt - -new TestCase( SECTION, "+('1234e5')", 123400000, +("1234e5") ); -new TestCase( SECTION, "+('+1234e5')", 123400000, +("+1234e5") ); -new TestCase( SECTION, "+('-1234e5')", -123400000, +("-1234e5") ); - -new TestCase( SECTION, "+('1234e+5')", 123400000, +("1234e+5") ); -new TestCase( SECTION, "+('+1234e+5')", 123400000, +("+1234e+5") ); -new TestCase( SECTION, "+('-1234e+5')", -123400000, +("-1234e+5") ); - -new TestCase( SECTION, "+('1234e-5')", 0.01234, +("1234e-5") ); -new TestCase( SECTION, "+('+1234e-5')", 0.01234, +("+1234e-5") ); -new TestCase( SECTION, "+('-1234e-5')", -0.01234, +("-1234e-5") ); - -// StrNumericLiteral::: HexIntegerLiteral - -new TestCase( SECTION, "+('0x0')", 0, +("0x0")); -new TestCase( SECTION, "+('0x1')", 1, +("0x1")); -new TestCase( SECTION, "+('0x2')", 2, +("0x2")); -new TestCase( SECTION, "+('0x3')", 3, +("0x3")); -new TestCase( SECTION, "+('0x4')", 4, +("0x4")); -new TestCase( SECTION, "+('0x5')", 5, +("0x5")); -new TestCase( SECTION, "+('0x6')", 6, +("0x6")); -new TestCase( SECTION, "+('0x7')", 7, +("0x7")); -new TestCase( SECTION, "+('0x8')", 8, +("0x8")); -new TestCase( SECTION, "+('0x9')", 9, +("0x9")); -new TestCase( SECTION, "+('0xa')", 10, +("0xa")); -new TestCase( SECTION, "+('0xb')", 11, +("0xb")); -new TestCase( SECTION, "+('0xc')", 12, +("0xc")); -new TestCase( SECTION, "+('0xd')", 13, +("0xd")); -new TestCase( SECTION, "+('0xe')", 14, +("0xe")); -new TestCase( SECTION, "+('0xf')", 15, +("0xf")); -new TestCase( SECTION, "+('0xA')", 10, +("0xA")); -new TestCase( SECTION, "+('0xB')", 11, +("0xB")); -new TestCase( SECTION, "+('0xC')", 12, +("0xC")); -new TestCase( SECTION, "+('0xD')", 13, +("0xD")); -new TestCase( SECTION, "+('0xE')", 14, +("0xE")); -new TestCase( SECTION, "+('0xF')", 15, +("0xF")); - -new TestCase( SECTION, "+('0X0')", 0, +("0X0")); -new TestCase( SECTION, "+('0X1')", 1, +("0X1")); -new TestCase( SECTION, "+('0X2')", 2, +("0X2")); -new TestCase( SECTION, "+('0X3')", 3, +("0X3")); -new TestCase( SECTION, "+('0X4')", 4, +("0X4")); -new TestCase( SECTION, "+('0X5')", 5, +("0X5")); -new TestCase( SECTION, "+('0X6')", 6, +("0X6")); -new TestCase( SECTION, "+('0X7')", 7, +("0X7")); -new TestCase( SECTION, "+('0X8')", 8, +("0X8")); -new TestCase( SECTION, "+('0X9')", 9, +("0X9")); -new TestCase( SECTION, "+('0Xa')", 10, +("0Xa")); -new TestCase( SECTION, "+('0Xb')", 11, +("0Xb")); -new TestCase( SECTION, "+('0Xc')", 12, +("0Xc")); -new TestCase( SECTION, "+('0Xd')", 13, +("0Xd")); -new TestCase( SECTION, "+('0Xe')", 14, +("0Xe")); -new TestCase( SECTION, "+('0Xf')", 15, +("0Xf")); -new TestCase( SECTION, "+('0XA')", 10, +("0XA")); -new TestCase( SECTION, "+('0XB')", 11, +("0XB")); -new TestCase( SECTION, "+('0XC')", 12, +("0XC")); -new TestCase( SECTION, "+('0XD')", 13, +("0XD")); -new TestCase( SECTION, "+('0XE')", 14, +("0XE")); -new TestCase( SECTION, "+('0XF')", 15, +("0XF")); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.4.7-01.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.4.7-01.js deleted file mode 100644 index 827b80189d..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.4.7-01.js +++ /dev/null @@ -1,299 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.4.7-01.js'; - -/** - File Name: 11.4.7-01.js - ECMA Section: 11.4.7 Unary - Operator - Description: convert operand to Number type and change sign - Author: christine@netscape.com - Date: 7 july 1997 -*/ - -var SECTION = "11.4.7"; -var VERSION = "ECMA_1"; -var BUGNUMBER="77391"; - -startTest(); - -writeHeaderToLog( SECTION + " Unary + operator"); - -new TestCase( SECTION, "-('')", -0, -("") ); -new TestCase( SECTION, "-(' ')", -0, -(" ") ); -new TestCase( SECTION, "-(\\t)", -0, -("\t") ); -new TestCase( SECTION, "-(\\n)", -0, -("\n") ); -new TestCase( SECTION, "-(\\r)", -0, -("\r") ); -new TestCase( SECTION, "-(\\f)", -0, -("\f") ); - -new TestCase( SECTION, "-(String.fromCharCode(0x0009)", -0, -(String.fromCharCode(0x0009)) ); -new TestCase( SECTION, "-(String.fromCharCode(0x0020)", -0, -(String.fromCharCode(0x0020)) ); -new TestCase( SECTION, "-(String.fromCharCode(0x000C)", -0, -(String.fromCharCode(0x000C)) ); -new TestCase( SECTION, "-(String.fromCharCode(0x000B)", -0, -(String.fromCharCode(0x000B)) ); -new TestCase( SECTION, "-(String.fromCharCode(0x000D)", -0, -(String.fromCharCode(0x000D)) ); -new TestCase( SECTION, "-(String.fromCharCode(0x000A)", -0, -(String.fromCharCode(0x000A)) ); - -// a StringNumericLiteral may be preceeded or followed by whitespace and/or -// line terminators - -new TestCase( SECTION, "-( ' ' + 999 )", -999, -( ' '+999) ); -new TestCase( SECTION, "-( '\\n' + 999 )", -999, -( '\n' +999) ); -new TestCase( SECTION, "-( '\\r' + 999 )", -999, -( '\r' +999) ); -new TestCase( SECTION, "-( '\\t' + 999 )", -999, -( '\t' +999) ); -new TestCase( SECTION, "-( '\\f' + 999 )", -999, -( '\f' +999) ); - -new TestCase( SECTION, "-( 999 + ' ' )", -999, -( 999+' ') ); -new TestCase( SECTION, "-( 999 + '\\n' )", -999, -( 999+'\n' ) ); -new TestCase( SECTION, "-( 999 + '\\r' )", -999, -( 999+'\r' ) ); -new TestCase( SECTION, "-( 999 + '\\t' )", -999, -( 999+'\t' ) ); -new TestCase( SECTION, "-( 999 + '\\f' )", -999, -( 999+'\f' ) ); - -new TestCase( SECTION, "-( '\\n' + 999 + '\\n' )", -999, -( '\n' +999+'\n' ) ); -new TestCase( SECTION, "-( '\\r' + 999 + '\\r' )", -999, -( '\r' +999+'\r' ) ); -new TestCase( SECTION, "-( '\\t' + 999 + '\\t' )", -999, -( '\t' +999+'\t' ) ); -new TestCase( SECTION, "-( '\\f' + 999 + '\\f' )", -999, -( '\f' +999+'\f' ) ); - -new TestCase( SECTION, "-( ' ' + '999' )", -999, -( ' '+'999') ); -new TestCase( SECTION, "-( '\\n' + '999' )", -999, -( '\n' +'999') ); -new TestCase( SECTION, "-( '\\r' + '999' )", -999, -( '\r' +'999') ); -new TestCase( SECTION, "-( '\\t' + '999' )", -999, -( '\t' +'999') ); -new TestCase( SECTION, "-( '\\f' + '999' )", -999, -( '\f' +'999') ); - -new TestCase( SECTION, "-( '999' + ' ' )", -999, -( '999'+' ') ); -new TestCase( SECTION, "-( '999' + '\\n' )", -999, -( '999'+'\n' ) ); -new TestCase( SECTION, "-( '999' + '\\r' )", -999, -( '999'+'\r' ) ); -new TestCase( SECTION, "-( '999' + '\\t' )", -999, -( '999'+'\t' ) ); -new TestCase( SECTION, "-( '999' + '\\f' )", -999, -( '999'+'\f' ) ); - -new TestCase( SECTION, "-( '\\n' + '999' + '\\n' )", -999, -( '\n' +'999'+'\n' ) ); -new TestCase( SECTION, "-( '\\r' + '999' + '\\r' )", -999, -( '\r' +'999'+'\r' ) ); -new TestCase( SECTION, "-( '\\t' + '999' + '\\t' )", -999, -( '\t' +'999'+'\t' ) ); -new TestCase( SECTION, "-( '\\f' + '999' + '\\f' )", -999, -( '\f' +'999'+'\f' ) ); - -new TestCase( SECTION, "-( String.fromCharCode(0x0009) + '99' )", -99, -( String.fromCharCode(0x0009) + '99' ) ); -new TestCase( SECTION, "-( String.fromCharCode(0x0020) + '99' )", -99, -( String.fromCharCode(0x0020) + '99' ) ); -new TestCase( SECTION, "-( String.fromCharCode(0x000C) + '99' )", -99, -( String.fromCharCode(0x000C) + '99' ) ); -new TestCase( SECTION, "-( String.fromCharCode(0x000B) + '99' )", -99, -( String.fromCharCode(0x000B) + '99' ) ); -new TestCase( SECTION, "-( String.fromCharCode(0x000D) + '99' )", -99, -( String.fromCharCode(0x000D) + '99' ) ); -new TestCase( SECTION, "-( String.fromCharCode(0x000A) + '99' )", -99, -( String.fromCharCode(0x000A) + '99' ) ); - -new TestCase( SECTION, "-( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x0009)", -99, -( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x0009)) ); -new TestCase( SECTION, "-( String.fromCharCode(0x0020) + '99' + String.fromCharCode(0x0020)", -99, -( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x0020)) ); -new TestCase( SECTION, "-( String.fromCharCode(0x000C) + '99' + String.fromCharCode(0x000C)", -99, -( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x000C)) ); -new TestCase( SECTION, "-( String.fromCharCode(0x000D) + '99' + String.fromCharCode(0x000D)", -99, -( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x000D)) ); -new TestCase( SECTION, "-( String.fromCharCode(0x000B) + '99' + String.fromCharCode(0x000B)", -99, -( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x000B)) ); -new TestCase( SECTION, "-( String.fromCharCode(0x000A) + '99' + String.fromCharCode(0x000A)", -99, -( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x000A)) ); - -new TestCase( SECTION, "-( '99' + String.fromCharCode(0x0009)", -99, -( '99' + String.fromCharCode(0x0009)) ); -new TestCase( SECTION, "-( '99' + String.fromCharCode(0x0020)", -99, -( '99' + String.fromCharCode(0x0020)) ); -new TestCase( SECTION, "-( '99' + String.fromCharCode(0x000C)", -99, -( '99' + String.fromCharCode(0x000C)) ); -new TestCase( SECTION, "-( '99' + String.fromCharCode(0x000D)", -99, -( '99' + String.fromCharCode(0x000D)) ); -new TestCase( SECTION, "-( '99' + String.fromCharCode(0x000B)", -99, -( '99' + String.fromCharCode(0x000B)) ); -new TestCase( SECTION, "-( '99' + String.fromCharCode(0x000A)", -99, -( '99' + String.fromCharCode(0x000A)) ); - -new TestCase( SECTION, "-( String.fromCharCode(0x0009) + 99 )", -99, -( String.fromCharCode(0x0009) + 99 ) ); -new TestCase( SECTION, "-( String.fromCharCode(0x0020) + 99 )", -99, -( String.fromCharCode(0x0020) + 99 ) ); -new TestCase( SECTION, "-( String.fromCharCode(0x000C) + 99 )", -99, -( String.fromCharCode(0x000C) + 99 ) ); -new TestCase( SECTION, "-( String.fromCharCode(0x000B) + 99 )", -99, -( String.fromCharCode(0x000B) + 99 ) ); -new TestCase( SECTION, "-( String.fromCharCode(0x000D) + 99 )", -99, -( String.fromCharCode(0x000D) + 99 ) ); -new TestCase( SECTION, "-( String.fromCharCode(0x000A) + 99 )", -99, -( String.fromCharCode(0x000A) + 99 ) ); - -new TestCase( SECTION, "-( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x0009)", -99, -( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x0009)) ); -new TestCase( SECTION, "-( String.fromCharCode(0x0020) + 99 + String.fromCharCode(0x0020)", -99, -( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x0020)) ); -new TestCase( SECTION, "-( String.fromCharCode(0x000C) + 99 + String.fromCharCode(0x000C)", -99, -( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x000C)) ); -new TestCase( SECTION, "-( String.fromCharCode(0x000D) + 99 + String.fromCharCode(0x000D)", -99, -( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x000D)) ); -new TestCase( SECTION, "-( String.fromCharCode(0x000B) + 99 + String.fromCharCode(0x000B)", -99, -( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x000B)) ); -new TestCase( SECTION, "-( String.fromCharCode(0x000A) + 99 + String.fromCharCode(0x000A)", -99, -( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x000A)) ); - -new TestCase( SECTION, "-( 99 + String.fromCharCode(0x0009)", -99, -( 99 + String.fromCharCode(0x0009)) ); -new TestCase( SECTION, "-( 99 + String.fromCharCode(0x0020)", -99, -( 99 + String.fromCharCode(0x0020)) ); -new TestCase( SECTION, "-( 99 + String.fromCharCode(0x000C)", -99, -( 99 + String.fromCharCode(0x000C)) ); -new TestCase( SECTION, "-( 99 + String.fromCharCode(0x000D)", -99, -( 99 + String.fromCharCode(0x000D)) ); -new TestCase( SECTION, "-( 99 + String.fromCharCode(0x000B)", -99, -( 99 + String.fromCharCode(0x000B)) ); -new TestCase( SECTION, "-( 99 + String.fromCharCode(0x000A)", -99, -( 99 + String.fromCharCode(0x000A)) ); - - -// StrNumericLiteral:::StrDecimalLiteral:::Infinity - -new TestCase( SECTION, "-('Infinity')", -Math.pow(10,10000), -("Infinity") ); -new TestCase( SECTION, "-('-Infinity')", +Math.pow(10,10000), -("-Infinity") ); -new TestCase( SECTION, "-('+Infinity')", -Math.pow(10,10000), -("+Infinity") ); - -// StrNumericLiteral::: StrDecimalLiteral ::: DecimalDigits . DecimalDigits opt ExponentPart opt - -new TestCase( SECTION, "-('0')", -0, -("0") ); -new TestCase( SECTION, "-('-0')", +0, -("-0") ); -new TestCase( SECTION, "-('+0')", -0, -("+0") ); - -new TestCase( SECTION, "-('1')", -1, -("1") ); -new TestCase( SECTION, "-('-1')", +1, -("-1") ); -new TestCase( SECTION, "-('+1')", -1, -("+1") ); - -new TestCase( SECTION, "-('2')", -2, -("2") ); -new TestCase( SECTION, "-('-2')", +2, -("-2") ); -new TestCase( SECTION, "-('+2')", -2, -("+2") ); - -new TestCase( SECTION, "-('3')", -3, -("3") ); -new TestCase( SECTION, "-('-3')", +3, -("-3") ); -new TestCase( SECTION, "-('+3')", -3, -("+3") ); - -new TestCase( SECTION, "-('4')", -4, -("4") ); -new TestCase( SECTION, "-('-4')", +4, -("-4") ); -new TestCase( SECTION, "-('+4')", -4, -("+4") ); - -new TestCase( SECTION, "-('5')", -5, -("5") ); -new TestCase( SECTION, "-('-5')", +5, -("-5") ); -new TestCase( SECTION, "-('+5')", -5, -("+5") ); - -new TestCase( SECTION, "-('6')", -6, -("6") ); -new TestCase( SECTION, "-('-6')", +6, -("-6") ); -new TestCase( SECTION, "-('+6')", -6, -("+6") ); - -new TestCase( SECTION, "-('7')", -7, -("7") ); -new TestCase( SECTION, "-('-7')", +7, -("-7") ); -new TestCase( SECTION, "-('+7')", -7, -("+7") ); - -new TestCase( SECTION, "-('8')", -8, -("8") ); -new TestCase( SECTION, "-('-8')", +8, -("-8") ); -new TestCase( SECTION, "-('+8')", -8, -("+8") ); - -new TestCase( SECTION, "-('9')", -9, -("9") ); -new TestCase( SECTION, "-('-9')", +9, -("-9") ); -new TestCase( SECTION, "-('+9')", -9, -("+9") ); - -new TestCase( SECTION, "-('3.14159')", -3.14159, -("3.14159") ); -new TestCase( SECTION, "-('-3.14159')", +3.14159, -("-3.14159") ); -new TestCase( SECTION, "-('+3.14159')", -3.14159, -("+3.14159") ); - -new TestCase( SECTION, "-('3.')", -3, -("3.") ); -new TestCase( SECTION, "-('-3.')", +3, -("-3.") ); -new TestCase( SECTION, "-('+3.')", -3, -("+3.") ); - -new TestCase( SECTION, "-('3.e1')", -30, -("3.e1") ); -new TestCase( SECTION, "-('-3.e1')", +30, -("-3.e1") ); -new TestCase( SECTION, "-('+3.e1')", -30, -("+3.e1") ); - -new TestCase( SECTION, "-('3.e+1')", -30, -("3.e+1") ); -new TestCase( SECTION, "-('-3.e+1')", +30, -("-3.e+1") ); -new TestCase( SECTION, "-('+3.e+1')", -30, -("+3.e+1") ); - -new TestCase( SECTION, "-('3.e-1')", -.30, -("3.e-1") ); -new TestCase( SECTION, "-('-3.e-1')", +.30, -("-3.e-1") ); -new TestCase( SECTION, "-('+3.e-1')", -.30, -("+3.e-1") ); - -// StrDecimalLiteral::: .DecimalDigits ExponentPart opt - -new TestCase( SECTION, "-('.00001')", -0.00001, -(".00001") ); -new TestCase( SECTION, "-('+.00001')", -0.00001, -("+.00001") ); -new TestCase( SECTION, "-('-0.0001')", +0.00001, -("-.00001") ); - -new TestCase( SECTION, "-('.01e2')", -1, -(".01e2") ); -new TestCase( SECTION, "-('+.01e2')", -1, -("+.01e2") ); -new TestCase( SECTION, "-('-.01e2')", +1, -("-.01e2") ); - -new TestCase( SECTION, "-('.01e+2')", -1, -(".01e+2") ); -new TestCase( SECTION, "-('+.01e+2')", -1, -("+.01e+2") ); -new TestCase( SECTION, "-('-.01e+2')", +1, -("-.01e+2") ); - -new TestCase( SECTION, "-('.01e-2')", -0.0001, -(".01e-2") ); -new TestCase( SECTION, "-('+.01e-2')", -0.0001, -("+.01e-2") ); -new TestCase( SECTION, "-('-.01e-2')", +0.0001, -("-.01e-2") ); - -// StrDecimalLiteral::: DecimalDigits ExponentPart opt - -new TestCase( SECTION, "-('1234e5')", -123400000, -("1234e5") ); -new TestCase( SECTION, "-('+1234e5')", -123400000, -("+1234e5") ); -new TestCase( SECTION, "-('-1234e5')", +123400000, -("-1234e5") ); - -new TestCase( SECTION, "-('1234e+5')", -123400000, -("1234e+5") ); -new TestCase( SECTION, "-('+1234e+5')", -123400000, -("+1234e+5") ); -new TestCase( SECTION, "-('-1234e+5')", +123400000, -("-1234e+5") ); - -new TestCase( SECTION, "-('1234e-5')", -0.01234, -("1234e-5") ); -new TestCase( SECTION, "-('+1234e-5')", -0.01234, -("+1234e-5") ); -new TestCase( SECTION, "-('-1234e-5')", +0.01234, -("-1234e-5") ); - -// StrNumericLiteral::: HexIntegerLiteral - -new TestCase( SECTION, "-('0x0')", -0, -("0x0")); -new TestCase( SECTION, "-('0x1')", -1, -("0x1")); -new TestCase( SECTION, "-('0x2')", -2, -("0x2")); -new TestCase( SECTION, "-('0x3')", -3, -("0x3")); -new TestCase( SECTION, "-('0x4')", -4, -("0x4")); -new TestCase( SECTION, "-('0x5')", -5, -("0x5")); -new TestCase( SECTION, "-('0x6')", -6, -("0x6")); -new TestCase( SECTION, "-('0x7')", -7, -("0x7")); -new TestCase( SECTION, "-('0x8')", -8, -("0x8")); -new TestCase( SECTION, "-('0x9')", -9, -("0x9")); -new TestCase( SECTION, "-('0xa')", -10, -("0xa")); -new TestCase( SECTION, "-('0xb')", -11, -("0xb")); -new TestCase( SECTION, "-('0xc')", -12, -("0xc")); -new TestCase( SECTION, "-('0xd')", -13, -("0xd")); -new TestCase( SECTION, "-('0xe')", -14, -("0xe")); -new TestCase( SECTION, "-('0xf')", -15, -("0xf")); -new TestCase( SECTION, "-('0xA')", -10, -("0xA")); -new TestCase( SECTION, "-('0xB')", -11, -("0xB")); -new TestCase( SECTION, "-('0xC')", -12, -("0xC")); -new TestCase( SECTION, "-('0xD')", -13, -("0xD")); -new TestCase( SECTION, "-('0xE')", -14, -("0xE")); -new TestCase( SECTION, "-('0xF')", -15, -("0xF")); - -new TestCase( SECTION, "-('0X0')", -0, -("0X0")); -new TestCase( SECTION, "-('0X1')", -1, -("0X1")); -new TestCase( SECTION, "-('0X2')", -2, -("0X2")); -new TestCase( SECTION, "-('0X3')", -3, -("0X3")); -new TestCase( SECTION, "-('0X4')", -4, -("0X4")); -new TestCase( SECTION, "-('0X5')", -5, -("0X5")); -new TestCase( SECTION, "-('0X6')", -6, -("0X6")); -new TestCase( SECTION, "-('0X7')", -7, -("0X7")); -new TestCase( SECTION, "-('0X8')", -8, -("0X8")); -new TestCase( SECTION, "-('0X9')", -9, -("0X9")); -new TestCase( SECTION, "-('0Xa')", -10, -("0Xa")); -new TestCase( SECTION, "-('0Xb')", -11, -("0Xb")); -new TestCase( SECTION, "-('0Xc')", -12, -("0Xc")); -new TestCase( SECTION, "-('0Xd')", -13, -("0Xd")); -new TestCase( SECTION, "-('0Xe')", -14, -("0Xe")); -new TestCase( SECTION, "-('0Xf')", -15, -("0Xf")); -new TestCase( SECTION, "-('0XA')", -10, -("0XA")); -new TestCase( SECTION, "-('0XB')", -11, -("0XB")); -new TestCase( SECTION, "-('0XC')", -12, -("0XC")); -new TestCase( SECTION, "-('0XD')", -13, -("0XD")); -new TestCase( SECTION, "-('0XE')", -14, -("0XE")); -new TestCase( SECTION, "-('0XF')", -15, -("0XF")); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.4.7-02.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.4.7-02.js deleted file mode 100644 index 43bd923e23..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.4.7-02.js +++ /dev/null @@ -1,87 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Mozilla Foundation. - * Portions created by the Initial Developer are Copyright (C) 2007 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.4.7-02.js'; - -/** - * File Name: 11.4.7-02.js - * Reference: https://bugzilla.mozilla.org/show_bug.cgi?id=432881 - * Description: ecma 11.4.7 - */ - -var SECTION = "11.4.7"; -var VERSION = "ECMA"; -var TITLE = "Unary - Operator"; -var BUGNUMBER = "432881"; - -startTest(); - -test_negation(0, -0.0); -test_negation(-0.0, 0); -test_negation(1, -1); -test_negation(1.0/0.0, -1.0/0.0); -test_negation(-1.0/0.0, 1.0/0.0); - -//1073741824 == (1 << 30) -test_negation(1073741824, -1073741824); -test_negation(-1073741824, 1073741824); - -//1073741824 == (1 << 30) - 1 -test_negation(1073741823, -1073741823); -test_negation(-1073741823, 1073741823); - -//1073741824 == (1 << 30) -test_negation(1073741824, -1073741824); -test_negation(-1073741824, 1073741824); - -//1073741824 == (1 << 30) - 1 -test_negation(1073741823, -1073741823); -test_negation(-1073741823, 1073741823); - -//2147483648 == (1 << 31) -test_negation(2147483648, -2147483648); -test_negation(-2147483648, 2147483648); - -//2147483648 == (1 << 31) - 1 -test_negation(2147483647, -2147483647); -test_negation(-2147483647, 2147483647); - -function test_negation(value, expected) -{ - var actual = -value; - reportCompare(expected, actual, '-(' + value + ') == ' + expected); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.4.8.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.4.8.js deleted file mode 100644 index f617e10689..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.4.8.js +++ /dev/null @@ -1,215 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.4.8.js'; - -/** - File Name: 11.4.8.js - ECMA Section: 11.4.8 Bitwise NOT Operator - Description: flip bits up to 32 bits - no special cases - Author: christine@netscape.com - Date: 7 july 1997 - - Data File Fields: - VALUE value passed as an argument to the ~ operator - E_RESULT expected return value of ~ VALUE; - - Static variables: - none - -*/ - -var SECTION = "11.4.8"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Bitwise Not operator"); - -for ( var i = 0; i < 35; i++ ) { - var p = Math.pow(2,i); - - new TestCase( SECTION, "~"+p, Not(p), ~p ); - -} -for ( i = 0; i < 35; i++ ) { - var p = -Math.pow(2,i); - - new TestCase( SECTION, "~"+p, Not(p), ~p ); - -} - -test(); - -function ToInteger( n ) { - n = Number( n ); - var sign = ( n < 0 ) ? -1 : 1; - - if ( n != n ) { - return 0; - } - if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY ) { - return n; - } - return ( sign * Math.floor(Math.abs(n)) ); -} -function ToInt32( 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) )) % Math.pow(2,32); - n = ( n >= Math.pow(2,31) ) ? n - Math.pow(2,32) : n; - - return ( n ); -} -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 ); -} -function ToUint16( 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) ) ) % Math.pow(2,16); - - if (n <0) { - n += Math.pow(2,16); - } - - return ( n ); -} -function Mask( b, n ) { - b = ToUint32BitString( b ); - b = b.substring( b.length - n ); - b = ToUint32Decimal( b ); - return ( b ); -} -function ToUint32BitString( n ) { - var b = ""; - for ( var p = 31; p >=0; p-- ) { - if ( n >= Math.pow(2,p) ) { - b += "1"; - n -= Math.pow(2,p); - } else { - b += "0"; - } - } - return b; -} -function ToInt32BitString( n ) { - var b = ""; - var sign = ( n < 0 ) ? -1 : 1; - - b += ( sign == 1 ) ? "0" : "1"; - - for ( var p = 30; p >=0; p-- ) { - if ( (sign == 1 ) ? sign * n >= Math.pow(2,p) : sign * n > Math.pow(2,p) ) { - b += ( sign == 1 ) ? "1" : "0"; - n -= sign * Math.pow( 2, p ); - } else { - b += ( sign == 1 ) ? "0" : "1"; - } - } - - return b; -} -function ToInt32Decimal( bin ) { - var r = 0; - var sign; - - if ( Number(bin.charAt(0)) == 0 ) { - sign = 1; - r = 0; - } else { - sign = -1; - r = -(Math.pow(2,31)); - } - - for ( var j = 0; j < 31; j++ ) { - r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); - } - - return r; -} -function ToUint32Decimal( bin ) { - var r = 0; - - for ( var l = bin.length; l < 32; l++ ) { - bin = "0" + bin; - } - - for ( var j = 0; j < 31; j++ ) { - r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); - } - - return r; -} -function Not( n ) { - n = ToInt32(n); - n = ToInt32BitString(n); - - var r = ""; - - for( var l = 0; l < n.length; l++ ) { - r += ( n.charAt(l) == "0" ) ? "1" : "0"; - } - - n = ToInt32Decimal(r); - - return n; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.4.9.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.4.9.js deleted file mode 100644 index 2c57e88211..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.4.9.js +++ /dev/null @@ -1,94 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.4.9.js'; - -/** - File Name: 11.4.9.js - ECMA Section: 11.4.9 Logical NOT Operator (!) - Description: if the ToBoolean( VALUE ) result is true, return - true. else return false. - Author: christine@netscape.com - Date: 7 july 1997 - - Static variables: - none -*/ -var SECTION = "11.4.9"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Logical NOT operator (!)"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -// version("130") - - -new TestCase( SECTION, "!(null)", true, !(null) ); -new TestCase( SECTION, "!(var x)", true, !(eval("var x")) ); -new TestCase( SECTION, "!(void 0)", true, !(void 0) ); - -new TestCase( SECTION, "!(false)", true, !(false) ); -new TestCase( SECTION, "!(true)", false, !(true) ); -new TestCase( SECTION, "!()", true, !(eval()) ); -new TestCase( SECTION, "!(0)", true, !(0) ); -new TestCase( SECTION, "!(-0)", true, !(-0) ); -new TestCase( SECTION, "!(NaN)", true, !(Number.NaN) ); -new TestCase( SECTION, "!(Infinity)", false, !(Number.POSITIVE_INFINITY) ); -new TestCase( SECTION, "!(-Infinity)", false, !(Number.NEGATIVE_INFINITY) ); -new TestCase( SECTION, "!(Math.PI)", false, !(Math.PI) ); -new TestCase( SECTION, "!(1)", false, !(1) ); -new TestCase( SECTION, "!(-1)", false, !(-1) ); -new TestCase( SECTION, "!('')", true, !("") ); -new TestCase( SECTION, "!('\t')", false, !("\t") ); -new TestCase( SECTION, "!('0')", false, !("0") ); -new TestCase( SECTION, "!('string')", false, !("string") ); -new TestCase( SECTION, "!(new String(''))", false, !(new String("")) ); -new TestCase( SECTION, "!(new String('string'))", false, !(new String("string")) ); -new TestCase( SECTION, "!(new String())", false, !(new String()) ); -new TestCase( SECTION, "!(new Boolean(true))", false, !(new Boolean(true)) ); -new TestCase( SECTION, "!(new Boolean(false))", false, !(new Boolean(false)) ); -new TestCase( SECTION, "!(new Array())", false, !(new Array()) ); -new TestCase( SECTION, "!(new Array(1,2,3)", false, !(new Array(1,2,3)) ); -new TestCase( SECTION, "!(new Number())", false, !(new Number()) ); -new TestCase( SECTION, "!(new Number(0))", false, !(new Number(0)) ); -new TestCase( SECTION, "!(new Number(NaN))", false, !(new Number(Number.NaN)) ); -new TestCase( SECTION, "!(new Number(Infinity))", false, !(new Number(Number.POSITIVE_INFINITY)) ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.5.1.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.5.1.js deleted file mode 100644 index 94edcefea5..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.5.1.js +++ /dev/null @@ -1,115 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.5.1.js'; - -/** - File Name: 11.5.1.js - ECMA Section: 11.5.1 Applying the * operator - Description: - - 11.5.1 Applying the * operator - - The * operator performs multiplication, producing the product of its - operands. Multiplication is commutative. Multiplication is not always - associative in ECMAScript, because of finite precision. - - The result of a floating-point multiplication is governed by the rules - of IEEE 754 double-precision arithmetic: - - If either operand is NaN, the result is NaN. - The sign of the result is positive if both operands have the same sign, - negative if the operands have different signs. - Multiplication of an infinity by a zero results in NaN. - Multiplication of an infinity by an infinity results in an infinity. - The sign is determined by the rule already stated above. - Multiplication of an infinity by a finite non-zero value results in a - signed infinity. The sign is determined by the rule already stated above. - In the remaining cases, where neither an infinity or NaN is involved, the - product is computed and rounded to the nearest representable value using IEEE - 754 round-to-nearest mode. If the magnitude is too large to represent, - the result is then an infinity of appropriate sign. If the magnitude is - oo small to represent, the result is then a zero - of appropriate sign. The ECMAScript language requires support of gradual - underflow as defined by IEEE 754. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.5.1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Applying the * operator"); - -new TestCase( SECTION, "Number.NaN * Number.NaN", Number.NaN, Number.NaN * Number.NaN ); -new TestCase( SECTION, "Number.NaN * 1", Number.NaN, Number.NaN * 1 ); -new TestCase( SECTION, "1 * Number.NaN", Number.NaN, 1 * Number.NaN ); - -new TestCase( SECTION, "Number.POSITIVE_INFINITY * 0", Number.NaN, Number.POSITIVE_INFINITY * 0 ); -new TestCase( SECTION, "Number.NEGATIVE_INFINITY * 0", Number.NaN, Number.NEGATIVE_INFINITY * 0 ); -new TestCase( SECTION, "0 * Number.POSITIVE_INFINITY", Number.NaN, 0 * Number.POSITIVE_INFINITY ); -new TestCase( SECTION, "0 * Number.NEGATIVE_INFINITY", Number.NaN, 0 * Number.NEGATIVE_INFINITY ); - -new TestCase( SECTION, "-0 * Number.POSITIVE_INFINITY", Number.NaN, -0 * Number.POSITIVE_INFINITY ); -new TestCase( SECTION, "-0 * Number.NEGATIVE_INFINITY", Number.NaN, -0 * Number.NEGATIVE_INFINITY ); -new TestCase( SECTION, "Number.POSITIVE_INFINITY * -0", Number.NaN, Number.POSITIVE_INFINITY * -0 ); -new TestCase( SECTION, "Number.NEGATIVE_INFINITY * -0", Number.NaN, Number.NEGATIVE_INFINITY * -0 ); - -new TestCase( SECTION, "0 * -0", -0, 0 * -0 ); -new TestCase( SECTION, "-0 * 0", -0, -0 * 0 ); -new TestCase( SECTION, "-0 * -0", 0, -0 * -0 ); -new TestCase( SECTION, "0 * 0", 0, 0 * 0 ); - -new TestCase( SECTION, "Number.NEGATIVE_INFINITY * Number.NEGATIVE_INFINITY", Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY * Number.NEGATIVE_INFINITY ); -new TestCase( SECTION, "Number.POSITIVE_INFINITY * Number.NEGATIVE_INFINITY", Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY * Number.NEGATIVE_INFINITY ); -new TestCase( SECTION, "Number.NEGATIVE_INFINITY * Number.POSITIVE_INFINITY", Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY * Number.POSITIVE_INFINITY ); -new TestCase( SECTION, "Number.POSITIVE_INFINITY * Number.POSITIVE_INFINITY", Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY * Number.POSITIVE_INFINITY ); - -new TestCase( SECTION, "Number.NEGATIVE_INFINITY * 1 ", Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY * 1 ); -new TestCase( SECTION, "Number.NEGATIVE_INFINITY * -1 ", Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY * -1 ); -new TestCase( SECTION, "1 * Number.NEGATIVE_INFINITY", Number.NEGATIVE_INFINITY, 1 * Number.NEGATIVE_INFINITY ); -new TestCase( SECTION, "-1 * Number.NEGATIVE_INFINITY", Number.POSITIVE_INFINITY, -1 * Number.NEGATIVE_INFINITY ); - -new TestCase( SECTION, "Number.POSITIVE_INFINITY * 1 ", Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY * 1 ); -new TestCase( SECTION, "Number.POSITIVE_INFINITY * -1 ", Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY * -1 ); -new TestCase( SECTION, "1 * Number.POSITIVE_INFINITY", Number.POSITIVE_INFINITY, 1 * Number.POSITIVE_INFINITY ); -new TestCase( SECTION, "-1 * Number.POSITIVE_INFINITY", Number.NEGATIVE_INFINITY, -1 * Number.POSITIVE_INFINITY ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.5.2.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.5.2.js deleted file mode 100644 index e459e7613f..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.5.2.js +++ /dev/null @@ -1,154 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.5.2.js'; - -/** - File Name: 11.5.2.js - ECMA Section: 11.5.2 Applying the / operator - Description: - - The / operator performs division, producing the quotient of its operands. - The left operand is the dividend and the right operand is the divisor. - ECMAScript does not perform integer division. The operands and result of all - division operations are double-precision floating-point numbers. - The result of division is determined by the specification of IEEE 754 arithmetic: - - If either operand is NaN, the result is NaN. - The sign of the result is positive if both operands have the same sign, negative if the operands have different - signs. - Division of an infinity by an infinity results in NaN. - Division of an infinity by a zero results in an infinity. The sign is determined by the rule already stated above. - Division of an infinity by a non-zero finite value results in a signed infinity. The sign is determined by the rule - already stated above. - Division of a finite value by an infinity results in zero. The sign is determined by the rule already stated above. - Division of a zero by a zero results in NaN; division of zero by any other finite value results in zero, with the sign - determined by the rule already stated above. - Division of a non-zero finite value by a zero results in a signed infinity. The sign is determined by the rule - already stated above. - In the remaining cases, where neither an infinity, nor a zero, nor NaN is involved, the quotient is computed and - rounded to the nearest representable value using IEEE 754 round-to-nearest mode. If the magnitude is too - large to represent, we say the operation overflows; the result is then an infinity of appropriate sign. If the - magnitude is too small to represent, we say the operation underflows and the result is a zero of the appropriate - sign. The ECMAScript language requires support of gradual underflow as defined by IEEE 754. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.5.2"; -var VERSION = "ECMA_1"; -var BUGNUMBER="111202"; -startTest(); - -writeHeaderToLog( SECTION + " Applying the / operator"); - -// if either operand is NaN, the result is NaN. - -new TestCase( SECTION, "Number.NaN / Number.NaN", Number.NaN, Number.NaN / Number.NaN ); -new TestCase( SECTION, "Number.NaN / 1", Number.NaN, Number.NaN / 1 ); -new TestCase( SECTION, "1 / Number.NaN", Number.NaN, 1 / Number.NaN ); - -new TestCase( SECTION, "Number.POSITIVE_INFINITY / Number.NaN", Number.NaN, Number.POSITIVE_INFINITY / Number.NaN ); -new TestCase( SECTION, "Number.NEGATIVE_INFINITY / Number.NaN", Number.NaN, Number.NEGATIVE_INFINITY / Number.NaN ); - -// Division of an infinity by an infinity results in NaN. - -new TestCase( SECTION, "Number.NEGATIVE_INFINITY / Number.NEGATIVE_INFINITY", Number.NaN, Number.NEGATIVE_INFINITY / Number.NEGATIVE_INFINITY ); -new TestCase( SECTION, "Number.POSITIVE_INFINITY / Number.NEGATIVE_INFINITY", Number.NaN, Number.POSITIVE_INFINITY / Number.NEGATIVE_INFINITY ); -new TestCase( SECTION, "Number.NEGATIVE_INFINITY / Number.POSITIVE_INFINITY", Number.NaN, Number.NEGATIVE_INFINITY / Number.POSITIVE_INFINITY ); -new TestCase( SECTION, "Number.POSITIVE_INFINITY / Number.POSITIVE_INFINITY", Number.NaN, Number.POSITIVE_INFINITY / Number.POSITIVE_INFINITY ); - -// Division of an infinity by a zero results in an infinity. - -new TestCase( SECTION, "Number.POSITIVE_INFINITY / 0", Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY / 0 ); -new TestCase( SECTION, "Number.NEGATIVE_INFINITY / 0", Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY / 0 ); -new TestCase( SECTION, "Number.POSITIVE_INFINITY / -0", Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY / -0 ); -new TestCase( SECTION, "Number.NEGATIVE_INFINITY / -0", Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY / -0 ); - -// Division of an infinity by a non-zero finite value results in a signed infinity. - -new TestCase( SECTION, "Number.NEGATIVE_INFINITY / 1 ", Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY / 1 ); -new TestCase( SECTION, "Number.NEGATIVE_INFINITY / -1 ", Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY / -1 ); -new TestCase( SECTION, "Number.POSITIVE_INFINITY / 1 ", Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY / 1 ); -new TestCase( SECTION, "Number.POSITIVE_INFINITY / -1 ", Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY / -1 ); - -new TestCase( SECTION, "Number.NEGATIVE_INFINITY / Number.MAX_VALUE ", Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY / Number.MAX_VALUE ); -new TestCase( SECTION, "Number.NEGATIVE_INFINITY / -Number.MAX_VALUE ", Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY / -Number.MAX_VALUE ); -new TestCase( SECTION, "Number.POSITIVE_INFINITY / Number.MAX_VALUE ", Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY / Number.MAX_VALUE ); -new TestCase( SECTION, "Number.POSITIVE_INFINITY / -Number.MAX_VALUE ", Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY / -Number.MAX_VALUE ); - -// Division of a finite value by an infinity results in zero. - -new TestCase( SECTION, "1 / Number.NEGATIVE_INFINITY", -0, 1 / Number.NEGATIVE_INFINITY ); -new TestCase( SECTION, "1 / Number.POSITIVE_INFINITY", 0, 1 / Number.POSITIVE_INFINITY ); -new TestCase( SECTION, "-1 / Number.POSITIVE_INFINITY", -0, -1 / Number.POSITIVE_INFINITY ); -new TestCase( SECTION, "-1 / Number.NEGATIVE_INFINITY", 0, -1 / Number.NEGATIVE_INFINITY ); - -new TestCase( SECTION, "Number.MAX_VALUE / Number.NEGATIVE_INFINITY", -0, Number.MAX_VALUE / Number.NEGATIVE_INFINITY ); -new TestCase( SECTION, "Number.MAX_VALUE / Number.POSITIVE_INFINITY", 0, Number.MAX_VALUE / Number.POSITIVE_INFINITY ); -new TestCase( SECTION, "-Number.MAX_VALUE / Number.POSITIVE_INFINITY", -0, -Number.MAX_VALUE / Number.POSITIVE_INFINITY ); -new TestCase( SECTION, "-Number.MAX_VALUE / Number.NEGATIVE_INFINITY", 0, -Number.MAX_VALUE / Number.NEGATIVE_INFINITY ); - -// Division of a zero by a zero results in NaN - -new TestCase( SECTION, "0 / -0", Number.NaN, 0 / -0 ); -new TestCase( SECTION, "-0 / 0", Number.NaN, -0 / 0 ); -new TestCase( SECTION, "-0 / -0", Number.NaN, -0 / -0 ); -new TestCase( SECTION, "0 / 0", Number.NaN, 0 / 0 ); - -// division of zero by any other finite value results in zero - -new TestCase( SECTION, "0 / 1", 0, 0 / 1 ); -new TestCase( SECTION, "0 / -1", -0, 0 / -1 ); -new TestCase( SECTION, "-0 / 1", -0, -0 / 1 ); -new TestCase( SECTION, "-0 / -1", 0, -0 / -1 ); - -// Division of a non-zero finite value by a zero results in a signed infinity. - -new TestCase( SECTION, "1 / 0", Number.POSITIVE_INFINITY, 1/0 ); -new TestCase( SECTION, "1 / -0", Number.NEGATIVE_INFINITY, 1/-0 ); -new TestCase( SECTION, "-1 / 0", Number.NEGATIVE_INFINITY, -1/0 ); -new TestCase( SECTION, "-1 / -0", Number.POSITIVE_INFINITY, -1/-0 ); - -new TestCase( SECTION, "0 / Number.POSITIVE_INFINITY", 0, 0 / Number.POSITIVE_INFINITY ); -new TestCase( SECTION, "0 / Number.NEGATIVE_INFINITY", -0, 0 / Number.NEGATIVE_INFINITY ); -new TestCase( SECTION, "-0 / Number.POSITIVE_INFINITY", -0, -0 / Number.POSITIVE_INFINITY ); -new TestCase( SECTION, "-0 / Number.NEGATIVE_INFINITY", 0, -0 / Number.NEGATIVE_INFINITY ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.5.3.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.5.3.js deleted file mode 100644 index 9558b63a96..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.5.3.js +++ /dev/null @@ -1,161 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.5.3.js'; - -/** - File Name: 11.5.3.js - ECMA Section: 11.5.3 Applying the % operator - Description: - - The binary % operator is said to yield the remainder of its operands from - an implied division; the left operand is the dividend and the right operand - is the divisor. In C and C++, the remainder operator accepts only integral - operands, but in ECMAScript, it also accepts floating-point operands. - - The result of a floating-point remainder operation as computed by the % - operator is not the same as the "remainder" operation defined by IEEE 754. - The IEEE 754 "remainder" operation computes the remainder from a rounding - division, not a truncating division, and so its behavior is not analogous - to that of the usual integer remainder operator. Instead the ECMAScript - language defines % on floating-point operations to behave in a manner - analogous to that of the Java integer remainder operator; this may be - compared with the C library function fmod. - - The result of a ECMAScript floating-point remainder operation is determined by the rules of IEEE arithmetic: - - If either operand is NaN, the result is NaN. - The sign of the result equals the sign of the dividend. - If the dividend is an infinity, or the divisor is a zero, or both, the result is NaN. - If the dividend is finite and the divisor is an infinity, the result equals the dividend. - If the dividend is a zero and the divisor is finite, the result is the same as the dividend. - In the remaining cases, where neither an infinity, nor a zero, nor NaN is involved, the floating-point remainder r - from a dividend n and a divisor d is defined by the mathematical relation r = n (d * q) where q is an integer that - is negative only if n/d is negative and positive only if n/d is positive, and whose magnitude is as large as - possible without exceeding the magnitude of the true mathematical quotient of n and d. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.5.3"; -var VERSION = "ECMA_1"; -var BUGNUMBER="111202"; -startTest(); - - -writeHeaderToLog( SECTION + " Applying the % operator"); - -// if either operand is NaN, the result is NaN. - -new TestCase( SECTION, "Number.NaN % Number.NaN", Number.NaN, Number.NaN % Number.NaN ); -new TestCase( SECTION, "Number.NaN % 1", Number.NaN, Number.NaN % 1 ); -new TestCase( SECTION, "1 % Number.NaN", Number.NaN, 1 % Number.NaN ); - -new TestCase( SECTION, "Number.POSITIVE_INFINITY % Number.NaN", Number.NaN, Number.POSITIVE_INFINITY % Number.NaN ); -new TestCase( SECTION, "Number.NEGATIVE_INFINITY % Number.NaN", Number.NaN, Number.NEGATIVE_INFINITY % Number.NaN ); - -// If the dividend is an infinity, or the divisor is a zero, or both, the result is NaN. -// dividend is an infinity - -new TestCase( SECTION, "Number.NEGATIVE_INFINITY % Number.NEGATIVE_INFINITY", Number.NaN, Number.NEGATIVE_INFINITY % Number.NEGATIVE_INFINITY ); -new TestCase( SECTION, "Number.POSITIVE_INFINITY % Number.NEGATIVE_INFINITY", Number.NaN, Number.POSITIVE_INFINITY % Number.NEGATIVE_INFINITY ); -new TestCase( SECTION, "Number.NEGATIVE_INFINITY % Number.POSITIVE_INFINITY", Number.NaN, Number.NEGATIVE_INFINITY % Number.POSITIVE_INFINITY ); -new TestCase( SECTION, "Number.POSITIVE_INFINITY % Number.POSITIVE_INFINITY", Number.NaN, Number.POSITIVE_INFINITY % Number.POSITIVE_INFINITY ); - -new TestCase( SECTION, "Number.POSITIVE_INFINITY % 0", Number.NaN, Number.POSITIVE_INFINITY % 0 ); -new TestCase( SECTION, "Number.NEGATIVE_INFINITY % 0", Number.NaN, Number.NEGATIVE_INFINITY % 0 ); -new TestCase( SECTION, "Number.POSITIVE_INFINITY % -0", Number.NaN, Number.POSITIVE_INFINITY % -0 ); -new TestCase( SECTION, "Number.NEGATIVE_INFINITY % -0", Number.NaN, Number.NEGATIVE_INFINITY % -0 ); - -new TestCase( SECTION, "Number.NEGATIVE_INFINITY % 1 ", Number.NaN, Number.NEGATIVE_INFINITY % 1 ); -new TestCase( SECTION, "Number.NEGATIVE_INFINITY % -1 ", Number.NaN, Number.NEGATIVE_INFINITY % -1 ); -new TestCase( SECTION, "Number.POSITIVE_INFINITY % 1 ", Number.NaN, Number.POSITIVE_INFINITY % 1 ); -new TestCase( SECTION, "Number.POSITIVE_INFINITY % -1 ", Number.NaN, Number.POSITIVE_INFINITY % -1 ); - -new TestCase( SECTION, "Number.NEGATIVE_INFINITY % Number.MAX_VALUE ", Number.NaN, Number.NEGATIVE_INFINITY % Number.MAX_VALUE ); -new TestCase( SECTION, "Number.NEGATIVE_INFINITY % -Number.MAX_VALUE ", Number.NaN, Number.NEGATIVE_INFINITY % -Number.MAX_VALUE ); -new TestCase( SECTION, "Number.POSITIVE_INFINITY % Number.MAX_VALUE ", Number.NaN, Number.POSITIVE_INFINITY % Number.MAX_VALUE ); -new TestCase( SECTION, "Number.POSITIVE_INFINITY % -Number.MAX_VALUE ", Number.NaN, Number.POSITIVE_INFINITY % -Number.MAX_VALUE ); - -// divisor is 0 -new TestCase( SECTION, "0 % -0", Number.NaN, 0 % -0 ); -new TestCase( SECTION, "-0 % 0", Number.NaN, -0 % 0 ); -new TestCase( SECTION, "-0 % -0", Number.NaN, -0 % -0 ); -new TestCase( SECTION, "0 % 0", Number.NaN, 0 % 0 ); - -new TestCase( SECTION, "1 % 0", Number.NaN, 1%0 ); -new TestCase( SECTION, "1 % -0", Number.NaN, 1%-0 ); -new TestCase( SECTION, "-1 % 0", Number.NaN, -1%0 ); -new TestCase( SECTION, "-1 % -0", Number.NaN, -1%-0 ); - -new TestCase( SECTION, "Number.MAX_VALUE % 0", Number.NaN, Number.MAX_VALUE%0 ); -new TestCase( SECTION, "Number.MAX_VALUE % -0", Number.NaN, Number.MAX_VALUE%-0 ); -new TestCase( SECTION, "-Number.MAX_VALUE % 0", Number.NaN, -Number.MAX_VALUE%0 ); -new TestCase( SECTION, "-Number.MAX_VALUE % -0", Number.NaN, -Number.MAX_VALUE%-0 ); - -// If the dividend is finite and the divisor is an infinity, the result equals the dividend. - -new TestCase( SECTION, "1 % Number.NEGATIVE_INFINITY", 1, 1 % Number.NEGATIVE_INFINITY ); -new TestCase( SECTION, "1 % Number.POSITIVE_INFINITY", 1, 1 % Number.POSITIVE_INFINITY ); -new TestCase( SECTION, "-1 % Number.POSITIVE_INFINITY", -1, -1 % Number.POSITIVE_INFINITY ); -new TestCase( SECTION, "-1 % Number.NEGATIVE_INFINITY", -1, -1 % Number.NEGATIVE_INFINITY ); - -new TestCase( SECTION, "Number.MAX_VALUE % Number.NEGATIVE_INFINITY", Number.MAX_VALUE, Number.MAX_VALUE % Number.NEGATIVE_INFINITY ); -new TestCase( SECTION, "Number.MAX_VALUE % Number.POSITIVE_INFINITY", Number.MAX_VALUE, Number.MAX_VALUE % Number.POSITIVE_INFINITY ); -new TestCase( SECTION, "-Number.MAX_VALUE % Number.POSITIVE_INFINITY", -Number.MAX_VALUE, -Number.MAX_VALUE % Number.POSITIVE_INFINITY ); -new TestCase( SECTION, "-Number.MAX_VALUE % Number.NEGATIVE_INFINITY", -Number.MAX_VALUE, -Number.MAX_VALUE % Number.NEGATIVE_INFINITY ); - -new TestCase( SECTION, "0 % Number.POSITIVE_INFINITY", 0, 0 % Number.POSITIVE_INFINITY ); -new TestCase( SECTION, "0 % Number.NEGATIVE_INFINITY", 0, 0 % Number.NEGATIVE_INFINITY ); -new TestCase( SECTION, "-0 % Number.POSITIVE_INFINITY", -0, -0 % Number.POSITIVE_INFINITY ); -new TestCase( SECTION, "-0 % Number.NEGATIVE_INFINITY", -0, -0 % Number.NEGATIVE_INFINITY ); - -// If the dividend is a zero and the divisor is finite, the result is the same as the dividend. - -new TestCase( SECTION, "0 % 1", 0, 0 % 1 ); -new TestCase( SECTION, "0 % -1", -0, 0 % -1 ); -new TestCase( SECTION, "-0 % 1", -0, -0 % 1 ); -new TestCase( SECTION, "-0 % -1", 0, -0 % -1 ); - -// In the remaining cases, where neither an infinity, nor a zero, nor NaN is involved, the floating-point remainder r -// from a dividend n and a divisor d is defined by the mathematical relation r = n (d * q) where q is an integer that -// is negative only if n/d is negative and positive only if n/d is positive, and whose magnitude is as large as -// possible without exceeding the magnitude of the true mathematical quotient of n and d. - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.6.1-1.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.6.1-1.js deleted file mode 100644 index 87666161b6..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.6.1-1.js +++ /dev/null @@ -1,160 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.6.1-1.js'; - -/** - File Name: 11.6.1-1.js - ECMA Section: 11.6.1 The addition operator ( + ) - Description: - - The addition operator either performs string concatenation or numeric - addition. - - The production AdditiveExpression : AdditiveExpression + MultiplicativeExpression - is evaluated as follows: - - 1. Evaluate AdditiveExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate MultiplicativeExpression. - 4. Call GetValue(Result(3)). - 5. Call ToPrimitive(Result(2)). - 6. Call ToPrimitive(Result(4)). - 7. If Type(Result(5)) is String or Type(Result(6)) is String, go to step 12. - (Note that this step differs from step 3 in the algorithm for comparison - for the relational operators in using or instead of and.) - 8. Call ToNumber(Result(5)). - 9. Call ToNumber(Result(6)). - 10. Apply the addition operation to Result(8) and Result(9). See the discussion below (11.6.3). - 11. Return Result(10). - 12. Call ToString(Result(5)). - 13. Call ToString(Result(6)). - 14. Concatenate Result(12) followed by Result(13). - 15. Return Result(14). - - Note that no hint is provided in the calls to ToPrimitive in steps 5 and 6. - All native ECMAScript objects except Date objects handle the absence of a - hint as if the hint Number were given; Date objects handle the absence of a - hint as if the hint String were given. Host objects may handle the absence - of a hint in some other manner. - - This test does not cover cases where the Additive or Mulplicative expression - ToPrimitive is string. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.6.1-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " The Addition operator ( + )"); - -// tests for boolean primitive, boolean object, Object object, a "MyObject" whose value is -// a boolean primitive and a boolean object. - -new TestCase( SECTION, - "var EXP_1 = true; var EXP_2 = false; EXP_1 + EXP_2", - 1, - eval("var EXP_1 = true; var EXP_2 = false; EXP_1 + EXP_2") ); - -new TestCase( SECTION, - "var EXP_1 = new Boolean(true); var EXP_2 = new Boolean(false); EXP_1 + EXP_2", - 1, - eval("var EXP_1 = new Boolean(true); var EXP_2 = new Boolean(false); EXP_1 + EXP_2") ); - -new TestCase( SECTION, - "var EXP_1 = new Object(true); var EXP_2 = new Object(false); EXP_1 + EXP_2", - 1, - eval("var EXP_1 = new Object(true); var EXP_2 = new Object(false); EXP_1 + EXP_2") ); - -new TestCase( SECTION, - "var EXP_1 = new Object(new Boolean(true)); var EXP_2 = new Object(new Boolean(false)); EXP_1 + EXP_2", - 1, - eval("var EXP_1 = new Object(new Boolean(true)); var EXP_2 = new Object(new Boolean(false)); EXP_1 + EXP_2") ); - -new TestCase( SECTION, - "var EXP_1 = new MyObject(true); var EXP_2 = new MyObject(false); EXP_1 + EXP_2", - 1, - eval("var EXP_1 = new MyObject(true); var EXP_2 = new MyObject(false); EXP_1 + EXP_2") ); - -new TestCase( SECTION, - "var EXP_1 = new MyObject(new Boolean(true)); var EXP_2 = new MyObject(new Boolean(false)); EXP_1 + EXP_2", - "[object Object][object Object]", - eval("var EXP_1 = new MyObject(new Boolean(true)); var EXP_2 = new MyObject(new Boolean(false)); EXP_1 + EXP_2") ); - -// tests for number primitive, number object, Object object, a "MyObject" whose value is -// a number primitive and a number object. - -new TestCase( SECTION, - "var EXP_1 = 100; var EXP_2 = -1; EXP_1 + EXP_2", - 99, - eval("var EXP_1 = 100; var EXP_2 = -1; EXP_1 + EXP_2") ); - -new TestCase( SECTION, - "var EXP_1 = new Number(100); var EXP_2 = new Number(-1); EXP_1 + EXP_2", - 99, - eval("var EXP_1 = new Number(100); var EXP_2 = new Number(-1); EXP_1 + EXP_2") ); - -new TestCase( SECTION, - "var EXP_1 = new Object(100); var EXP_2 = new Object(-1); EXP_1 + EXP_2", - 99, - eval("var EXP_1 = new Object(100); var EXP_2 = new Object(-1); EXP_1 + EXP_2") ); - -new TestCase( SECTION, - "var EXP_1 = new Object(new Number(100)); var EXP_2 = new Object(new Number(-1)); EXP_1 + EXP_2", - 99, - eval("var EXP_1 = new Object(new Number(100)); var EXP_2 = new Object(new Number(-1)); EXP_1 + EXP_2") ); - -new TestCase( SECTION, - "var EXP_1 = new MyObject(100); var EXP_2 = new MyObject(-1); EXP_1 + EXP_2", - 99, - eval("var EXP_1 = new MyObject(100); var EXP_2 = new MyObject(-1); EXP_1 + EXP_2") ); - -new TestCase( SECTION, - "var EXP_1 = new MyObject(new Number(100)); var EXP_2 = new MyObject(new Number(-1)); EXP_1 + EXP_2", - "[object Object][object Object]", - eval("var EXP_1 = new MyObject(new Number(100)); var EXP_2 = new MyObject(new Number(-1)); EXP_1 + EXP_2") ); - - -test(); - -function MyObject( value ) { - this.valueOf = new Function( "return this.value" ); - this.value = value; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.6.1-2.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.6.1-2.js deleted file mode 100644 index 1d96d14e92..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.6.1-2.js +++ /dev/null @@ -1,164 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.6.1-2.js'; - -/** - File Name: 11.6.1-2.js - ECMA Section: 11.6.1 The addition operator ( + ) - Description: - - The addition operator either performs string concatenation or numeric - addition. - - The production AdditiveExpression : AdditiveExpression + MultiplicativeExpression - is evaluated as follows: - - 1. Evaluate AdditiveExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate MultiplicativeExpression. - 4. Call GetValue(Result(3)). - 5. Call ToPrimitive(Result(2)). - 6. Call ToPrimitive(Result(4)). - 7. If Type(Result(5)) is String or Type(Result(6)) is String, go to step 12. - (Note that this step differs from step 3 in the algorithm for comparison - for the relational operators in using or instead of and.) - 8. Call ToNumber(Result(5)). - 9. Call ToNumber(Result(6)). - 10. Apply the addition operation to Result(8) and Result(9). See the discussion below (11.6.3). - 11. Return Result(10). - 12. Call ToString(Result(5)). - 13. Call ToString(Result(6)). - 14. Concatenate Result(12) followed by Result(13). - 15. Return Result(14). - - Note that no hint is provided in the calls to ToPrimitive in steps 5 and 6. - All native ECMAScript objects except Date objects handle the absence of a - hint as if the hint Number were given; Date objects handle the absence of a - hint as if the hint String were given. Host objects may handle the absence - of a hint in some other manner. - - This test does only covers cases where the Additive or Mulplicative expression - ToPrimitive is a string. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.6.1-2"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " The Addition operator ( + )"); - -// tests for boolean primitive, boolean object, Object object, a "MyObject" whose value is -// a boolean primitive and a boolean object. - -new TestCase( SECTION, - "var EXP_1 = 'string'; var EXP_2 = false; EXP_1 + EXP_2", - "stringfalse", - eval("var EXP_1 = 'string'; var EXP_2 = false; EXP_1 + EXP_2") ); - -new TestCase( SECTION, - "var EXP_1 = true; var EXP_2 = 'string'; EXP_1 + EXP_2", - "truestring", - eval("var EXP_1 = true; var EXP_2 = 'string'; EXP_1 + EXP_2") ); - -new TestCase( SECTION, - "var EXP_1 = new Boolean(true); var EXP_2 = new String('string'); EXP_1 + EXP_2", - "truestring", - eval("var EXP_1 = new Boolean(true); var EXP_2 = new String('string'); EXP_1 + EXP_2") ); - -new TestCase( SECTION, - "var EXP_1 = new Object(true); var EXP_2 = new Object('string'); EXP_1 + EXP_2", - "truestring", - eval("var EXP_1 = new Object(true); var EXP_2 = new Object('string'); EXP_1 + EXP_2") ); - -new TestCase( SECTION, - "var EXP_1 = new Object(new String('string')); var EXP_2 = new Object(new Boolean(false)); EXP_1 + EXP_2", - "stringfalse", - eval("var EXP_1 = new Object(new String('string')); var EXP_2 = new Object(new Boolean(false)); EXP_1 + EXP_2") ); - -new TestCase( SECTION, - "var EXP_1 = new MyObject(true); var EXP_2 = new MyObject('string'); EXP_1 + EXP_2", - "truestring", - eval("var EXP_1 = new MyObject(true); var EXP_2 = new MyObject('string'); EXP_1 + EXP_2") ); - -new TestCase( SECTION, - "var EXP_1 = new MyObject(new String('string')); var EXP_2 = new MyObject(new Boolean(false)); EXP_1 + EXP_2", - "[object Object][object Object]", - eval("var EXP_1 = new MyObject(new String('string')); var EXP_2 = new MyObject(new Boolean(false)); EXP_1 + EXP_2") ); - -// tests for number primitive, number object, Object object, a "MyObject" whose value is -// a number primitive and a number object. - -new TestCase( SECTION, - "var EXP_1 = 100; var EXP_2 = 'string'; EXP_1 + EXP_2", - "100string", - eval("var EXP_1 = 100; var EXP_2 = 'string'; EXP_1 + EXP_2") ); - -new TestCase( SECTION, - "var EXP_1 = new String('string'); var EXP_2 = new Number(-1); EXP_1 + EXP_2", - "string-1", - eval("var EXP_1 = new String('string'); var EXP_2 = new Number(-1); EXP_1 + EXP_2") ); - -new TestCase( SECTION, - "var EXP_1 = new Object(100); var EXP_2 = new Object('string'); EXP_1 + EXP_2", - "100string", - eval("var EXP_1 = new Object(100); var EXP_2 = new Object('string'); EXP_1 + EXP_2") ); - -new TestCase( SECTION, - "var EXP_1 = new Object(new String('string')); var EXP_2 = new Object(new Number(-1)); EXP_1 + EXP_2", - "string-1", - eval("var EXP_1 = new Object(new String('string')); var EXP_2 = new Object(new Number(-1)); EXP_1 + EXP_2") ); - -new TestCase( SECTION, - "var EXP_1 = new MyObject(100); var EXP_2 = new MyObject('string'); EXP_1 + EXP_2", - "100string", - eval("var EXP_1 = new MyObject(100); var EXP_2 = new MyObject('string'); EXP_1 + EXP_2") ); - -new TestCase( SECTION, - "var EXP_1 = new MyObject(new String('string')); var EXP_2 = new MyObject(new Number(-1)); EXP_1 + EXP_2", - "[object Object][object Object]", - eval("var EXP_1 = new MyObject(new String('string')); var EXP_2 = new MyObject(new Number(-1)); EXP_1 + EXP_2") ); - -test(); - -function MyObject( value ) { - this.valueOf = new Function( "return this.value" ); - this.value = value; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.6.1-3.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.6.1-3.js deleted file mode 100644 index 9a162787d5..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.6.1-3.js +++ /dev/null @@ -1,150 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.6.1-3.js'; - -/** - File Name: 11.6.1-3.js - ECMA Section: 11.6.1 The addition operator ( + ) - Description: - - The addition operator either performs string concatenation or numeric - addition. - - The production AdditiveExpression : AdditiveExpression + MultiplicativeExpression - is evaluated as follows: - - 1. Evaluate AdditiveExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate MultiplicativeExpression. - 4. Call GetValue(Result(3)). - 5. Call ToPrimitive(Result(2)). - 6. Call ToPrimitive(Result(4)). - 7. If Type(Result(5)) is String or Type(Result(6)) is String, go to step 12. - (Note that this step differs from step 3 in the algorithm for comparison - for the relational operators in using or instead of and.) - 8. Call ToNumber(Result(5)). - 9. Call ToNumber(Result(6)). - 10. Apply the addition operation to Result(8) and Result(9). See the discussion below (11.6.3). - 11. Return Result(10). - 12. Call ToString(Result(5)). - 13. Call ToString(Result(6)). - 14. Concatenate Result(12) followed by Result(13). - 15. Return Result(14). - - Note that no hint is provided in the calls to ToPrimitive in steps 5 and 6. - All native ECMAScript objects except Date objects handle the absence of a - hint as if the hint Number were given; Date objects handle the absence of a - hint as if the hint String were given. Host objects may handle the absence - of a hint in some other manner. - - This test does only covers cases where the Additive or Mulplicative expression - is a Date. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.6.1-3"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " The Addition operator ( + )"); - -// tests for boolean primitive, boolean object, Object object, a "MyObject" whose value is -// a boolean primitive and a boolean object. - -var DATE1 = new Date(); - -new TestCase( SECTION, - "var DATE1 = new Date(); DATE1 + DATE1", - DATE1.toString() + DATE1.toString(), - DATE1 + DATE1 ); - -new TestCase( SECTION, - "var DATE1 = new Date(); DATE1 + 0", - DATE1.toString() + 0, - DATE1 + 0 ); - -new TestCase( SECTION, - "var DATE1 = new Date(); DATE1 + new Number(0)", - DATE1.toString() + 0, - DATE1 + new Number(0) ); - -new TestCase( SECTION, - "var DATE1 = new Date(); DATE1 + true", - DATE1.toString() + "true", - DATE1 + true ); - -new TestCase( SECTION, - "var DATE1 = new Date(); DATE1 + new Boolean(true)", - DATE1.toString() + "true", - DATE1 + new Boolean(true) ); - -new TestCase( SECTION, - "var DATE1 = new Date(); DATE1 + new Boolean(true)", - DATE1.toString() + "true", - DATE1 + new Boolean(true) ); - -var MYOB1 = new MyObject( DATE1 ); - -new TestCase( SECTION, - "MYOB1 = new MyObject(DATE1); MYOB1 + new Number(1)", - "[object Object]1", - MYOB1 + new Number(1) ); - -new TestCase( SECTION, - "MYOB1 = new MyObject(DATE1); MYOB1 + 1", - "[object Object]1", - MYOB1 + 1 ); - -new TestCase( SECTION, - "MYOB1 = new MyObject(DATE1); MYOB1 + true", - "[object Object]true", - MYOB1 + true ); - -test(); - -function MyPrototypeObject(value) { - this.valueOf = new Function( "return this.value;" ); - this.toString = new Function( "return (this.value + '');" ); - this.value = value; -} -function MyObject( value ) { - this.valueOf = new Function( "return this.value" ); - this.value = value; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.6.2-1.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.6.2-1.js deleted file mode 100644 index b3ab9b17fb..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.6.2-1.js +++ /dev/null @@ -1,165 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.6.2-1.js'; - -/** - File Name: 11.6.2-1.js - ECMA Section: 11.6.2 The Subtraction operator ( - ) - Description: - - The production AdditiveExpression : AdditiveExpression - - MultiplicativeExpression is evaluated as follows: - - 1. Evaluate AdditiveExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate MultiplicativeExpression. - 4. Call GetValue(Result(3)). - 5. Call ToNumber(Result(2)). - 6. Call ToNumber(Result(4)). - 7. Apply the subtraction operation to Result(5) and Result(6). See the - discussion below (11.6.3). - 8. Return Result(7). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.6.2-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " The subtraction operator ( - )"); - -// tests for boolean primitive, boolean object, Object object, a "MyObject" whose value is -// a boolean primitive and a boolean object. - -new TestCase( SECTION, - "var EXP_1 = true; var EXP_2 = false; EXP_1 - EXP_2", - 1, - eval("var EXP_1 = true; var EXP_2 = false; EXP_1 - EXP_2") ); - -new TestCase( SECTION, - "var EXP_1 = new Boolean(true); var EXP_2 = new Boolean(false); EXP_1 - EXP_2", - 1, - eval("var EXP_1 = new Boolean(true); var EXP_2 = new Boolean(false); EXP_1 - EXP_2") ); - -new TestCase( SECTION, - "var EXP_1 = new Object(true); var EXP_2 = new Object(false); EXP_1 - EXP_2", - 1, - eval("var EXP_1 = new Object(true); var EXP_2 = new Object(false); EXP_1 - EXP_2") ); - -new TestCase( SECTION, - "var EXP_1 = new Object(new Boolean(true)); var EXP_2 = new Object(new Boolean(false)); EXP_1 - EXP_2", - 1, - eval("var EXP_1 = new Object(new Boolean(true)); var EXP_2 = new Object(new Boolean(false)); EXP_1 - EXP_2") ); - -new TestCase( SECTION, - "var EXP_1 = new MyObject(true); var EXP_2 = new MyObject(false); EXP_1 - EXP_2", - 1, - eval("var EXP_1 = new MyObject(true); var EXP_2 = new MyObject(false); EXP_1 - EXP_2") ); - -new TestCase( SECTION, - "var EXP_1 = new MyObject(new Boolean(true)); var EXP_2 = new MyObject(new Boolean(false)); EXP_1 - EXP_2", - Number.NaN, - eval("var EXP_1 = new MyObject(new Boolean(true)); var EXP_2 = new MyObject(new Boolean(false)); EXP_1 - EXP_2") ); - -new TestCase( SECTION, - "var EXP_1 = new MyOtherObject(new Boolean(true)); var EXP_2 = new MyOtherObject(new Boolean(false)); EXP_1 - EXP_2", - Number.NaN, - eval("var EXP_1 = new MyOtherObject(new Boolean(true)); var EXP_2 = new MyOtherObject(new Boolean(false)); EXP_1 - EXP_2") ); - -// tests for number primitive, number object, Object object, a "MyObject" whose value is -// a number primitive and a number object. - -new TestCase( SECTION, - "var EXP_1 = 100; var EXP_2 = 1; EXP_1 - EXP_2", - 99, - eval("var EXP_1 = 100; var EXP_2 = 1; EXP_1 - EXP_2") ); - -new TestCase( SECTION, - "var EXP_1 = new Number(100); var EXP_2 = new Number(1); EXP_1 - EXP_2", - 99, - eval("var EXP_1 = new Number(100); var EXP_2 = new Number(1); EXP_1 - EXP_2") ); - -new TestCase( SECTION, - "var EXP_1 = new Object(100); var EXP_2 = new Object(1); EXP_1 - EXP_2", - 99, - eval("var EXP_1 = new Object(100); var EXP_2 = new Object(1); EXP_1 - EXP_2") ); - -new TestCase( SECTION, - "var EXP_1 = new Object(new Number(100)); var EXP_2 = new Object(new Number(1)); EXP_1 - EXP_2", - 99, - eval("var EXP_1 = new Object(new Number(100)); var EXP_2 = new Object(new Number(1)); EXP_1 - EXP_2") ); - -new TestCase( SECTION, - "var EXP_1 = new MyObject(100); var EXP_2 = new MyObject(1); EXP_1 - EXP_2", - 99, - eval("var EXP_1 = new MyObject(100); var EXP_2 = new MyObject(1); EXP_1 - EXP_2") ); - -new TestCase( SECTION, - "var EXP_1 = new MyObject(new Number(100)); var EXP_2 = new MyObject(new Number(1)); EXP_1 - EXP_2", - Number.NaN, - eval("var EXP_1 = new MyObject(new Number(100)); var EXP_2 = new MyObject(new Number(1)); EXP_1 - EXP_2") ); - -new TestCase( SECTION, - "var EXP_1 = new MyOtherObject(new Number(100)); var EXP_2 = new MyOtherObject(new Number(1)); EXP_1 - EXP_2", - 99, - eval("var EXP_1 = new MyOtherObject(new Number(100)); var EXP_2 = new MyOtherObject(new Number(1)); EXP_1 - EXP_2") ); - -// same thing with string! -new TestCase( SECTION, - "var EXP_1 = new MyOtherObject(new String('0xff')); var EXP_2 = new MyOtherObject(new String('1'); EXP_1 - EXP_2", - 254, - eval("var EXP_1 = new MyOtherObject(new String('0xff')); var EXP_2 = new MyOtherObject(new String('1')); EXP_1 - EXP_2") ); - -test(); - -function MyPrototypeObject(value) { - this.valueOf = new Function( "return this.value;" ); - this.toString = new Function( "return (this.value + '');" ); - this.value = value; -} -function MyObject( value ) { - this.valueOf = new Function( "return this.value" ); - this.value = value; -} -function MyOtherObject( value ) { - this.valueOf = new Function( "return this.value" ); - this.toString = new Function ( "return this.value + ''" ); - this.value = value; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.6.3.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.6.3.js deleted file mode 100644 index cf44738528..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.6.3.js +++ /dev/null @@ -1,115 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.6.3.js'; - -/** - File Name: 11.6.3.js - ECMA Section: 11.6.3 Applying the additive operators - (+, -) to numbers - Description: - The + operator performs addition when applied to two operands of numeric - type, producing the sum of the operands. The - operator performs - subtraction, producing the difference of two numeric operands. - - Addition is a commutative operation, but not always associative. - - The result of an addition is determined using the rules of IEEE 754 - double-precision arithmetic: - - If either operand is NaN, the result is NaN. - The sum of two infinities of opposite sign is NaN. - The sum of two infinities of the same sign is the infinity of that sign. - The sum of an infinity and a finite value is equal to the infinite operand. - The sum of two negative zeros is 0. The sum of two positive zeros, or of - two zeros of opposite sign, is +0. - The sum of a zero and a nonzero finite value is equal to the nonzero - operand. - The sum of two nonzero finite values of the same magnitude and opposite - sign is +0. - In the remaining cases, where neither an infinity, nor a zero, nor NaN is - involved, and the operands have the same sign or have different - magnitudes, the sum is computed and rounded to the nearest - representable value using IEEE 754 round-to-nearest mode. If the - magnitude is too large to represent, the operation overflows and - the result is then an infinity of appropriate sign. The ECMAScript - language requires support of gradual underflow as defined by IEEE 754. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.6.3"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Applying the additive operators (+,-) to numbers"); - -new TestCase( SECTION, "Number.NaN + 1", Number.NaN, Number.NaN + 1 ); -new TestCase( SECTION, "1 + Number.NaN", Number.NaN, 1 + Number.NaN ); - -new TestCase( SECTION, "Number.NaN - 1", Number.NaN, Number.NaN - 1 ); -new TestCase( SECTION, "1 - Number.NaN", Number.NaN, 1 - Number.NaN ); - -new TestCase( SECTION, "Number.POSITIVE_INFINITY + Number.POSITIVE_INFINITY", Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY + Number.POSITIVE_INFINITY); -new TestCase( SECTION, "Number.NEGATIVE_INFINITY + Number.NEGATIVE_INFINITY", Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY + Number.NEGATIVE_INFINITY); - -new TestCase( SECTION, "Number.POSITIVE_INFINITY + Number.NEGATIVE_INFINITY", Number.NaN, Number.POSITIVE_INFINITY + Number.NEGATIVE_INFINITY); -new TestCase( SECTION, "Number.NEGATIVE_INFINITY + Number.POSITIVE_INFINITY", Number.NaN, Number.NEGATIVE_INFINITY + Number.POSITIVE_INFINITY); - -new TestCase( SECTION, "Number.POSITIVE_INFINITY - Number.POSITIVE_INFINITY", Number.NaN, Number.POSITIVE_INFINITY - Number.POSITIVE_INFINITY); -new TestCase( SECTION, "Number.NEGATIVE_INFINITY - Number.NEGATIVE_INFINITY", Number.NaN, Number.NEGATIVE_INFINITY - Number.NEGATIVE_INFINITY); - -new TestCase( SECTION, "Number.POSITIVE_INFINITY - Number.NEGATIVE_INFINITY", Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY - Number.NEGATIVE_INFINITY); -new TestCase( SECTION, "Number.NEGATIVE_INFINITY - Number.POSITIVE_INFINITY", Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY - Number.POSITIVE_INFINITY); - -new TestCase( SECTION, "-0 + -0", -0, -0 + -0 ); -new TestCase( SECTION, "-0 - 0", -0, -0 - 0 ); - -new TestCase( SECTION, "0 + 0", 0, 0 + 0 ); -new TestCase( SECTION, "0 + -0", 0, 0 + -0 ); -new TestCase( SECTION, "0 - -0", 0, 0 - -0 ); -new TestCase( SECTION, "0 - 0", 0, 0 - 0 ); -new TestCase( SECTION, "-0 - -0", 0, -0 - -0 ); -new TestCase( SECTION, "-0 + 0", 0, -0 + 0 ); - -new TestCase( SECTION, "Number.MAX_VALUE - Number.MAX_VALUE", 0, Number.MAX_VALUE - Number.MAX_VALUE ); -new TestCase( SECTION, "1/Number.MAX_VALUE - 1/Number.MAX_VALUE", 0, 1/Number.MAX_VALUE - 1/Number.MAX_VALUE ); - -new TestCase( SECTION, "Number.MIN_VALUE - Number.MIN_VALUE", 0, Number.MIN_VALUE - Number.MIN_VALUE ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.7.1.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.7.1.js deleted file mode 100644 index 44099f6c94..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.7.1.js +++ /dev/null @@ -1,228 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.7.1.js'; - -/** - File Name: 11.7.1.js - ECMA Section: 11.7.1 The Left Shift Operator ( << ) - Description: - Performs a bitwise left shift operation on the left argument by the amount - specified by the right argument. - - The production ShiftExpression : ShiftExpression << AdditiveExpression is - evaluated as follows: - - 1. Evaluate ShiftExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate AdditiveExpression. - 4. Call GetValue(Result(3)). - 5. Call ToInt32(Result(2)). - 6. Call ToUint32(Result(4)). - 7. Mask out all but the least significant 5 bits of Result(6), that is, - compute Result(6) & 0x1F. - 8. Left shift Result(5) by Result(7) bits. The result is a signed 32 bit - integer. - 9. Return Result(8). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.7.1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " The left shift operator ( << )"); - -for ( power = 0; power < 33; power++ ) { - shiftexp = Math.pow( 2, power ); - - for ( addexp = 0; addexp < 33; addexp++ ) { - new TestCase( SECTION, - shiftexp + " << " + addexp, - LeftShift( shiftexp, addexp ), - shiftexp << addexp ); - } -} - -test(); - -function ToInteger( n ) { - n = Number( n ); - var sign = ( n < 0 ) ? -1 : 1; - - if ( n != n ) { - return 0; - } - if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY ) { - return n; - } - return ( sign * Math.floor(Math.abs(n)) ); -} -function ToInt32( 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) )) % Math.pow(2,32); - n = ( n >= Math.pow(2,31) ) ? n - Math.pow(2,32) : n; - - return ( n ); -} -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 ); -} -function ToUint16( 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) ) ) % Math.pow(2,16); - - if (n <0) { - n += Math.pow(2,16); - } - - return ( n ); -} -function Mask( b, n ) { - b = ToUint32BitString( b ); - b = b.substring( b.length - n ); - b = ToUint32Decimal( b ); - return ( b ); -} -function ToUint32BitString( n ) { - var b = ""; - for ( p = 31; p >=0; p-- ) { - if ( n >= Math.pow(2,p) ) { - b += "1"; - n -= Math.pow(2,p); - } else { - b += "0"; - } - } - return b; -} -function ToInt32BitString( n ) { - var b = ""; - var sign = ( n < 0 ) ? -1 : 1; - - b += ( sign == 1 ) ? "0" : "1"; - - for ( p = 30; p >=0; p-- ) { - if ( (sign == 1 ) ? sign * n >= Math.pow(2,p) : sign * n > Math.pow(2,p) ) { - b += ( sign == 1 ) ? "1" : "0"; - n -= sign * Math.pow( 2, p ); - } else { - b += ( sign == 1 ) ? "0" : "1"; - } - } - - return b; -} -function ToInt32Decimal( bin ) { - var r = 0; - var sign; - - if ( Number(bin.charAt(0)) == 0 ) { - sign = 1; - r = 0; - } else { - sign = -1; - r = -(Math.pow(2,31)); - } - - for ( var j = 0; j < 31; j++ ) { - r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); - } - - return r; -} -function ToUint32Decimal( bin ) { - var r = 0; - - - for ( l = bin.length; l < 32; l++ ) { - bin = "0" + bin; - } - - for ( j = 0; j < 31; j++ ) { - r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); - - } - - return r; -} -function LeftShift( s, a ) { - var shift = ToInt32( s ); - var add = ToUint32( a ); - add = Mask( add, 5 ); - var exp = LShift( shift, add ); - - return ( exp ); -} -function LShift( s, a ) { - s = ToInt32BitString( s ); - - for ( var z = 0; z < a; z++ ) { - s += "0"; - } - - s = s.substring( a, s.length); - - return ToInt32(ToInt32Decimal(s)); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.7.2.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.7.2.js deleted file mode 100644 index 843388767f..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.7.2.js +++ /dev/null @@ -1,246 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.7.2.js'; - -/** - File Name: 11.7.2.js - ECMA Section: 11.7.2 The signed right shift operator ( >> ) - Description: - Performs a sign-filling bitwise right shift operation on the left argument - by the amount specified by the right argument. - - The production ShiftExpression : ShiftExpression >> AdditiveExpression is - evaluated as follows: - - 1. Evaluate ShiftExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate AdditiveExpression. - 4. Call GetValue(Result(3)). - 5. Call ToInt32(Result(2)). - 6. Call ToUint32(Result(4)). - 7. Mask out all but the least significant 5 bits of Result(6), that is, - compute Result(6) & 0x1F. - 8. Perform sign-extending right shift of Result(5) by Result(7) bits. The - most significant bit is propagated. The result is a signed 32 bit - integer. - 9. Return Result(8). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.7.2"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " The signed right shift operator ( >> )"); - -var power = 0; -var addexp = 0; - -for ( power = 0; power <= 32; power++ ) { - shiftexp = Math.pow( 2, power ); - - for ( addexp = 0; addexp <= 32; addexp++ ) { - new TestCase( SECTION, - shiftexp + " >> " + addexp, - SignedRightShift( shiftexp, addexp ), - shiftexp >> addexp ); - } -} - -for ( power = 0; power <= 32; power++ ) { - shiftexp = -Math.pow( 2, power ); - - for ( addexp = 0; addexp <= 32; addexp++ ) { - new TestCase( SECTION, - shiftexp + " >> " + addexp, - SignedRightShift( shiftexp, addexp ), - shiftexp >> addexp ); - } -} - -test(); - -function ToInteger( n ) { - n = Number( n ); - var sign = ( n < 0 ) ? -1 : 1; - - if ( n != n ) { - return 0; - } - if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY ) { - return n; - } - return ( sign * Math.floor(Math.abs(n)) ); -} -function ToInt32( 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) )) % Math.pow(2,32); - n = ( n >= Math.pow(2,31) ) ? n - Math.pow(2,32) : n; - - return ( n ); -} -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 ); -} -function ToUint16( 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) ) ) % Math.pow(2,16); - - if (n <0) { - n += Math.pow(2,16); - } - - return ( n ); -} -function Mask( b, n ) { - b = ToUint32BitString( b ); - b = b.substring( b.length - n ); - b = ToUint32Decimal( b ); - return ( b ); -} -function ToUint32BitString( n ) { - var b = ""; - for ( p = 31; p >=0; p-- ) { - if ( n >= Math.pow(2,p) ) { - b += "1"; - n -= Math.pow(2,p); - } else { - b += "0"; - } - } - return b; -} -function ToInt32BitString( n ) { - var b = ""; - var sign = ( n < 0 ) ? -1 : 1; - - b += ( sign == 1 ) ? "0" : "1"; - - for ( p = 30; p >=0; p-- ) { - if ( (sign == 1 ) ? sign * n >= Math.pow(2,p) : sign * n > Math.pow(2,p) ) { - b += ( sign == 1 ) ? "1" : "0"; - n -= sign * Math.pow( 2, p ); - } else { - b += ( sign == 1 ) ? "0" : "1"; - } - } - - return b; -} -function ToInt32Decimal( bin ) { - var r = 0; - var sign; - - if ( Number(bin.charAt(0)) == 0 ) { - sign = 1; - r = 0; - } else { - sign = -1; - r = -(Math.pow(2,31)); - } - - for ( var j = 0; j < 31; j++ ) { - r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); - } - - return r; -} -function ToUint32Decimal( bin ) { - var r = 0; - - for ( l = bin.length; l < 32; l++ ) { - bin = "0" + bin; - } - - for ( j = 0; j < 31; j++ ) { - r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); - } - - return r; -} -function SignedRightShift( s, a ) { - s = ToInt32( s ); - a = ToUint32( a ); - a = Mask( a, 5 ); - return ( SignedRShift( s, a ) ); -} -function SignedRShift( s, a ) { - s = ToInt32BitString( s ); - - var firstbit = s.substring(0,1); - - s = s.substring( 1, s.length ); - - for ( var z = 0; z < a; z++ ) { - s = firstbit + s; - } - - s = s.substring( 0, s.length - a); - - s = firstbit +s; - - - return ToInt32(ToInt32Decimal(s)); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.7.3.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.7.3.js deleted file mode 100644 index 27d24e121a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.7.3.js +++ /dev/null @@ -1,230 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.7.3.js'; - -/** - File Name: 11.7.3.js - ECMA Section: 11.7.3 The unsigned right shift operator ( >>> ) - Description: - 11.7.3 The unsigned right shift operator ( >>> ) - Performs a zero-filling bitwise right shift operation on the left argument - by the amount specified by the right argument. - - The production ShiftExpression : ShiftExpression >>> AdditiveExpression is - evaluated as follows: - - 1. Evaluate ShiftExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate AdditiveExpression. - 4. Call GetValue(Result(3)). - 5. Call ToUint32(Result(2)). - 6. Call ToUint32(Result(4)). - 7. Mask out all but the least significant 5 bits of Result(6), that is, - compute Result(6) & 0x1F. - 8. Perform zero-filling right shift of Result(5) by Result(7) bits. - Vacated bits are filled with zero. The result is an unsigned 32 bit - integer. - 9. Return Result(8). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.7.3"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " The unsigned right shift operator ( >>> )"); - -var addexp = 0; -var power = 0; - -for ( power = 0; power <= 32; power++ ) { - shiftexp = Math.pow( 2, power ); - - for ( addexp = 0; addexp <= 32; addexp++ ) { - new TestCase( SECTION, - shiftexp + " >>> " + addexp, - UnsignedRightShift( shiftexp, addexp ), - shiftexp >>> addexp ); - } -} - -test(); - - -function ToInteger( n ) { - n = Number( n ); - var sign = ( n < 0 ) ? -1 : 1; - - if ( n != n ) { - return 0; - } - if ( Math.abs( n ) == 0 || Math.abs( n ) == Number.POSITIVE_INFINITY ) { - return n; - } - return ( sign * Math.floor(Math.abs(n)) ); -} -function ToInt32( 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) )) % Math.pow(2,32); - n = ( n >= Math.pow(2,31) ) ? n - Math.pow(2,32) : n; - - return ( n ); -} -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 ); -} -function ToUint16( 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) ) ) % Math.pow(2,16); - - if (n <0) { - n += Math.pow(2,16); - } - - return ( n ); -} -function Mask( b, n ) { - b = ToUint32BitString( b ); - b = b.substring( b.length - n ); - b = ToUint32Decimal( b ); - return ( b ); -} -function ToUint32BitString( n ) { - var b = ""; - for ( p = 31; p >=0; p-- ) { - if ( n >= Math.pow(2,p) ) { - b += "1"; - n -= Math.pow(2,p); - } else { - b += "0"; - } - } - return b; -} -function ToInt32BitString( n ) { - var b = ""; - var sign = ( n < 0 ) ? -1 : 1; - - b += ( sign == 1 ) ? "0" : "1"; - - for ( p = 30; p >=0; p-- ) { - if ( (sign == 1 ) ? sign * n >= Math.pow(2,p) : sign * n > Math.pow(2,p) ) { - b += ( sign == 1 ) ? "1" : "0"; - n -= sign * Math.pow( 2, p ); - } else { - b += ( sign == 1 ) ? "0" : "1"; - } - } - - return b; -} -function ToInt32Decimal( bin ) { - var r = 0; - var sign; - - if ( Number(bin.charAt(0)) == 0 ) { - sign = 1; - r = 0; - } else { - sign = -1; - r = -(Math.pow(2,31)); - } - - for ( var j = 0; j < 31; j++ ) { - r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); - } - - return r; -} -function ToUint32Decimal( bin ) { - var r = 0; - - - for ( l = bin.length; l < 32; l++ ) { - bin = "0" + bin; - } - - for ( j = 0; j < 32; j++ ) { - r += Math.pow( 2, j ) * Number(bin.charAt(31-j)); - - } - - return r; -} -function RShift( s, a ) { - s = ToUint32BitString( s ); - for ( z = 0; z < a; z++ ) { - s = "0" + s; - } - s = s.substring( 0, s.length - a ); - - return ToUint32Decimal(s); -} -function UnsignedRightShift( s, a ) { - s = ToUint32( s ); - a = ToUint32( a ); - a = Mask( a, 5 ); - return ( RShift( s, a ) ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.8.1.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.8.1.js deleted file mode 100644 index 4b35c11b16..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.8.1.js +++ /dev/null @@ -1,121 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.8.1.js'; - -/** - File Name: 11.8.1.js - ECMA Section: 11.8.1 The less-than operator ( < ) - Description: - - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.8.1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " The less-than operator ( < )"); - -new TestCase( SECTION, "true < false", false, true < false ); -new TestCase( SECTION, "false < true", true, false < true ); -new TestCase( SECTION, "false < false", false, false < false ); -new TestCase( SECTION, "true < true", false, true < true ); - -new TestCase( SECTION, "new Boolean(true) < new Boolean(true)", false, new Boolean(true) < new Boolean(true) ); -new TestCase( SECTION, "new Boolean(true) < new Boolean(false)", false, new Boolean(true) < new Boolean(false) ); -new TestCase( SECTION, "new Boolean(false) < new Boolean(true)", true, new Boolean(false) < new Boolean(true) ); -new TestCase( SECTION, "new Boolean(false) < new Boolean(false)", false, new Boolean(false) < new Boolean(false) ); - -new TestCase( SECTION, "new MyObject(Infinity) < new MyObject(Infinity)", false, new MyObject( Number.POSITIVE_INFINITY ) < new MyObject( Number.POSITIVE_INFINITY) ); -new TestCase( SECTION, "new MyObject(-Infinity) < new MyObject(Infinity)", true, new MyObject( Number.NEGATIVE_INFINITY ) < new MyObject( Number.POSITIVE_INFINITY) ); -new TestCase( SECTION, "new MyObject(-Infinity) < new MyObject(-Infinity)", false, new MyObject( Number.NEGATIVE_INFINITY ) < new MyObject( Number.NEGATIVE_INFINITY) ); - -new TestCase( SECTION, "new MyValueObject(false) < new MyValueObject(true)", true, new MyValueObject(false) < new MyValueObject(true) ); -new TestCase( SECTION, "new MyValueObject(true) < new MyValueObject(true)", false, new MyValueObject(true) < new MyValueObject(true) ); -new TestCase( SECTION, "new MyValueObject(false) < new MyValueObject(false)", false, new MyValueObject(false) < new MyValueObject(false) ); - -new TestCase( SECTION, "new MyStringObject(false) < new MyStringObject(true)", true, new MyStringObject(false) < new MyStringObject(true) ); -new TestCase( SECTION, "new MyStringObject(true) < new MyStringObject(true)", false, new MyStringObject(true) < new MyStringObject(true) ); -new TestCase( SECTION, "new MyStringObject(false) < new MyStringObject(false)", false, new MyStringObject(false) < new MyStringObject(false) ); - -new TestCase( SECTION, "Number.NaN < Number.NaN", false, Number.NaN < Number.NaN ); -new TestCase( SECTION, "0 < Number.NaN", false, 0 < Number.NaN ); -new TestCase( SECTION, "Number.NaN < 0", false, Number.NaN < 0 ); - -new TestCase( SECTION, "0 < -0", false, 0 < -0 ); -new TestCase( SECTION, "-0 < 0", false, -0 < 0 ); - -new TestCase( SECTION, "Infinity < 0", false, Number.POSITIVE_INFINITY < 0 ); -new TestCase( SECTION, "Infinity < Number.MAX_VALUE", false, Number.POSITIVE_INFINITY < Number.MAX_VALUE ); -new TestCase( SECTION, "Infinity < Infinity", false, Number.POSITIVE_INFINITY < Number.POSITIVE_INFINITY ); - -new TestCase( SECTION, "0 < Infinity", true, 0 < Number.POSITIVE_INFINITY ); -new TestCase( SECTION, "Number.MAX_VALUE < Infinity", true, Number.MAX_VALUE < Number.POSITIVE_INFINITY ); - -new TestCase( SECTION, "0 < -Infinity", false, 0 < Number.NEGATIVE_INFINITY ); -new TestCase( SECTION, "Number.MAX_VALUE < -Infinity", false, Number.MAX_VALUE < Number.NEGATIVE_INFINITY ); -new TestCase( SECTION, "-Infinity < -Infinity", false, Number.NEGATIVE_INFINITY < Number.NEGATIVE_INFINITY ); - -new TestCase( SECTION, "-Infinity < 0", true, Number.NEGATIVE_INFINITY < 0 ); -new TestCase( SECTION, "-Infinity < -Number.MAX_VALUE", true, Number.NEGATIVE_INFINITY < -Number.MAX_VALUE ); -new TestCase( SECTION, "-Infinity < Number.MIN_VALUE", true, Number.NEGATIVE_INFINITY < Number.MIN_VALUE ); - -new TestCase( SECTION, "'string' < 'string'", false, 'string' < 'string' ); -new TestCase( SECTION, "'astring' < 'string'", true, 'astring' < 'string' ); -new TestCase( SECTION, "'strings' < 'stringy'", true, 'strings' < 'stringy' ); -new TestCase( SECTION, "'strings' < 'stringier'", false, 'strings' < 'stringier' ); -new TestCase( SECTION, "'string' < 'astring'", false, 'string' < 'astring' ); -new TestCase( SECTION, "'string' < 'strings'", true, 'string' < 'strings' ); - -test(); - -function MyObject(value) { - this.value = value; - this.valueOf = new Function( "return this.value" ); - this.toString = new Function( "return this.value +''" ); -} -function MyValueObject(value) { - this.value = value; - this.valueOf = new Function( "return this.value" ); -} -function MyStringObject(value) { - this.value = value; - this.toString = new Function( "return this.value +''" ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.8.2.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.8.2.js deleted file mode 100644 index c4e6f4cfbd..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.8.2.js +++ /dev/null @@ -1,121 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.8.2.js'; - -/** - File Name: 11.8.2.js - ECMA Section: 11.8.2 The greater-than operator ( > ) - Description: - - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.8.2"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " The greater-than operator ( > )"); - -new TestCase( SECTION, "true > false", true, true > false ); -new TestCase( SECTION, "false > true", false, false > true ); -new TestCase( SECTION, "false > false", false, false > false ); -new TestCase( SECTION, "true > true", false, true > true ); - -new TestCase( SECTION, "new Boolean(true) > new Boolean(true)", false, new Boolean(true) > new Boolean(true) ); -new TestCase( SECTION, "new Boolean(true) > new Boolean(false)", true, new Boolean(true) > new Boolean(false) ); -new TestCase( SECTION, "new Boolean(false) > new Boolean(true)", false, new Boolean(false) > new Boolean(true) ); -new TestCase( SECTION, "new Boolean(false) > new Boolean(false)", false, new Boolean(false) > new Boolean(false) ); - -new TestCase( SECTION, "new MyObject(Infinity) > new MyObject(Infinity)", false, new MyObject( Number.POSITIVE_INFINITY ) > new MyObject( Number.POSITIVE_INFINITY) ); -new TestCase( SECTION, "new MyObject(-Infinity) > new MyObject(Infinity)", false, new MyObject( Number.NEGATIVE_INFINITY ) > new MyObject( Number.POSITIVE_INFINITY) ); -new TestCase( SECTION, "new MyObject(-Infinity) > new MyObject(-Infinity)", false, new MyObject( Number.NEGATIVE_INFINITY ) > new MyObject( Number.NEGATIVE_INFINITY) ); - -new TestCase( SECTION, "new MyValueObject(false) > new MyValueObject(true)", false, new MyValueObject(false) > new MyValueObject(true) ); -new TestCase( SECTION, "new MyValueObject(true) > new MyValueObject(true)", false, new MyValueObject(true) > new MyValueObject(true) ); -new TestCase( SECTION, "new MyValueObject(false) > new MyValueObject(false)", false, new MyValueObject(false) > new MyValueObject(false) ); - -new TestCase( SECTION, "new MyStringObject(false) > new MyStringObject(true)", false, new MyStringObject(false) > new MyStringObject(true) ); -new TestCase( SECTION, "new MyStringObject(true) > new MyStringObject(true)", false, new MyStringObject(true) > new MyStringObject(true) ); -new TestCase( SECTION, "new MyStringObject(false) > new MyStringObject(false)", false, new MyStringObject(false) > new MyStringObject(false) ); - -new TestCase( SECTION, "Number.NaN > Number.NaN", false, Number.NaN > Number.NaN ); -new TestCase( SECTION, "0 > Number.NaN", false, 0 > Number.NaN ); -new TestCase( SECTION, "Number.NaN > 0", false, Number.NaN > 0 ); - -new TestCase( SECTION, "0 > -0", false, 0 > -0 ); -new TestCase( SECTION, "-0 > 0", false, -0 > 0 ); - -new TestCase( SECTION, "Infinity > 0", true, Number.POSITIVE_INFINITY > 0 ); -new TestCase( SECTION, "Infinity > Number.MAX_VALUE", true, Number.POSITIVE_INFINITY > Number.MAX_VALUE ); -new TestCase( SECTION, "Infinity > Infinity", false, Number.POSITIVE_INFINITY > Number.POSITIVE_INFINITY ); - -new TestCase( SECTION, "0 > Infinity", false, 0 > Number.POSITIVE_INFINITY ); -new TestCase( SECTION, "Number.MAX_VALUE > Infinity", false, Number.MAX_VALUE > Number.POSITIVE_INFINITY ); - -new TestCase( SECTION, "0 > -Infinity", true, 0 > Number.NEGATIVE_INFINITY ); -new TestCase( SECTION, "Number.MAX_VALUE > -Infinity", true, Number.MAX_VALUE > Number.NEGATIVE_INFINITY ); -new TestCase( SECTION, "-Infinity > -Infinity", false, Number.NEGATIVE_INFINITY > Number.NEGATIVE_INFINITY ); - -new TestCase( SECTION, "-Infinity > 0", false, Number.NEGATIVE_INFINITY > 0 ); -new TestCase( SECTION, "-Infinity > -Number.MAX_VALUE", false, Number.NEGATIVE_INFINITY > -Number.MAX_VALUE ); -new TestCase( SECTION, "-Infinity > Number.MIN_VALUE", false, Number.NEGATIVE_INFINITY > Number.MIN_VALUE ); - -new TestCase( SECTION, "'string' > 'string'", false, 'string' > 'string' ); -new TestCase( SECTION, "'astring' > 'string'", false, 'astring' > 'string' ); -new TestCase( SECTION, "'strings' > 'stringy'", false, 'strings' > 'stringy' ); -new TestCase( SECTION, "'strings' > 'stringier'", true, 'strings' > 'stringier' ); -new TestCase( SECTION, "'string' > 'astring'", true, 'string' > 'astring' ); -new TestCase( SECTION, "'string' > 'strings'", false, 'string' > 'strings' ); - -test(); - -function MyObject(value) { - this.value = value; - this.valueOf = new Function( "return this.value" ); - this.toString = new Function( "return this.value +''" ); -} -function MyValueObject(value) { - this.value = value; - this.valueOf = new Function( "return this.value" ); -} -function MyStringObject(value) { - this.value = value; - this.toString = new Function( "return this.value +''" ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.8.3.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.8.3.js deleted file mode 100644 index 2180fc5655..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.8.3.js +++ /dev/null @@ -1,120 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.8.3.js'; - -/** - File Name: 11.8.3.js - ECMA Section: 11.8.3 The less-than-or-equal operator ( <= ) - Description: - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.8.1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " The less-than-or-equal operator ( <= )"); - -new TestCase( SECTION, "true <= false", false, true <= false ); -new TestCase( SECTION, "false <= true", true, false <= true ); -new TestCase( SECTION, "false <= false", true, false <= false ); -new TestCase( SECTION, "true <= true", true, true <= true ); - -new TestCase( SECTION, "new Boolean(true) <= new Boolean(true)", true, new Boolean(true) <= new Boolean(true) ); -new TestCase( SECTION, "new Boolean(true) <= new Boolean(false)", false, new Boolean(true) <= new Boolean(false) ); -new TestCase( SECTION, "new Boolean(false) <= new Boolean(true)", true, new Boolean(false) <= new Boolean(true) ); -new TestCase( SECTION, "new Boolean(false) <= new Boolean(false)", true, new Boolean(false) <= new Boolean(false) ); - -new TestCase( SECTION, "new MyObject(Infinity) <= new MyObject(Infinity)", true, new MyObject( Number.POSITIVE_INFINITY ) <= new MyObject( Number.POSITIVE_INFINITY) ); -new TestCase( SECTION, "new MyObject(-Infinity) <= new MyObject(Infinity)", true, new MyObject( Number.NEGATIVE_INFINITY ) <= new MyObject( Number.POSITIVE_INFINITY) ); -new TestCase( SECTION, "new MyObject(-Infinity) <= new MyObject(-Infinity)", true, new MyObject( Number.NEGATIVE_INFINITY ) <= new MyObject( Number.NEGATIVE_INFINITY) ); - -new TestCase( SECTION, "new MyValueObject(false) <= new MyValueObject(true)", true, new MyValueObject(false) <= new MyValueObject(true) ); -new TestCase( SECTION, "new MyValueObject(true) <= new MyValueObject(true)", true, new MyValueObject(true) <= new MyValueObject(true) ); -new TestCase( SECTION, "new MyValueObject(false) <= new MyValueObject(false)", true, new MyValueObject(false) <= new MyValueObject(false) ); - -new TestCase( SECTION, "new MyStringObject(false) <= new MyStringObject(true)", true, new MyStringObject(false) <= new MyStringObject(true) ); -new TestCase( SECTION, "new MyStringObject(true) <= new MyStringObject(true)", true, new MyStringObject(true) <= new MyStringObject(true) ); -new TestCase( SECTION, "new MyStringObject(false) <= new MyStringObject(false)", true, new MyStringObject(false) <= new MyStringObject(false) ); - -new TestCase( SECTION, "Number.NaN <= Number.NaN", false, Number.NaN <= Number.NaN ); -new TestCase( SECTION, "0 <= Number.NaN", false, 0 <= Number.NaN ); -new TestCase( SECTION, "Number.NaN <= 0", false, Number.NaN <= 0 ); - -new TestCase( SECTION, "0 <= -0", true, 0 <= -0 ); -new TestCase( SECTION, "-0 <= 0", true, -0 <= 0 ); - -new TestCase( SECTION, "Infinity <= 0", false, Number.POSITIVE_INFINITY <= 0 ); -new TestCase( SECTION, "Infinity <= Number.MAX_VALUE", false, Number.POSITIVE_INFINITY <= Number.MAX_VALUE ); -new TestCase( SECTION, "Infinity <= Infinity", true, Number.POSITIVE_INFINITY <= Number.POSITIVE_INFINITY ); - -new TestCase( SECTION, "0 <= Infinity", true, 0 <= Number.POSITIVE_INFINITY ); -new TestCase( SECTION, "Number.MAX_VALUE <= Infinity", true, Number.MAX_VALUE <= Number.POSITIVE_INFINITY ); - -new TestCase( SECTION, "0 <= -Infinity", false, 0 <= Number.NEGATIVE_INFINITY ); -new TestCase( SECTION, "Number.MAX_VALUE <= -Infinity", false, Number.MAX_VALUE <= Number.NEGATIVE_INFINITY ); -new TestCase( SECTION, "-Infinity <= -Infinity", true, Number.NEGATIVE_INFINITY <= Number.NEGATIVE_INFINITY ); - -new TestCase( SECTION, "-Infinity <= 0", true, Number.NEGATIVE_INFINITY <= 0 ); -new TestCase( SECTION, "-Infinity <= -Number.MAX_VALUE", true, Number.NEGATIVE_INFINITY <= -Number.MAX_VALUE ); -new TestCase( SECTION, "-Infinity <= Number.MIN_VALUE", true, Number.NEGATIVE_INFINITY <= Number.MIN_VALUE ); - -new TestCase( SECTION, "'string' <= 'string'", true, 'string' <= 'string' ); -new TestCase( SECTION, "'astring' <= 'string'", true, 'astring' <= 'string' ); -new TestCase( SECTION, "'strings' <= 'stringy'", true, 'strings' <= 'stringy' ); -new TestCase( SECTION, "'strings' <= 'stringier'", false, 'strings' <= 'stringier' ); -new TestCase( SECTION, "'string' <= 'astring'", false, 'string' <= 'astring' ); -new TestCase( SECTION, "'string' <= 'strings'", true, 'string' <= 'strings' ); - -test(); - -function MyObject(value) { - this.value = value; - this.valueOf = new Function( "return this.value" ); - this.toString = new Function( "return this.value +''" ); -} -function MyValueObject(value) { - this.value = value; - this.valueOf = new Function( "return this.value" ); -} -function MyStringObject(value) { - this.value = value; - this.toString = new Function( "return this.value +''" ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.8.4.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.8.4.js deleted file mode 100644 index d43aaa260d..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.8.4.js +++ /dev/null @@ -1,121 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.8.4.js'; - -/** - File Name: 11.8.4.js - ECMA Section: 11.8.4 The greater-than-or-equal operator ( >= ) - Description: - - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.8.4"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " The greater-than-or-equal operator ( >= )"); - -new TestCase( SECTION, "true >= false", true, true >= false ); -new TestCase( SECTION, "false >= true", false, false >= true ); -new TestCase( SECTION, "false >= false", true, false >= false ); -new TestCase( SECTION, "true >= true", true, true >= true ); - -new TestCase( SECTION, "new Boolean(true) >= new Boolean(true)", true, new Boolean(true) >= new Boolean(true) ); -new TestCase( SECTION, "new Boolean(true) >= new Boolean(false)", true, new Boolean(true) >= new Boolean(false) ); -new TestCase( SECTION, "new Boolean(false) >= new Boolean(true)", false, new Boolean(false) >= new Boolean(true) ); -new TestCase( SECTION, "new Boolean(false) >= new Boolean(false)", true, new Boolean(false) >= new Boolean(false) ); - -new TestCase( SECTION, "new MyObject(Infinity) >= new MyObject(Infinity)", true, new MyObject( Number.POSITIVE_INFINITY ) >= new MyObject( Number.POSITIVE_INFINITY) ); -new TestCase( SECTION, "new MyObject(-Infinity) >= new MyObject(Infinity)", false, new MyObject( Number.NEGATIVE_INFINITY ) >= new MyObject( Number.POSITIVE_INFINITY) ); -new TestCase( SECTION, "new MyObject(-Infinity) >= new MyObject(-Infinity)", true, new MyObject( Number.NEGATIVE_INFINITY ) >= new MyObject( Number.NEGATIVE_INFINITY) ); - -new TestCase( SECTION, "new MyValueObject(false) >= new MyValueObject(true)", false, new MyValueObject(false) >= new MyValueObject(true) ); -new TestCase( SECTION, "new MyValueObject(true) >= new MyValueObject(true)", true, new MyValueObject(true) >= new MyValueObject(true) ); -new TestCase( SECTION, "new MyValueObject(false) >= new MyValueObject(false)", true, new MyValueObject(false) >= new MyValueObject(false) ); - -new TestCase( SECTION, "new MyStringObject(false) >= new MyStringObject(true)", false, new MyStringObject(false) >= new MyStringObject(true) ); -new TestCase( SECTION, "new MyStringObject(true) >= new MyStringObject(true)", true, new MyStringObject(true) >= new MyStringObject(true) ); -new TestCase( SECTION, "new MyStringObject(false) >= new MyStringObject(false)", true, new MyStringObject(false) >= new MyStringObject(false) ); - -new TestCase( SECTION, "Number.NaN >= Number.NaN", false, Number.NaN >= Number.NaN ); -new TestCase( SECTION, "0 >= Number.NaN", false, 0 >= Number.NaN ); -new TestCase( SECTION, "Number.NaN >= 0", false, Number.NaN >= 0 ); - -new TestCase( SECTION, "0 >= -0", true, 0 >= -0 ); -new TestCase( SECTION, "-0 >= 0", true, -0 >= 0 ); - -new TestCase( SECTION, "Infinity >= 0", true, Number.POSITIVE_INFINITY >= 0 ); -new TestCase( SECTION, "Infinity >= Number.MAX_VALUE", true, Number.POSITIVE_INFINITY >= Number.MAX_VALUE ); -new TestCase( SECTION, "Infinity >= Infinity", true, Number.POSITIVE_INFINITY >= Number.POSITIVE_INFINITY ); - -new TestCase( SECTION, "0 >= Infinity", false, 0 >= Number.POSITIVE_INFINITY ); -new TestCase( SECTION, "Number.MAX_VALUE >= Infinity", false, Number.MAX_VALUE >= Number.POSITIVE_INFINITY ); - -new TestCase( SECTION, "0 >= -Infinity", true, 0 >= Number.NEGATIVE_INFINITY ); -new TestCase( SECTION, "Number.MAX_VALUE >= -Infinity", true, Number.MAX_VALUE >= Number.NEGATIVE_INFINITY ); -new TestCase( SECTION, "-Infinity >= -Infinity", true, Number.NEGATIVE_INFINITY >= Number.NEGATIVE_INFINITY ); - -new TestCase( SECTION, "-Infinity >= 0", false, Number.NEGATIVE_INFINITY >= 0 ); -new TestCase( SECTION, "-Infinity >= -Number.MAX_VALUE", false, Number.NEGATIVE_INFINITY >= -Number.MAX_VALUE ); -new TestCase( SECTION, "-Infinity >= Number.MIN_VALUE", false, Number.NEGATIVE_INFINITY >= Number.MIN_VALUE ); - -new TestCase( SECTION, "'string' > 'string'", false, 'string' > 'string' ); -new TestCase( SECTION, "'astring' > 'string'", false, 'astring' > 'string' ); -new TestCase( SECTION, "'strings' > 'stringy'", false, 'strings' > 'stringy' ); -new TestCase( SECTION, "'strings' > 'stringier'", true, 'strings' > 'stringier' ); -new TestCase( SECTION, "'string' > 'astring'", true, 'string' > 'astring' ); -new TestCase( SECTION, "'string' > 'strings'", false, 'string' > 'strings' ); - -test(); - -function MyObject(value) { - this.value = value; - this.valueOf = new Function( "return this.value" ); - this.toString = new Function( "return this.value +''" ); -} -function MyValueObject(value) { - this.value = value; - this.valueOf = new Function( "return this.value" ); -} -function MyStringObject(value) { - this.value = value; - this.toString = new Function( "return this.value +''" ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.9.1.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.9.1.js deleted file mode 100644 index 6bf3fc0517..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.9.1.js +++ /dev/null @@ -1,159 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.9.1.js'; - -/** - File Name: 11.9.1.js - ECMA Section: 11.9.1 The equals operator ( == ) - Description: - - The production EqualityExpression: - EqualityExpression == RelationalExpression is evaluated as follows: - - 1. Evaluate EqualityExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate RelationalExpression. - 4. Call GetValue(Result(3)). - 5. Perform the comparison Result(4) == Result(2). (See section 11.9.3) - 6. Return Result(5). - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.9.1"; -var VERSION = "ECMA_1"; -var BUGNUMBER="77391"; -startTest(); - -writeHeaderToLog( SECTION + " The equals operator ( == )"); - -// type x and type y are the same. if type x is undefined or null, return true - -new TestCase( SECTION, "void 0 = void 0", true, void 0 == void 0 ); -new TestCase( SECTION, "null == null", true, null == null ); - -// if x is NaN, return false. if y is NaN, return false. - -new TestCase( SECTION, "NaN == NaN", false, Number.NaN == Number.NaN ); -new TestCase( SECTION, "NaN == 0", false, Number.NaN == 0 ); -new TestCase( SECTION, "0 == NaN", false, 0 == Number.NaN ); -new TestCase( SECTION, "NaN == Infinity", false, Number.NaN == Number.POSITIVE_INFINITY ); -new TestCase( SECTION, "Infinity == NaN", false, Number.POSITIVE_INFINITY == Number.NaN ); - -// if x is the same number value as y, return true. - -new TestCase( SECTION, "Number.MAX_VALUE == Number.MAX_VALUE", true, Number.MAX_VALUE == Number.MAX_VALUE ); -new TestCase( SECTION, "Number.MIN_VALUE == Number.MIN_VALUE", true, Number.MIN_VALUE == Number.MIN_VALUE ); -new TestCase( SECTION, "Number.POSITIVE_INFINITY == Number.POSITIVE_INFINITY", true, Number.POSITIVE_INFINITY == Number.POSITIVE_INFINITY ); -new TestCase( SECTION, "Number.NEGATIVE_INFINITY == Number.NEGATIVE_INFINITY", true, Number.NEGATIVE_INFINITY == Number.NEGATIVE_INFINITY ); - -// if xis 0 and y is -0, return true. if x is -0 and y is 0, return true. - -new TestCase( SECTION, "0 == 0", true, 0 == 0 ); -new TestCase( SECTION, "0 == -0", true, 0 == -0 ); -new TestCase( SECTION, "-0 == 0", true, -0 == 0 ); -new TestCase( SECTION, "-0 == -0", true, -0 == -0 ); - -// return false. - -new TestCase( SECTION, "0.9 == 1", false, 0.9 == 1 ); -new TestCase( SECTION, "0.999999 == 1", false, 0.999999 == 1 ); -new TestCase( SECTION, "0.9999999999 == 1", false, 0.9999999999 == 1 ); -new TestCase( SECTION, "0.9999999999999 == 1", false, 0.9999999999999 == 1 ); - -// type x and type y are the same type, but not numbers. - - -// x and y are strings. return true if x and y are exactly the same sequence of characters. -// otherwise, return false. - -new TestCase( SECTION, "'hello' == 'hello'", true, "hello" == "hello" ); - -// x and y are booleans. return true if both are true or both are false. - -new TestCase( SECTION, "true == true", true, true == true ); -new TestCase( SECTION, "false == false", true, false == false ); -new TestCase( SECTION, "true == false", false, true == false ); -new TestCase( SECTION, "false == true", false, false == true ); - -// return true if x and y refer to the same object. otherwise return false. - -new TestCase( SECTION, "new MyObject(true) == new MyObject(true)", false, new MyObject(true) == new MyObject(true) ); -new TestCase( SECTION, "new Boolean(true) == new Boolean(true)", false, new Boolean(true) == new Boolean(true) ); -new TestCase( SECTION, "new Boolean(false) == new Boolean(false)", false, new Boolean(false) == new Boolean(false) ); - - -new TestCase( SECTION, "x = new MyObject(true); y = x; z = x; z == y", true, eval("x = new MyObject(true); y = x; z = x; z == y") ); -new TestCase( SECTION, "x = new MyObject(false); y = x; z = x; z == y", true, eval("x = new MyObject(false); y = x; z = x; z == y") ); -new TestCase( SECTION, "x = new Boolean(true); y = x; z = x; z == y", true, eval("x = new Boolean(true); y = x; z = x; z == y") ); -new TestCase( SECTION, "x = new Boolean(false); y = x; z = x; z == y", true, eval("x = new Boolean(false); y = x; z = x; z == y") ); - -new TestCase( SECTION, "new Boolean(true) == new Boolean(true)", false, new Boolean(true) == new Boolean(true) ); -new TestCase( SECTION, "new Boolean(false) == new Boolean(false)", false, new Boolean(false) == new Boolean(false) ); - -// if x is null and y is undefined, return true. if x is undefined and y is null return true. - -new TestCase( SECTION, "null == void 0", true, null == void 0 ); -new TestCase( SECTION, "void 0 == null", true, void 0 == null ); - -// if type(x) is Number and type(y) is string, return the result of the comparison x == ToNumber(y). - -new TestCase( SECTION, "1 == '1'", true, 1 == '1' ); -new TestCase( SECTION, "255 == '0xff'", true, 255 == '0xff' ); -new TestCase( SECTION, "0 == '\r'", true, 0 == "\r" ); -new TestCase( SECTION, "1e19 == '1e19'", true, 1e19 == "1e19" ); - - -new TestCase( SECTION, "new Boolean(true) == true", true, true == new Boolean(true) ); -new TestCase( SECTION, "new MyObject(true) == true", true, true == new MyObject(true) ); - -new TestCase( SECTION, "new Boolean(false) == false", true, new Boolean(false) == false ); -new TestCase( SECTION, "new MyObject(false) == false", true, new MyObject(false) == false ); - -new TestCase( SECTION, "true == new Boolean(true)", true, true == new Boolean(true) ); -new TestCase( SECTION, "true == new MyObject(true)", true, true == new MyObject(true) ); - -new TestCase( SECTION, "false == new Boolean(false)", true, false == new Boolean(false) ); -new TestCase( SECTION, "false == new MyObject(false)", true, false == new MyObject(false) ); - -test(); - -function MyObject( value ) { - this.value = value; - this.valueOf = new Function( "return this.value" ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.9.2.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.9.2.js deleted file mode 100644 index b6983e6af1..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.9.2.js +++ /dev/null @@ -1,159 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.9.2.js'; - -/** - File Name: 11.9.2.js - ECMA Section: 11.9.2 The equals operator ( == ) - Description: - - The production EqualityExpression: - EqualityExpression == RelationalExpression is evaluated as follows: - - 1. Evaluate EqualityExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate RelationalExpression. - 4. Call GetValue(Result(3)). - 5. Perform the comparison Result(4) == Result(2). (See section 11.9.3) - 6. Return Result(5). - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.9.2"; -var VERSION = "ECMA_1"; -var BUGNUMBER="77391"; -startTest(); - -writeHeaderToLog( SECTION + " The equals operator ( == )"); - -// type x and type y are the same. if type x is undefined or null, return true - -new TestCase( SECTION, "void 0 == void 0", false, void 0 != void 0 ); -new TestCase( SECTION, "null == null", false, null != null ); - -// if x is NaN, return false. if y is NaN, return false. - -new TestCase( SECTION, "NaN != NaN", true, Number.NaN != Number.NaN ); -new TestCase( SECTION, "NaN != 0", true, Number.NaN != 0 ); -new TestCase( SECTION, "0 != NaN", true, 0 != Number.NaN ); -new TestCase( SECTION, "NaN != Infinity", true, Number.NaN != Number.POSITIVE_INFINITY ); -new TestCase( SECTION, "Infinity != NaN", true, Number.POSITIVE_INFINITY != Number.NaN ); - -// if x is the same number value as y, return true. - -new TestCase( SECTION, "Number.MAX_VALUE != Number.MAX_VALUE", false, Number.MAX_VALUE != Number.MAX_VALUE ); -new TestCase( SECTION, "Number.MIN_VALUE != Number.MIN_VALUE", false, Number.MIN_VALUE != Number.MIN_VALUE ); -new TestCase( SECTION, "Number.POSITIVE_INFINITY != Number.POSITIVE_INFINITY", false, Number.POSITIVE_INFINITY != Number.POSITIVE_INFINITY ); -new TestCase( SECTION, "Number.NEGATIVE_INFINITY != Number.NEGATIVE_INFINITY", false, Number.NEGATIVE_INFINITY != Number.NEGATIVE_INFINITY ); - -// if xis 0 and y is -0, return true. if x is -0 and y is 0, return true. - -new TestCase( SECTION, "0 != 0", false, 0 != 0 ); -new TestCase( SECTION, "0 != -0", false, 0 != -0 ); -new TestCase( SECTION, "-0 != 0", false, -0 != 0 ); -new TestCase( SECTION, "-0 != -0", false, -0 != -0 ); - -// return false. - -new TestCase( SECTION, "0.9 != 1", true, 0.9 != 1 ); -new TestCase( SECTION, "0.999999 != 1", true, 0.999999 != 1 ); -new TestCase( SECTION, "0.9999999999 != 1", true, 0.9999999999 != 1 ); -new TestCase( SECTION, "0.9999999999999 != 1", true, 0.9999999999999 != 1 ); - -// type x and type y are the same type, but not numbers. - - -// x and y are strings. return true if x and y are exactly the same sequence of characters. -// otherwise, return false. - -new TestCase( SECTION, "'hello' != 'hello'", false, "hello" != "hello" ); - -// x and y are booleans. return true if both are true or both are false. - -new TestCase( SECTION, "true != true", false, true != true ); -new TestCase( SECTION, "false != false", false, false != false ); -new TestCase( SECTION, "true != false", true, true != false ); -new TestCase( SECTION, "false != true", true, false != true ); - -// return true if x and y refer to the same object. otherwise return false. - -new TestCase( SECTION, "new MyObject(true) != new MyObject(true)", true, new MyObject(true) != new MyObject(true) ); -new TestCase( SECTION, "new Boolean(true) != new Boolean(true)", true, new Boolean(true) != new Boolean(true) ); -new TestCase( SECTION, "new Boolean(false) != new Boolean(false)", true, new Boolean(false) != new Boolean(false) ); - - -new TestCase( SECTION, "x = new MyObject(true); y = x; z = x; z != y", false, eval("x = new MyObject(true); y = x; z = x; z != y") ); -new TestCase( SECTION, "x = new MyObject(false); y = x; z = x; z != y", false, eval("x = new MyObject(false); y = x; z = x; z != y") ); -new TestCase( SECTION, "x = new Boolean(true); y = x; z = x; z != y", false, eval("x = new Boolean(true); y = x; z = x; z != y") ); -new TestCase( SECTION, "x = new Boolean(false); y = x; z = x; z != y", false, eval("x = new Boolean(false); y = x; z = x; z != y") ); - -new TestCase( SECTION, "new Boolean(true) != new Boolean(true)", true, new Boolean(true) != new Boolean(true) ); -new TestCase( SECTION, "new Boolean(false) != new Boolean(false)", true, new Boolean(false) != new Boolean(false) ); - -// if x is null and y is undefined, return true. if x is undefined and y is null return true. - -new TestCase( SECTION, "null != void 0", false, null != void 0 ); -new TestCase( SECTION, "void 0 != null", false, void 0 != null ); - -// if type(x) is Number and type(y) is string, return the result of the comparison x != ToNumber(y). - -new TestCase( SECTION, "1 != '1'", false, 1 != '1' ); -new TestCase( SECTION, "255 != '0xff'", false, 255 != '0xff' ); -new TestCase( SECTION, "0 != '\r'", false, 0 != "\r" ); -new TestCase( SECTION, "1e19 != '1e19'", false, 1e19 != "1e19" ); - - -new TestCase( SECTION, "new Boolean(true) != true", false, true != new Boolean(true) ); -new TestCase( SECTION, "new MyObject(true) != true", false, true != new MyObject(true) ); - -new TestCase( SECTION, "new Boolean(false) != false", false, new Boolean(false) != false ); -new TestCase( SECTION, "new MyObject(false) != false", false, new MyObject(false) != false ); - -new TestCase( SECTION, "true != new Boolean(true)", false, true != new Boolean(true) ); -new TestCase( SECTION, "true != new MyObject(true)", false, true != new MyObject(true) ); - -new TestCase( SECTION, "false != new Boolean(false)", false, false != new Boolean(false) ); -new TestCase( SECTION, "false != new MyObject(false)", false, false != new MyObject(false) ); - -test(); - -function MyObject( value ) { - this.value = value; - this.valueOf = new Function( "return this.value" ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.9.3.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.9.3.js deleted file mode 100644 index cce1c63c16..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/11.9.3.js +++ /dev/null @@ -1,159 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.9.3.js'; - -/** - File Name: 11.9.3.js - ECMA Section: 11.9.3 The equals operator ( == ) - Description: - - The production EqualityExpression: - EqualityExpression == RelationalExpression is evaluated as follows: - - 1. Evaluate EqualityExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate RelationalExpression. - 4. Call GetValue(Result(3)). - 5. Perform the comparison Result(4) == Result(2). (See section 11.9.3) - 6. Return Result(5). - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.9.3"; -var VERSION = "ECMA_1"; -var BUGNUMBER="77391"; -startTest(); - -writeHeaderToLog( SECTION + " The equals operator ( == )"); - -// type x and type y are the same. if type x is undefined or null, return true - -new TestCase( SECTION, "void 0 = void 0", true, void 0 == void 0 ); -new TestCase( SECTION, "null == null", true, null == null ); - -// if x is NaN, return false. if y is NaN, return false. - -new TestCase( SECTION, "NaN == NaN", false, Number.NaN == Number.NaN ); -new TestCase( SECTION, "NaN == 0", false, Number.NaN == 0 ); -new TestCase( SECTION, "0 == NaN", false, 0 == Number.NaN ); -new TestCase( SECTION, "NaN == Infinity", false, Number.NaN == Number.POSITIVE_INFINITY ); -new TestCase( SECTION, "Infinity == NaN", false, Number.POSITIVE_INFINITY == Number.NaN ); - -// if x is the same number value as y, return true. - -new TestCase( SECTION, "Number.MAX_VALUE == Number.MAX_VALUE", true, Number.MAX_VALUE == Number.MAX_VALUE ); -new TestCase( SECTION, "Number.MIN_VALUE == Number.MIN_VALUE", true, Number.MIN_VALUE == Number.MIN_VALUE ); -new TestCase( SECTION, "Number.POSITIVE_INFINITY == Number.POSITIVE_INFINITY", true, Number.POSITIVE_INFINITY == Number.POSITIVE_INFINITY ); -new TestCase( SECTION, "Number.NEGATIVE_INFINITY == Number.NEGATIVE_INFINITY", true, Number.NEGATIVE_INFINITY == Number.NEGATIVE_INFINITY ); - -// if xis 0 and y is -0, return true. if x is -0 and y is 0, return true. - -new TestCase( SECTION, "0 == 0", true, 0 == 0 ); -new TestCase( SECTION, "0 == -0", true, 0 == -0 ); -new TestCase( SECTION, "-0 == 0", true, -0 == 0 ); -new TestCase( SECTION, "-0 == -0", true, -0 == -0 ); - -// return false. - -new TestCase( SECTION, "0.9 == 1", false, 0.9 == 1 ); -new TestCase( SECTION, "0.999999 == 1", false, 0.999999 == 1 ); -new TestCase( SECTION, "0.9999999999 == 1", false, 0.9999999999 == 1 ); -new TestCase( SECTION, "0.9999999999999 == 1", false, 0.9999999999999 == 1 ); - -// type x and type y are the same type, but not numbers. - - -// x and y are strings. return true if x and y are exactly the same sequence of characters. -// otherwise, return false. - -new TestCase( SECTION, "'hello' == 'hello'", true, "hello" == "hello" ); - -// x and y are booleans. return true if both are true or both are false. - -new TestCase( SECTION, "true == true", true, true == true ); -new TestCase( SECTION, "false == false", true, false == false ); -new TestCase( SECTION, "true == false", false, true == false ); -new TestCase( SECTION, "false == true", false, false == true ); - -// return true if x and y refer to the same object. otherwise return false. - -new TestCase( SECTION, "new MyObject(true) == new MyObject(true)", false, new MyObject(true) == new MyObject(true) ); -new TestCase( SECTION, "new Boolean(true) == new Boolean(true)", false, new Boolean(true) == new Boolean(true) ); -new TestCase( SECTION, "new Boolean(false) == new Boolean(false)", false, new Boolean(false) == new Boolean(false) ); - - -new TestCase( SECTION, "x = new MyObject(true); y = x; z = x; z == y", true, eval("x = new MyObject(true); y = x; z = x; z == y") ); -new TestCase( SECTION, "x = new MyObject(false); y = x; z = x; z == y", true, eval("x = new MyObject(false); y = x; z = x; z == y") ); -new TestCase( SECTION, "x = new Boolean(true); y = x; z = x; z == y", true, eval("x = new Boolean(true); y = x; z = x; z == y") ); -new TestCase( SECTION, "x = new Boolean(false); y = x; z = x; z == y", true, eval("x = new Boolean(false); y = x; z = x; z == y") ); - -new TestCase( SECTION, "new Boolean(true) == new Boolean(true)", false, new Boolean(true) == new Boolean(true) ); -new TestCase( SECTION, "new Boolean(false) == new Boolean(false)", false, new Boolean(false) == new Boolean(false) ); - -// if x is null and y is undefined, return true. if x is undefined and y is null return true. - -new TestCase( SECTION, "null == void 0", true, null == void 0 ); -new TestCase( SECTION, "void 0 == null", true, void 0 == null ); - -// if type(x) is Number and type(y) is string, return the result of the comparison x == ToNumber(y). - -new TestCase( SECTION, "1 == '1'", true, 1 == '1' ); -new TestCase( SECTION, "255 == '0xff'", true, 255 == '0xff' ); -new TestCase( SECTION, "0 == '\r'", true, 0 == "\r" ); -new TestCase( SECTION, "1e19 == '1e19'", true, 1e19 == "1e19" ); - - -new TestCase( SECTION, "new Boolean(true) == true", true, true == new Boolean(true) ); -new TestCase( SECTION, "new MyObject(true) == true", true, true == new MyObject(true) ); - -new TestCase( SECTION, "new Boolean(false) == false", true, new Boolean(false) == false ); -new TestCase( SECTION, "new MyObject(false) == false", true, new MyObject(false) == false ); - -new TestCase( SECTION, "true == new Boolean(true)", true, true == new Boolean(true) ); -new TestCase( SECTION, "true == new MyObject(true)", true, true == new MyObject(true) ); - -new TestCase( SECTION, "false == new Boolean(false)", true, false == new Boolean(false) ); -new TestCase( SECTION, "false == new MyObject(false)", true, false == new MyObject(false) ); - -test(); - -function MyObject( value ) { - this.value = value; - this.valueOf = new Function( "return this.value" ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/browser.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/browser.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/auto/declarative/parserstress/tests/ecma/Expressions/shell.js b/tests/auto/declarative/parserstress/tests/ecma/Expressions/shell.js deleted file mode 100644 index 8f5d1129d5..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Expressions/shell.js +++ /dev/null @@ -1 +0,0 @@ -gTestsubsuite = 'Expressions'; diff --git a/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.1.1-1.js b/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.1.1-1.js deleted file mode 100644 index 90f080acc9..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.1.1-1.js +++ /dev/null @@ -1,136 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.3.1.1-1.js'; - -/** - File Name: 15.3.1.1.js - ECMA Section: 15.3.1.1 The Function Constructor Called as a Function - - Description: - When the Function function is called with some arguments p1, p2, . . . , pn, body - (where n might be 0, that is, there are no "p" arguments, and where body might - also not be provided), the following steps are taken: - - 1. Create and return a new Function object exactly if the function constructor had - been called with the same arguments (15.3.2.1). - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ -var SECTION = "15.3.1.1-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The Function Constructor Called as a Function"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var MyObject = Function( "value", "this.value = value; this.valueOf = Function( 'return this.value' ); this.toString = Function( 'return String(this.value);' )" ); - - -var myfunc = Function(); -myfunc.toString = Object.prototype.toString; - -// not going to test toString here since it is implementation dependent. -// new TestCase( SECTION, "myfunc.toString()", "function anonymous() { }", myfunc.toString() ); - -myfunc.toString = Object.prototype.toString; -new TestCase( SECTION, - "myfunc = Function(); myfunc.toString = Object.prototype.toString; myfunc.toString()", - "[object Function]", - myfunc.toString() ); - -new TestCase( SECTION, - "myfunc.length", - 0, - myfunc.length ); - -new TestCase( SECTION, - "myfunc.prototype.toString()", - "[object Object]", - myfunc.prototype.toString() ); - -new TestCase( SECTION, - "myfunc.prototype.constructor", - myfunc, - myfunc.prototype.constructor ); - -new TestCase( SECTION, - "myfunc.arguments", - null, - myfunc.arguments ); - -new TestCase( SECTION, - "var OBJ = new MyObject(true); OBJ.valueOf()", - true, - eval("var OBJ = new MyObject(true); OBJ.valueOf()") ); - -new TestCase( SECTION, - "OBJ.toString()", - "true", - OBJ.toString() ); - -new TestCase( SECTION, - "OBJ.toString = Object.prototype.toString; OBJ.toString()", - "[object Object]", - eval("OBJ.toString = Object.prototype.toString; OBJ.toString()") ); - -new TestCase( SECTION, - "MyObject.toString = Object.prototype.toString; MyObject.toString()", - "[object Function]", - eval("MyObject.toString = Object.prototype.toString; MyObject.toString()") ); - -new TestCase( SECTION, - "MyObject.length", - 1, - MyObject.length ); - -new TestCase( SECTION, - "MyObject.prototype.constructor", - MyObject, - MyObject.prototype.constructor ); - -new TestCase( SECTION, - "MyObject.arguments", - null, - MyObject.arguments ); - -test(); - - diff --git a/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.1.1-2.js b/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.1.1-2.js deleted file mode 100644 index 57fe78c8f1..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.1.1-2.js +++ /dev/null @@ -1,183 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.3.1.1-2.js'; - -/** - File Name: 15.3.1.1-2.js - ECMA Section: 15.3.1.1 The Function Constructor Called as a Function - Function(p1, p2, ..., pn, body ) - - Description: - When the Function function is called with some arguments p1, p2, . . . , pn, - body (where n might be 0, that is, there are no "p" arguments, and where body - might also not be provided), the following steps are taken: - - 1. Create and return a new Function object exactly if the function constructor - had been called with the same arguments (15.3.2.1). - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ -var SECTION = "15.3.1.1-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The Function Constructor Called as a Function"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var myfunc1 = Function("a","b","c", "return a+b+c" ); -var myfunc2 = Function("a, b, c", "return a+b+c" ); -var myfunc3 = Function("a,b", "c", "return a+b+c" ); - -myfunc1.toString = Object.prototype.toString; -myfunc2.toString = Object.prototype.toString; -myfunc3.toString = Object.prototype.toString; - -new TestCase( SECTION, - "myfunc1 = Function('a','b','c'); myfunc.toString = Object.prototype.toString; myfunc.toString()", - "[object Function]", - myfunc1.toString() ); - -new TestCase( SECTION, - "myfunc1.length", - 3, - myfunc1.length ); - -new TestCase( SECTION, - "myfunc1.prototype.toString()", - "[object Object]", - myfunc1.prototype.toString() ); - -new TestCase( SECTION, - "myfunc1.prototype.constructor", - myfunc1, - myfunc1.prototype.constructor ); - -new TestCase( SECTION, - "myfunc1.arguments", - null, - myfunc1.arguments ); - -new TestCase( SECTION, - "myfunc1(1,2,3)", - 6, - myfunc1(1,2,3) ); - -new TestCase( SECTION, - "var MYPROPS = ''; for ( var p in myfunc1.prototype ) { MYPROPS += p; }; MYPROPS", - "", - eval("var MYPROPS = ''; for ( var p in myfunc1.prototype ) { MYPROPS += p; }; MYPROPS") ); - -new TestCase( SECTION, - "myfunc2 = Function('a','b','c'); myfunc.toString = Object.prototype.toString; myfunc.toString()", - "[object Function]", - myfunc2.toString() ); - -new TestCase( SECTION, - "myfunc2.length", - 3, - myfunc2.length ); - -new TestCase( SECTION, - "myfunc2.prototype.toString()", - "[object Object]", - myfunc2.prototype.toString() ); - -new TestCase( SECTION, - "myfunc2.prototype.constructor", - myfunc2, - myfunc2.prototype.constructor ); - -new TestCase( SECTION, - "myfunc2.arguments", - null, - myfunc2.arguments ); - -new TestCase( SECTION, - "myfunc2( 1000, 200, 30 )", - 1230, - myfunc2(1000,200,30) ); - -new TestCase( SECTION, - "var MYPROPS = ''; for ( var p in myfunc2.prototype ) { MYPROPS += p; }; MYPROPS", - "", - eval("var MYPROPS = ''; for ( var p in myfunc2.prototype ) { MYPROPS += p; }; MYPROPS") ); - -new TestCase( SECTION, - "myfunc3 = Function('a','b','c'); myfunc.toString = Object.prototype.toString; myfunc.toString()", - "[object Function]", - myfunc3.toString() ); - -new TestCase( SECTION, - "myfunc3.length", - 3, - myfunc3.length ); - -new TestCase( SECTION, - "myfunc3.prototype.toString()", - "[object Object]", - myfunc3.prototype.toString() ); - -new TestCase( SECTION, - "myfunc3.prototype.valueOf() +''", - "[object Object]", - myfunc3.prototype.valueOf() +'' ); - -new TestCase( SECTION, - "myfunc3.prototype.constructor", - myfunc3, - myfunc3.prototype.constructor ); - -new TestCase( SECTION, - "myfunc3.arguments", - null, - myfunc3.arguments ); - -new TestCase( SECTION, - "myfunc3(-100,100,NaN)", - Number.NaN, - myfunc3(-100,100,NaN) ); - -new TestCase( SECTION, - "var MYPROPS = ''; for ( var p in myfunc3.prototype ) { MYPROPS += p; }; MYPROPS", - "", - eval("var MYPROPS = ''; for ( var p in myfunc3.prototype ) { MYPROPS += p; }; MYPROPS") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.1.1-3.js b/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.1.1-3.js deleted file mode 100644 index 51f7bb763b..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.1.1-3.js +++ /dev/null @@ -1,99 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.3.1.1-3.js'; - -/** - File Name: 15.3.1.1-3.js - ECMA Section: 15.3.1.1 The Function Constructor Called as a Function - - new Function(p1, p2, ..., pn, body ) - - Description: The last argument specifies the body (executable code) - of a function; any preceeding arguments sepcify formal - parameters. - - See the text for description of this section. - - This test examples from the specification. - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ -var SECTION = "15.3.1.1-3"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The Function Constructor Called as a Function"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var args = ""; - -for ( var i = 0; i < 2000; i++ ) { - args += "arg"+i; - if ( i != 1999 ) { - args += ","; - } -} - -var s = ""; - -for ( var i = 0; i < 2000; i++ ) { - s += ".0005"; - if ( i != 1999 ) { - s += ","; - } -} - -MyFunc = Function( args, "var r=0; for (var i = 0; i < MyFunc.length; i++ ) { if ( eval('arg'+i) == void 0) break; else r += eval('arg'+i); }; return r"); -MyObject = Function( args, "for (var i = 0; i < MyFunc.length; i++ ) { if ( eval('arg'+i) == void 0) break; eval('this.arg'+i +'=arg'+i); };"); - -var MY_OB = eval( "MyFunc("+ s +")" ); - -new TestCase( SECTION, "MyFunc.length", 2000, MyFunc.length ); -new TestCase( SECTION, "var MY_OB = eval('MyFunc(s)')", 1, MY_OB ); -new TestCase( SECTION, "var MY_OB = eval('MyFunc(s)')", 1, eval("var MY_OB = MyFunc("+s+"); MY_OB") ); - -new TestCase( SECTION, "MyObject.length", 2000, MyObject.length ); - -new TestCase( SECTION, "FUN1 = Function( 'a','b','c', 'return FUN1.length' ); FUN1.length", 3, eval("FUN1 = Function( 'a','b','c', 'return FUN1.length' ); FUN1.length") ); -new TestCase( SECTION, "FUN1 = Function( 'a','b','c', 'return FUN1.length' ); FUN1()", 3, eval("FUN1 = Function( 'a','b','c', 'return FUN1.length' ); FUN1()") ); -new TestCase( SECTION, "FUN1 = Function( 'a','b','c', 'return FUN1.length' ); FUN1(1,2,3,4,5)", 3, eval("FUN1 = Function( 'a','b','c', 'return FUN1.length' ); FUN1(1,2,3,4,5)") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.2.1-1.js b/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.2.1-1.js deleted file mode 100644 index d76e57b828..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.2.1-1.js +++ /dev/null @@ -1,132 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.3.2.1-1.js'; - -/** - File Name: 15.3.2.1.js - ECMA Section: 15.3.2.1 The Function Constructor - new Function(p1, p2, ..., pn, body ) - - Description: The last argument specifies the body (executable code) - of a function; any preceeding arguments sepcify formal - parameters. - - See the text for description of this section. - - This test examples from the specification. - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ -var SECTION = "15.3.2.1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The Function Constructor"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var MyObject = new Function( "value", "this.value = value; this.valueOf = new Function( 'return this.value' ); this.toString = new Function( 'return String(this.value);' )" ); - -var myfunc = new Function(); - -// not going to test toString here since it is implementation dependent. -// new TestCase( SECTION, "myfunc.toString()", "function anonymous() { }", myfunc.toString() ); - -myfunc.toString = Object.prototype.toString; - -new TestCase( SECTION, "myfunc = new Function(); myfunc.toString = Object.prototype.toString; myfunc.toString()", - "[object Function]", - myfunc.toString() ); - -new TestCase( SECTION, - "myfunc.length", - 0, - myfunc.length ); - -new TestCase( SECTION, - "myfunc.prototype.toString()", - "[object Object]", - myfunc.prototype.toString() ); - -new TestCase( SECTION, - "myfunc.prototype.constructor", - myfunc, - myfunc.prototype.constructor ); - -new TestCase( SECTION, - "myfunc.arguments", - null, - myfunc.arguments ); - -new TestCase( SECTION, - "var OBJ = new MyObject(true); OBJ.valueOf()", - true, - eval("var OBJ = new MyObject(true); OBJ.valueOf()") ); - -new TestCase( SECTION, - "OBJ.toString()", - "true", - OBJ.toString() ); - -new TestCase( SECTION, - "OBJ.toString = Object.prototype.toString; OBJ.toString()", "[object Object]", - eval("OBJ.toString = Object.prototype.toString; OBJ.toString()") ); - -new TestCase( SECTION, - "MyObject.toString = Object.prototype.toString; MyObject.toString()", - "[object Function]", - eval("MyObject.toString = Object.prototype.toString; MyObject.toString()") ); - -new TestCase( SECTION, - "MyObject.length", - 1, - MyObject.length ); - -new TestCase( SECTION, - "MyObject.prototype.constructor", - MyObject, - MyObject.prototype.constructor ); - -new TestCase( SECTION, - "MyObject.arguments", - null, - MyObject.arguments ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.2.1-2.js b/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.2.1-2.js deleted file mode 100644 index 7729c9587a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.2.1-2.js +++ /dev/null @@ -1,107 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.3.2.1-2.js'; - -/** - File Name: 15.3.2.1.js - ECMA Section: 15.3.2.1 The Function Constructor - new Function(p1, p2, ..., pn, body ) - - Description: - Author: christine@netscape.com - Date: 28 october 1997 - -*/ -var SECTION = "15.3.2.1-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The Function Constructor"; - -writeHeaderToLog( SECTION + " "+ TITLE); - - -var myfunc1 = new Function("a","b","c", "return a+b+c" ); -var myfunc2 = new Function("a, b, c", "return a+b+c" ); -var myfunc3 = new Function("a,b", "c", "return a+b+c" ); - -myfunc1.toString = Object.prototype.toString; -myfunc2.toString = Object.prototype.toString; -myfunc3.toString = Object.prototype.toString; - -new TestCase( SECTION, "myfunc1 = new Function('a','b','c'); myfunc.toString = Object.prototype.toString; myfunc.toString()", - "[object Function]", - myfunc1.toString() ); - -new TestCase( SECTION, "myfunc1.length", 3, myfunc1.length ); -new TestCase( SECTION, "myfunc1.prototype.toString()", "[object Object]", myfunc1.prototype.toString() ); - -new TestCase( SECTION, "myfunc1.prototype.constructor", myfunc1, myfunc1.prototype.constructor ); -new TestCase( SECTION, "myfunc1.arguments", null, myfunc1.arguments ); -new TestCase( SECTION, "myfunc1(1,2,3)", 6, myfunc1(1,2,3) ); -new TestCase( SECTION, "var MYPROPS = ''; for ( var p in myfunc1.prototype ) { MYPROPS += p; }; MYPROPS", - "", - eval("var MYPROPS = ''; for ( var p in myfunc1.prototype ) { MYPROPS += p; }; MYPROPS") ); - -new TestCase( SECTION, "myfunc2 = new Function('a','b','c'); myfunc.toString = Object.prototype.toString; myfunc.toString()", - "[object Function]", - myfunc2.toString() ); -new TestCase( SECTION, "myfunc2.length", 3, myfunc2.length ); -new TestCase( SECTION, "myfunc2.prototype.toString()", "[object Object]", myfunc2.prototype.toString() ); - -new TestCase( SECTION, "myfunc2.prototype.constructor", myfunc2, myfunc2.prototype.constructor ); -new TestCase( SECTION, "myfunc2.arguments", null, myfunc2.arguments ); -new TestCase( SECTION, "myfunc2( 1000, 200, 30 )", 1230, myfunc2(1000,200,30) ); -new TestCase( SECTION, "var MYPROPS = ''; for ( var p in myfunc2.prototype ) { MYPROPS += p; }; MYPROPS", - "", - eval("var MYPROPS = ''; for ( var p in myfunc2.prototype ) { MYPROPS += p; }; MYPROPS") ); - -new TestCase( SECTION, "myfunc3 = new Function('a','b','c'); myfunc.toString = Object.prototype.toString; myfunc.toString()", - "[object Function]", - myfunc3.toString() ); -new TestCase( SECTION, "myfunc3.length", 3, myfunc3.length ); -new TestCase( SECTION, "myfunc3.prototype.toString()", "[object Object]", myfunc3.prototype.toString() ); -new TestCase( SECTION, "myfunc3.prototype.valueOf() +''", "[object Object]", myfunc3.prototype.valueOf() +'' ); -new TestCase( SECTION, "myfunc3.prototype.constructor", myfunc3, myfunc3.prototype.constructor ); -new TestCase( SECTION, "myfunc3.arguments", null, myfunc3.arguments ); -new TestCase( SECTION, "myfunc3(-100,100,NaN)", Number.NaN, myfunc3(-100,100,NaN) ); - -new TestCase( SECTION, "var MYPROPS = ''; for ( var p in myfunc3.prototype ) { MYPROPS += p; }; MYPROPS", - "", - eval("var MYPROPS = ''; for ( var p in myfunc3.prototype ) { MYPROPS += p; }; MYPROPS") ); -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.2.1-3.js b/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.2.1-3.js deleted file mode 100644 index 80b1c41e00..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.2.1-3.js +++ /dev/null @@ -1,95 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.3.2.1-3.js'; - -/** - File Name: 15.3.2.1-3.js - ECMA Section: 15.3.2.1 The Function Constructor - new Function(p1, p2, ..., pn, body ) - - Description: The last argument specifies the body (executable code) - of a function; any preceeding arguments sepcify formal - parameters. - - See the text for description of this section. - - This test examples from the specification. - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ -var SECTION = "15.3.2.1-3"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The Function Constructor"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var args = ""; - -for ( var i = 0; i < 2000; i++ ) { - args += "arg"+i; - if ( i != 1999 ) { - args += ","; - } -} - -var s = ""; - -for ( var i = 0; i < 2000; i++ ) { - s += ".0005"; - if ( i != 1999 ) { - s += ","; - } -} - -MyFunc = new Function( args, "var r=0; for (var i = 0; i < MyFunc.length; i++ ) { if ( eval('arg'+i) == void 0) break; else r += eval('arg'+i); }; return r"); -MyObject = new Function( args, "for (var i = 0; i < MyFunc.length; i++ ) { if ( eval('arg'+i) == void 0) break; eval('this.arg'+i +'=arg'+i); };"); - -new TestCase( SECTION, "MyFunc.length", 2000, MyFunc.length ); -new TestCase( SECTION, "var MY_OB = eval('MyFunc(s)')", 1, eval("var MY_OB = MyFunc("+s+"); MY_OB") ); - -new TestCase( SECTION, "MyObject.length", 2000, MyObject.length ); - -new TestCase( SECTION, "FUN1 = new Function( 'a','b','c', 'return FUN1.length' ); FUN1.length", 3, eval("FUN1 = new Function( 'a','b','c', 'return FUN1.length' ); FUN1.length") ); -new TestCase( SECTION, "FUN1 = new Function( 'a','b','c', 'return FUN1.length' ); FUN1()", 3, eval("FUN1 = new Function( 'a','b','c', 'return FUN1.length' ); FUN1()") ); -new TestCase( SECTION, "FUN1 = new Function( 'a','b','c', 'return FUN1.length' ); FUN1(1,2,3,4,5)", 3, eval("FUN1 = new Function( 'a','b','c', 'return FUN1.length' ); FUN1(1,2,3,4,5)") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.3.1-2.js b/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.3.1-2.js deleted file mode 100644 index b760afd149..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.3.1-2.js +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.3.3.1-2.js'; - -/** - File Name: 15.3.3.1-2.js - ECMA Section: 15.3.3.1 Properties of the Function Constructor - Function.prototype - - Description: The initial value of Function.prototype is the built-in - Function prototype object. - - This property shall have the attributes [DontEnum | - DontDelete | ReadOnly] - - This test the DontEnum property of Function.prototype. - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ -var SECTION = "15.3.3.1-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Function.prototype"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "var str='';for (prop in Function ) str += prop; str;", - "", - eval("var str='';for (prop in Function) str += prop; str;") - ); -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.3.1-3.js b/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.3.1-3.js deleted file mode 100644 index 62e6d42342..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.3.1-3.js +++ /dev/null @@ -1,79 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.3.3.1-3.js'; - -/** - File Name: 15.3.3.1-3.js - ECMA Section: 15.3.3.1 Properties of the Function Constructor - Function.prototype - - Description: The initial value of Function.prototype is the built-in - Function prototype object. - - This property shall have the attributes [DontEnum | - DontDelete | ReadOnly] - - This test the DontDelete property of Function.prototype. - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ -var SECTION = "15.3.3.1-3"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Function.prototype"; - -writeHeaderToLog( SECTION + " "+ TITLE); - - -var FUN_PROTO = Function.prototype; - -new TestCase( SECTION, - "delete Function.prototype", - false, - delete Function.prototype - ); - -new TestCase( SECTION, - "delete Function.prototype; Function.prototype", - FUN_PROTO, - eval("delete Function.prototype; Function.prototype") - ); -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.3.1-4.js b/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.3.1-4.js deleted file mode 100644 index 6e1aa8426d..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.3.1-4.js +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.3.3.1-4.js'; - -/** - File Name: 15.3.3.1-4.js - ECMA Section: 15.3.3.1 Properties of the Function Constructor - Function.prototype - - Description: The initial value of Function.prototype is the built-in - Function prototype object. - - This property shall have the attributes [DontEnum | - DontDelete | ReadOnly] - - This test the ReadOnly property of Function.prototype. - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ -var SECTION = "15.3.3.1-4"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Function.prototype"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "Function.prototype = null; Function.prototype", - Function.prototype, - eval("Function.prototype = null; Function.prototype") - ); -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.3.2.js b/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.3.2.js deleted file mode 100644 index b1d04f3957..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.3.2.js +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.3.3.2.js'; - -/** - File Name: 15.3.3.2.js - ECMA Section: 15.3.3.2 Properties of the Function Constructor - Function.length - - Description: The length property is 1. - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ - -var SECTION = "15.3.3.2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Function.length"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "Function.length", 1, Function.length ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.4-1.js b/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.4-1.js deleted file mode 100644 index c90c26a9e5..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.4-1.js +++ /dev/null @@ -1,94 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.3.4-1.js'; - -/** - File Name: 15.3.4-1.js - ECMA Section: 15.3.4 Properties of the Function Prototype Object - - Description: The Function prototype object is itself a Function - object ( its [[Class]] is "Function") that, when - invoked, accepts any arguments and returns undefined. - - The value of the internal [[Prototype]] property - object is the Object prototype object. - - It is a function with an "empty body"; if it is - invoked, it merely returns undefined. - - The Function prototype object does not have a valueOf - property of its own; however it inherits the valueOf - property from the Object prototype Object. - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ - -var SECTION = "15.3.4-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Properties of the Function Prototype Object"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "var myfunc = Function.prototype; myfunc.toString = Object.prototype.toString; myfunc.toString()", - "[object Function]", - eval("var myfunc = Function.prototype; myfunc.toString = Object.prototype.toString; myfunc.toString()")); - - -// new TestCase( SECTION, "Function.prototype.__proto__", Object.prototype, Function.prototype.__proto__ ); - -new TestCase( SECTION, - "Function.prototype.valueOf", - Object.prototype.valueOf, - Function.prototype.valueOf ); - -new TestCase( SECTION, - "Function.prototype()", - (void 0), - Function.prototype() ); - -new TestCase( SECTION, - "Function.prototype(1,true,false,'string', new Date(),null)", - (void 0), - Function.prototype(1,true,false,'string', new Date(),null) ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.4.1.js b/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.4.1.js deleted file mode 100644 index a6bc775902..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.4.1.js +++ /dev/null @@ -1,61 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.3.4.1.js'; - -/** - File Name: 15.3.4.1.js - ECMA Section: 15.3.4.1 Function.prototype.constructor - - Description: The initial value of Function.prototype.constructor - is the built-in Function constructor. - Author: christine@netscape.com - Date: 28 october 1997 - -*/ - -var SECTION = "15.3.4.1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Function.prototype.constructor"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "Function.prototype.constructor", Function, Function.prototype.constructor ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.4.js b/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.4.js deleted file mode 100644 index 59e3ff81a5..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.4.js +++ /dev/null @@ -1,81 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.3.4.js'; - -/** - File Name: 15.3.4.js - ECMA Section: 15.3.4 Properties of the Function Prototype Object - - Description: The Function prototype object is itself a Function - object ( its [[Class]] is "Function") that, when - invoked, accepts any arguments and returns undefined. - - The value of the internal [[Prototype]] property - object is the Object prototype object. - - It is a function with an "empty body"; if it is - invoked, it merely returns undefined. - - The Function prototype object does not have a valueOf - property of its own; however it inherits the valueOf - property from the Object prototype Object. - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ -var SECTION = "15.3.4"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Properties of the Function Prototype Object"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "var myfunc = Function.prototype; myfunc.toString = Object.prototype.toString; myfunc.toString()", - "[object Function]", - eval("var myfunc = Function.prototype; myfunc.toString = Object.prototype.toString; myfunc.toString()")); - - -// new TestCase( SECTION, "Function.prototype.__proto__", Object.prototype, Function.prototype.__proto__ ); -new TestCase( SECTION, "Function.prototype.valueOf", Object.prototype.valueOf, Function.prototype.valueOf ); -new TestCase( SECTION, "Function.prototype()", (void 0), Function.prototype() ); -new TestCase( SECTION, "Function.prototype(1,true,false,'string', new Date(),null)", (void 0), Function.prototype(1,true,false,'string', new Date(),null) ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.5-1.js b/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.5-1.js deleted file mode 100644 index c3fbfc774e..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.5-1.js +++ /dev/null @@ -1,117 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.3.5-1.js'; - -/** - File Name: 15.3.5-1.js - ECMA Section: 15.3.5 Properties of Function Instances - new Function(p1, p2, ..., pn, body ) - - Description: - - 15.3.5.1 length - - The value of the length property is usually an integer that indicates - the "typical" number of arguments expected by the function. However, - the language permits the function to be invoked with some other number - of arguments. The behavior of a function when invoked on a number of - arguments other than the number specified by its length property depends - on the function. - - 15.3.5.2 prototype - The value of the prototype property is used to initialize the internal [[ - Prototype]] property of a newly created object before the Function object - is invoked as a constructor for that newly created object. - - 15.3.5.3 arguments - - The value of the arguments property is normally null if there is no - outstanding invocation of the function in progress (that is, the function has been called - but has not yet returned). When a non-internal Function object (15.3.2.1) is invoked, its - arguments property is "dynamically bound" to a newly created object that contains the - arguments on which it was invoked (see 10.1.6 and 10.1.8). Note that the use of this - property is discouraged; it is provided principally for compatibility with existing old code. - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ - -var SECTION = "15.3.5-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Properties of Function Instances"; - -writeHeaderToLog( SECTION + " "+TITLE); - -var args = ""; - -for ( var i = 0; i < 2000; i++ ) { - args += "arg"+i; - if ( i != 1999 ) { - args += ","; - } -} - -var s = ""; - -for ( var i = 0; i < 2000; i++ ) { - s += ".0005"; - if ( i != 1999 ) { - s += ","; - } -} - -MyFunc = new Function( args, "var r=0; for (var i = 0; i < MyFunc.length; i++ ) { if ( eval('arg'+i) == void 0) break; else r += eval('arg'+i); }; return r"); -MyObject = new Function( args, "for (var i = 0; i < MyFunc.length; i++ ) { if ( eval('arg'+i) == void 0) break; eval('this.arg'+i +'=arg'+i); };"); - - -new TestCase( SECTION, "MyFunc.length", 2000, MyFunc.length ); -new TestCase( SECTION, "var MY_OB = eval('MyFunc(s)')", 1, eval("var MY_OB = MyFunc("+s+"); MY_OB") ); -new TestCase( SECTION, "MyFunc.prototype.toString()", "[object Object]", MyFunc.prototype.toString() ); -new TestCase( SECTION, "typeof MyFunc.prototype", "object", typeof MyFunc.prototype ); - - -new TestCase( SECTION, "MyObject.length", 2000, MyObject.length ); - -new TestCase( SECTION, "FUN1 = new Function( 'a','b','c', 'return FUN1.length' ); FUN1.length", 3, eval("FUN1 = new Function( 'a','b','c', 'return FUN1.length' ); FUN1.length") ); -new TestCase( SECTION, "FUN1 = new Function( 'a','b','c', 'return FUN1.length' ); FUN1()", 3, eval("FUN1 = new Function( 'a','b','c', 'return FUN1.length' ); FUN1()") ); -new TestCase( SECTION, "FUN1 = new Function( 'a','b','c', 'return FUN1.length' ); FUN1(1,2,3,4,5)", 3, eval("FUN1 = new Function( 'a','b','c', 'return FUN1.length' ); FUN1(1,2,3,4,5)") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.5-2.js b/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.5-2.js deleted file mode 100644 index dcb351985d..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.5-2.js +++ /dev/null @@ -1,90 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.3.5-2.js'; - -/** - File Name: 15.3.5-1.js - ECMA Section: 15.3.5 Properties of Function Instances - new Function(p1, p2, ..., pn, body ) - - Description: - - 15.3.5.1 length - - The value of the length property is usually an integer that indicates - the "typical" number of arguments expected by the function. However, - the language permits the function to be invoked with some other number - of arguments. The behavior of a function when invoked on a number of - arguments other than the number specified by its length property depends - on the function. - - 15.3.5.2 prototype - The value of the prototype property is used to initialize the internal [[ - Prototype]] property of a newly created object before the Function object - is invoked as a constructor for that newly created object. - - 15.3.5.3 arguments - - The value of the arguments property is normally null if there is no - outstanding invocation of the function in progress (that is, the function has been called - but has not yet returned). When a non-internal Function object (15.3.2.1) is invoked, its - arguments property is "dynamically bound" to a newly created object that contains the - arguments on which it was invoked (see 10.1.6 and 10.1.8). Note that the use of this - property is discouraged; it is provided principally for compatibility with existing old code. - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ - -var SECTION = "15.3.5-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Properties of Function Instances"; - -writeHeaderToLog( SECTION + " "+TITLE); - -var MyObject = new Function( 'a', 'b', 'c', 'this.a = a; this.b = b; this.c = c; this.value = a+b+c; this.valueOf = new Function( "return this.value" )' ); - -new TestCase( SECTION, "MyObject.length", 3, MyObject.length ); -new TestCase( SECTION, "typeof MyObject.prototype", "object", typeof MyObject.prototype ); -new TestCase( SECTION, "typeof MyObject.prototype.constructor", "function", typeof MyObject.prototype.constructor ); -new TestCase( SECTION, "MyObject.arguments", null, MyObject.arguments ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.5.1.js b/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.5.1.js deleted file mode 100644 index 406d569dba..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.5.1.js +++ /dev/null @@ -1,83 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.3.5.1.js'; - -/** - File Name: 15.3.5.1.js - ECMA Section: Function.length - Description: - - The value of the length property is usually an integer that indicates the - "typical" number of arguments expected by the function. However, the - language permits the function to be invoked with some other number of - arguments. The behavior of a function when invoked on a number of arguments - other than the number specified by its length property depends on the function. - - this test needs a 1.2 version check. - - http://scopus.mcom.com/bugsplat/show_bug.cgi?id=104204 - - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.3.5.1"; -var VERSION = "ECMA_1"; -var TITLE = "Function.length"; -var BUGNUMBER="104204"; -startTest(); - -writeHeaderToLog( SECTION + " "+ TITLE); - -var f = new Function( "a","b", "c", "return f.length"); - -new TestCase( SECTION, - 'var f = new Function( "a","b", "c", "return f.length"); f()', - 3, - f() ); - - -new TestCase( SECTION, - 'var f = new Function( "a","b", "c", "return f.length"); f(1,2,3,4,5)', - 3, - f(1,2,3,4,5) ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.5.3.js b/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.5.3.js deleted file mode 100644 index 4a127fbc68..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/15.3.5.3.js +++ /dev/null @@ -1,72 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.3.5.3.js'; - -/** - File Name: 15.3.5.3.js - ECMA Section: Function.arguments - Description: - - The value of the arguments property is normally null if there is no - outstanding invocation of the function in progress (that is, the - function has been called but has not yet returned). When a non-internal - Function object (15.3.2.1) is invoked, its arguments property is - "dynamically bound" to a newly created object that contains the arguments - on which it was invoked (see 10.1.6 and 10.1.8). Note that the use of this - property is discouraged; it is provided principally for compatibility - with existing old code. - - See sections 10.1.6 and 10.1.8 for more extensive tests. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.3.5.3"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Function.arguments"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var MYFUNCTION = new Function( "return this.arguments" ); - -new TestCase( SECTION, "var MYFUNCTION = new Function( 'return this.arguments' ); MYFUNCTION.arguments", null, MYFUNCTION.arguments ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/browser.js b/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/browser.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/shell.js b/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/shell.js deleted file mode 100644 index 27aa7b1318..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/FunctionObjects/shell.js +++ /dev/null @@ -1 +0,0 @@ -gTestsubsuite = 'FunctionObjects'; diff --git a/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1-1-n.js b/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1-1-n.js deleted file mode 100644 index 9946a7f2da..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1-1-n.js +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.1-1-n.js'; - -/** - File Name: 15.1-1-n.js - ECMA Section: The global object - Description: - - The global object does not have a [[Construct]] property; it is not - possible to use the global object as a constructor with the new operator. - - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.1-1-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The Global Object"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "var MY_GLOBAL = new this()"; -EXPECTED = "error"; - -new TestCase( SECTION, - "var MY_GLOBAL = new this()", - "error", - eval("var MY_GLOBAL = new this()") ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1-2-n.js b/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1-2-n.js deleted file mode 100644 index 545caeeae0..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1-2-n.js +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.1-2-n.js'; - -/** - File Name: 15.1-2-n.js - ECMA Section: The global object - Description: - - The global object does not have a [[Call]] property; it is not possible - to invoke the global object as a function. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.1-2-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The Global Object"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "var MY_GLOBAL = this()"; -EXPECTED = "error"; - -new TestCase( SECTION, - "var MY_GLOBAL = this()", - "error", - eval("var MY_GLOBAL = this()") ); -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.1.1.js b/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.1.1.js deleted file mode 100644 index a8d4e7fecf..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.1.1.js +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.1.1.1.js'; - -/** - File Name: 15.1.1.1.js - ECMA Section: 15.1.1.1 NaN - - Description: The initial value of NaN is NaN. - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ -var SECTION = "15.1.1.1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "NaN"; - -writeHeaderToLog( SECTION + " "+ TITLE); - - -new TestCase( SECTION, "NaN", Number.NaN, NaN ); -new TestCase( SECTION, "this.NaN", Number.NaN, this.NaN ); -new TestCase( SECTION, "typeof NaN", "number", typeof NaN ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.1.2.js b/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.1.2.js deleted file mode 100644 index 8671ff642a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.1.2.js +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.1.1.2.js'; - -/** - File Name: 15.1.1.2.js - ECMA Section: 15.1.1.2 Infinity - - Description: The initial value of Infinity is +Infinity. - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ -var SECTION = "15.1.1.2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Infinity"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "Infinity", Number.POSITIVE_INFINITY, Infinity ); -new TestCase( SECTION, "this.Infinity", Number.POSITIVE_INFINITY, this.Infinity ); -new TestCase( SECTION, "typeof Infinity", "number", typeof Infinity ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.1-2.js b/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.1-2.js deleted file mode 100644 index 8572371f8e..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.1-2.js +++ /dev/null @@ -1,66 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.1.2.1-2.js'; - -/** - File Name: 15.1.2.1-2.js - ECMA Section: 15.1.2.1 eval(x) - - Parse x as an ECMAScript Program. If the parse fails, - generate a runtime error. Evaluate the program. If - result is "Normal completion after value V", return - the value V. Else, return undefined. - Description: - Author: christine@netscape.com - Date: 16 september 1997 -*/ -var SECTION = "15.1.2.1-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "eval(x)"; -var BUGNUMBER = "none"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "d = new Date(0); with (d) { x = getUTCMonth() +'/'+ getUTCDate() +'/'+ getUTCFullYear(); } x", - "0/1/1970", - eval( "d = new Date(0); with (d) { x = getUTCMonth() +'/'+ getUTCDate() +'/'+ getUTCFullYear(); } x" )); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.2-1.js b/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.2-1.js deleted file mode 100644 index a4bf1c7de6..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.2-1.js +++ /dev/null @@ -1,410 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.1.2.2-1.js'; - -/** - File Name: 15.1.2.2-1.js - ECMA Section: 15.1.2.2 Function properties of the global object - parseInt( string, radix ) - - Description: - - The parseInt function produces an integer value dictated by intepretation - of the contents of the string argument according to the specified radix. - - When the parseInt function is called, the following steps are taken: - - 1. Call ToString(string). - 2. Compute a substring of Result(1) consisting of the leftmost character - that is not a StrWhiteSpaceChar and all characters to the right of - that character. (In other words, remove leading whitespace.) - 3. Let sign be 1. - 4. If Result(2) is not empty and the first character of Result(2) is a - minus sign -, let sign be -1. - 5. If Result(2) is not empty and the first character of Result(2) is a - plus sign + or a minus sign -, then Result(5) is the substring of - Result(2) produced by removing the first character; otherwise, Result(5) - is Result(2). - 6. If the radix argument is not supplied, go to step 12. - 7. Call ToInt32(radix). - 8. If Result(7) is zero, go to step 12; otherwise, if Result(7) < 2 or - Result(7) > 36, return NaN. - 9. Let R be Result(7). - 10. If R = 16 and the length of Result(5) is at least 2 and the first two - characters of Result(5) are either "0x" or "0X", let S be the substring - of Result(5) consisting of all but the first two characters; otherwise, - let S be Result(5). - 11. Go to step 22. - 12. If Result(5) is empty or the first character of Result(5) is not 0, - go to step 20. - 13. If the length of Result(5) is at least 2 and the second character of - Result(5) is x or X, go to step 17. - 14. Let R be 8. - 15. Let S be Result(5). - 16. Go to step 22. - 17. Let R be 16. - 18. Let S be the substring of Result(5) consisting of all but the first - two characters. - 19. Go to step 22. - 20. Let R be 10. - 21. Let S be Result(5). - 22. If S contains any character that is not a radix-R digit, then let Z be - the substring of S consisting of all characters to the left of the - leftmost such character; otherwise, let Z be S. - 23. If Z is empty, return NaN. - 24. Compute the mathematical integer value that is represented by Z in - radix-R notation. (But if R is 10 and Z contains more than 20 - significant digits, every digit after the 20th may be replaced by a 0 - digit, at the option of the implementation; and if R is not 2, 4, 8, - 10, 16, or 32, then Result(24) may be an implementation-dependent - approximation to the mathematical integer value that is represented - by Z in radix-R notation.) - 25. Compute the number value for Result(24). - 26. Return sign Result(25). - - Note that parseInt may interpret only a leading portion of the string as - an integer value; it ignores any characters that cannot be interpreted as - part of the notation of an integer, and no indication is given that any - such characters were ignored. - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ -var SECTION = "15.1.2.2-1"; -var VERSION = "ECMA_1"; -var TITLE = "parseInt(string, radix)"; -var BUGNUMBER = "none"; - -startTest(); - -writeHeaderToLog( SECTION + " "+ TITLE); - -var HEX_STRING = "0x0"; -var HEX_VALUE = 0; - -new TestCase( SECTION, - "parseInt.length", - 2, - parseInt.length ); - -new TestCase( SECTION, - "parseInt.length = 0; parseInt.length", - 2, - eval("parseInt.length = 0; parseInt.length") ); - -new TestCase( SECTION, - "var PROPS=''; for ( var p in parseInt ) { PROPS += p; }; PROPS", "prototype", - eval("var PROPS=''; for ( var p in parseInt ) { PROPS += p; }; PROPS") ); - -new TestCase( SECTION, - "delete parseInt.length", - false, - delete parseInt.length ); - -new TestCase( SECTION, - "delete parseInt.length; parseInt.length", - 2, - eval("delete parseInt.length; parseInt.length") ); - -new TestCase( SECTION, - "parseInt.length = null; parseInt.length", - 2, - eval("parseInt.length = null; parseInt.length") ); - -new TestCase( SECTION, - "parseInt()", - NaN, - parseInt() ); - -new TestCase( SECTION, - "parseInt('')", - NaN, - parseInt("") ); - -new TestCase( SECTION, - "parseInt('','')", - NaN, - parseInt("","") ); - -new TestCase( SECTION, - "parseInt(\" 0xabcdef ", - 11259375, - parseInt( " 0xabcdef " )); - -new TestCase( SECTION, - "parseInt(\" 0XABCDEF ", - 11259375, - parseInt( " 0XABCDEF " ) ); - -new TestCase( SECTION, - "parseInt( 0xabcdef )", - 11259375, - parseInt( "0xabcdef") ); - -new TestCase( SECTION, - "parseInt( 0XABCDEF )", - 11259375, - parseInt( "0XABCDEF") ); - -for ( HEX_STRING = "0x0", HEX_VALUE = 0, POWER = 0; POWER < 15; POWER++, HEX_STRING = HEX_STRING +"f" ) { - new TestCase( SECTION, "parseInt("+HEX_STRING+")", HEX_VALUE, parseInt(HEX_STRING) ); - HEX_VALUE += Math.pow(16,POWER)*15; -} -for ( HEX_STRING = "0X0", HEX_VALUE = 0, POWER = 0; POWER < 15; POWER++, HEX_STRING = HEX_STRING +"f" ) { - new TestCase( SECTION, "parseInt("+HEX_STRING+")", HEX_VALUE, parseInt(HEX_STRING) ); - HEX_VALUE += Math.pow(16,POWER)*15; -} -for ( HEX_STRING = "0x0", HEX_VALUE = 0, POWER = 0; POWER < 15; POWER++, HEX_STRING = HEX_STRING +"f" ) { - new TestCase( SECTION, "parseInt("+HEX_STRING+",16)", HEX_VALUE, parseInt(HEX_STRING,16) ); - HEX_VALUE += Math.pow(16,POWER)*15; -} -for ( HEX_STRING = "0x0", HEX_VALUE = 0, POWER = 0; POWER < 15; POWER++, HEX_STRING = HEX_STRING +"f" ) { - new TestCase( SECTION, "parseInt("+HEX_STRING+",16)", HEX_VALUE, parseInt(HEX_STRING,16) ); - HEX_VALUE += Math.pow(16,POWER)*15; -} -for ( HEX_STRING = "0x0", HEX_VALUE = 0, POWER = 0; POWER < 15; POWER++, HEX_STRING = HEX_STRING +"f" ) { - new TestCase( SECTION, "parseInt("+HEX_STRING+",null)", HEX_VALUE, parseInt(HEX_STRING,null) ); - HEX_VALUE += Math.pow(16,POWER)*15; -} -for ( HEX_STRING = "0x0", HEX_VALUE = 0, POWER = 0; POWER < 15; POWER++, HEX_STRING = HEX_STRING +"f" ) { - new TestCase( SECTION, "parseInt("+HEX_STRING+", void 0)", HEX_VALUE, parseInt(HEX_STRING, void 0) ); - HEX_VALUE += Math.pow(16,POWER)*15; -} - -// a few tests with spaces - -for ( var space = " ", HEX_STRING = "0x0", HEX_VALUE = 0, POWER = 0; - POWER < 15; - POWER++, HEX_STRING = HEX_STRING +"f", space += " ") -{ - new TestCase( SECTION, "parseInt("+space+HEX_STRING+space+", void 0)", HEX_VALUE, parseInt(space+HEX_STRING+space, void 0) ); - HEX_VALUE += Math.pow(16,POWER)*15; -} - -// a few tests with negative numbers -for ( HEX_STRING = "-0x0", HEX_VALUE = 0, POWER = 0; POWER < 15; POWER++, HEX_STRING = HEX_STRING +"f" ) { - new TestCase( SECTION, "parseInt("+HEX_STRING+")", HEX_VALUE, parseInt(HEX_STRING) ); - HEX_VALUE -= Math.pow(16,POWER)*15; -} - -// we should stop parsing when we get to a value that is not a numeric literal for the type we expect - -for ( HEX_STRING = "0x0", HEX_VALUE = 0, POWER = 0; POWER < 15; POWER++, HEX_STRING = HEX_STRING +"f" ) { - new TestCase( SECTION, "parseInt("+HEX_STRING+"g,16)", HEX_VALUE, parseInt(HEX_STRING+"g",16) ); - HEX_VALUE += Math.pow(16,POWER)*15; -} -for ( HEX_STRING = "0x0", HEX_VALUE = 0, POWER = 0; POWER < 15; POWER++, HEX_STRING = HEX_STRING +"f" ) { - new TestCase( SECTION, "parseInt("+HEX_STRING+"g,16)", HEX_VALUE, parseInt(HEX_STRING+"G",16) ); - HEX_VALUE += Math.pow(16,POWER)*15; -} - -for ( HEX_STRING = "-0x0", HEX_VALUE = 0, POWER = 0; POWER < 15; POWER++, HEX_STRING = HEX_STRING +"f" ) { - new TestCase( SECTION, "parseInt("+HEX_STRING+")", HEX_VALUE, parseInt(HEX_STRING) ); - HEX_VALUE -= Math.pow(16,POWER)*15; -} -for ( HEX_STRING = "-0X0", HEX_VALUE = 0, POWER = 0; POWER < 15; POWER++, HEX_STRING = HEX_STRING +"f" ) { - new TestCase( SECTION, "parseInt("+HEX_STRING+")", HEX_VALUE, parseInt(HEX_STRING) ); - HEX_VALUE -= Math.pow(16,POWER)*15; -} -for ( HEX_STRING = "-0x0", HEX_VALUE = 0, POWER = 0; POWER < 15; POWER++, HEX_STRING = HEX_STRING +"f" ) { - new TestCase( SECTION, "parseInt("+HEX_STRING+",16)", HEX_VALUE, parseInt(HEX_STRING,16) ); - HEX_VALUE -= Math.pow(16,POWER)*15; -} -for ( HEX_STRING = "-0x0", HEX_VALUE = 0, POWER = 0; POWER < 15; POWER++, HEX_STRING = HEX_STRING +"f" ) { - new TestCase( SECTION, "parseInt("+HEX_STRING+",16)", HEX_VALUE, parseInt(HEX_STRING,16) ); - HEX_VALUE -= Math.pow(16,POWER)*15; -} - -// let us do some octal tests. numbers that start with 0 and do not provid a radix should -// default to using "0" as a radix. - -var OCT_STRING = "0"; -var OCT_VALUE = 0; - -for ( OCT_STRING = "0", OCT_VALUE = 0, POWER = 0; POWER < 15; POWER++, OCT_STRING = OCT_STRING +"7" ) { - new TestCase( SECTION, "parseInt("+OCT_STRING+")", OCT_VALUE, parseInt(OCT_STRING) ); - OCT_VALUE += Math.pow(8,POWER)*7; -} - -for ( OCT_STRING = "-0", OCT_VALUE = 0, POWER = 0; POWER < 15; POWER++, OCT_STRING = OCT_STRING +"7" ) { - new TestCase( SECTION, "parseInt("+OCT_STRING+")", OCT_VALUE, parseInt(OCT_STRING) ); - OCT_VALUE -= Math.pow(8,POWER)*7; -} - -// should get the same results as above if we provid the radix of 8 (or 010) - -for ( OCT_STRING = "0", OCT_VALUE = 0, POWER = 0; POWER < 15; POWER++, OCT_STRING = OCT_STRING +"7" ) { - new TestCase( SECTION, "parseInt("+OCT_STRING+",8)", OCT_VALUE, parseInt(OCT_STRING,8) ); - OCT_VALUE += Math.pow(8,POWER)*7; -} -for ( OCT_STRING = "-0", OCT_VALUE = 0, POWER = 0; POWER < 15; POWER++, OCT_STRING = OCT_STRING +"7" ) { - new TestCase( SECTION, "parseInt("+OCT_STRING+",010)", OCT_VALUE, parseInt(OCT_STRING,010) ); - OCT_VALUE -= Math.pow(8,POWER)*7; -} - -// we shall stop parsing digits when we get one that isn't a numeric literal of the type we think -// it should be. -for ( OCT_STRING = "0", OCT_VALUE = 0, POWER = 0; POWER < 15; POWER++, OCT_STRING = OCT_STRING +"7" ) { - new TestCase( SECTION, "parseInt("+OCT_STRING+"8,8)", OCT_VALUE, parseInt(OCT_STRING+"8",8) ); - OCT_VALUE += Math.pow(8,POWER)*7; -} -for ( OCT_STRING = "-0", OCT_VALUE = 0, POWER = 0; POWER < 15; POWER++, OCT_STRING = OCT_STRING +"7" ) { - new TestCase( SECTION, "parseInt("+OCT_STRING+"8,010)", OCT_VALUE, parseInt(OCT_STRING+"8",010) ); - OCT_VALUE -= Math.pow(8,POWER)*7; -} - -new TestCase( SECTION, - "parseInt( '0x' )", - NaN, - parseInt("0x") ); - -new TestCase( SECTION, - "parseInt( '0X' )", - NaN, - parseInt("0X") ); - -new TestCase( SECTION, - "parseInt( '11111111112222222222' )", - 11111111112222222222, - parseInt("11111111112222222222") ); - -new TestCase( SECTION, - "parseInt( '111111111122222222223' )", - 111111111122222222220, - parseInt("111111111122222222223") ); - -new TestCase( SECTION, - "parseInt( '11111111112222222222',10 )", - 11111111112222222222, - parseInt("11111111112222222222",10) ); - -new TestCase( SECTION, - "parseInt( '111111111122222222223',10 )", - 111111111122222222220, - parseInt("111111111122222222223",10) ); - -new TestCase( SECTION, - "parseInt( '01234567890', -1 )", - Number.NaN, - parseInt("01234567890",-1) ); - -new TestCase( SECTION, - "parseInt( '01234567890', 0 )", - Number.NaN, - parseInt("01234567890",1) ); - -new TestCase( SECTION, - "parseInt( '01234567890', 1 )", - Number.NaN, - parseInt("01234567890",1) ); - -new TestCase( SECTION, - "parseInt( '01234567890', 2 )", - 1, - parseInt("01234567890",2) ); - -new TestCase( SECTION, - "parseInt( '01234567890', 3 )", - 5, - parseInt("01234567890",3) ); - -new TestCase( SECTION, - "parseInt( '01234567890', 4 )", - 27, - parseInt("01234567890",4) ); - -new TestCase( SECTION, - "parseInt( '01234567890', 5 )", - 194, - parseInt("01234567890",5) ); - -new TestCase( SECTION, - "parseInt( '01234567890', 6 )", - 1865, - parseInt("01234567890",6) ); - -new TestCase( SECTION, - "parseInt( '01234567890', 7 )", - 22875, - parseInt("01234567890",7) ); - -new TestCase( SECTION, - "parseInt( '01234567890', 8 )", - 342391, - parseInt("01234567890",8) ); - -new TestCase( SECTION, - "parseInt( '01234567890', 9 )", - 6053444, - parseInt("01234567890",9) ); - -new TestCase( SECTION, - "parseInt( '01234567890', 10 )", - 1234567890, - parseInt("01234567890",10) ); - -// need more test cases with hex radix - -new TestCase( SECTION, - "parseInt( '1234567890', '0xa')", - 1234567890, - parseInt("1234567890","0xa") ); - -new TestCase( SECTION, - "parseInt( '012345', 11 )", - 17715, - parseInt("012345",11) ); - -new TestCase( SECTION, - "parseInt( '012345', 35 )", - 1590195, - parseInt("012345",35) ); - -new TestCase( SECTION, - "parseInt( '012345', 36 )", - 1776965, - parseInt("012345",36) ); - -new TestCase( SECTION, - "parseInt( '012345', 37 )", - Number.NaN, - parseInt("012345",37) ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.2-2.js b/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.2-2.js deleted file mode 100644 index ff8806dfb2..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.2-2.js +++ /dev/null @@ -1,238 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.1.2.2-2.js'; - -/** - File Name: 15.1.2.2-1.js - ECMA Section: 15.1.2.2 Function properties of the global object - parseInt( string, radix ) - - Description: parseInt test cases written by waldemar, and documented in - http://scopus.mcom.com/bugsplat/show_bug.cgi?id=123874. - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ -var SECTION = "15.1.2.2-2"; -var VERSION = "ECMA_1"; -var TITLE = "parseInt(string, radix)"; -var BUGNUMBER = "none"; - -startTest(); - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - 'parseInt("000000100000000100100011010001010110011110001001101010111100",2)', - 9027215253084860, - parseInt("000000100000000100100011010001010110011110001001101010111100",2) ); - -new TestCase( SECTION, - 'parseInt("000000100000000100100011010001010110011110001001101010111101",2)', - 9027215253084860, - parseInt("000000100000000100100011010001010110011110001001101010111101",2)); - -new TestCase( SECTION, - 'parseInt("000000100000000100100011010001010110011110001001101010111111",2)', - 9027215253084864, - parseInt("000000100000000100100011010001010110011110001001101010111111",2) ); - -new TestCase( SECTION, - 'parseInt("0000001000000001001000110100010101100111100010011010101111010",2)', - 18054430506169720, - parseInt("0000001000000001001000110100010101100111100010011010101111010",2) ); - -new TestCase( SECTION, - 'parseInt("0000001000000001001000110100010101100111100010011010101111011",2)', - 18054430506169724, - parseInt("0000001000000001001000110100010101100111100010011010101111011",2)); - -new TestCase( SECTION, - 'parseInt("0000001000000001001000110100010101100111100010011010101111100",2)', - 18054430506169724, - parseInt("0000001000000001001000110100010101100111100010011010101111100",2) ); - -new TestCase( SECTION, - 'parseInt("0000001000000001001000110100010101100111100010011010101111110",2)', - 18054430506169728, - parseInt("0000001000000001001000110100010101100111100010011010101111110",2) ); - -new TestCase( SECTION, - 'parseInt("yz",35)', - 34, - parseInt("yz",35) ); - -new TestCase( SECTION, - 'parseInt("yz",36)', - 1259, - parseInt("yz",36) ); - -new TestCase( SECTION, - 'parseInt("yz",37)', - NaN, - parseInt("yz",37) ); - -new TestCase( SECTION, - 'parseInt("+77")', - 77, - parseInt("+77") ); - -new TestCase( SECTION, - 'parseInt("-77",9)', - -70, - parseInt("-77",9) ); - -new TestCase( SECTION, - 'parseInt("\u20001234\u2000")', - 1234, - parseInt("\u20001234\u2000") ); - -new TestCase( SECTION, - 'parseInt("123456789012345678")', - 123456789012345680, - parseInt("123456789012345678") ); - -new TestCase( SECTION, - 'parseInt("9",8)', - NaN, - parseInt("9",8) ); - -new TestCase( SECTION, - 'parseInt("1e2")', - 1, - parseInt("1e2") ); - -new TestCase( SECTION, - 'parseInt("1.9999999999999999999")', - 1, - parseInt("1.9999999999999999999") ); - -new TestCase( SECTION, - 'parseInt("0x10")', - 16, - parseInt("0x10") ); - -new TestCase( SECTION, - 'parseInt("0x10",10)', - 0, - parseInt("0x10",10)); - -new TestCase( SECTION, - 'parseInt("0022")', - 18, - parseInt("0022")); - -new TestCase( SECTION, - 'parseInt("0022",10)', - 22, - parseInt("0022",10) ); - -new TestCase( SECTION, - 'parseInt("0x1000000000000080")', - 1152921504606847000, - parseInt("0x1000000000000080") ); - -new TestCase( SECTION, - 'parseInt("0x1000000000000081")', - 1152921504606847200, - parseInt("0x1000000000000081") ); - -s = - "0xFFFFFFFFFFFFF80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" - - s += "0000000000000000000000000000000000000"; - -new TestCase( SECTION, - "s = " + s +"; -s", - -1.7976931348623157e+308, - -s ); - -s = - "0xFFFFFFFFFFFFF80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; -s += "0000000000000000000000000000000000001"; - -new TestCase( SECTION, - "s = " + s +"; -s", - -1.7976931348623157e+308, - -s ); - - -s = "0xFFFFFFFFFFFFFC0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; - -s += "0000000000000000000000000000000000000" - - -new TestCase( SECTION, - "s = " + s + "; -s", - -Infinity, - -s ); - -s = "0xFFFFFFFFFFFFFB0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; -s += "0000000000000000000000000000000000001"; - -new TestCase( SECTION, - "s = " + s + "; -s", - -1.7976931348623157e+308, - -s ); - -s += "0" - -new TestCase( SECTION, - "s = " + s + "; -s", - -Infinity, - -s ); - -new TestCase( SECTION, - 'parseInt(s)', - Infinity, - parseInt(s) ); - -new TestCase( SECTION, - 'parseInt(s,32)', - 0, - parseInt(s,32) ); - -new TestCase( SECTION, - 'parseInt(s,36)', - Infinity, - parseInt(s,36)); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.3-1.js b/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.3-1.js deleted file mode 100644 index 56bf83adcc..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.3-1.js +++ /dev/null @@ -1,441 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.1.2.3-1.js'; - -/** - File Name: 15.1.2.3.js - ECMA Section: 15.1.2.3 Function properties of the global object: - parseFloat( string ) - - Description: The parseFloat function produces a number value dictated - by the interpretation of the contents of the string - argument defined as a decimal literal. - - When the parseFloat function is called, the following - steps are taken: - - 1. Call ToString( string ). - 2. Remove leading whitespace Result(1). - 3. If neither Result(2) nor any prefix of Result(2) - satisfies the syntax of a StrDecimalLiteral, - return NaN. - 4. Compute the longest prefix of Result(2) which might - be Resusult(2) itself, that satisfies the syntax of - a StrDecimalLiteral - 5. Return the number value for the MV of Result(4). - - Note that parseFloate may interpret only a leading - portion of the string as a number value; it ignores any - characters that cannot be interpreted as part of the - notation of a decimal literal, and no indication is given - that such characters were ignored. - - StrDecimalLiteral:: - Infinity - DecimalDigits.DecimalDigits opt ExponentPart opt - .DecimalDigits ExponentPart opt - DecimalDigits ExponentPart opt - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ - -var SECTION = "15.1.2.3-1"; -var VERSION = "ECMA_1"; -var TITLE = "parseFloat(string)"; -var BUGNUMBER="none"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "parseFloat.length", 1, parseFloat.length ); - -new TestCase( SECTION, "parseFloat.length = null; parseFloat.length", 1, eval("parseFloat.length = null; parseFloat.length") ); -new TestCase( SECTION, "delete parseFloat.length", false, delete parseFloat.length ); -new TestCase( SECTION, "delete parseFloat.length; parseFloat.length", 1, eval("delete parseFloat.length; parseFloat.length") ); -new TestCase( SECTION, "var MYPROPS=''; for ( var p in parseFloat ) { MYPROPS += p }; MYPROPS", "prototype", eval("var MYPROPS=''; for ( var p in parseFloat ) { MYPROPS += p }; MYPROPS") ); - -new TestCase( SECTION, "parseFloat()", Number.NaN, parseFloat() ); -new TestCase( SECTION, "parseFloat('')", Number.NaN, parseFloat('') ); - -new TestCase( SECTION, "parseFloat(' ')", Number.NaN, parseFloat(' ') ); -new TestCase( SECTION, "parseFloat(true)", Number.NaN, parseFloat(true) ); -new TestCase( SECTION, "parseFloat(false)", Number.NaN, parseFloat(false) ); -new TestCase( SECTION, "parseFloat('string')", Number.NaN, parseFloat("string") ); - -new TestCase( SECTION, "parseFloat(' Infinity')", Infinity, parseFloat("Infinity") ); -new TestCase( SECTION, "parseFloat(' Infinity ')", Infinity, parseFloat(' Infinity ') ); - -new TestCase( SECTION, "parseFloat('Infinity')", Infinity, parseFloat("Infinity") ); -new TestCase( SECTION, "parseFloat(Infinity)", Infinity, parseFloat(Infinity) ); - - -new TestCase( SECTION, "parseFloat(' +Infinity')", +Infinity, parseFloat("+Infinity") ); -new TestCase( SECTION, "parseFloat(' -Infinity ')", -Infinity, parseFloat(' -Infinity ') ); - -new TestCase( SECTION, "parseFloat('+Infinity')", +Infinity, parseFloat("+Infinity") ); -new TestCase( SECTION, "parseFloat(-Infinity)", -Infinity, parseFloat(-Infinity) ); - -new TestCase( SECTION, "parseFloat('0')", 0, parseFloat("0") ); -new TestCase( SECTION, "parseFloat('-0')", -0, parseFloat("-0") ); -new TestCase( SECTION, "parseFloat('+0')", 0, parseFloat("+0") ); - -new TestCase( SECTION, "parseFloat('1')", 1, parseFloat("1") ); -new TestCase( SECTION, "parseFloat('-1')", -1, parseFloat("-1") ); -new TestCase( SECTION, "parseFloat('+1')", 1, parseFloat("+1") ); - -new TestCase( SECTION, "parseFloat('2')", 2, parseFloat("2") ); -new TestCase( SECTION, "parseFloat('-2')", -2, parseFloat("-2") ); -new TestCase( SECTION, "parseFloat('+2')", 2, parseFloat("+2") ); - -new TestCase( SECTION, "parseFloat('3')", 3, parseFloat("3") ); -new TestCase( SECTION, "parseFloat('-3')", -3, parseFloat("-3") ); -new TestCase( SECTION, "parseFloat('+3')", 3, parseFloat("+3") ); - -new TestCase( SECTION, "parseFloat('4')", 4, parseFloat("4") ); -new TestCase( SECTION, "parseFloat('-4')", -4, parseFloat("-4") ); -new TestCase( SECTION, "parseFloat('+4')", 4, parseFloat("+4") ); - -new TestCase( SECTION, "parseFloat('5')", 5, parseFloat("5") ); -new TestCase( SECTION, "parseFloat('-5')", -5, parseFloat("-5") ); -new TestCase( SECTION, "parseFloat('+5')", 5, parseFloat("+5") ); - -new TestCase( SECTION, "parseFloat('6')", 6, parseFloat("6") ); -new TestCase( SECTION, "parseFloat('-6')", -6, parseFloat("-6") ); -new TestCase( SECTION, "parseFloat('+6')", 6, parseFloat("+6") ); - -new TestCase( SECTION, "parseFloat('7')", 7, parseFloat("7") ); -new TestCase( SECTION, "parseFloat('-7')", -7, parseFloat("-7") ); -new TestCase( SECTION, "parseFloat('+7')", 7, parseFloat("+7") ); - -new TestCase( SECTION, "parseFloat('8')", 8, parseFloat("8") ); -new TestCase( SECTION, "parseFloat('-8')", -8, parseFloat("-8") ); -new TestCase( SECTION, "parseFloat('+8')", 8, parseFloat("+8") ); - -new TestCase( SECTION, "parseFloat('9')", 9, parseFloat("9") ); -new TestCase( SECTION, "parseFloat('-9')", -9, parseFloat("-9") ); -new TestCase( SECTION, "parseFloat('+9')", 9, parseFloat("+9") ); - -new TestCase( SECTION, "parseFloat('3.14159')", 3.14159, parseFloat("3.14159") ); -new TestCase( SECTION, "parseFloat('-3.14159')", -3.14159, parseFloat("-3.14159") ); -new TestCase( SECTION, "parseFloat('+3.14159')", 3.14159, parseFloat("+3.14159") ); - -new TestCase( SECTION, "parseFloat('3.')", 3, parseFloat("3.") ); -new TestCase( SECTION, "parseFloat('-3.')", -3, parseFloat("-3.") ); -new TestCase( SECTION, "parseFloat('+3.')", 3, parseFloat("+3.") ); - -new TestCase( SECTION, "parseFloat('3.e1')", 30, parseFloat("3.e1") ); -new TestCase( SECTION, "parseFloat('-3.e1')", -30, parseFloat("-3.e1") ); -new TestCase( SECTION, "parseFloat('+3.e1')", 30, parseFloat("+3.e1") ); - -new TestCase( SECTION, "parseFloat('3.e+1')", 30, parseFloat("3.e+1") ); -new TestCase( SECTION, "parseFloat('-3.e+1')", -30, parseFloat("-3.e+1") ); -new TestCase( SECTION, "parseFloat('+3.e+1')", 30, parseFloat("+3.e+1") ); - -new TestCase( SECTION, "parseFloat('3.e-1')", .30, parseFloat("3.e-1") ); -new TestCase( SECTION, "parseFloat('-3.e-1')", -.30, parseFloat("-3.e-1") ); -new TestCase( SECTION, "parseFloat('+3.e-1')", .30, parseFloat("+3.e-1") ); - -// StrDecimalLiteral::: .DecimalDigits ExponentPart opt - -new TestCase( SECTION, "parseFloat('.00001')", 0.00001, parseFloat(".00001") ); -new TestCase( SECTION, "parseFloat('+.00001')", 0.00001, parseFloat("+.00001") ); -new TestCase( SECTION, "parseFloat('-0.0001')", -0.00001, parseFloat("-.00001") ); - -new TestCase( SECTION, "parseFloat('.01e2')", 1, parseFloat(".01e2") ); -new TestCase( SECTION, "parseFloat('+.01e2')", 1, parseFloat("+.01e2") ); -new TestCase( SECTION, "parseFloat('-.01e2')", -1, parseFloat("-.01e2") ); - -new TestCase( SECTION, "parseFloat('.01e+2')", 1, parseFloat(".01e+2") ); -new TestCase( SECTION, "parseFloat('+.01e+2')", 1, parseFloat("+.01e+2") ); -new TestCase( SECTION, "parseFloat('-.01e+2')", -1, parseFloat("-.01e+2") ); - -new TestCase( SECTION, "parseFloat('.01e-2')", 0.0001, parseFloat(".01e-2") ); -new TestCase( SECTION, "parseFloat('+.01e-2')", 0.0001, parseFloat("+.01e-2") ); -new TestCase( SECTION, "parseFloat('-.01e-2')", -0.0001, parseFloat("-.01e-2") ); - -// StrDecimalLiteral::: DecimalDigits ExponentPart opt - -new TestCase( SECTION, "parseFloat('1234e5')", 123400000, parseFloat("1234e5") ); -new TestCase( SECTION, "parseFloat('+1234e5')", 123400000, parseFloat("+1234e5") ); -new TestCase( SECTION, "parseFloat('-1234e5')", -123400000, parseFloat("-1234e5") ); - -new TestCase( SECTION, "parseFloat('1234e+5')", 123400000, parseFloat("1234e+5") ); -new TestCase( SECTION, "parseFloat('+1234e+5')", 123400000, parseFloat("+1234e+5") ); -new TestCase( SECTION, "parseFloat('-1234e+5')", -123400000, parseFloat("-1234e+5") ); - -new TestCase( SECTION, "parseFloat('1234e-5')", 0.01234, parseFloat("1234e-5") ); -new TestCase( SECTION, "parseFloat('+1234e-5')", 0.01234, parseFloat("+1234e-5") ); -new TestCase( SECTION, "parseFloat('-1234e-5')", -0.01234, parseFloat("-1234e-5") ); - - -new TestCase( SECTION, "parseFloat(0)", 0, parseFloat(0) ); -new TestCase( SECTION, "parseFloat(-0)", -0, parseFloat(-0) ); - -new TestCase( SECTION, "parseFloat(1)", 1, parseFloat(1) ); -new TestCase( SECTION, "parseFloat(-1)", -1, parseFloat(-1) ); - -new TestCase( SECTION, "parseFloat(2)", 2, parseFloat(2) ); -new TestCase( SECTION, "parseFloat(-2)", -2, parseFloat(-2) ); - -new TestCase( SECTION, "parseFloat(3)", 3, parseFloat(3) ); -new TestCase( SECTION, "parseFloat(-3)", -3, parseFloat(-3) ); - -new TestCase( SECTION, "parseFloat(4)", 4, parseFloat(4) ); -new TestCase( SECTION, "parseFloat(-4)", -4, parseFloat(-4) ); - -new TestCase( SECTION, "parseFloat(5)", 5, parseFloat(5) ); -new TestCase( SECTION, "parseFloat(-5)", -5, parseFloat(-5) ); - -new TestCase( SECTION, "parseFloat(6)", 6, parseFloat(6) ); -new TestCase( SECTION, "parseFloat(-6)", -6, parseFloat(-6) ); - -new TestCase( SECTION, "parseFloat(7)", 7, parseFloat(7) ); -new TestCase( SECTION, "parseFloat(-7)", -7, parseFloat(-7) ); - -new TestCase( SECTION, "parseFloat(8)", 8, parseFloat(8) ); -new TestCase( SECTION, "parseFloat(-8)", -8, parseFloat(-8) ); - -new TestCase( SECTION, "parseFloat(9)", 9, parseFloat(9) ); -new TestCase( SECTION, "parseFloat(-9)", -9, parseFloat(-9) ); - -new TestCase( SECTION, "parseFloat(3.14159)", 3.14159, parseFloat(3.14159) ); -new TestCase( SECTION, "parseFloat(-3.14159)", -3.14159, parseFloat(-3.14159) ); - -new TestCase( SECTION, "parseFloat(3.)", 3, parseFloat(3.) ); -new TestCase( SECTION, "parseFloat(-3.)", -3, parseFloat(-3.) ); - -new TestCase( SECTION, "parseFloat(3.e1)", 30, parseFloat(3.e1) ); -new TestCase( SECTION, "parseFloat(-3.e1)", -30, parseFloat(-3.e1) ); - -new TestCase( SECTION, "parseFloat(3.e+1)", 30, parseFloat(3.e+1) ); -new TestCase( SECTION, "parseFloat(-3.e+1)", -30, parseFloat(-3.e+1) ); - -new TestCase( SECTION, "parseFloat(3.e-1)", .30, parseFloat(3.e-1) ); -new TestCase( SECTION, "parseFloat(-3.e-1)", -.30, parseFloat(-3.e-1) ); - - -new TestCase( SECTION, "parseFloat(3.E1)", 30, parseFloat(3.E1) ); -new TestCase( SECTION, "parseFloat(-3.E1)", -30, parseFloat(-3.E1) ); - -new TestCase( SECTION, "parseFloat(3.E+1)", 30, parseFloat(3.E+1) ); -new TestCase( SECTION, "parseFloat(-3.E+1)", -30, parseFloat(-3.E+1) ); - -new TestCase( SECTION, "parseFloat(3.E-1)", .30, parseFloat(3.E-1) ); -new TestCase( SECTION, "parseFloat(-3.E-1)", -.30, parseFloat(-3.E-1) ); - -// StrDecimalLiteral::: .DecimalDigits ExponentPart opt - -new TestCase( SECTION, "parseFloat(.00001)", 0.00001, parseFloat(.00001) ); -new TestCase( SECTION, "parseFloat(-0.0001)", -0.00001, parseFloat(-.00001) ); - -new TestCase( SECTION, "parseFloat(.01e2)", 1, parseFloat(.01e2) ); -new TestCase( SECTION, "parseFloat(-.01e2)", -1, parseFloat(-.01e2) ); - -new TestCase( SECTION, "parseFloat(.01e+2)", 1, parseFloat(.01e+2) ); -new TestCase( SECTION, "parseFloat(-.01e+2)", -1, parseFloat(-.01e+2) ); - -new TestCase( SECTION, "parseFloat(.01e-2)", 0.0001, parseFloat(.01e-2) ); -new TestCase( SECTION, "parseFloat(-.01e-2)", -0.0001, parseFloat(-.01e-2) ); - -// StrDecimalLiteral::: DecimalDigits ExponentPart opt - -new TestCase( SECTION, "parseFloat(1234e5)", 123400000, parseFloat(1234e5) ); -new TestCase( SECTION, "parseFloat(-1234e5)", -123400000, parseFloat(-1234e5) ); - -new TestCase( SECTION, "parseFloat(1234e+5)", 123400000, parseFloat(1234e+5) ); -new TestCase( SECTION, "parseFloat(-1234e+5)", -123400000, parseFloat(-1234e+5) ); - -new TestCase( SECTION, "parseFloat(1234e-5)", 0.01234, parseFloat(1234e-5) ); -new TestCase( SECTION, "parseFloat(-1234e-5)", -0.01234, parseFloat(-1234e-5) ); - -// hex cases should all return 0 (0 is the longest string that satisfies a StringDecimalLiteral) - -new TestCase( SECTION, "parseFloat('0x0')", 0, parseFloat("0x0")); -new TestCase( SECTION, "parseFloat('0x1')", 0, parseFloat("0x1")); -new TestCase( SECTION, "parseFloat('0x2')", 0, parseFloat("0x2")); -new TestCase( SECTION, "parseFloat('0x3')", 0, parseFloat("0x3")); -new TestCase( SECTION, "parseFloat('0x4')", 0, parseFloat("0x4")); -new TestCase( SECTION, "parseFloat('0x5')", 0, parseFloat("0x5")); -new TestCase( SECTION, "parseFloat('0x6')", 0, parseFloat("0x6")); -new TestCase( SECTION, "parseFloat('0x7')", 0, parseFloat("0x7")); -new TestCase( SECTION, "parseFloat('0x8')", 0, parseFloat("0x8")); -new TestCase( SECTION, "parseFloat('0x9')", 0, parseFloat("0x9")); -new TestCase( SECTION, "parseFloat('0xa')", 0, parseFloat("0xa")); -new TestCase( SECTION, "parseFloat('0xb')", 0, parseFloat("0xb")); -new TestCase( SECTION, "parseFloat('0xc')", 0, parseFloat("0xc")); -new TestCase( SECTION, "parseFloat('0xd')", 0, parseFloat("0xd")); -new TestCase( SECTION, "parseFloat('0xe')", 0, parseFloat("0xe")); -new TestCase( SECTION, "parseFloat('0xf')", 0, parseFloat("0xf")); -new TestCase( SECTION, "parseFloat('0xA')", 0, parseFloat("0xA")); -new TestCase( SECTION, "parseFloat('0xB')", 0, parseFloat("0xB")); -new TestCase( SECTION, "parseFloat('0xC')", 0, parseFloat("0xC")); -new TestCase( SECTION, "parseFloat('0xD')", 0, parseFloat("0xD")); -new TestCase( SECTION, "parseFloat('0xE')", 0, parseFloat("0xE")); -new TestCase( SECTION, "parseFloat('0xF')", 0, parseFloat("0xF")); - -new TestCase( SECTION, "parseFloat('0X0')", 0, parseFloat("0X0")); -new TestCase( SECTION, "parseFloat('0X1')", 0, parseFloat("0X1")); -new TestCase( SECTION, "parseFloat('0X2')", 0, parseFloat("0X2")); -new TestCase( SECTION, "parseFloat('0X3')", 0, parseFloat("0X3")); -new TestCase( SECTION, "parseFloat('0X4')", 0, parseFloat("0X4")); -new TestCase( SECTION, "parseFloat('0X5')", 0, parseFloat("0X5")); -new TestCase( SECTION, "parseFloat('0X6')", 0, parseFloat("0X6")); -new TestCase( SECTION, "parseFloat('0X7')", 0, parseFloat("0X7")); -new TestCase( SECTION, "parseFloat('0X8')", 0, parseFloat("0X8")); -new TestCase( SECTION, "parseFloat('0X9')", 0, parseFloat("0X9")); -new TestCase( SECTION, "parseFloat('0Xa')", 0, parseFloat("0Xa")); -new TestCase( SECTION, "parseFloat('0Xb')", 0, parseFloat("0Xb")); -new TestCase( SECTION, "parseFloat('0Xc')", 0, parseFloat("0Xc")); -new TestCase( SECTION, "parseFloat('0Xd')", 0, parseFloat("0Xd")); -new TestCase( SECTION, "parseFloat('0Xe')", 0, parseFloat("0Xe")); -new TestCase( SECTION, "parseFloat('0Xf')", 0, parseFloat("0Xf")); -new TestCase( SECTION, "parseFloat('0XA')", 0, parseFloat("0XA")); -new TestCase( SECTION, "parseFloat('0XB')", 0, parseFloat("0XB")); -new TestCase( SECTION, "parseFloat('0XC')", 0, parseFloat("0XC")); -new TestCase( SECTION, "parseFloat('0XD')", 0, parseFloat("0XD")); -new TestCase( SECTION, "parseFloat('0XE')", 0, parseFloat("0XE")); -new TestCase( SECTION, "parseFloat('0XF')", 0, parseFloat("0XF")); -new TestCase( SECTION, "parseFloat(' 0XF ')", 0, parseFloat(" 0XF ")); - -// hex literals should still succeed - -new TestCase( SECTION, "parseFloat(0x0)", 0, parseFloat(0x0)); -new TestCase( SECTION, "parseFloat(0x1)", 1, parseFloat(0x1)); -new TestCase( SECTION, "parseFloat(0x2)", 2, parseFloat(0x2)); -new TestCase( SECTION, "parseFloat(0x3)", 3, parseFloat(0x3)); -new TestCase( SECTION, "parseFloat(0x4)", 4, parseFloat(0x4)); -new TestCase( SECTION, "parseFloat(0x5)", 5, parseFloat(0x5)); -new TestCase( SECTION, "parseFloat(0x6)", 6, parseFloat(0x6)); -new TestCase( SECTION, "parseFloat(0x7)", 7, parseFloat(0x7)); -new TestCase( SECTION, "parseFloat(0x8)", 8, parseFloat(0x8)); -new TestCase( SECTION, "parseFloat(0x9)", 9, parseFloat(0x9)); -new TestCase( SECTION, "parseFloat(0xa)", 10, parseFloat(0xa)); -new TestCase( SECTION, "parseFloat(0xb)", 11, parseFloat(0xb)); -new TestCase( SECTION, "parseFloat(0xc)", 12, parseFloat(0xc)); -new TestCase( SECTION, "parseFloat(0xd)", 13, parseFloat(0xd)); -new TestCase( SECTION, "parseFloat(0xe)", 14, parseFloat(0xe)); -new TestCase( SECTION, "parseFloat(0xf)", 15, parseFloat(0xf)); -new TestCase( SECTION, "parseFloat(0xA)", 10, parseFloat(0xA)); -new TestCase( SECTION, "parseFloat(0xB)", 11, parseFloat(0xB)); -new TestCase( SECTION, "parseFloat(0xC)", 12, parseFloat(0xC)); -new TestCase( SECTION, "parseFloat(0xD)", 13, parseFloat(0xD)); -new TestCase( SECTION, "parseFloat(0xE)", 14, parseFloat(0xE)); -new TestCase( SECTION, "parseFloat(0xF)", 15, parseFloat(0xF)); - -new TestCase( SECTION, "parseFloat(0X0)", 0, parseFloat(0X0)); -new TestCase( SECTION, "parseFloat(0X1)", 1, parseFloat(0X1)); -new TestCase( SECTION, "parseFloat(0X2)", 2, parseFloat(0X2)); -new TestCase( SECTION, "parseFloat(0X3)", 3, parseFloat(0X3)); -new TestCase( SECTION, "parseFloat(0X4)", 4, parseFloat(0X4)); -new TestCase( SECTION, "parseFloat(0X5)", 5, parseFloat(0X5)); -new TestCase( SECTION, "parseFloat(0X6)", 6, parseFloat(0X6)); -new TestCase( SECTION, "parseFloat(0X7)", 7, parseFloat(0X7)); -new TestCase( SECTION, "parseFloat(0X8)", 8, parseFloat(0X8)); -new TestCase( SECTION, "parseFloat(0X9)", 9, parseFloat(0X9)); -new TestCase( SECTION, "parseFloat(0Xa)", 10, parseFloat(0Xa)); -new TestCase( SECTION, "parseFloat(0Xb)", 11, parseFloat(0Xb)); -new TestCase( SECTION, "parseFloat(0Xc)", 12, parseFloat(0Xc)); -new TestCase( SECTION, "parseFloat(0Xd)", 13, parseFloat(0Xd)); -new TestCase( SECTION, "parseFloat(0Xe)", 14, parseFloat(0Xe)); -new TestCase( SECTION, "parseFloat(0Xf)", 15, parseFloat(0Xf)); -new TestCase( SECTION, "parseFloat(0XA)", 10, parseFloat(0XA)); -new TestCase( SECTION, "parseFloat(0XB)", 11, parseFloat(0XB)); -new TestCase( SECTION, "parseFloat(0XC)", 12, parseFloat(0XC)); -new TestCase( SECTION, "parseFloat(0XD)", 13, parseFloat(0XD)); -new TestCase( SECTION, "parseFloat(0XE)", 14, parseFloat(0XE)); -new TestCase( SECTION, "parseFloat(0XF)", 15, parseFloat(0XF)); - - -// A StringNumericLiteral may not use octal notation - -new TestCase( SECTION, "parseFloat('00')", 0, parseFloat("00")); -new TestCase( SECTION, "parseFloat('01')", 1, parseFloat("01")); -new TestCase( SECTION, "parseFloat('02')", 2, parseFloat("02")); -new TestCase( SECTION, "parseFloat('03')", 3, parseFloat("03")); -new TestCase( SECTION, "parseFloat('04')", 4, parseFloat("04")); -new TestCase( SECTION, "parseFloat('05')", 5, parseFloat("05")); -new TestCase( SECTION, "parseFloat('06')", 6, parseFloat("06")); -new TestCase( SECTION, "parseFloat('07')", 7, parseFloat("07")); -new TestCase( SECTION, "parseFloat('010')", 10, parseFloat("010")); -new TestCase( SECTION, "parseFloat('011')", 11, parseFloat("011")); - -// A StringNumericLIteral may have any number of leading 0 digits - -new TestCase( SECTION, "parseFloat('001')", 1, parseFloat("001")); -new TestCase( SECTION, "parseFloat('0001')", 1, parseFloat("0001")); -new TestCase( SECTION, "parseFloat(' 0001 ')", 1, parseFloat(" 0001 ")); - -// an octal numeric literal should be treated as an octal - -new TestCase( SECTION, "parseFloat(00)", 0, parseFloat(00)); -new TestCase( SECTION, "parseFloat(01)", 1, parseFloat(01)); -new TestCase( SECTION, "parseFloat(02)", 2, parseFloat(02)); -new TestCase( SECTION, "parseFloat(03)", 3, parseFloat(03)); -new TestCase( SECTION, "parseFloat(04)", 4, parseFloat(04)); -new TestCase( SECTION, "parseFloat(05)", 5, parseFloat(05)); -new TestCase( SECTION, "parseFloat(06)", 6, parseFloat(06)); -new TestCase( SECTION, "parseFloat(07)", 7, parseFloat(07)); -new TestCase( SECTION, "parseFloat(010)", 8, parseFloat(010)); -new TestCase( SECTION, "parseFloat(011)", 9, parseFloat(011)); - -// A StringNumericLIteral may have any number of leading 0 digits - -new TestCase( SECTION, "parseFloat(001)", 1, parseFloat(001)); -new TestCase( SECTION, "parseFloat(0001)", 1, parseFloat(0001)); - -// make sure it's reflexive -new TestCase( SECTION, "parseFloat(Math.PI)", Math.PI, parseFloat(Math.PI)); -new TestCase( SECTION, "parseFloat(Math.LN2)", Math.LN2, parseFloat(Math.LN2)); -new TestCase( SECTION, "parseFloat(Math.LN10)", Math.LN10, parseFloat(Math.LN10)); -new TestCase( SECTION, "parseFloat(Math.LOG2E)", Math.LOG2E, parseFloat(Math.LOG2E)); -new TestCase( SECTION, "parseFloat(Math.LOG10E)", Math.LOG10E, parseFloat(Math.LOG10E)); -new TestCase( SECTION, "parseFloat(Math.SQRT2)", Math.SQRT2, parseFloat(Math.SQRT2)); -new TestCase( SECTION, "parseFloat(Math.SQRT1_2)", Math.SQRT1_2, parseFloat(Math.SQRT1_2)); - -new TestCase( SECTION, "parseFloat(Math.PI+'')", Math.PI, parseFloat(Math.PI+'')); -new TestCase( SECTION, "parseFloat(Math.LN2+'')", Math.LN2, parseFloat(Math.LN2+'')); -new TestCase( SECTION, "parseFloat(Math.LN10+'')", Math.LN10, parseFloat(Math.LN10+'')); -new TestCase( SECTION, "parseFloat(Math.LOG2E+'')", Math.LOG2E, parseFloat(Math.LOG2E+'')); -new TestCase( SECTION, "parseFloat(Math.LOG10E+'')", Math.LOG10E, parseFloat(Math.LOG10E+'')); -new TestCase( SECTION, "parseFloat(Math.SQRT2+'')", Math.SQRT2, parseFloat(Math.SQRT2+'')); -new TestCase( SECTION, "parseFloat(Math.SQRT1_2+'')", Math.SQRT1_2, parseFloat(Math.SQRT1_2+'')); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.3-2.js b/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.3-2.js deleted file mode 100644 index 557b93f637..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.3-2.js +++ /dev/null @@ -1,291 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.1.2.3-2.js'; - -/** - File Name: 15.1.2.3-2.js - ECMA Section: 15.1.2.3 Function properties of the global object: - parseFloat( string ) - - Description: The parseFloat function produces a number value dictated - by the interpretation of the contents of the string - argument defined as a decimal literal. - - When the parseFloat function is called, the following - steps are taken: - - 1. Call ToString( string ). - 2. Remove leading whitespace Result(1). - 3. If neither Result(2) nor any prefix of Result(2) - satisfies the syntax of a StrDecimalLiteral, - return NaN. - 4. Compute the longest prefix of Result(2) which might - be Resusult(2) itself, that satisfies the syntax of - a StrDecimalLiteral - 5. Return the number value for the MV of Result(4). - - Note that parseFloate may interpret only a leading - portion of the string as a number value; it ignores any - characters that cannot be interpreted as part of the - notation of a decimal literal, and no indication is given - that such characters were ignored. - - StrDecimalLiteral:: - Infinity - DecimalDigits.DecimalDigits opt ExponentPart opt - .DecimalDigits ExponentPart opt - DecimalDigits ExponentPart opt - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ -var SECTION = "15.1.2.3-2"; -var VERSION = "ECMA_1"; -startTest(); - -var BUGNUMBER="none"; - -new TestCase( SECTION, "parseFloat(true)", Number.NaN, parseFloat(true) ); -new TestCase( SECTION, "parseFloat(false)", Number.NaN, parseFloat(false) ); -new TestCase( SECTION, "parseFloat('string')", Number.NaN, parseFloat("string") ); - -new TestCase( SECTION, "parseFloat(' Infinity')", Number.POSITIVE_INFINITY, parseFloat("Infinity") ); -// new TestCase( SECTION, "parseFloat(Infinity)", Number.POSITIVE_INFINITY, parseFloat(Infinity) ); - -new TestCase( SECTION, "parseFloat(' 0')", 0, parseFloat(" 0") ); -new TestCase( SECTION, "parseFloat(' -0')", -0, parseFloat(" -0") ); -new TestCase( SECTION, "parseFloat(' +0')", 0, parseFloat(" +0") ); - -new TestCase( SECTION, "parseFloat(' 1')", 1, parseFloat(" 1") ); -new TestCase( SECTION, "parseFloat(' -1')", -1, parseFloat(" -1") ); -new TestCase( SECTION, "parseFloat(' +1')", 1, parseFloat(" +1") ); - -new TestCase( SECTION, "parseFloat(' 2')", 2, parseFloat(" 2") ); -new TestCase( SECTION, "parseFloat(' -2')", -2, parseFloat(" -2") ); -new TestCase( SECTION, "parseFloat(' +2')", 2, parseFloat(" +2") ); - -new TestCase( SECTION, "parseFloat(' 3')", 3, parseFloat(" 3") ); -new TestCase( SECTION, "parseFloat(' -3')", -3, parseFloat(" -3") ); -new TestCase( SECTION, "parseFloat(' +3')", 3, parseFloat(" +3") ); - -new TestCase( SECTION, "parseFloat(' 4')", 4, parseFloat(" 4") ); -new TestCase( SECTION, "parseFloat(' -4')", -4, parseFloat(" -4") ); -new TestCase( SECTION, "parseFloat(' +4')", 4, parseFloat(" +4") ); - -new TestCase( SECTION, "parseFloat(' 5')", 5, parseFloat(" 5") ); -new TestCase( SECTION, "parseFloat(' -5')", -5, parseFloat(" -5") ); -new TestCase( SECTION, "parseFloat(' +5')", 5, parseFloat(" +5") ); - -new TestCase( SECTION, "parseFloat(' 6')", 6, parseFloat(" 6") ); -new TestCase( SECTION, "parseFloat(' -6')", -6, parseFloat(" -6") ); -new TestCase( SECTION, "parseFloat(' +6')", 6, parseFloat(" +6") ); - -new TestCase( SECTION, "parseFloat(' 7')", 7, parseFloat(" 7") ); -new TestCase( SECTION, "parseFloat(' -7')", -7, parseFloat(" -7") ); -new TestCase( SECTION, "parseFloat(' +7')", 7, parseFloat(" +7") ); - -new TestCase( SECTION, "parseFloat(' 8')", 8, parseFloat(" 8") ); -new TestCase( SECTION, "parseFloat(' -8')", -8, parseFloat(" -8") ); -new TestCase( SECTION, "parseFloat(' +8')", 8, parseFloat(" +8") ); - -new TestCase( SECTION, "parseFloat(' 9')", 9, parseFloat(" 9") ); -new TestCase( SECTION, "parseFloat(' -9')", -9, parseFloat(" -9") ); -new TestCase( SECTION, "parseFloat(' +9')", 9, parseFloat(" +9") ); - -new TestCase( SECTION, "parseFloat(' 3.14159')", 3.14159, parseFloat(" 3.14159") ); -new TestCase( SECTION, "parseFloat(' -3.14159')", -3.14159, parseFloat(" -3.14159") ); -new TestCase( SECTION, "parseFloat(' +3.14159')", 3.14159, parseFloat(" +3.14159") ); - -new TestCase( SECTION, "parseFloat(' 3.')", 3, parseFloat(" 3.") ); -new TestCase( SECTION, "parseFloat(' -3.')", -3, parseFloat(" -3.") ); -new TestCase( SECTION, "parseFloat(' +3.')", 3, parseFloat(" +3.") ); - -new TestCase( SECTION, "parseFloat(' 3.e1')", 30, parseFloat(" 3.e1") ); -new TestCase( SECTION, "parseFloat(' -3.e1')", -30, parseFloat(" -3.e1") ); -new TestCase( SECTION, "parseFloat(' +3.e1')", 30, parseFloat(" +3.e1") ); - -new TestCase( SECTION, "parseFloat(' 3.e+1')", 30, parseFloat(" 3.e+1") ); -new TestCase( SECTION, "parseFloat(' -3.e+1')", -30, parseFloat(" -3.e+1") ); -new TestCase( SECTION, "parseFloat(' +3.e+1')", 30, parseFloat(" +3.e+1") ); - -new TestCase( SECTION, "parseFloat(' 3.e-1')", .30, parseFloat(" 3.e-1") ); -new TestCase( SECTION, "parseFloat(' -3.e-1')", -.30, parseFloat(" -3.e-1") ); -new TestCase( SECTION, "parseFloat(' +3.e-1')", .30, parseFloat(" +3.e-1") ); - -// StrDecimalLiteral::: .DecimalDigits ExponentPart opt - -new TestCase( SECTION, "parseFloat(' .00001')", 0.00001, parseFloat(" .00001") ); -new TestCase( SECTION, "parseFloat(' +.00001')", 0.00001, parseFloat(" +.00001") ); -new TestCase( SECTION, "parseFloat(' -0.0001')", -0.00001, parseFloat(" -.00001") ); - -new TestCase( SECTION, "parseFloat(' .01e2')", 1, parseFloat(" .01e2") ); -new TestCase( SECTION, "parseFloat(' +.01e2')", 1, parseFloat(" +.01e2") ); -new TestCase( SECTION, "parseFloat(' -.01e2')", -1, parseFloat(" -.01e2") ); - -new TestCase( SECTION, "parseFloat(' .01e+2')", 1, parseFloat(" .01e+2") ); -new TestCase( SECTION, "parseFloat(' +.01e+2')", 1, parseFloat(" +.01e+2") ); -new TestCase( SECTION, "parseFloat(' -.01e+2')", -1, parseFloat(" -.01e+2") ); - -new TestCase( SECTION, "parseFloat(' .01e-2')", 0.0001, parseFloat(" .01e-2") ); -new TestCase( SECTION, "parseFloat(' +.01e-2')", 0.0001, parseFloat(" +.01e-2") ); -new TestCase( SECTION, "parseFloat(' -.01e-2')", -0.0001, parseFloat(" -.01e-2") ); - -// StrDecimalLiteral::: DecimalDigits ExponentPart opt - -new TestCase( SECTION, "parseFloat(' 1234e5')", 123400000, parseFloat(" 1234e5") ); -new TestCase( SECTION, "parseFloat(' +1234e5')", 123400000, parseFloat(" +1234e5") ); -new TestCase( SECTION, "parseFloat(' -1234e5')", -123400000, parseFloat(" -1234e5") ); - -new TestCase( SECTION, "parseFloat(' 1234e+5')", 123400000, parseFloat(" 1234e+5") ); -new TestCase( SECTION, "parseFloat(' +1234e+5')", 123400000, parseFloat(" +1234e+5") ); -new TestCase( SECTION, "parseFloat(' -1234e+5')", -123400000, parseFloat(" -1234e+5") ); - -new TestCase( SECTION, "parseFloat(' 1234e-5')", 0.01234, parseFloat(" 1234e-5") ); -new TestCase( SECTION, "parseFloat(' +1234e-5')", 0.01234, parseFloat(" +1234e-5") ); -new TestCase( SECTION, "parseFloat(' -1234e-5')", -0.01234, parseFloat(" -1234e-5") ); - - -new TestCase( SECTION, "parseFloat(' .01E2')", 1, parseFloat(" .01E2") ); -new TestCase( SECTION, "parseFloat(' +.01E2')", 1, parseFloat(" +.01E2") ); -new TestCase( SECTION, "parseFloat(' -.01E2')", -1, parseFloat(" -.01E2") ); - -new TestCase( SECTION, "parseFloat(' .01E+2')", 1, parseFloat(" .01E+2") ); -new TestCase( SECTION, "parseFloat(' +.01E+2')", 1, parseFloat(" +.01E+2") ); -new TestCase( SECTION, "parseFloat(' -.01E+2')", -1, parseFloat(" -.01E+2") ); - -new TestCase( SECTION, "parseFloat(' .01E-2')", 0.0001, parseFloat(" .01E-2") ); -new TestCase( SECTION, "parseFloat(' +.01E-2')", 0.0001, parseFloat(" +.01E-2") ); -new TestCase( SECTION, "parseFloat(' -.01E-2')", -0.0001, parseFloat(" -.01E-2") ); - -// StrDecimalLiteral::: DecimalDigits ExponentPart opt -new TestCase( SECTION, "parseFloat(' 1234E5')", 123400000, parseFloat(" 1234E5") ); -new TestCase( SECTION, "parseFloat(' +1234E5')", 123400000, parseFloat(" +1234E5") ); -new TestCase( SECTION, "parseFloat(' -1234E5')", -123400000, parseFloat(" -1234E5") ); - -new TestCase( SECTION, "parseFloat(' 1234E+5')", 123400000, parseFloat(" 1234E+5") ); -new TestCase( SECTION, "parseFloat(' +1234E+5')", 123400000, parseFloat(" +1234E+5") ); -new TestCase( SECTION, "parseFloat(' -1234E+5')", -123400000, parseFloat(" -1234E+5") ); - -new TestCase( SECTION, "parseFloat(' 1234E-5')", 0.01234, parseFloat(" 1234E-5") ); -new TestCase( SECTION, "parseFloat(' +1234E-5')", 0.01234, parseFloat(" +1234E-5") ); -new TestCase( SECTION, "parseFloat(' -1234E-5')", -0.01234, parseFloat(" -1234E-5") ); - - -// hex cases should all return NaN - -new TestCase( SECTION, "parseFloat(' 0x0')", 0, parseFloat(" 0x0")); -new TestCase( SECTION, "parseFloat(' 0x1')", 0, parseFloat(" 0x1")); -new TestCase( SECTION, "parseFloat(' 0x2')", 0, parseFloat(" 0x2")); -new TestCase( SECTION, "parseFloat(' 0x3')", 0, parseFloat(" 0x3")); -new TestCase( SECTION, "parseFloat(' 0x4')", 0, parseFloat(" 0x4")); -new TestCase( SECTION, "parseFloat(' 0x5')", 0, parseFloat(" 0x5")); -new TestCase( SECTION, "parseFloat(' 0x6')", 0, parseFloat(" 0x6")); -new TestCase( SECTION, "parseFloat(' 0x7')", 0, parseFloat(" 0x7")); -new TestCase( SECTION, "parseFloat(' 0x8')", 0, parseFloat(" 0x8")); -new TestCase( SECTION, "parseFloat(' 0x9')", 0, parseFloat(" 0x9")); -new TestCase( SECTION, "parseFloat(' 0xa')", 0, parseFloat(" 0xa")); -new TestCase( SECTION, "parseFloat(' 0xb')", 0, parseFloat(" 0xb")); -new TestCase( SECTION, "parseFloat(' 0xc')", 0, parseFloat(" 0xc")); -new TestCase( SECTION, "parseFloat(' 0xd')", 0, parseFloat(" 0xd")); -new TestCase( SECTION, "parseFloat(' 0xe')", 0, parseFloat(" 0xe")); -new TestCase( SECTION, "parseFloat(' 0xf')", 0, parseFloat(" 0xf")); -new TestCase( SECTION, "parseFloat(' 0xA')", 0, parseFloat(" 0xA")); -new TestCase( SECTION, "parseFloat(' 0xB')", 0, parseFloat(" 0xB")); -new TestCase( SECTION, "parseFloat(' 0xC')", 0, parseFloat(" 0xC")); -new TestCase( SECTION, "parseFloat(' 0xD')", 0, parseFloat(" 0xD")); -new TestCase( SECTION, "parseFloat(' 0xE')", 0, parseFloat(" 0xE")); -new TestCase( SECTION, "parseFloat(' 0xF')", 0, parseFloat(" 0xF")); - -new TestCase( SECTION, "parseFloat(' 0X0')", 0, parseFloat(" 0X0")); -new TestCase( SECTION, "parseFloat(' 0X1')", 0, parseFloat(" 0X1")); -new TestCase( SECTION, "parseFloat(' 0X2')", 0, parseFloat(" 0X2")); -new TestCase( SECTION, "parseFloat(' 0X3')", 0, parseFloat(" 0X3")); -new TestCase( SECTION, "parseFloat(' 0X4')", 0, parseFloat(" 0X4")); -new TestCase( SECTION, "parseFloat(' 0X5')", 0, parseFloat(" 0X5")); -new TestCase( SECTION, "parseFloat(' 0X6')", 0, parseFloat(" 0X6")); -new TestCase( SECTION, "parseFloat(' 0X7')", 0, parseFloat(" 0X7")); -new TestCase( SECTION, "parseFloat(' 0X8')", 0, parseFloat(" 0X8")); -new TestCase( SECTION, "parseFloat(' 0X9')", 0, parseFloat(" 0X9")); -new TestCase( SECTION, "parseFloat(' 0Xa')", 0, parseFloat(" 0Xa")); -new TestCase( SECTION, "parseFloat(' 0Xb')", 0, parseFloat(" 0Xb")); -new TestCase( SECTION, "parseFloat(' 0Xc')", 0, parseFloat(" 0Xc")); -new TestCase( SECTION, "parseFloat(' 0Xd')", 0, parseFloat(" 0Xd")); -new TestCase( SECTION, "parseFloat(' 0Xe')", 0, parseFloat(" 0Xe")); -new TestCase( SECTION, "parseFloat(' 0Xf')", 0, parseFloat(" 0Xf")); -new TestCase( SECTION, "parseFloat(' 0XA')", 0, parseFloat(" 0XA")); -new TestCase( SECTION, "parseFloat(' 0XB')", 0, parseFloat(" 0XB")); -new TestCase( SECTION, "parseFloat(' 0XC')", 0, parseFloat(" 0XC")); -new TestCase( SECTION, "parseFloat(' 0XD')", 0, parseFloat(" 0XD")); -new TestCase( SECTION, "parseFloat(' 0XE')", 0, parseFloat(" 0XE")); -new TestCase( SECTION, "parseFloat(' 0XF')", 0, parseFloat(" 0XF")); - -// A StringNumericLiteral may not use octal notation - -new TestCase( SECTION, "parseFloat(' 00')", 0, parseFloat(" 00")); -new TestCase( SECTION, "parseFloat(' 01')", 1, parseFloat(" 01")); -new TestCase( SECTION, "parseFloat(' 02')", 2, parseFloat(" 02")); -new TestCase( SECTION, "parseFloat(' 03')", 3, parseFloat(" 03")); -new TestCase( SECTION, "parseFloat(' 04')", 4, parseFloat(" 04")); -new TestCase( SECTION, "parseFloat(' 05')", 5, parseFloat(" 05")); -new TestCase( SECTION, "parseFloat(' 06')", 6, parseFloat(" 06")); -new TestCase( SECTION, "parseFloat(' 07')", 7, parseFloat(" 07")); -new TestCase( SECTION, "parseFloat(' 010')", 10, parseFloat(" 010")); -new TestCase( SECTION, "parseFloat(' 011')", 11, parseFloat(" 011")); - -// A StringNumericLIteral may have any number of leading 0 digits - -new TestCase( SECTION, "parseFloat(' 001')", 1, parseFloat(" 001")); -new TestCase( SECTION, "parseFloat(' 0001')", 1, parseFloat(" 0001")); - -// A StringNumericLIteral may have any number of leading 0 digits - -new TestCase( SECTION, "parseFloat(001)", 1, parseFloat(001)); -new TestCase( SECTION, "parseFloat(0001)", 1, parseFloat(0001)); - -// make sure it' s reflexive -new TestCase( SECTION, "parseFloat( ' ' +Math.PI+' ')", Math.PI, parseFloat( ' ' +Math.PI+' ')); -new TestCase( SECTION, "parseFloat( ' ' +Math.LN2+' ')", Math.LN2, parseFloat( ' ' +Math.LN2+' ')); -new TestCase( SECTION, "parseFloat( ' ' +Math.LN10+' ')", Math.LN10, parseFloat( ' ' +Math.LN10+' ')); -new TestCase( SECTION, "parseFloat( ' ' +Math.LOG2E+' ')", Math.LOG2E, parseFloat( ' ' +Math.LOG2E+' ')); -new TestCase( SECTION, "parseFloat( ' ' +Math.LOG10E+' ')", Math.LOG10E, parseFloat( ' ' +Math.LOG10E+' ')); -new TestCase( SECTION, "parseFloat( ' ' +Math.SQRT2+' ')", Math.SQRT2, parseFloat( ' ' +Math.SQRT2+' ')); -new TestCase( SECTION, "parseFloat( ' ' +Math.SQRT1_2+' ')", Math.SQRT1_2, parseFloat( ' ' +Math.SQRT1_2+' ')); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.4.js b/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.4.js deleted file mode 100644 index bd2114a1a9..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.4.js +++ /dev/null @@ -1,205 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.1.2.4.js'; - -/** - File Name: 15.1.2.4.js - ECMA Section: 15.1.2.4 Function properties of the global object - escape( string ) - - Description: - The escape function computes a new version of a string value in which - certain characters have been replaced by a hexadecimal escape sequence. - The result thus contains no special characters that might have special - meaning within a URL. - - For characters whose Unicode encoding is 0xFF or less, a two-digit - escape sequence of the form %xx is used in accordance with RFC1738. - For characters whose Unicode encoding is greater than 0xFF, a four- - digit escape sequence of the form %uxxxx is used. - - When the escape function is called with one argument string, the - following steps are taken: - - 1. Call ToString(string). - 2. Compute the number of characters in Result(1). - 3. Let R be the empty string. - 4. Let k be 0. - 5. If k equals Result(2), return R. - 6. Get the character at position k within Result(1). - 7. If Result(6) is one of the 69 nonblank ASCII characters - ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz - 0123456789 @*_+-./, go to step 14. - 8. Compute the 16-bit unsigned integer that is the Unicode character - encoding of Result(6). - 9. If Result(8), is less than 256, go to step 12. - 10. Let S be a string containing six characters "%uwxyz" where wxyz are - four hexadecimal digits encoding the value of Result(8). - 11. Go to step 15. - 12. Let S be a string containing three characters "%xy" where xy are two - hexadecimal digits encoding the value of Result(8). - 13. Go to step 15. - 14. Let S be a string containing the single character Result(6). - 15. Let R be a new string value computed by concatenating the previous value - of R and S. - 16. Increase k by 1. - 17. Go to step 5. - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ -var SECTION = "15.1.2.4"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "escape(string)"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "escape.length", 1, escape.length ); -new TestCase( SECTION, "escape.length = null; escape.length", 1, eval("escape.length = null; escape.length") ); -new TestCase( SECTION, "delete escape.length", false, delete escape.length ); -new TestCase( SECTION, "delete escape.length; escape.length", 1, eval("delete escape.length; escape.length") ); -new TestCase( SECTION, "var MYPROPS=''; for ( var p in escape ) { MYPROPS+= p}; MYPROPS", "prototype", eval("var MYPROPS=''; for ( var p in escape ) { MYPROPS+= p}; MYPROPS") ); - -new TestCase( SECTION, "escape()", "undefined", escape() ); -new TestCase( SECTION, "escape('')", "", escape('') ); -new TestCase( SECTION, "escape( null )", "null", escape(null) ); -new TestCase( SECTION, "escape( void 0 )", "undefined", escape(void 0) ); -new TestCase( SECTION, "escape( true )", "true", escape( true ) ); -new TestCase( SECTION, "escape( false )", "false", escape( false ) ); - -new TestCase( SECTION, "escape( new Boolean(true) )", "true", escape(new Boolean(true)) ); -new TestCase( SECTION, "escape( new Boolean(false) )", "false", escape(new Boolean(false)) ); - -new TestCase( SECTION, "escape( Number.NaN )", "NaN", escape(Number.NaN) ); -new TestCase( SECTION, "escape( -0 )", "0", escape( -0 ) ); -new TestCase( SECTION, "escape( 'Infinity' )", "Infinity", escape( "Infinity" ) ); -new TestCase( SECTION, "escape( Number.POSITIVE_INFINITY )", "Infinity", escape( Number.POSITIVE_INFINITY ) ); -new TestCase( SECTION, "escape( Number.NEGATIVE_INFINITY )", "-Infinity", escape( Number.NEGATIVE_INFINITY ) ); - -var ASCII_TEST_STRING = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@*_+-./"; - -new TestCase( SECTION, "escape( " +ASCII_TEST_STRING+" )", ASCII_TEST_STRING, escape( ASCII_TEST_STRING ) ); - -// ASCII value less than - -for ( var CHARCODE = 0; CHARCODE < 32; CHARCODE++ ) { - new TestCase( SECTION, - "escape(String.fromCharCode("+CHARCODE+"))", - "%"+ToHexString(CHARCODE), - escape(String.fromCharCode(CHARCODE)) ); -} -for ( var CHARCODE = 128; CHARCODE < 256; CHARCODE++ ) { - new TestCase( SECTION, - "escape(String.fromCharCode("+CHARCODE+"))", - "%"+ToHexString(CHARCODE), - escape(String.fromCharCode(CHARCODE)) ); -} - -for ( var CHARCODE = 256; CHARCODE < 1024; CHARCODE++ ) { - new TestCase( SECTION, - "escape(String.fromCharCode("+CHARCODE+"))", - "%u"+ ToUnicodeString(CHARCODE), - escape(String.fromCharCode(CHARCODE)) ); -} -for ( var CHARCODE = 65500; CHARCODE < 65536; CHARCODE++ ) { - new TestCase( SECTION, - "escape(String.fromCharCode("+CHARCODE+"))", - "%u"+ ToUnicodeString(CHARCODE), - escape(String.fromCharCode(CHARCODE)) ); -} - -test(); - -function ToUnicodeString( n ) { - var string = ToHexString(n); - - for ( var PAD = (4 - string.length ); PAD > 0; PAD-- ) { - string = "0" + string; - } - - return string; -} -function ToHexString( n ) { - var hex = new Array(); - - for ( var mag = 1; Math.pow(16,mag) <= n ; mag++ ) { - ; - } - - for ( index = 0, mag -= 1; mag > 0; index++, mag-- ) { - hex[index] = Math.floor( n / Math.pow(16,mag) ); - n -= Math.pow(16,mag) * Math.floor( n/Math.pow(16,mag) ); - } - - hex[hex.length] = n % 16; - - var string =""; - - for ( var index = 0 ; index < hex.length ; index++ ) { - switch ( hex[index] ) { - case 10: - string += "A"; - break; - case 11: - string += "B"; - break; - case 12: - string += "C"; - break; - case 13: - string += "D"; - break; - case 14: - string += "E"; - break; - case 15: - string += "F"; - break; - default: - string += hex[index]; - } - } - - if ( string.length == 1 ) { - string = "0" + string; - } - return string; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.5-1.js b/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.5-1.js deleted file mode 100644 index b7b072a627..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.5-1.js +++ /dev/null @@ -1,206 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.1.2.5-1.js'; - -/** - File Name: 15.1.2.5-1.js - ECMA Section: 15.1.2.5 Function properties of the global object - unescape( string ) - - Description: - The unescape function computes a new version of a string value in which - each escape sequences of the sort that might be introduced by the escape - function is replaced with the character that it represents. - - When the unescape function is called with one argument string, the - following steps are taken: - - 1. Call ToString(string). - 2. Compute the number of characters in Result(1). - 3. Let R be the empty string. - 4. Let k be 0. - 5. If k equals Result(2), return R. - 6. Let c be the character at position k within Result(1). - 7. If c is not %, go to step 18. - 8. If k is greater than Result(2)-6, go to step 14. - 9. If the character at position k+1 within result(1) is not u, go to step - 14. - 10. If the four characters at positions k+2, k+3, k+4, and k+5 within - Result(1) are not all hexadecimal digits, go to step 14. - 11. Let c be the character whose Unicode encoding is the integer represented - by the four hexadecimal digits at positions k+2, k+3, k+4, and k+5 - within Result(1). - 12. Increase k by 5. - 13. Go to step 18. - 14. If k is greater than Result(2)-3, go to step 18. - 15. If the two characters at positions k+1 and k+2 within Result(1) are not - both hexadecimal digits, go to step 18. - 16. Let c be the character whose Unicode encoding is the integer represented - by two zeroes plus the two hexadecimal digits at positions k+1 and k+2 - within Result(1). - 17. Increase k by 2. - 18. Let R be a new string value computed by concatenating the previous value - of R and c. - 19. Increase k by 1. - 20. Go to step 5. - Author: christine@netscape.com - Date: 28 october 1997 -*/ - -var SECTION = "15.1.2.5-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "unescape(string)"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "unescape.length", 1, unescape.length ); -new TestCase( SECTION, "unescape.length = null; unescape.length", 1, eval("unescape.length=null; unescape.length") ); -new TestCase( SECTION, "delete unescape.length", false, delete unescape.length ); -new TestCase( SECTION, "delete unescape.length; unescape.length", 1, eval("delete unescape.length; unescape.length") ); -new TestCase( SECTION, "var MYPROPS=''; for ( var p in unescape ) { MYPROPS+= p }; MYPROPS", "prototype", eval("var MYPROPS=''; for ( var p in unescape ) { MYPROPS+= p }; MYPROPS") ); - -new TestCase( SECTION, "unescape()", "undefined", unescape() ); -new TestCase( SECTION, "unescape('')", "", unescape('') ); -new TestCase( SECTION, "unescape( null )", "null", unescape(null) ); -new TestCase( SECTION, "unescape( void 0 )", "undefined", unescape(void 0) ); -new TestCase( SECTION, "unescape( true )", "true", unescape( true ) ); -new TestCase( SECTION, "unescape( false )", "false", unescape( false ) ); - -new TestCase( SECTION, "unescape( new Boolean(true) )", "true", unescape(new Boolean(true)) ); -new TestCase( SECTION, "unescape( new Boolean(false) )", "false", unescape(new Boolean(false)) ); - -new TestCase( SECTION, "unescape( Number.NaN )", "NaN", unescape(Number.NaN) ); -new TestCase( SECTION, "unescape( -0 )", "0", unescape( -0 ) ); -new TestCase( SECTION, "unescape( 'Infinity' )", "Infinity", unescape( "Infinity" ) ); -new TestCase( SECTION, "unescape( Number.POSITIVE_INFINITY )", "Infinity", unescape( Number.POSITIVE_INFINITY ) ); -new TestCase( SECTION, "unescape( Number.NEGATIVE_INFINITY )", "-Infinity", unescape( Number.NEGATIVE_INFINITY ) ); - -var ASCII_TEST_STRING = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@*_+-./"; - -new TestCase( SECTION, "unescape( " +ASCII_TEST_STRING+" )", ASCII_TEST_STRING, unescape( ASCII_TEST_STRING ) ); - -// escaped chars with ascii values less than 256 - -for ( var CHARCODE = 0; CHARCODE < 256; CHARCODE++ ) { - new TestCase( SECTION, - "unescape( %"+ ToHexString(CHARCODE)+" )", - String.fromCharCode(CHARCODE), - unescape( "%" + ToHexString(CHARCODE) ) ); -} - -// unicode chars represented by two hex digits -for ( var CHARCODE = 0; CHARCODE < 256; CHARCODE++ ) { - new TestCase( SECTION, - "unescape( %u"+ ToHexString(CHARCODE)+" )", - "%u"+ToHexString(CHARCODE), - unescape( "%u" + ToHexString(CHARCODE) ) ); -} -/* - for ( var CHARCODE = 0; CHARCODE < 256; CHARCODE++ ) { - new TestCase( SECTION, - "unescape( %u"+ ToUnicodeString(CHARCODE)+" )", - String.fromCharCode(CHARCODE), - unescape( "%u" + ToUnicodeString(CHARCODE) ) ); - } - for ( var CHARCODE = 256; CHARCODE < 65536; CHARCODE+= 333 ) { - new TestCase( SECTION, - "unescape( %u"+ ToUnicodeString(CHARCODE)+" )", - String.fromCharCode(CHARCODE), - unescape( "%u" + ToUnicodeString(CHARCODE) ) ); - } -*/ - -test(); - -function ToUnicodeString( n ) { - var string = ToHexString(n); - - for ( var PAD = (4 - string.length ); PAD > 0; PAD-- ) { - string = "0" + string; - } - - return string; -} -function ToHexString( n ) { - var hex = new Array(); - - for ( var mag = 1; Math.pow(16,mag) <= n ; mag++ ) { - ; - } - - for ( index = 0, mag -= 1; mag > 0; index++, mag-- ) { - hex[index] = Math.floor( n / Math.pow(16,mag) ); - n -= Math.pow(16,mag) * Math.floor( n/Math.pow(16,mag) ); - } - - hex[hex.length] = n % 16; - - var string =""; - - for ( var index = 0 ; index < hex.length ; index++ ) { - switch ( hex[index] ) { - case 10: - string += "A"; - break; - case 11: - string += "B"; - break; - case 12: - string += "C"; - break; - case 13: - string += "D"; - break; - case 14: - string += "E"; - break; - case 15: - string += "F"; - break; - default: - string += hex[index]; - } - } - - if ( string.length == 1 ) { - string = "0" + string; - } - return string; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.5-2.js b/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.5-2.js deleted file mode 100644 index 99b58752b2..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.5-2.js +++ /dev/null @@ -1,183 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.1.2.5-2.js'; - -/** - File Name: 15.1.2.5-2.js - ECMA Section: 15.1.2.5 Function properties of the global object - unescape( string ) - Description: - - This tests the cases where there are fewer than 4 characters following "%u", - or fewer than 2 characters following "%" or "%u". - - The unescape function computes a new version of a string value in which - each escape sequences of the sort that might be introduced by the escape - function is replaced with the character that it represents. - - When the unescape function is called with one argument string, the - following steps are taken: - - 1. Call ToString(string). - 2. Compute the number of characters in Result(1). - 3. Let R be the empty string. - 4. Let k be 0. - 5. If k equals Result(2), return R. - 6. Let c be the character at position k within Result(1). - 7. If c is not %, go to step 18. - 8. If k is greater than Result(2)-6, go to step 14. - 9. If the character at position k+1 within result(1) is not u, go to step - 14. - 10. If the four characters at positions k+2, k+3, k+4, and k+5 within - Result(1) are not all hexadecimal digits, go to step 14. - 11. Let c be the character whose Unicode encoding is the integer represented - by the four hexadecimal digits at positions k+2, k+3, k+4, and k+5 - within Result(1). - 12. Increase k by 5. - 13. Go to step 18. - 14. If k is greater than Result(2)-3, go to step 18. - 15. If the two characters at positions k+1 and k+2 within Result(1) are not - both hexadecimal digits, go to step 18. - 16. Let c be the character whose Unicode encoding is the integer represented - by two zeroes plus the two hexadecimal digits at positions k+1 and k+2 - within Result(1). - 17. Increase k by 2. - 18. Let R be a new string value computed by concatenating the previous value - of R and c. - 19. Increase k by 1. - 20. Go to step 5. - Author: christine@netscape.com - Date: 28 october 1997 -*/ - -var SECTION = "15.1.2.5-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "unescape(string)"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -// since there is only one character following "%", no conversion should occur. - -for ( var CHARCODE = 0; CHARCODE < 256; CHARCODE += 16 ) { - new TestCase( SECTION, - "unescape( %"+ (ToHexString(CHARCODE)).substring(0,1) +" )", - "%"+(ToHexString(CHARCODE)).substring(0,1), - unescape( "%" + (ToHexString(CHARCODE)).substring(0,1) ) ); -} - -// since there is only one character following "%u", no conversion should occur. - -for ( var CHARCODE = 0; CHARCODE < 256; CHARCODE +=16 ) { - new TestCase( SECTION, - "unescape( %u"+ (ToHexString(CHARCODE)).substring(0,1) +" )", - "%u"+(ToHexString(CHARCODE)).substring(0,1), - unescape( "%u" + (ToHexString(CHARCODE)).substring(0,1) ) ); -} - - -// three char unicode string. no conversion should occur - -for ( var CHARCODE = 1024; CHARCODE < 65536; CHARCODE+= 1234 ) { - new TestCase - ( SECTION, - "unescape( %u"+ (ToUnicodeString(CHARCODE)).substring(0,3)+ " )", - - "%u"+(ToUnicodeString(CHARCODE)).substring(0,3), - unescape( "%u"+(ToUnicodeString(CHARCODE)).substring(0,3) ) - ); -} - -test(); - -function ToUnicodeString( n ) { - var string = ToHexString(n); - - for ( var PAD = (4 - string.length ); PAD > 0; PAD-- ) { - string = "0" + string; - } - - return string; -} -function ToHexString( n ) { - var hex = new Array(); - - for ( var mag = 1; Math.pow(16,mag) <= n ; mag++ ) { - ; - } - - for ( index = 0, mag -= 1; mag > 0; index++, mag-- ) { - hex[index] = Math.floor( n / Math.pow(16,mag) ); - n -= Math.pow(16,mag) * Math.floor( n/Math.pow(16,mag) ); - } - - hex[hex.length] = n % 16; - - var string =""; - - for ( var index = 0 ; index < hex.length ; index++ ) { - switch ( hex[index] ) { - case 10: - string += "A"; - break; - case 11: - string += "B"; - break; - case 12: - string += "C"; - break; - case 13: - string += "D"; - break; - case 14: - string += "E"; - break; - case 15: - string += "F"; - break; - default: - string += hex[index]; - } - } - - if ( string.length == 1 ) { - string = "0" + string; - } - return string; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.5-3.js b/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.5-3.js deleted file mode 100644 index 2615d62531..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.5-3.js +++ /dev/null @@ -1,207 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.1.2.5-3.js'; - -/** - File Name: 15.1.2.5-3.js - ECMA Section: 15.1.2.5 Function properties of the global object - unescape( string ) - - Description: - This tests the cases where one of the four characters following "%u" is - not a hexidecimal character, or one of the two characters following "%" - or "%u" is not a hexidecimal character. - - The unescape function computes a new version of a string value in which - each escape sequences of the sort that might be introduced by the escape - function is replaced with the character that it represents. - - When the unescape function is called with one argument string, the - following steps are taken: - - 1. Call ToString(string). - 2. Compute the number of characters in Result(1). - 3. Let R be the empty string. - 4. Let k be 0. - 5. If k equals Result(2), return R. - 6. Let c be the character at position k within Result(1). - 7. If c is not %, go to step 18. - 8. If k is greater than Result(2)-6, go to step 14. - 9. If the character at position k+1 within result(1) is not u, go to step - 14. - 10. If the four characters at positions k+2, k+3, k+4, and k+5 within - Result(1) are not all hexadecimal digits, go to step 14. - 11. Let c be the character whose Unicode encoding is the integer represented - by the four hexadecimal digits at positions k+2, k+3, k+4, and k+5 - within Result(1). - 12. Increase k by 5. - 13. Go to step 18. - 14. If k is greater than Result(2)-3, go to step 18. - 15. If the two characters at positions k+1 and k+2 within Result(1) are not - both hexadecimal digits, go to step 18. - 16. Let c be the character whose Unicode encoding is the integer represented - by two zeroes plus the two hexadecimal digits at positions k+1 and k+2 - within Result(1). - 17. Increase k by 2. - 18. Let R be a new string value computed by concatenating the previous value - of R and c. - 19. Increase k by 1. - 20. Go to step 5. - Author: christine@netscape.com - Date: 28 october 1997 -*/ - - -var SECTION = "15.1.2.5-3"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "unescape(string)"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -for ( var CHARCODE = 0, NONHEXCHARCODE = 0; CHARCODE < 256; CHARCODE++, NONHEXCHARCODE++ ) { - NONHEXCHARCODE = getNextNonHexCharCode( NONHEXCHARCODE ); - - new TestCase( SECTION, - "unescape( %"+ (ToHexString(CHARCODE)).substring(0,1) + - String.fromCharCode( NONHEXCHARCODE ) +" )" + - "[where last character is String.fromCharCode("+NONHEXCHARCODE+")]", - "%"+(ToHexString(CHARCODE)).substring(0,1)+ - String.fromCharCode( NONHEXCHARCODE ), - unescape( "%" + (ToHexString(CHARCODE)).substring(0,1)+ - String.fromCharCode( NONHEXCHARCODE ) ) ); -} -for ( var CHARCODE = 0, NONHEXCHARCODE = 0; CHARCODE < 256; CHARCODE++, NONHEXCHARCODE++ ) { - NONHEXCHARCODE = getNextNonHexCharCode( NONHEXCHARCODE ); - - new TestCase( SECTION, - "unescape( %u"+ (ToHexString(CHARCODE)).substring(0,1) + - String.fromCharCode( NONHEXCHARCODE ) +" )" + - "[where last character is String.fromCharCode("+NONHEXCHARCODE+")]", - "%u"+(ToHexString(CHARCODE)).substring(0,1)+ - String.fromCharCode( NONHEXCHARCODE ), - unescape( "%u" + (ToHexString(CHARCODE)).substring(0,1)+ - String.fromCharCode( NONHEXCHARCODE ) ) ); -} - -for ( var CHARCODE = 0, NONHEXCHARCODE = 0 ; CHARCODE < 65536; CHARCODE+= 54321, NONHEXCHARCODE++ ) { - NONHEXCHARCODE = getNextNonHexCharCode( NONHEXCHARCODE ); - - new TestCase( SECTION, - "unescape( %u"+ (ToUnicodeString(CHARCODE)).substring(0,3) + - String.fromCharCode( NONHEXCHARCODE ) +" )" + - "[where last character is String.fromCharCode("+NONHEXCHARCODE+")]", - - String.fromCharCode(eval("0x"+ (ToUnicodeString(CHARCODE)).substring(0,2))) + - (ToUnicodeString(CHARCODE)).substring(2,3) + - String.fromCharCode( NONHEXCHARCODE ), - - unescape( "%" + (ToUnicodeString(CHARCODE)).substring(0,3)+ - String.fromCharCode( NONHEXCHARCODE ) ) ); -} - -test(); - -function getNextNonHexCharCode( n ) { - for ( ; n < Math.pow(2,16); n++ ) { - if ( ( n == 43 || n == 45 || n == 46 || n == 47 || - (n >= 71 && n <= 90) || (n >= 103 && n <= 122) || - n == 64 || n == 95 ) ) { - break; - } else { - n = ( n > 122 ) ? 0 : n; - } - } - return n; -} -function ToUnicodeString( n ) { - var string = ToHexString(n); - - for ( var PAD = (4 - string.length ); PAD > 0; PAD-- ) { - string = "0" + string; - } - - return string; -} -function ToHexString( n ) { - var hex = new Array(); - - for ( var mag = 1; Math.pow(16,mag) <= n ; mag++ ) { - ; - } - - for ( index = 0, mag -= 1; mag > 0; index++, mag-- ) { - hex[index] = Math.floor( n / Math.pow(16,mag) ); - n -= Math.pow(16,mag) * Math.floor( n/Math.pow(16,mag) ); - } - - hex[hex.length] = n % 16; - - var string =""; - - for ( var index = 0 ; index < hex.length ; index++ ) { - switch ( hex[index] ) { - case 10: - string += "A"; - break; - case 11: - string += "B"; - break; - case 12: - string += "C"; - break; - case 13: - string += "D"; - break; - case 14: - string += "E"; - break; - case 15: - string += "F"; - break; - default: - string += hex[index]; - } - } - - if ( string.length == 1 ) { - string = "0" + string; - } - return string; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.6.js b/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.6.js deleted file mode 100644 index faeeb9e0b0..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.6.js +++ /dev/null @@ -1,125 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.1.2.6.js'; - -/** - File Name: 15.1.2.6.js - ECMA Section: 15.1.2.6 isNaN( x ) - - Description: Applies ToNumber to its argument, then returns true if - the result isNaN and otherwise returns false. - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ -var SECTION = "15.1.2.6"; -var VERSION = "ECMA_1"; -var TITLE = "isNaN( x )"; -var BUGNUMBER = "none"; - -startTest(); - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "isNaN.length", 1, isNaN.length ); -new TestCase( SECTION, "var MYPROPS=''; for ( var p in isNaN ) { MYPROPS+= p }; MYPROPS", "prototype", eval("var MYPROPS=''; for ( var p in isNaN ) { MYPROPS+= p }; MYPROPS") ); -new TestCase( SECTION, "isNaN.length = null; isNaN.length", 1, eval("isNaN.length=null; isNaN.length") ); -new TestCase( SECTION, "delete isNaN.length", false, delete isNaN.length ); -new TestCase( SECTION, "delete isNaN.length; isNaN.length", 1, eval("delete isNaN.length; isNaN.length") ); - -// new TestCase( SECTION, "isNaN.__proto__", Function.prototype, isNaN.__proto__ ); - -new TestCase( SECTION, "isNaN()", true, isNaN() ); -new TestCase( SECTION, "isNaN( null )", false, isNaN(null) ); -new TestCase( SECTION, "isNaN( void 0 )", true, isNaN(void 0) ); -new TestCase( SECTION, "isNaN( true )", false, isNaN(true) ); -new TestCase( SECTION, "isNaN( false)", false, isNaN(false) ); -new TestCase( SECTION, "isNaN( ' ' )", false, isNaN( " " ) ); - -new TestCase( SECTION, "isNaN( 0 )", false, isNaN(0) ); -new TestCase( SECTION, "isNaN( 1 )", false, isNaN(1) ); -new TestCase( SECTION, "isNaN( 2 )", false, isNaN(2) ); -new TestCase( SECTION, "isNaN( 3 )", false, isNaN(3) ); -new TestCase( SECTION, "isNaN( 4 )", false, isNaN(4) ); -new TestCase( SECTION, "isNaN( 5 )", false, isNaN(5) ); -new TestCase( SECTION, "isNaN( 6 )", false, isNaN(6) ); -new TestCase( SECTION, "isNaN( 7 )", false, isNaN(7) ); -new TestCase( SECTION, "isNaN( 8 )", false, isNaN(8) ); -new TestCase( SECTION, "isNaN( 9 )", false, isNaN(9) ); - -new TestCase( SECTION, "isNaN( '0' )", false, isNaN('0') ); -new TestCase( SECTION, "isNaN( '1' )", false, isNaN('1') ); -new TestCase( SECTION, "isNaN( '2' )", false, isNaN('2') ); -new TestCase( SECTION, "isNaN( '3' )", false, isNaN('3') ); -new TestCase( SECTION, "isNaN( '4' )", false, isNaN('4') ); -new TestCase( SECTION, "isNaN( '5' )", false, isNaN('5') ); -new TestCase( SECTION, "isNaN( '6' )", false, isNaN('6') ); -new TestCase( SECTION, "isNaN( '7' )", false, isNaN('7') ); -new TestCase( SECTION, "isNaN( '8' )", false, isNaN('8') ); -new TestCase( SECTION, "isNaN( '9' )", false, isNaN('9') ); - - -new TestCase( SECTION, "isNaN( 0x0a )", false, isNaN( 0x0a ) ); -new TestCase( SECTION, "isNaN( 0xaa )", false, isNaN( 0xaa ) ); -new TestCase( SECTION, "isNaN( 0x0A )", false, isNaN( 0x0A ) ); -new TestCase( SECTION, "isNaN( 0xAA )", false, isNaN( 0xAA ) ); - -new TestCase( SECTION, "isNaN( '0x0a' )", false, isNaN( "0x0a" ) ); -new TestCase( SECTION, "isNaN( '0xaa' )", false, isNaN( "0xaa" ) ); -new TestCase( SECTION, "isNaN( '0x0A' )", false, isNaN( "0x0A" ) ); -new TestCase( SECTION, "isNaN( '0xAA' )", false, isNaN( "0xAA" ) ); - -new TestCase( SECTION, "isNaN( 077 )", false, isNaN( 077 ) ); -new TestCase( SECTION, "isNaN( '077' )", false, isNaN( "077" ) ); - - -new TestCase( SECTION, "isNaN( Number.NaN )", true, isNaN(Number.NaN) ); -new TestCase( SECTION, "isNaN( Number.POSITIVE_INFINITY )", false, isNaN(Number.POSITIVE_INFINITY) ); -new TestCase( SECTION, "isNaN( Number.NEGATIVE_INFINITY )", false, isNaN(Number.NEGATIVE_INFINITY) ); -new TestCase( SECTION, "isNaN( Number.MAX_VALUE )", false, isNaN(Number.MAX_VALUE) ); -new TestCase( SECTION, "isNaN( Number.MIN_VALUE )", false, isNaN(Number.MIN_VALUE) ); - -new TestCase( SECTION, "isNaN( NaN )", true, isNaN(NaN) ); -new TestCase( SECTION, "isNaN( Infinity )", false, isNaN(Infinity) ); - -new TestCase( SECTION, "isNaN( 'Infinity' )", false, isNaN("Infinity") ); -new TestCase( SECTION, "isNaN( '-Infinity' )", false, isNaN("-Infinity") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.7.js b/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.7.js deleted file mode 100644 index e3db5e7931..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/15.1.2.7.js +++ /dev/null @@ -1,130 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.1.2.7.js'; - -/** - File Name: 15.1.2.7.js - ECMA Section: 15.1.2.7 isFinite(number) - - Description: Applies ToNumber to its argument, then returns false if - the result is NaN, Infinity, or -Infinity, and otherwise - returns true. - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ -var SECTION = "15.1.2.7"; -var VERSION = "ECMA_1"; -var TITLE = "isFinite( x )"; -var BUGNUMBER= "none"; - -startTest(); - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "isFinite.length", 1, isFinite.length ); -new TestCase( SECTION, "isFinite.length = null; isFinite.length", 1, eval("isFinite.length=null; isFinite.length") ); -new TestCase( SECTION, "delete isFinite.length", false, delete isFinite.length ); -new TestCase( SECTION, "delete isFinite.length; isFinite.length", 1, eval("delete isFinite.length; isFinite.length") ); -new TestCase( SECTION, "var MYPROPS=''; for ( p in isFinite ) { MYPROPS+= p }; MYPROPS", "prototype", eval("var MYPROPS=''; for ( p in isFinite ) { MYPROPS += p }; MYPROPS") ); - -new TestCase( SECTION, "isFinite()", false, isFinite() ); -new TestCase( SECTION, "isFinite( null )", true, isFinite(null) ); -new TestCase( SECTION, "isFinite( void 0 )", false, isFinite(void 0) ); -new TestCase( SECTION, "isFinite( false )", true, isFinite(false) ); -new TestCase( SECTION, "isFinite( true)", true, isFinite(true) ); -new TestCase( SECTION, "isFinite( ' ' )", true, isFinite( " " ) ); - -new TestCase( SECTION, "isFinite( new Boolean(true) )", true, isFinite(new Boolean(true)) ); -new TestCase( SECTION, "isFinite( new Boolean(false) )", true, isFinite(new Boolean(false)) ); - -new TestCase( SECTION, "isFinite( 0 )", true, isFinite(0) ); -new TestCase( SECTION, "isFinite( 1 )", true, isFinite(1) ); -new TestCase( SECTION, "isFinite( 2 )", true, isFinite(2) ); -new TestCase( SECTION, "isFinite( 3 )", true, isFinite(3) ); -new TestCase( SECTION, "isFinite( 4 )", true, isFinite(4) ); -new TestCase( SECTION, "isFinite( 5 )", true, isFinite(5) ); -new TestCase( SECTION, "isFinite( 6 )", true, isFinite(6) ); -new TestCase( SECTION, "isFinite( 7 )", true, isFinite(7) ); -new TestCase( SECTION, "isFinite( 8 )", true, isFinite(8) ); -new TestCase( SECTION, "isFinite( 9 )", true, isFinite(9) ); - -new TestCase( SECTION, "isFinite( '0' )", true, isFinite('0') ); -new TestCase( SECTION, "isFinite( '1' )", true, isFinite('1') ); -new TestCase( SECTION, "isFinite( '2' )", true, isFinite('2') ); -new TestCase( SECTION, "isFinite( '3' )", true, isFinite('3') ); -new TestCase( SECTION, "isFinite( '4' )", true, isFinite('4') ); -new TestCase( SECTION, "isFinite( '5' )", true, isFinite('5') ); -new TestCase( SECTION, "isFinite( '6' )", true, isFinite('6') ); -new TestCase( SECTION, "isFinite( '7' )", true, isFinite('7') ); -new TestCase( SECTION, "isFinite( '8' )", true, isFinite('8') ); -new TestCase( SECTION, "isFinite( '9' )", true, isFinite('9') ); - -new TestCase( SECTION, "isFinite( 0x0a )", true, isFinite( 0x0a ) ); -new TestCase( SECTION, "isFinite( 0xaa )", true, isFinite( 0xaa ) ); -new TestCase( SECTION, "isFinite( 0x0A )", true, isFinite( 0x0A ) ); -new TestCase( SECTION, "isFinite( 0xAA )", true, isFinite( 0xAA ) ); - -new TestCase( SECTION, "isFinite( '0x0a' )", true, isFinite( "0x0a" ) ); -new TestCase( SECTION, "isFinite( '0xaa' )", true, isFinite( "0xaa" ) ); -new TestCase( SECTION, "isFinite( '0x0A' )", true, isFinite( "0x0A" ) ); -new TestCase( SECTION, "isFinite( '0xAA' )", true, isFinite( "0xAA" ) ); - -new TestCase( SECTION, "isFinite( 077 )", true, isFinite( 077 ) ); -new TestCase( SECTION, "isFinite( '077' )", true, isFinite( "077" ) ); - -new TestCase( SECTION, "isFinite( new String('Infinity') )", false, isFinite(new String("Infinity")) ); -new TestCase( SECTION, "isFinite( new String('-Infinity') )", false, isFinite(new String("-Infinity")) ); - -new TestCase( SECTION, "isFinite( 'Infinity' )", false, isFinite("Infinity") ); -new TestCase( SECTION, "isFinite( '-Infinity' )", false, isFinite("-Infinity") ); -new TestCase( SECTION, "isFinite( Number.POSITIVE_INFINITY )", false, isFinite(Number.POSITIVE_INFINITY) ); -new TestCase( SECTION, "isFinite( Number.NEGATIVE_INFINITY )", false, isFinite(Number.NEGATIVE_INFINITY) ); -new TestCase( SECTION, "isFinite( Number.NaN )", false, isFinite(Number.NaN) ); - -new TestCase( SECTION, "isFinite( Infinity )", false, isFinite(Infinity) ); -new TestCase( SECTION, "isFinite( -Infinity )", false, isFinite(-Infinity) ); -new TestCase( SECTION, "isFinite( NaN )", false, isFinite(NaN) ); - - -new TestCase( SECTION, "isFinite( Number.MAX_VALUE )", true, isFinite(Number.MAX_VALUE) ); -new TestCase( SECTION, "isFinite( Number.MIN_VALUE )", true, isFinite(Number.MIN_VALUE) ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/browser.js b/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/browser.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/shell.js b/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/shell.js deleted file mode 100644 index d922707218..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/GlobalObject/shell.js +++ /dev/null @@ -1 +0,0 @@ -gTestsubsuite = 'GlobalObject'; diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.1-1.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.1-1.js deleted file mode 100644 index 7fa415c20d..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.1-1.js +++ /dev/null @@ -1,82 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.1-1.js'; - -/** - File Name: 7.1-1.js - ECMA Section: 7.1 White Space - Description: - readability - - separate tokens - - otherwise should be insignificant - - in strings, white space characters are significant - - cannot appear within any other kind of token - - white space characters are: - unicode name formal name string representation - \u0009 tab \t - \u000B veritical tab \v - \U000C form feed \f - \u0020 space " " - - Author: christine@netscape.com - Date: 11 september 1997 -*/ - -var SECTION = "7.1-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "White Space"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -// whitespace between var keyword and identifier - -new TestCase( SECTION, 'var'+'\t'+'MYVAR1=10;MYVAR1', 10, eval('var'+'\t'+'MYVAR1=10;MYVAR1') ); -new TestCase( SECTION, 'var'+'\f'+'MYVAR2=10;MYVAR2', 10, eval('var'+'\f'+'MYVAR2=10;MYVAR2') ); -new TestCase( SECTION, 'var'+'\v'+'MYVAR2=10;MYVAR2', 10, eval('var'+'\v'+'MYVAR2=10;MYVAR2') ); -new TestCase( SECTION, 'var'+'\ '+'MYVAR2=10;MYVAR2', 10, eval('var'+'\ '+'MYVAR2=10;MYVAR2') ); - -// use whitespace between tokens object name, dot operator, and object property - -new TestCase( SECTION, - "var a = new Array(12345); a\t\v\f .\\u0009\\000B\\u000C\\u0020length", - 12345, - eval("var a = new Array(12345); a\t\v\f .\u0009\u0020\u000C\u000Blength") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.1-2.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.1-2.js deleted file mode 100644 index aa0c3fb373..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.1-2.js +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.1-2.js'; - -/** - File Name: 7.1-2.js - ECMA Section: 7.1 White Space - Description: - readability - - separate tokens - - otherwise should be insignificant - - in strings, white space characters are significant - - cannot appear within any other kind of token - - white space characters are: - unicode name formal name string representation - \u0009 tab \t - \u000B veritical tab ?? - \U000C form feed \f - \u0020 space " " - - Author: christine@netscape.com - Date: 11 september 1997 -*/ - -var SECTION = "7.1-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "White Space"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "'var'+'\u000B'+'MYVAR1=10;MYVAR1'", 10, eval('var'+'\u000B'+'MYVAR1=10;MYVAR1') ); -new TestCase( SECTION, "'var'+'\u0009'+'MYVAR2=10;MYVAR2'", 10, eval('var'+'\u0009'+'MYVAR2=10;MYVAR2') ); -new TestCase( SECTION, "'var'+'\u000C'+'MYVAR3=10;MYVAR3'", 10, eval('var'+'\u000C'+'MYVAR3=10;MYVAR3') ); -new TestCase( SECTION, "'var'+'\u0020'+'MYVAR4=10;MYVAR4'", 10, eval('var'+'\u0020'+'MYVAR4=10;MYVAR4') ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.1-3.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.1-3.js deleted file mode 100644 index c405106ade..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.1-3.js +++ /dev/null @@ -1,89 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.1-3.js'; - -/** - File Name: 7.1-3.js - ECMA Section: 7.1 White Space - Description: - readability - - separate tokens - - otherwise should be insignificant - - in strings, white space characters are significant - - cannot appear within any other kind of token - - white space characters are: - unicode name formal name string representation - \u0009 tab \t - \u000B veritical tab ?? - \U000C form feed \f - \u0020 space " " - - Author: christine@netscape.com - Date: 11 september 1997 -*/ - -var SECTION = "7.1-3"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "White Space"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "'var'+'\u000B'+'MYVAR1=10;MYVAR1'", 10, eval('var'+'\u000B'+'MYVAR1=10;MYVAR1') ); -new TestCase( SECTION, "'var'+'\u0009'+'MYVAR2=10;MYVAR2'", 10, eval('var'+'\u0009'+'MYVAR2=10;MYVAR2') ); -new TestCase( SECTION, "'var'+'\u000C'+'MYVAR3=10;MYVAR3'", 10, eval('var'+'\u000C'+'MYVAR3=10;MYVAR3') ); -new TestCase( SECTION, "'var'+'\u0020'+'MYVAR4=10;MYVAR4'", 10, eval('var'+'\u0020'+'MYVAR4=10;MYVAR4') ); - -// ++ should be interpreted as the unary + operator twice, not as a post or prefix increment operator - -new TestCase( SECTION, - "var VAR = 12345; + + VAR", - 12345, - eval("var VAR = 12345; + + VAR") ); - -new TestCase( SECTION, - "var VAR = 12345;VAR+ + VAR", - 24690, - eval("var VAR = 12345;VAR+ +VAR") ); -new TestCase( SECTION, - "var VAR = 12345;VAR - - VAR", - 24690, - eval("var VAR = 12345;VAR- -VAR") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.2-1.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.2-1.js deleted file mode 100644 index dd4f2fcbed..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.2-1.js +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.2-1.js'; - -/** - File Name: 7.2-1.js - ECMA Section: 7.2 Line Terminators - Description: - readability - - separate tokens - - may occur between any two tokens - - cannot occur within any token, not even a string - - affect the process of automatic semicolon insertion. - - white space characters are: - unicode name formal name string representation - \u000A line feed \n - \u000D carriage return \r - - Author: christine@netscape.com - Date: 11 september 1997 -*/ -var SECTION = "7.2-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Line Terminators"; - -writeHeaderToLog( SECTION + " "+ TITLE); - - -new TestCase( SECTION, "var a\nb = 5; ab=10;ab;", 10, eval("var a\nb = 5; ab=10;ab") ); -new TestCase( SECTION, "var a\nb = 5; ab=10;b;", 5, eval("var a\nb = 5; ab=10;b") ); -new TestCase( SECTION, "var a\rb = 5; ab=10;ab;", 10, eval("var a\rb = 5; ab=10;ab") ); -new TestCase( SECTION, "var a\rb = 5; ab=10;b;", 5, eval("var a\rb = 5; ab=10;b") ); -new TestCase( SECTION, "var a\r\nb = 5; ab=10;ab;", 10, eval("var a\r\nb = 5; ab=10;ab") ); -new TestCase( SECTION, "var a\r\nb = 5; ab=10;b;", 5, eval("var a\r\nb = 5; ab=10;b") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.2-2-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.2-2-n.js deleted file mode 100644 index d945115832..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.2-2-n.js +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.2-2-n.js'; - -/** - File Name: 7.2.js - ECMA Section: 7.2 Line Terminators - Description: - readability - - separate tokens - - may occur between any two tokens - - cannot occur within any token, not even a string - - affect the process of automatic semicolon insertion. - - white space characters are: - unicode name formal name string representation - \u000A line feed \n - \u000D carriage return \r - - this test uses onerror to capture line numbers. because - we use on error, we can only have one test case per file. - - Author: christine@netscape.com - Date: 11 september 1997 -*/ -var SECTION = "7.2-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Line Terminators"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "\r\r\r\nb"; -EXPECTED = "error" - - new TestCase( SECTION, DESCRIPTION, "error", eval("\r\r\r\nb")); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.2-3-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.2-3-n.js deleted file mode 100644 index c62410d202..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.2-3-n.js +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.2-3-n.js'; - -/** - File Name: 7.2-3.js - ECMA Section: 7.2 Line Terminators - Description: - readability - - separate tokens - - may occur between any two tokens - - cannot occur within any token, not even a string - - affect the process of automatic semicolon insertion. - - white space characters are: - unicode name formal name string representation - \u000A line feed \n - \u000D carriage return \r - - this test uses onerror to capture line numbers. because - we use on error, we can only have one test case per file. - - Author: christine@netscape.com - Date: 11 september 1997 -*/ -var SECTION = "7.2-3"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Line Terminators"; - -writeHeaderToLog( SECTION + " "+ TITLE); - - -DESCRIPTION = "\r\nb"; -EXPECTED = "error" - - new TestCase( SECTION, "a", "error", eval("\r\nb")); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.2-4-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.2-4-n.js deleted file mode 100644 index b29f999739..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.2-4-n.js +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.2-4-n.js'; - -/** - File Name: 7.2.js - ECMA Section: 7.2 Line Terminators - Description: - readability - - separate tokens - - may occur between any two tokens - - cannot occur within any token, not even a string - - affect the process of automatic semicolon insertion. - - white space characters are: - unicode name formal name string representation - \u000A line feed \n - \u000D carriage return \r - - this test uses onerror to capture line numbers. because - we use on error, we can only have one test case per file. - - Author: christine@netscape.com - Date: 11 september 1997 -*/ -var SECTION = "7.2-6"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Line Terminators"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "\nb"; -EXPECTED = "error"; - -new TestCase( SECTION, "\nb", "error", eval("\nb")); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.2-5-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.2-5-n.js deleted file mode 100644 index b563d86437..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.2-5-n.js +++ /dev/null @@ -1,72 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.2-5-n.js'; - -/** - File Name: 7.2.js - ECMA Section: 7.2 Line Terminators - Description: - readability - - separate tokens - - may occur between any two tokens - - cannot occur within any token, not even a string - - affect the process of automatic semicolon insertion. - - white space characters are: - unicode name formal name string representation - \u000A line feed \n - \u000D carriage return \r - - this test uses onerror to capture line numbers. because - we use on error, we can only have one test case per file. - - Author: christine@netscape.com - Date: 11 september 1997 -*/ -var SECTION = "7.2-5"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Line Terminators"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = - EXPECTED = "error"; - -new TestCase( SECTION, "\rb", "error", eval("\rb")); -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.2-6.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.2-6.js deleted file mode 100644 index 220548e78e..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.2-6.js +++ /dev/null @@ -1,68 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.2-6.js'; - -/** - File Name: 7.2-6.js - ECMA Section: 7.2 Line Terminators - Description: - readability - - separate tokens - - may occur between any two tokens - - cannot occur within any token, not even a string - - affect the process of automatic semicolon insertion. - - white space characters are: - unicode name formal name string representation - \u000A line feed \n - \u000D carriage return \r - - Author: christine@netscape.com - Date: 11 september 1997 -*/ -var SECTION = "7.2-6"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Line Terminators"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "var a\u000Ab = 5; ab=10;ab;", 10, eval("var a\nb = 5; ab=10;ab") ); -new TestCase( SECTION, "var a\u000Db = 5; ab=10;b;", 5, eval("var a\nb = 5; ab=10;b") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-1.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-1.js deleted file mode 100644 index 9701660576..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-1.js +++ /dev/null @@ -1,92 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.3-1.js'; - -/** - File Name: 7.3-1.js - ECMA Section: 7.3 Comments - Description: - - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "7.3-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Comments"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var testcase; - -testcase = new TestCase( SECTION, - "a comment with a line terminator string, and text following", - "pass", - "pass"); - -// "\u000A" testcase.actual = "fail"; - - -testcase = new TestCase( SECTION, - "// test \\n testcase.actual = \"pass\"", - "pass", - "" ); - -var x = "// test \n testcase.actual = 'pass'"; - -testcase.actual = eval(x); - -test(); - -// XXX bc replace test() -function test() { - for ( gTc=0; gTc < gTestcases.length; gTc++ ) { - gTestcases[gTc].passed = writeTestCaseResult( - gTestcases[gTc].expect, - gTestcases[gTc].actual, - gTestcases[gTc].description +": "+ - gTestcases[gTc].actual ); - - gTestcases[gTc].reason += ( gTestcases[gTc].passed ) ? "" : " ignored chars after line terminator of single-line comment"; - } - stopTest(); - return ( gTestcases ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-10.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-10.js deleted file mode 100644 index 1cd0f18a90..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-10.js +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.3-10.js'; - -/** - File Name: 7.3-10.js - ECMA Section: 7.3 Comments - Description: - - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "7.3-10"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Comments"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var testcase = new TestCase( SECTION, - "code following multiline comment", - "pass", - "fail"); - -/*//*/testcase.actual="pass"; - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-11.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-11.js deleted file mode 100644 index f9033cd05a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-11.js +++ /dev/null @@ -1,66 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.3-11.js'; - -/** - File Name: 7.3-11.js - ECMA Section: 7.3 Comments - Description: - - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "7.3-11"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Comments"; - -writeHeaderToLog( SECTION + " "+ TITLE); - - -var testcase = new TestCase( SECTION, - "code following multiline comment", - "pass", - "pass"); - -////testcase.actual="fail"; - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-12.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-12.js deleted file mode 100644 index 04ceb81409..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-12.js +++ /dev/null @@ -1,64 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.3-12.js'; - -/** - File Name: 7.3-12.js - ECMA Section: 7.3 Comments - Description: - - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "7.3-12"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Comments"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var testcase = new TestCase( SECTION, - "code following multiline comment", - "pass", - "pass"); -/*testcase.actual="fail";**/ - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-13-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-13-n.js deleted file mode 100644 index 714de99a9a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-13-n.js +++ /dev/null @@ -1,66 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.3-13-n.js'; - -/** - File Name: 7.3-13-n.js - ECMA Section: 7.3 Comments - Description: - - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "7.3-13-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Comments"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "nested comment"; -EXPECTED = "error"; - -var testcase = new TestCase( SECTION, - "nested comment", - "error", - eval("/*/*\"fail\";*/*/")); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-2.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-2.js deleted file mode 100644 index 7aa029feda..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-2.js +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.3-2.js'; - -/** - File Name: 7.3-2.js - ECMA Section: 7.3 Comments - Description: - - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "7.3-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Comments"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var testcase = new TestCase( SECTION, - "a comment with a carriage return, and text following", - "pass", - "pass"); - -// "\u000D" testcase.actual = "fail"; - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-3.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-3.js deleted file mode 100644 index 1886639e26..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-3.js +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.3-3.js'; - -/** - File Name: 7.3-3.js - ECMA Section: 7.3 Comments - Description: - - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "7.3-3"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Comments"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var testcase = new TestCase( SECTION, - "source text directly following a single-line comment", - "pass", - "fail"); -// a comment string -testcase.actual = "pass"; - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-4.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-4.js deleted file mode 100644 index 4cb53af0fb..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-4.js +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.3-4.js'; - -/** - File Name: 7.3-4.js - ECMA Section: 7.3 Comments - Description: - - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "7.3-4"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Comments"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var testcase = new TestCase( SECTION, - "multiline comment ", - "pass", - "pass"); - -/*testcase.actual = "fail";*/ - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-5.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-5.js deleted file mode 100644 index 22d9e08a60..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-5.js +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.3-5.js'; - -/** - File Name: 7.3-5.js - ECMA Section: 7.3 Comments - Description: - - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "7.3-5"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Comments"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var testcase = new TestCase( SECTION, - "a comment with a carriage return, and text following", - "pass", - "pass"); - -// "\u000A" testcase.actual = "fail"; - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-6.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-6.js deleted file mode 100644 index 91afd319a4..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-6.js +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.3-6.js'; - -/** - File Name: 7.3-6.js - ECMA Section: 7.3 Comments - Description: - - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "7.3-6"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Comments"; - -writeHeaderToLog( SECTION + " "+ TITLE); -var testcase = new TestCase( SECTION, - "comment with multiple asterisks", - "pass", - "fail"); - -/* -***/testcase.actual="pass"; - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-7.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-7.js deleted file mode 100644 index a35cd54289..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-7.js +++ /dev/null @@ -1,66 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.3-7.js'; - -/** - File Name: 7.3-7.js - ECMA Section: 7.3 Comments - Description: - - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "7.3-7"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Comments"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var testcase = new TestCase( SECTION, - "single line comment following multiline comment", - "pass", - "pass"); - -/* -***///testcase.actual="fail"; - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-8.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-8.js deleted file mode 100644 index 2d665c4ff0..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-8.js +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.3-8.js'; - -/** - File Name: 7.3-7.js - ECMA Section: 7.3 Comments - Description: - - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "7.3-8"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Comments"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var testcase = new TestCase( SECTION, - "code following multiline comment", - "pass", - "fail"); - -/**/testcase.actual="pass"; - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-9.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-9.js deleted file mode 100644 index caff9f7f09..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.3-9.js +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.3-9.js'; - -/** - File Name: 7.3-9.js - ECMA Section: 7.3 Comments - Description: - - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "7.3-9"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Comments"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var testcase = new TestCase( SECTION, - "code following multiline comment", - "pass", - "fail"); - -/*/*/testcase.actual="pass"; - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.1-1-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.1-1-n.js deleted file mode 100644 index 2153cc2638..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.1-1-n.js +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.4.1-1-n.js'; - -/** - File Name: 7.4.1-1-n.js - ECMA Section: 7.4.1 - - Description: - - Reserved words cannot be used as identifiers. - - ReservedWord :: - Keyword - FutureReservedWord - NullLiteral - BooleanLiteral - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "7.4.1-1-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Keywords"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "var null = true"; -EXPECTED = "error"; - -new TestCase( SECTION, "var null = true", "error", eval("var null = true") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.1-2-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.1-2-n.js deleted file mode 100644 index a50bd6020f..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.1-2-n.js +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.4.1-2-n.js'; - -/** - File Name: 7.4.1-2.js - ECMA Section: 7.4.1 - - Description: - - Reserved words cannot be used as identifiers. - - ReservedWord :: - Keyword - FutureReservedWord - NullLiteral - BooleanLiteral - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "7.4.1-2-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Keywords"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "var true = false"; -EXPECTED = "error"; - -new TestCase( SECTION, "var true = false", "error", eval("var true = false") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.1-3-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.1-3-n.js deleted file mode 100644 index b49fe7937b..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.1-3-n.js +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.4.1-3-n.js'; - -/** - File Name: 7.4.1-3-n.js - ECMA Section: 7.4.1 - - Description: - - Reserved words cannot be used as identifiers. - - ReservedWord :: - Keyword - FutureReservedWord - NullLiteral - BooleanLiteral - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "7.4.1-3-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Keywords"; - -DESCRIPTION = "var false = true"; -EXPECTED = "error"; - -new TestCase( SECTION, "var false = true", "error", eval("var false = true") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-1-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-1-n.js deleted file mode 100644 index 36723173f5..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-1-n.js +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.4.2-1-n.js'; - -/** - File Name: 7.4.2-1.js - ECMA Section: 7.4.2 - - Description: - The following tokens are ECMAScript keywords and may not be used as - identifiers in ECMAScript programs. - - Syntax - - Keyword :: one of - break for new var - continue function return void - delete if this while - else in typeof with - - This test verifies that the keyword cannot be used as an identifier. - Functioinal tests of the keyword may be found in the section corresponding - to the function of the keyword. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "7.4.2-1-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Keywords"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "var break = true"; -EXPECTED = "error"; - -new TestCase( SECTION, "var break = true", "error", eval("var break = true") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-10-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-10-n.js deleted file mode 100644 index 89003d3601..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-10-n.js +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.4.2-10-n.js'; - -/** - File Name: 7.4.2-10.js - ECMA Section: 7.4.2 - - Description: - The following tokens are ECMAScript keywords and may not be used as - identifiers in ECMAScript programs. - - Syntax - - Keyword :: one of - break for new var - continue function return void - delete if this while - else in typeof with - - This test verifies that the keyword cannot be used as an identifier. - Functioinal tests of the keyword may be found in the section corresponding - to the function of the keyword. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "7.4.1-10-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Keywords"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "var if = true"; -EXPECTED = "error"; - -new TestCase( SECTION, "var if = true", "error", eval("var if = true") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-11-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-11-n.js deleted file mode 100644 index 3aff749e51..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-11-n.js +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.4.2-11-n.js'; - -/** - File Name: 7.4.2-11-n.js - ECMA Section: 7.4.2 - - Description: - The following tokens are ECMAScript keywords and may not be used as - identifiers in ECMAScript programs. - - Syntax - - Keyword :: one of - break for new var - continue function return void - delete if this while - else in typeof with - - This test verifies that the keyword cannot be used as an identifier. - Functioinal tests of the keyword may be found in the section corresponding - to the function of the keyword. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "7.4.1-11-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Keywords"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "var this = true"; -EXPECTED = "error"; - -new TestCase( SECTION, "var this = true", "error", eval("var this = true") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-12-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-12-n.js deleted file mode 100644 index f19ed8c904..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-12-n.js +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.4.2-12-n.js'; - -/** - File Name: 7.4.2-12-n.js - ECMA Section: 7.4.2 - - Description: - The following tokens are ECMAScript keywords and may not be used as - identifiers in ECMAScript programs. - - Syntax - - Keyword :: one of - break for new var - continue function return void - delete if this while - else in typeof with - - This test verifies that the keyword cannot be used as an identifier. - Functioinal tests of the keyword may be found in the section corresponding - to the function of the keyword. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "7.4.1-12-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Keywords"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "var while = true"; -EXPECTED = "error"; - -new TestCase( SECTION, "var while = true", "error", eval("var while = true") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-13-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-13-n.js deleted file mode 100644 index 22a5284dcc..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-13-n.js +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.4.2-13-n.js'; - -/** - File Name: 7.4.2-13-n.js - ECMA Section: 7.4.2 - - Description: - The following tokens are ECMAScript keywords and may not be used as - identifiers in ECMAScript programs. - - Syntax - - Keyword :: one of - break for new var - continue function return void - delete if this while - else in typeof with - - This test verifies that the keyword cannot be used as an identifier. - Functioinal tests of the keyword may be found in the section corresponding - to the function of the keyword. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "7.4.1-13-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Keywords"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "var else = true"; -EXPECTED = "error"; - -new TestCase( SECTION, "var else = true", "error", eval("var else = true") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-14-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-14-n.js deleted file mode 100644 index b9b05f42b7..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-14-n.js +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.4.2-14-n.js'; - -/** - File Name: 7.4.2-14-n.js - ECMA Section: 7.4.2 - - Description: - The following tokens are ECMAScript keywords and may not be used as - identifiers in ECMAScript programs. - - Syntax - - Keyword :: one of - break for new var - continue function return void - delete if this while - else in typeof with - - This test verifies that the keyword cannot be used as an identifier. - Functioinal tests of the keyword may be found in the section corresponding - to the function of the keyword. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "7.4.1-14-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Keywords"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "var in = true"; -EXPECTED = "error"; - -new TestCase( SECTION, "var in = true", "error", eval("var in = true") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-15-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-15-n.js deleted file mode 100644 index 27e83972c3..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-15-n.js +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.4.2-15-n.js'; - -/** - File Name: 7.4.2-15-n.js - ECMA Section: 7.4.2 - - Description: - The following tokens are ECMAScript keywords and may not be used as - identifiers in ECMAScript programs. - - Syntax - - Keyword :: one of - break for new var - continue function return void - delete if this while - else in typeof with - - This test verifies that the keyword cannot be used as an identifier. - Functioinal tests of the keyword may be found in the section corresponding - to the function of the keyword. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "7.4.1-15-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Keywords"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "var typeof = true"; -EXPECTED = "error"; - -new TestCase( SECTION, "var typeof = true", "error", eval("var typeof = true") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-16-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-16-n.js deleted file mode 100644 index 988920538c..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-16-n.js +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.4.2-16-n.js'; - -/** - File Name: 7.4.2-16-n.js - ECMA Section: 7.4.2 - - Description: - The following tokens are ECMAScript keywords and may not be used as - identifiers in ECMAScript programs. - - Syntax - - Keyword :: one of - break for new var - continue function return void - delete if this while - else in typeof with - - This test verifies that the keyword cannot be used as an identifier. - Functioinal tests of the keyword may be found in the section corresponding - to the function of the keyword. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "7.4.1-16-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Keywords"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "var with = true"; -EXPECTED = "error"; - -new TestCase( SECTION, "var with = true", "error", eval("var with = true") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-2-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-2-n.js deleted file mode 100644 index 648610a9e6..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-2-n.js +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.4.2-2-n.js'; - -/** - File Name: 7.4.2-2-n.js - ECMA Section: 7.4.2 - - Description: - The following tokens are ECMAScript keywords and may not be used as - identifiers in ECMAScript programs. - - Syntax - - Keyword :: one of - break for new var - continue function return void - delete if this while - else in typeof with - - This test verifies that the keyword cannot be used as an identifier. - Functioinal tests of the keyword may be found in the section corresponding - to the function of the keyword. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "7.4.1-2-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Keywords"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "var for = true"; -EXPECTED = "error"; - -new TestCase( SECTION, "var for = true", "error", eval("var for = true") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-3-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-3-n.js deleted file mode 100644 index d8b74d6b0e..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-3-n.js +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.4.2-3-n.js'; - -/** - File Name: 7.4.2-3-n.js - ECMA Section: 7.4.2 - - Description: - The following tokens are ECMAScript keywords and may not be used as - identifiers in ECMAScript programs. - - Syntax - - Keyword :: one of - break for new var - continue function return void - delete if this while - else in typeof with - - This test verifies that the keyword cannot be used as an identifier. - Functioinal tests of the keyword may be found in the section corresponding - to the function of the keyword. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "7.4.2-3-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Keywords"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "var new = true"; -EXPECTED = "error"; - -new TestCase( SECTION, "var new = true", "error", eval("var new = true") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-4-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-4-n.js deleted file mode 100644 index 2bb0aa260b..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-4-n.js +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.4.2-4-n.js'; - -/** - File Name: 7.4.2-4-n.js - ECMA Section: 7.4.2 - - Description: - The following tokens are ECMAScript keywords and may not be used as - identifiers in ECMAScript programs. - - Syntax - - Keyword :: one of - break for new var - continue function return void - delete if this while - else in typeof with - - This test verifies that the keyword cannot be used as an identifier. - Functioinal tests of the keyword may be found in the section corresponding - to the function of the keyword. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "7.4.2-4-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Keywords"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "var var = true"; -EXPECTED = "error"; - -TestCase( SECTION, "var var = true", "error", eval("var var = true") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-5-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-5-n.js deleted file mode 100644 index 3fdf06b2c1..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-5-n.js +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.4.2-5-n.js'; - -/** - File Name: 7.4.2-5-n.js - ECMA Section: 7.4.2 - - Description: - The following tokens are ECMAScript keywords and may not be used as - identifiers in ECMAScript programs. - - Syntax - - Keyword :: one of - break for new var - continue function return void - delete if this while - else in typeof with - - This test verifies that the keyword cannot be used as an identifier. - Functioinal tests of the keyword may be found in the section corresponding - to the function of the keyword. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "7.4.2-5-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Keywords"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "var continue = true"; -EXPECTED = "error"; - -new TestCase( SECTION, "var continue = true", "error", eval("var continue = true") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-6-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-6-n.js deleted file mode 100644 index 00f3f99a4c..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-6-n.js +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.4.2-6-n.js'; - -/** - File Name: 7.4.2-6.js - ECMA Section: 7.4.2 - - Description: - The following tokens are ECMAScript keywords and may not be used as - identifiers in ECMAScript programs. - - Syntax - - Keyword :: one of - break for new var - continue function return void - delete if this while - else in typeof with - - This test verifies that the keyword cannot be used as an identifier. - Functioinal tests of the keyword may be found in the section corresponding - to the function of the keyword. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "7.4.2-6-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Keywords"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "var function = true"; -EXPECTED = "error"; - -new TestCase( SECTION, "var function = true", "error", eval("var function = true") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-7-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-7-n.js deleted file mode 100644 index 6a85b261ce..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-7-n.js +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.4.2-7-n.js'; - -/** - File Name: 7.4.2-7-n.js - ECMA Section: 7.4.2 - - Description: - The following tokens are ECMAScript keywords and may not be used as - identifiers in ECMAScript programs. - - Syntax - - Keyword :: one of - break for new var - continue function return void - delete if this while - else in typeof with - - This test verifies that the keyword cannot be used as an identifier. - Functioinal tests of the keyword may be found in the section corresponding - to the function of the keyword. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "7.4.2-7"; -var VERSION = "ECMA_1"; -startTest(); -writeHeaderToLog( SECTION + " Keywords"); - -DESCRIPTION = "var return = true"; -EXPECTED = "error"; - -new TestCase( SECTION, "var return = true", "error", eval("var return = true") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-8-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-8-n.js deleted file mode 100644 index 5f5122e0f2..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-8-n.js +++ /dev/null @@ -1,76 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.4.2-8-n.js'; - -/** - File Name: 7.4.2-8-n.js - ECMA Section: 7.4.2 - - Description: - The following tokens are ECMAScript keywords and may not be used as - identifiers in ECMAScript programs. - - Syntax - - Keyword :: one of - break for new var - continue function return void - delete if this while - else in typeof with - - This test verifies that the keyword cannot be used as an identifier. - Functioinal tests of the keyword may be found in the section corresponding - to the function of the keyword. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "7.4.2-8"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Keywords"); - -DESCRIPTION = "var void = true"; -EXPECTED = "error"; - -new TestCase( SECTION, "var void = true", "error", eval("var void = true") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-9-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-9-n.js deleted file mode 100644 index c1c4df6d9b..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.2-9-n.js +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.4.2-9-n.js'; - -/** - File Name: 7.4.2-9-n.js - ECMA Section: 7.4.2 - - Description: - The following tokens are ECMAScript keywords and may not be used as - identifiers in ECMAScript programs. - - Syntax - - Keyword :: one of - break for new var - continue function return void - delete if this while - else in typeof with - - This test verifies that the keyword cannot be used as an identifier. - Functioinal tests of the keyword may be found in the section corresponding - to the function of the keyword. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "7.4.1-9-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Keywords"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "var delete = true"; -EXPECTED = "error"; - -new TestCase( SECTION, "var delete = true", "error", eval("var delete = true") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-1-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-1-n.js deleted file mode 100644 index dee163d8e5..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-1-n.js +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.4.3-1-n.js'; - -/** - File Name: 7.4.3-1-n.js - ECMA Section: 7.4.3 - - Description: - The following words are used as keywords in proposed extensions and are - therefore reserved to allow for the possibility of future adoption of - those extensions. - - FutureReservedWord :: one of - case debugger export super - catch default extends switch - class do finally throw - const enum import try - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "7.4.3-1-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Future Reserved Words"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "var case = true"; -EXPECTED = "error"; - -new TestCase( SECTION, "var case = true", "error", eval("var case = true") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-10-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-10-n.js deleted file mode 100644 index 8d717f323d..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-10-n.js +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.4.3-10-n.js'; - -/** - File Name: 7.4.3-10-n.js - ECMA Section: 7.4.3 - - Description: - The following words are used as keywords in proposed extensions and are - therefore reserved to allow for the possibility of future adoption of - those extensions. - - FutureReservedWord :: one of - case debugger export super - catch default extends switch - class do finally throw - const enum import try - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "7.4.3-10-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Future Reserved Words"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "var do = true"; -EXPECTED = "error"; - -new TestCase( SECTION, "var do = true", "error", eval("var do = true") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-11-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-11-n.js deleted file mode 100644 index 4e29e9c3af..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-11-n.js +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.4.3-11-n.js'; - -/** - File Name: 7.4.3-11-n.js - ECMA Section: 7.4.3 - - Description: - The following words are used as keywords in proposed extensions and are - therefore reserved to allow for the possibility of future adoption of - those extensions. - - FutureReservedWord :: one of - case debugger export super - catch default extends switch - class do finally throw - const enum import try - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "7.4.3-11-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Future Reserved Words"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "var finally = true"; -EXPECTED = "error"; - -new TestCase( SECTION, "var finally = true", "error", eval("var finally = true") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-12-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-12-n.js deleted file mode 100644 index 913fae905b..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-12-n.js +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.4.3-12-n.js'; - -/** - File Name: 7.4.3-12-n.js - ECMA Section: 7.4.3 - - Description: - The following words are used as keywords in proposed extensions and are - therefore reserved to allow for the possibility of future adoption of - those extensions. - - FutureReservedWord :: one of - case debugger export super - catch default extends switch - class do finally throw - const enum import try - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "7.4.3-12-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Future Reserved Words"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "var throw = true"; -EXPECTED = "error"; - -new TestCase( SECTION, "var throw = true", "error", eval("var throw = true") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-13-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-13-n.js deleted file mode 100644 index c196ea2418..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-13-n.js +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.4.3-13-n.js'; - -/** - File Name: 7.4.3-13-n.js - ECMA Section: 7.4.3 - - Description: - The following words are used as keywords in proposed extensions and are - therefore reserved to allow for the possibility of future adoption of - those extensions. - - FutureReservedWord :: one of - case debugger export super - catch default extends switch - class do finally throw - const enum import try - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "7.4.3-13-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Future Reserved Words"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "var const = true"; -EXPECTED = "error"; - -new TestCase( SECTION, "var const = true", "error", eval("var const = true") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-14-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-14-n.js deleted file mode 100644 index 8d5af29ede..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-14-n.js +++ /dev/null @@ -1,97 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.4.3-14-n.js'; - -/** - File Name: 7.4.3-14-n.js - ECMA Section: 7.4.3 - - Description: - The following words are used as keywords in proposed extensions and are - therefore reserved to allow for the possibility of future adoption of - those extensions. - - FutureReservedWord :: one of - case debugger export super - catch default extends switch - class do finally throw - const enum import try - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "7.4.3-14-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Future Reserved Words"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var actual = 'no error'; -var prefValue; - -print("This test requires option javascript.options.strict enabled"); - -options('strict'); -options('werror'); - -try -{ - eval("var enum = true"); -} -catch(e) -{ - actual = 'error'; -} - -DESCRIPTION = "var enum = true"; -EXPECTED = "error"; - -// force exception since this is a negative test -if (actual == 'error') -{ - throw actual; -} - -new TestCase( SECTION, - "var enum = true", - "error", - actual ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-15-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-15-n.js deleted file mode 100644 index f855132d8a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-15-n.js +++ /dev/null @@ -1,97 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.4.3-15-n.js'; - -/** - File Name: 7.4.3-15-n.js - ECMA Section: 7.4.3 - - Description: - The following words are used as keywords in proposed extensions and are - therefore reserved to allow for the possibility of future adoption of - those extensions. - - FutureReservedWord :: one of - case debugger export super - catch default extends switch - class do finally throw - const enum import try - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "7.4.3-15-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Future Reserved Words"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var actual = 'no error'; -var prefValue; - -print("This test requires option javascript.options.strict enabled"); - -options('strict'); -options('werror'); - -try -{ - eval("var import = true"); -} -catch(e) -{ - actual = 'error'; -} - -DESCRIPTION = "var import = true"; -EXPECTED = "error"; - -// force exception since this is a negative test -if (actual == 'error') -{ - throw actual; -} - -new TestCase( SECTION, - "var import = true", - "error", - actual ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-16-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-16-n.js deleted file mode 100644 index 6d86d357f2..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-16-n.js +++ /dev/null @@ -1,88 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.4.3-16-n.js'; - -/** - File Name: lexical-023.js - Corresponds To: 7.4.3-16-n.js - ECMA Section: 7.4.3 - Description: - The following words are used as keywords in proposed extensions and are - therefore reserved to allow for the possibility of future adoption of - those extensions. - - FutureReservedWord :: one of - case debugger export super - catch default extends switch - class do finally throw - const enum import try - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "lexical-023.js"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Future Reserved Words"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; -/* - try { - try = true; - } catch ( e ) { - result = expect; - exception = e.toString(); - } -*/ - -DESCRIPTION = "try = true"; -EXPECTED = "error"; - -new TestCase( - SECTION, - "try = true" + - " (threw " + exception +")", - "error", - eval("try = true") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-2-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-2-n.js deleted file mode 100644 index fe5f6ffac1..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-2-n.js +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.4.3-2-n.js'; - -/** - File Name: 7.4.3-2-n.js - ECMA Section: 7.4.3 - - Description: - The following words are used as keywords in proposed extensions and are - therefore reserved to allow for the possibility of future adoption of - those extensions. - - FutureReservedWord :: one of - case debugger export super - catch default extends switch - class do finally throw - const enum import try - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "7.4.3-2-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Future Reserved Words"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "var debugger = true"; -EXPECTED = "error"; - -new TestCase( SECTION, "var debugger = true", "error", eval("var debugger = true") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-3-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-3-n.js deleted file mode 100644 index b95c8ecbe0..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-3-n.js +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.4.3-3-n.js'; - -/** - File Name: 7.4.3-3-n.js - ECMA Section: 7.4.3 - - Description: - The following words are used as keywords in proposed extensions and are - therefore reserved to allow for the possibility of future adoption of - those extensions. - - FutureReservedWord :: one of - case debugger export super - catch default extends switch - class do finally throw - const enum import try - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "7.4.3-3-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Future Reserved Words"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "var export = true"; -EXPECTED = "error"; - -new TestCase( SECTION, "var export = true", "error", eval("var export = true") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-4-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-4-n.js deleted file mode 100644 index b17b06f2e9..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-4-n.js +++ /dev/null @@ -1,96 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.4.3-4-n.js'; - -/** - File Name: 7.4.3-4-n.js - ECMA Section: 7.4.3 - - Description: - The following words are used as keywords in proposed extensions and are - therefore reserved to allow for the possibility of future adoption of - those extensions. - - FutureReservedWord :: one of - case debugger export super - catch default extends switch - class do finally throw - const enum import try - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "7.4.3-4-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Future Reserved Words"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var actual = 'no error'; -var prefValue; - -print("This test requires option javascript.options.strict enabled"); - -options('strict'); -options('werror'); - -try -{ - eval("var super = true"); -} -catch(e) -{ - actual = 'error'; -} - -DESCRIPTION = "var super = true" - EXPECTED = "error"; - -// force exception since this is a negative test -if (actual == 'error') -{ - throw actual; -} - -new TestCase( SECTION, - "var super = true", - "error", - actual ); -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-5-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-5-n.js deleted file mode 100644 index d76025b3cc..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-5-n.js +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.4.3-5-n.js'; - -/** - File Name: 7.4.3-5-n.js - ECMA Section: 7.4.3 - - Description: - The following words are used as keywords in proposed extensions and are - therefore reserved to allow for the possibility of future adoption of - those extensions. - - FutureReservedWord :: one of - case debugger export super - catch default extends switch - class do finally throw - const enum import try - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "7.4.3-5-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Future Reserved Words"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "var catch = true"; -EXPECTED = "error"; - -new TestCase( SECTION, "var catch = true", "error", eval("var catch = true") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-6-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-6-n.js deleted file mode 100644 index 36ffe63977..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-6-n.js +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.4.3-6-n.js'; - -/** - File Name: 7.4.3-6-n.js - ECMA Section: 7.4.3 - - Description: - The following words are used as keywords in proposed extensions and are - therefore reserved to allow for the possibility of future adoption of - those extensions. - - FutureReservedWord :: one of - case debugger export super - catch default extends switch - class do finally throw - const enum import try - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "7.4.3-6-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Future Reserved Words"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "var default = true"; -EXPECTED = "error"; - -new TestCase( SECTION, "var default = true", "error", eval("var default = true") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-7-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-7-n.js deleted file mode 100644 index 31239d561a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-7-n.js +++ /dev/null @@ -1,97 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.4.3-7-n.js'; - -/** - File Name: 7.4.3-7-n.js - ECMA Section: 7.4.3 - - Description: - The following words are used as keywords in proposed extensions and are - therefore reserved to allow for the possibility of future adoption of - those extensions. - - FutureReservedWord :: one of - case debugger export super - catch default extends switch - class do finally throw - const enum import try - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "7.4.3-7-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Future Reserved Words"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var actual = 'no error'; -var prefValue; - -print("This test requires option javascript.options.strict enabled"); - -options('strict'); -options('werror'); - -try -{ - eval("var extends = true"); -} -catch(e) -{ - actual = 'error'; -} - -DESCRIPTION = "var extends = true"; -EXPECTED = "error"; - -// force exception since this is a negative test -if (actual == 'error') -{ - throw actual; -} - -new TestCase( SECTION, - "var extends = true", - "error", - actual); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-8-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-8-n.js deleted file mode 100644 index 666abcc0c8..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-8-n.js +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.4.3-8-n.js'; - -/** - File Name: 7.4.3-8-n.js - ECMA Section: 7.4.3 - - Description: - The following words are used as keywords in proposed extensions and are - therefore reserved to allow for the possibility of future adoption of - those extensions. - - FutureReservedWord :: one of - case debugger export super - catch default extends switch - class do finally throw - const enum import try - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "7.4.3-9-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Future Reserved Words"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "var switch = true"; -EXPECTED = "error"; - -new TestCase( SECTION, "var switch = true", "error", eval("var switch = true") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-9-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-9-n.js deleted file mode 100644 index 4fee9c8c4a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.4.3-9-n.js +++ /dev/null @@ -1,98 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.4.3-9-n.js'; - -/** - File Name: 7.4.3-9-n.js - ECMA Section: 7.4.3 - - Description: - The following words are used as keywords in proposed extensions and are - therefore reserved to allow for the possibility of future adoption of - those extensions. - - FutureReservedWord :: one of - case debugger export super - catch default extends switch - class do finally throw - const enum import try - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "7.4.3-9-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Future Reserved Words"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var actual = 'no error'; -var prefValue; - -DESCRIPTION = "var class = true"; -EXPECTED = "error"; - - -print("This test requires option javascript.options.strict enabled"); - -options('strict'); -options('werror'); - -try -{ - eval("var class = true"); -} -catch(e) -{ - actual = 'error'; -} - -// force exception since this is a negative test -if (actual == 'error') -{ - throw actual; -} - -new TestCase( SECTION, - "var class = true", - "error", - actual ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.5-1.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.5-1.js deleted file mode 100644 index 57be9b63ee..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.5-1.js +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.5-1.js'; - -/** - File Name: 7.5-1.js - ECMA Section: 7.5 Identifiers - Description: Identifiers are of unlimited length - - can contain letters, a decimal digit, _, or $ - - the first character cannot be a decimal digit - - identifiers are case sensitive - - Author: christine@netscape.com - Date: 11 september 1997 -*/ -var SECTION = "7.5-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Identifiers"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "var $123 = 5", 5, eval("var $123 = 5;$123") ); -new TestCase( SECTION, "var _123 = 5", 5, eval("var _123 = 5;_123") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.5-10-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.5-10-n.js deleted file mode 100644 index 2561a3deda..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.5-10-n.js +++ /dev/null @@ -1,64 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.5-10-n.js'; - -/** - File Name: 7.5-9-n.js - ECMA Section: 7.5 Identifiers - Description: Identifiers are of unlimited length - - can contain letters, a decimal digit, _, or $ - - the first character cannot be a decimal digit - - identifiers are case sensitive - - Author: christine@netscape.com - Date: 11 september 1997 -*/ -var SECTION = "7.5-9-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Identifiers"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "var 123=\"hi\""; -EXPECTED = "error"; - -new TestCase( SECTION, "var 123=\"hi\"", "error", eval("123 = \"hi\"; array[item] = 123;") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.5-2-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.5-2-n.js deleted file mode 100644 index 3401fe4891..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.5-2-n.js +++ /dev/null @@ -1,64 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.5-2-n.js'; - -/** - File Name: 7.5-2-n.js - ECMA Section: 7.5 Identifiers - Description: Identifiers are of unlimited length - - can contain letters, a decimal digit, _, or $ - - the first character cannot be a decimal digit - - identifiers are case sensitive - - Author: christine@netscape.com - Date: 11 september 1997 -*/ -var SECTION = "7.5-2-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Identifiers"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "var 0abc"; -EXPECTED = "error"; - -new TestCase( SECTION, "var 0abc", "error", eval("var 0abc") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.5-3-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.5-3-n.js deleted file mode 100644 index 778c284cfb..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.5-3-n.js +++ /dev/null @@ -1,64 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.5-3-n.js'; - -/** - File Name: 7.5-2.js - ECMA Section: 7.5 Identifiers - Description: Identifiers are of unlimited length - - can contain letters, a decimal digit, _, or $ - - the first character cannot be a decimal digit - - identifiers are case sensitive - - Author: christine@netscape.com - Date: 11 september 1997 -*/ -var SECTION = "7.5-3-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Identifiers"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "var 1abc"; -EXPECTED = "error"; - -new TestCase( SECTION, "var 1abc", "error", eval("var 1abc") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.5-4-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.5-4-n.js deleted file mode 100644 index 0f4b0fb2f1..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.5-4-n.js +++ /dev/null @@ -1,64 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.5-4-n.js'; - -/** - File Name: 7.5-4-n.js - ECMA Section: 7.5 Identifiers - Description: Identifiers are of unlimited length - - can contain letters, a decimal digit, _, or $ - - the first character cannot be a decimal digit - - identifiers are case sensitive - - Author: christine@netscape.com - Date: 11 september 1997 -*/ -var SECTION = "7.5-4-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Identifiers"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "var 2abc"; -EXPECTED = "error"; - -new TestCase( SECTION, "var 2abc", "error", eval("var 2abc") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.5-5-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.5-5-n.js deleted file mode 100644 index 97a61e3449..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.5-5-n.js +++ /dev/null @@ -1,64 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.5-5-n.js'; - -/** - File Name: 7.5-5-n.js - ECMA Section: 7.5 Identifiers - Description: Identifiers are of unlimited length - - can contain letters, a decimal digit, _, or $ - - the first character cannot be a decimal digit - - identifiers are case sensitive - - Author: christine@netscape.com - Date: 11 september 1997 -*/ -var SECTION = "7.5-5-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Identifiers"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "var 3abc"; -EXPECTED = "error"; - -new TestCase( SECTION, "var 3abc", "error", eval("var 3abc") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.5-6.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.5-6.js deleted file mode 100644 index a53f4413eb..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.5-6.js +++ /dev/null @@ -1,61 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.5-6.js'; - -/** - File Name: 7.5-6.js - ECMA Section: 7.5 Identifiers - Description: Identifiers are of unlimited length - - can contain letters, a decimal digit, _, or $ - - the first character cannot be a decimal digit - - identifiers are case sensitive - - Author: christine@netscape.com - Date: 11 september 1997 -*/ -var SECTION = "7.5-6"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Identifiers"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "var _0abc = 5", 5, eval("var _0abc = 5; _0abc") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.5-7.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.5-7.js deleted file mode 100644 index c3446c6c0d..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.5-7.js +++ /dev/null @@ -1,61 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.5-7.js'; - -/** - File Name: 7.5-7.js - ECMA Section: 7.5 Identifiers - Description: Identifiers are of unlimited length - - can contain letters, a decimal digit, _, or $ - - the first character cannot be a decimal digit - - identifiers are case sensitive - - Author: christine@netscape.com - Date: 11 september 1997 -*/ -var SECTION = "7.5-7"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Identifiers"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "var $0abc = 5", 5, eval("var $0abc = 5; $0abc") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.5-8-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.5-8-n.js deleted file mode 100644 index e363666148..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.5-8-n.js +++ /dev/null @@ -1,64 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.5-8-n.js'; - -/** - File Name: 7.5-8-n.js - ECMA Section: 7.5 Identifiers - Description: Identifiers are of unlimited length - - can contain letters, a decimal digit, _, or $ - - the first character cannot be a decimal digit - - identifiers are case sensitive - - Author: christine@netscape.com - Date: 11 september 1997 -*/ -var SECTION = "7.5-8-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Identifiers"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "var @0abc = 5; @0abc"; -EXPECTED = "error"; - -new TestCase( SECTION, "var @0abc = 5; @0abc", "error", eval("var @0abc = 5; @0abc") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.5-9-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.5-9-n.js deleted file mode 100644 index c1ac68512a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.5-9-n.js +++ /dev/null @@ -1,64 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.5-9-n.js'; - -/** - File Name: 7.5-9-n.js - ECMA Section: 7.5 Identifiers - Description: Identifiers are of unlimited length - - can contain letters, a decimal digit, _, or $ - - the first character cannot be a decimal digit - - identifiers are case sensitive - - Author: christine@netscape.com - Date: 11 september 1997 -*/ -var SECTION = "7.5-9-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Identifiers"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "var 123=\"hi\""; -EXPECTED = "error"; - -new TestCase( SECTION, "var 123=\"hi\"", "error", eval("var 123 = \"hi\";array[item] = 123;") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.6.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.6.js deleted file mode 100644 index 091c74d7db..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.6.js +++ /dev/null @@ -1,313 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.6.js'; - -/** - File Name: 7.6.js - ECMA Section: Punctuators - Description: - - This tests verifies that all ECMA punctutors are recognized as a - token separator, but does not attempt to verify the functionality - of any punctuator. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "7.6"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Punctuators"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -// == -new TestCase( SECTION, - "var c,d;c==d", - true, - eval("var c,d;c==d") ); - -// = - -new TestCase( SECTION, - "var a=true;a", - true, - eval("var a=true;a") ); - -// > -new TestCase( SECTION, - "var a=true,b=false;a>b", - true, - eval("var a=true,b=false;a>b") ); - -// < -new TestCase( SECTION, - "var a=true,b=false;a= -new TestCase( SECTION, - "var a=0xFFFF,b=0XFFFE;a>=b", - true, - eval("var a=0xFFFF,b=0XFFFE;a>=b") ); - -// != -new TestCase( SECTION, - "var a=true,b=false;a!=b", - true, - eval("var a=true,b=false;a!=b") ); - -new TestCase( SECTION, - "var a=false,b=false;a!=b", - false, - eval("var a=false,b=false;a!=b") ); -// , -new TestCase( SECTION, - "var a=true,b=false;a,b", - false, - eval("var a=true,b=false;a,b") ); -// ! -new TestCase( SECTION, - "var a=true,b=false;!a", - false, - eval("var a=true,b=false;!a") ); - -// ~ -new TestCase( SECTION, - "var a=true;~a", - -2, - eval("var a=true;~a") ); -// ? -new TestCase( SECTION, - "var a=true; (a ? 'PASS' : '')", - "PASS", - eval("var a=true; (a ? 'PASS' : '')") ); - -// : - -new TestCase( SECTION, - "var a=false; (a ? 'FAIL' : 'PASS')", - "PASS", - eval("var a=false; (a ? 'FAIL' : 'PASS')") ); -// . - -new TestCase( SECTION, - "var a=Number;a.NaN", - NaN, - eval("var a=Number;a.NaN") ); - -// && -new TestCase( SECTION, - "var a=true,b=true;if(a&&b)'PASS';else'FAIL'", - "PASS", - eval("var a=true,b=true;if(a&&b)'PASS';else'FAIL'") ); - -// || -new TestCase( SECTION, - "var a=false,b=false;if(a||b)'FAIL';else'PASS'", - "PASS", - eval("var a=false,b=false;if(a||b)'FAIL';else'PASS'") ); -// ++ -new TestCase( SECTION, - "var a=false,b=false;++a", - 1, - eval("var a=false,b=false;++a") ); -// -- -new TestCase( SECTION, - "var a=true,b=false--a", - 0, - eval("var a=true,b=false;--a") ); -// + - -new TestCase( SECTION, - "var a=true,b=true;a+b", - 2, - eval("var a=true,b=true;a+b") ); -// - -new TestCase( SECTION, - "var a=true,b=true;a-b", - 0, - eval("var a=true,b=true;a-b") ); -// * -new TestCase( SECTION, - "var a=true,b=true;a*b", - 1, - eval("var a=true,b=true;a*b") ); -// / -new TestCase( SECTION, - "var a=true,b=true;a/b", - 1, - eval("var a=true,b=true;a/b") ); -// & -new TestCase( SECTION, - "var a=3,b=2;a&b", - 2, - eval("var a=3,b=2;a&b") ); -// | -new TestCase( SECTION, - "var a=4,b=3;a|b", - 7, - eval("var a=4,b=3;a|b") ); - -// | -new TestCase( SECTION, - "var a=4,b=3;a^b", - 7, - eval("var a=4,b=3;a^b") ); - -// % -new TestCase( SECTION, - "var a=4,b=3;a|b", - 1, - eval("var a=4,b=3;a%b") ); - -// << -new TestCase( SECTION, - "var a=4,b=3;a<> -new TestCase( SECTION, - "var a=4,b=1;a>>b", - 2, - eval("var a=4,b=1;a>>b") ); - -// >>> -new TestCase( SECTION, - "var a=1,b=1;a>>>b", - 0, - eval("var a=1,b=1;a>>>b") ); -// += -new TestCase( SECTION, - "var a=4,b=3;a+=b;a", - 7, - eval("var a=4,b=3;a+=b;a") ); - -// -= -new TestCase( SECTION, - "var a=4,b=3;a-=b;a", - 1, - eval("var a=4,b=3;a-=b;a") ); -// *= -new TestCase( SECTION, - "var a=4,b=3;a*=b;a", - 12, - eval("var a=4,b=3;a*=b;a") ); -// += -new TestCase( SECTION, - "var a=4,b=3;a+=b;a", - 7, - eval("var a=4,b=3;a+=b;a") ); -// /= -new TestCase( SECTION, - "var a=12,b=3;a/=b;a", - 4, - eval("var a=12,b=3;a/=b;a") ); - -// &= -new TestCase( SECTION, - "var a=4,b=5;a&=b;a", - 4, - eval("var a=4,b=5;a&=b;a") ); - -// |= -new TestCase( SECTION, - "var a=4,b=5;a&=b;a", - 5, - eval("var a=4,b=5;a|=b;a") ); -// ^= -new TestCase( SECTION, - "var a=4,b=5;a^=b;a", - 1, - eval("var a=4,b=5;a^=b;a") ); -// %= -new TestCase( SECTION, - "var a=12,b=5;a%=b;a", - 2, - eval("var a=12,b=5;a%=b;a") ); -// <<= -new TestCase( SECTION, - "var a=4,b=3;a<<=b;a", - 32, - eval("var a=4,b=3;a<<=b;a") ); - -// >> -new TestCase( SECTION, - "var a=4,b=1;a>>=b;a", - 2, - eval("var a=4,b=1;a>>=b;a") ); - -// >>> -new TestCase( SECTION, - "var a=1,b=1;a>>>=b;a", - 0, - eval("var a=1,b=1;a>>>=b;a") ); - -// () -new TestCase( SECTION, - "var a=4,b=3;(a)", - 4, - eval("var a=4,b=3;(a)") ); -// {} -new TestCase( SECTION, - "var a=4,b=3;{b}", - 3, - eval("var a=4,b=3;{b}") ); - -// [] -new TestCase( SECTION, - "var a=new Array('hi');a[0]", - "hi", - eval("var a=new Array('hi');a[0]") ); -// [] -new TestCase( SECTION, - ";", - void 0, - eval(";") ); -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.7.1.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.7.1.js deleted file mode 100644 index 83325b5f32..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.7.1.js +++ /dev/null @@ -1,64 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.7.1.js'; - -/** - File Name: 7.7.1.js - ECMA Section: 7.7.1 Null Literals - - Description: NullLiteral:: - null - - - The value of the null literal null is the sole value - of the Null type, namely null. - - Author: christine@netscape.com - Date: 21 october 1997 -*/ -var SECTION = "7.7.1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Null Literals"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "null", null, null); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.7.2.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.7.2.js deleted file mode 100644 index f021eb9b18..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.7.2.js +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.7.2.js'; - -/** - File Name: 7.7.2.js - ECMA Section: 7.7.2 Boolean Literals - - Description: BooleanLiteral:: - true - false - - The value of the Boolean literal true is a value of the - Boolean type, namely true. - - The value of the Boolean literal false is a value of the - Boolean type, namely false. - - Author: christine@netscape.com - Date: 16 september 1997 -*/ - -var SECTION = "7.7.2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Boolean Literals"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -// StringLiteral:: "" and '' - -new TestCase( SECTION, "true", Boolean(true), true ); -new TestCase( SECTION, "false", Boolean(false), false ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.7.3-1.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.7.3-1.js deleted file mode 100644 index fb13b24e07..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.7.3-1.js +++ /dev/null @@ -1,198 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.7.3-1.js'; - -/** - File Name: 7.7.3-1.js - ECMA Section: 7.7.3 Numeric Literals - - Description: A numeric literal stands for a value of the Number type - This value is determined in two steps: first a - mathematical value (MV) is derived from the literal; - second, this mathematical value is rounded, ideally - using IEEE 754 round-to-nearest mode, to a reprentable - value of of the number type. - - These test cases came from Waldemar. - - Author: christine@netscape.com - Date: 12 June 1998 -*/ - -var SECTION = "7.7.3-1"; -var VERSION = "ECMA_1"; -var TITLE = "Numeric Literals"; -var BUGNUMBER="122877"; - -startTest(); - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "0x12345678", - 305419896, - 0x12345678 ); - -new TestCase( SECTION, - "0x80000000", - 2147483648, - 0x80000000 ); - -new TestCase( SECTION, - "0xffffffff", - 4294967295, - 0xffffffff ); - -new TestCase( SECTION, - "0x100000000", - 4294967296, - 0x100000000 ); - -new TestCase( SECTION, - "077777777777777777", - 2251799813685247, - 077777777777777777 ); - -new TestCase( SECTION, - "077777777777777776", - 2251799813685246, - 077777777777777776 ); - -new TestCase( SECTION, - "0x1fffffffffffff", - 9007199254740991, - 0x1fffffffffffff ); - -new TestCase( SECTION, - "0x20000000000000", - 9007199254740992, - 0x20000000000000 ); - -new TestCase( SECTION, - "0x20123456789abc", - 9027215253084860, - 0x20123456789abc ); - -new TestCase( SECTION, - "0x20123456789abd", - 9027215253084860, - 0x20123456789abd ); - -new TestCase( SECTION, - "0x20123456789abe", - 9027215253084862, - 0x20123456789abe ); - -new TestCase( SECTION, - "0x20123456789abf", - 9027215253084864, - 0x20123456789abf ); - -new TestCase( SECTION, - "0x1000000000000080", - 1152921504606847000, - 0x1000000000000080 ); - -new TestCase( SECTION, - "0x1000000000000081", - 1152921504606847200, - 0x1000000000000081 ); - -new TestCase( SECTION, - "0x1000000000000100", - 1152921504606847200, - 0x1000000000000100 ); - -new TestCase( SECTION, - "0x100000000000017f", - 1152921504606847200, - 0x100000000000017f ); - -new TestCase( SECTION, - "0x1000000000000180", - 1152921504606847500, - 0x1000000000000180 ); - -new TestCase( SECTION, - "0x1000000000000181", - 1152921504606847500, - 0x1000000000000181 ); - -new TestCase( SECTION, - "0x10000000000001f0", - 1152921504606847500, - 0x10000000000001f0 ); - -new TestCase( SECTION, - "0x1000000000000200", - 1152921504606847500, - 0x1000000000000200 ); - -new TestCase( SECTION, - "0x100000000000027f", - 1152921504606847500, - 0x100000000000027f ); - -new TestCase( SECTION, - "0x1000000000000280", - 1152921504606847500, - 0x1000000000000280 ); - -new TestCase( SECTION, - "0x1000000000000281", - 1152921504606847700, - 0x1000000000000281 ); - -new TestCase( SECTION, - "0x10000000000002ff", - 1152921504606847700, - 0x10000000000002ff ); - -new TestCase( SECTION, - "0x1000000000000300", - 1152921504606847700, - 0x1000000000000300 ); - -new TestCase( SECTION, - "0x10000000000000000", - 18446744073709552000, - 0x10000000000000000 ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.7.3-2.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.7.3-2.js deleted file mode 100644 index 8fbe16cb8f..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.7.3-2.js +++ /dev/null @@ -1,93 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.7.3-2.js'; - -/** - File Name: 7.7.3-2.js - ECMA Section: 7.7.3 Numeric Literals - - Description: - - This is a regression test for - http://scopus.mcom.com/bugsplat/show_bug.cgi?id=122884 - - Waldemar's comments: - - A numeric literal that starts with either '08' or '09' is interpreted as a - decimal literal; it should be an error instead. (Strictly speaking, according - to ECMA v1 such literals should be interpreted as two integers -- a zero - followed by a decimal number whose first digit is 8 or 9, but this is a bug in - ECMA that will be fixed in v2. In any case, there is no place in the grammar - where two consecutive numbers would be legal.) - - Author: christine@netscape.com - Date: 15 june 1998 - -*/ -var SECTION = "7.7.3-2"; -var VERSION = "ECMA_1"; -var TITLE = "Numeric Literals"; -var BUGNUMBER="122884"; - -startTest(); - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "9", - 9, - 9 ); - -new TestCase( SECTION, - "09", - 9, - 09 ); - -new TestCase( SECTION, - "099", - 99, - 099 ); - - -new TestCase( SECTION, - "077", - 63, - 077 ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.7.3.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.7.3.js deleted file mode 100644 index 9ccb912752..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.7.3.js +++ /dev/null @@ -1,331 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.7.3.js'; - -/** - File Name: 7.7.3.js - ECMA Section: 7.7.3 Numeric Literals - - Description: A numeric literal stands for a value of the Number type - This value is determined in two steps: first a - mathematical value (MV) is derived from the literal; - second, this mathematical value is rounded, ideally - using IEEE 754 round-to-nearest mode, to a reprentable - value of of the number type. - - Author: christine@netscape.com - Date: 16 september 1997 -*/ -var SECTION = "7.7.3"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Numeric Literals"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "0", 0, 0 ); -new TestCase( SECTION, "1", 1, 1 ); -new TestCase( SECTION, "2", 2, 2 ); -new TestCase( SECTION, "3", 3, 3 ); -new TestCase( SECTION, "4", 4, 4 ); -new TestCase( SECTION, "5", 5, 5 ); -new TestCase( SECTION, "6", 6, 6 ); -new TestCase( SECTION, "7", 7, 7 ); -new TestCase( SECTION, "8", 8, 8 ); -new TestCase( SECTION, "9", 9, 9 ); - -new TestCase( SECTION, "0.", 0, 0. ); -new TestCase( SECTION, "1.", 1, 1. ); -new TestCase( SECTION, "2.", 2, 2. ); -new TestCase( SECTION, "3.", 3, 3. ); -new TestCase( SECTION, "4.", 4, 4. ); - -new TestCase( SECTION, "0.e0", 0, 0.e0 ); -new TestCase( SECTION, "1.e1", 10, 1.e1 ); -new TestCase( SECTION, "2.e2", 200, 2.e2 ); -new TestCase( SECTION, "3.e3", 3000, 3.e3 ); -new TestCase( SECTION, "4.e4", 40000, 4.e4 ); - -new TestCase( SECTION, "0.1e0", .1, 0.1e0 ); -new TestCase( SECTION, "1.1e1", 11, 1.1e1 ); -new TestCase( SECTION, "2.2e2", 220, 2.2e2 ); -new TestCase( SECTION, "3.3e3", 3300, 3.3e3 ); -new TestCase( SECTION, "4.4e4", 44000, 4.4e4 ); - -new TestCase( SECTION, ".1e0", .1, .1e0 ); -new TestCase( SECTION, ".1e1", 1, .1e1 ); -new TestCase( SECTION, ".2e2", 20, .2e2 ); -new TestCase( SECTION, ".3e3", 300, .3e3 ); -new TestCase( SECTION, ".4e4", 4000, .4e4 ); - -new TestCase( SECTION, "0e0", 0, 0e0 ); -new TestCase( SECTION, "1e1", 10, 1e1 ); -new TestCase( SECTION, "2e2", 200, 2e2 ); -new TestCase( SECTION, "3e3", 3000, 3e3 ); -new TestCase( SECTION, "4e4", 40000, 4e4 ); - -new TestCase( SECTION, "0e0", 0, 0e0 ); -new TestCase( SECTION, "1e1", 10, 1e1 ); -new TestCase( SECTION, "2e2", 200, 2e2 ); -new TestCase( SECTION, "3e3", 3000, 3e3 ); -new TestCase( SECTION, "4e4", 40000, 4e4 ); - -new TestCase( SECTION, "0E0", 0, 0E0 ); -new TestCase( SECTION, "1E1", 10, 1E1 ); -new TestCase( SECTION, "2E2", 200, 2E2 ); -new TestCase( SECTION, "3E3", 3000, 3E3 ); -new TestCase( SECTION, "4E4", 40000, 4E4 ); - -new TestCase( SECTION, "1.e-1", 0.1, 1.e-1 ); -new TestCase( SECTION, "2.e-2", 0.02, 2.e-2 ); -new TestCase( SECTION, "3.e-3", 0.003, 3.e-3 ); -new TestCase( SECTION, "4.e-4", 0.0004, 4.e-4 ); - -new TestCase( SECTION, "0.1e-0", .1, 0.1e-0 ); -new TestCase( SECTION, "1.1e-1", 0.11, 1.1e-1 ); -new TestCase( SECTION, "2.2e-2", .022, 2.2e-2 ); -new TestCase( SECTION, "3.3e-3", .0033, 3.3e-3 ); -new TestCase( SECTION, "4.4e-4", .00044, 4.4e-4 ); - -new TestCase( SECTION, ".1e-0", .1, .1e-0 ); -new TestCase( SECTION, ".1e-1", .01, .1e-1 ); -new TestCase( SECTION, ".2e-2", .002, .2e-2 ); -new TestCase( SECTION, ".3e-3", .0003, .3e-3 ); -new TestCase( SECTION, ".4e-4", .00004, .4e-4 ); - -new TestCase( SECTION, "1.e+1", 10, 1.e+1 ); -new TestCase( SECTION, "2.e+2", 200, 2.e+2 ); -new TestCase( SECTION, "3.e+3", 3000, 3.e+3 ); -new TestCase( SECTION, "4.e+4", 40000, 4.e+4 ); - -new TestCase( SECTION, "0.1e+0", .1, 0.1e+0 ); -new TestCase( SECTION, "1.1e+1", 11, 1.1e+1 ); -new TestCase( SECTION, "2.2e+2", 220, 2.2e+2 ); -new TestCase( SECTION, "3.3e+3", 3300, 3.3e+3 ); -new TestCase( SECTION, "4.4e+4", 44000, 4.4e+4 ); - -new TestCase( SECTION, ".1e+0", .1, .1e+0 ); -new TestCase( SECTION, ".1e+1", 1, .1e+1 ); -new TestCase( SECTION, ".2e+2", 20, .2e+2 ); -new TestCase( SECTION, ".3e+3", 300, .3e+3 ); -new TestCase( SECTION, ".4e+4", 4000, .4e+4 ); - -new TestCase( SECTION, "0x0", 0, 0x0 ); -new TestCase( SECTION, "0x1", 1, 0x1 ); -new TestCase( SECTION, "0x2", 2, 0x2 ); -new TestCase( SECTION, "0x3", 3, 0x3 ); -new TestCase( SECTION, "0x4", 4, 0x4 ); -new TestCase( SECTION, "0x5", 5, 0x5 ); -new TestCase( SECTION, "0x6", 6, 0x6 ); -new TestCase( SECTION, "0x7", 7, 0x7 ); -new TestCase( SECTION, "0x8", 8, 0x8 ); -new TestCase( SECTION, "0x9", 9, 0x9 ); -new TestCase( SECTION, "0xa", 10, 0xa ); -new TestCase( SECTION, "0xb", 11, 0xb ); -new TestCase( SECTION, "0xc", 12, 0xc ); -new TestCase( SECTION, "0xd", 13, 0xd ); -new TestCase( SECTION, "0xe", 14, 0xe ); -new TestCase( SECTION, "0xf", 15, 0xf ); - -new TestCase( SECTION, "0X0", 0, 0X0 ); -new TestCase( SECTION, "0X1", 1, 0X1 ); -new TestCase( SECTION, "0X2", 2, 0X2 ); -new TestCase( SECTION, "0X3", 3, 0X3 ); -new TestCase( SECTION, "0X4", 4, 0X4 ); -new TestCase( SECTION, "0X5", 5, 0X5 ); -new TestCase( SECTION, "0X6", 6, 0X6 ); -new TestCase( SECTION, "0X7", 7, 0X7 ); -new TestCase( SECTION, "0X8", 8, 0X8 ); -new TestCase( SECTION, "0X9", 9, 0X9 ); -new TestCase( SECTION, "0Xa", 10, 0Xa ); -new TestCase( SECTION, "0Xb", 11, 0Xb ); -new TestCase( SECTION, "0Xc", 12, 0Xc ); -new TestCase( SECTION, "0Xd", 13, 0Xd ); -new TestCase( SECTION, "0Xe", 14, 0Xe ); -new TestCase( SECTION, "0Xf", 15, 0Xf ); - -new TestCase( SECTION, "0x0", 0, 0x0 ); -new TestCase( SECTION, "0x1", 1, 0x1 ); -new TestCase( SECTION, "0x2", 2, 0x2 ); -new TestCase( SECTION, "0x3", 3, 0x3 ); -new TestCase( SECTION, "0x4", 4, 0x4 ); -new TestCase( SECTION, "0x5", 5, 0x5 ); -new TestCase( SECTION, "0x6", 6, 0x6 ); -new TestCase( SECTION, "0x7", 7, 0x7 ); -new TestCase( SECTION, "0x8", 8, 0x8 ); -new TestCase( SECTION, "0x9", 9, 0x9 ); -new TestCase( SECTION, "0xA", 10, 0xA ); -new TestCase( SECTION, "0xB", 11, 0xB ); -new TestCase( SECTION, "0xC", 12, 0xC ); -new TestCase( SECTION, "0xD", 13, 0xD ); -new TestCase( SECTION, "0xE", 14, 0xE ); -new TestCase( SECTION, "0xF", 15, 0xF ); - -new TestCase( SECTION, "0X0", 0, 0X0 ); -new TestCase( SECTION, "0X1", 1, 0X1 ); -new TestCase( SECTION, "0X2", 2, 0X2 ); -new TestCase( SECTION, "0X3", 3, 0X3 ); -new TestCase( SECTION, "0X4", 4, 0X4 ); -new TestCase( SECTION, "0X5", 5, 0X5 ); -new TestCase( SECTION, "0X6", 6, 0X6 ); -new TestCase( SECTION, "0X7", 7, 0X7 ); -new TestCase( SECTION, "0X8", 8, 0X8 ); -new TestCase( SECTION, "0X9", 9, 0X9 ); -new TestCase( SECTION, "0XA", 10, 0XA ); -new TestCase( SECTION, "0XB", 11, 0XB ); -new TestCase( SECTION, "0XC", 12, 0XC ); -new TestCase( SECTION, "0XD", 13, 0XD ); -new TestCase( SECTION, "0XE", 14, 0XE ); -new TestCase( SECTION, "0XF", 15, 0XF ); - - -new TestCase( SECTION, "00", 0, 00 ); -new TestCase( SECTION, "01", 1, 01 ); -new TestCase( SECTION, "02", 2, 02 ); -new TestCase( SECTION, "03", 3, 03 ); -new TestCase( SECTION, "04", 4, 04 ); -new TestCase( SECTION, "05", 5, 05 ); -new TestCase( SECTION, "06", 6, 06 ); -new TestCase( SECTION, "07", 7, 07 ); - -new TestCase( SECTION, "000", 0, 000 ); -new TestCase( SECTION, "011", 9, 011 ); -new TestCase( SECTION, "022", 18, 022 ); -new TestCase( SECTION, "033", 27, 033 ); -new TestCase( SECTION, "044", 36, 044 ); -new TestCase( SECTION, "055", 45, 055 ); -new TestCase( SECTION, "066", 54, 066 ); -new TestCase( SECTION, "077", 63, 077 ); - -new TestCase( SECTION, "0.00000000001", 0.00000000001, 0.00000000001 ); -new TestCase( SECTION, "0.00000000001e-2", 0.0000000000001, 0.00000000001e-2 ); - - -new TestCase( SECTION, - "123456789012345671.9999", - "123456789012345660", - 123456789012345671.9999 +""); -new TestCase( SECTION, - "123456789012345672", - "123456789012345660", - 123456789012345672 +""); - -new TestCase( SECTION, - "123456789012345672.000000000000000000000000000", - "123456789012345660", - 123456789012345672.000000000000000000000000000 +""); - -new TestCase( SECTION, - "123456789012345672.01", - "123456789012345680", - 123456789012345672.01 +""); - -new TestCase( SECTION, - "123456789012345672.000000000000000000000000001+'' == 123456789012345680 || 123456789012345660", - true, - ( 123456789012345672.00000000000000000000000000 +"" == 1234567890 * 100000000 + 12345680 ) - || - ( 123456789012345672.00000000000000000000000000 +"" == 1234567890 * 100000000 + 12345660) ); - -new TestCase( SECTION, - "123456789012345673", - "123456789012345680", - 123456789012345673 +"" ); - -new TestCase( SECTION, - "-123456789012345671.9999", - "-123456789012345660", - -123456789012345671.9999 +"" ); - -new TestCase( SECTION, - "-123456789012345672", - "-123456789012345660", - -123456789012345672+""); - -new TestCase( SECTION, - "-123456789012345672.000000000000000000000000000", - "-123456789012345660", - -123456789012345672.000000000000000000000000000 +""); - -new TestCase( SECTION, - "-123456789012345672.01", - "-123456789012345680", - -123456789012345672.01 +"" ); - -new TestCase( SECTION, - "-123456789012345672.000000000000000000000000001 == -123456789012345680 or -123456789012345660", - true, - (-123456789012345672.000000000000000000000000001 +"" == -1234567890 * 100000000 -12345680) - || - (-123456789012345672.000000000000000000000000001 +"" == -1234567890 * 100000000 -12345660)); - -new TestCase( SECTION, - -123456789012345673, - "-123456789012345680", - -123456789012345673 +""); - -new TestCase( SECTION, - "12345678901234567890", - "12345678901234567000", - 12345678901234567890 +"" ); - - -/* - new TestCase( SECTION, "12345678901234567", "12345678901234567", 12345678901234567+"" ); - new TestCase( SECTION, "123456789012345678", "123456789012345678", 123456789012345678+"" ); - new TestCase( SECTION, "1234567890123456789", "1234567890123456789", 1234567890123456789+"" ); - new TestCase( SECTION, "12345678901234567890", "12345678901234567890", 12345678901234567890+"" ); - new TestCase( SECTION, "123456789012345678900", "123456789012345678900", 123456789012345678900+"" ); - new TestCase( SECTION, "1234567890123456789000", "1234567890123456789000", 1234567890123456789000+"" ); -*/ -new TestCase( SECTION, "0x1", 1, 0x1 ); -new TestCase( SECTION, "0x10", 16, 0x10 ); -new TestCase( SECTION, "0x100", 256, 0x100 ); -new TestCase( SECTION, "0x1000", 4096, 0x1000 ); -new TestCase( SECTION, "0x10000", 65536, 0x10000 ); -new TestCase( SECTION, "0x100000", 1048576, 0x100000 ); -new TestCase( SECTION, "0x1000000", 16777216, 0x1000000 ); -new TestCase( SECTION, "0x10000000", 268435456, 0x10000000 ); -/* - new TestCase( SECTION, "0x100000000", 4294967296, 0x100000000 ); - new TestCase( SECTION, "0x1000000000", 68719476736, 0x1000000000 ); - new TestCase( SECTION, "0x10000000000", 1099511627776, 0x10000000000 ); -*/ - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.7.4.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.7.4.js deleted file mode 100644 index 015a385220..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.7.4.js +++ /dev/null @@ -1,269 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.7.4.js'; - -/** - File Name: 7.7.4.js - ECMA Section: 7.7.4 String Literals - - Description: A string literal is zero or more characters enclosed in - single or double quotes. Each character may be - represented by an escape sequence. - - - Author: christine@netscape.com - Date: 16 september 1997 -*/ - -var SECTION = "7.7.4"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "String Literals"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -// StringLiteral:: "" and '' - -new TestCase( SECTION, "\"\"", "", "" ); -new TestCase( SECTION, "\'\'", "", '' ); - -// DoubleStringCharacters:: DoubleStringCharacter :: EscapeSequence :: CharacterEscapeSequence -new TestCase( SECTION, "\\\"", String.fromCharCode(0x0022), "\"" ); -new TestCase( SECTION, "\\\'", String.fromCharCode(0x0027), "\'" ); -new TestCase( SECTION, "\\", String.fromCharCode(0x005C), "\\" ); -new TestCase( SECTION, "\\b", String.fromCharCode(0x0008), "\b" ); -new TestCase( SECTION, "\\f", String.fromCharCode(0x000C), "\f" ); -new TestCase( SECTION, "\\n", String.fromCharCode(0x000A), "\n" ); -new TestCase( SECTION, "\\r", String.fromCharCode(0x000D), "\r" ); -new TestCase( SECTION, "\\t", String.fromCharCode(0x0009), "\t" ); -new TestCase( SECTION, "\\v", String.fromCharCode(0x000B), "\v" ); - -// DoubleStringCharacters:DoubleStringCharacter::EscapeSequence::OctalEscapeSequence - -new TestCase( SECTION, "\\00", String.fromCharCode(0x0000), "\00" ); -new TestCase( SECTION, "\\01", String.fromCharCode(0x0001), "\01" ); -new TestCase( SECTION, "\\02", String.fromCharCode(0x0002), "\02" ); -new TestCase( SECTION, "\\03", String.fromCharCode(0x0003), "\03" ); -new TestCase( SECTION, "\\04", String.fromCharCode(0x0004), "\04" ); -new TestCase( SECTION, "\\05", String.fromCharCode(0x0005), "\05" ); -new TestCase( SECTION, "\\06", String.fromCharCode(0x0006), "\06" ); -new TestCase( SECTION, "\\07", String.fromCharCode(0x0007), "\07" ); - -new TestCase( SECTION, "\\010", String.fromCharCode(0x0008), "\010" ); -new TestCase( SECTION, "\\011", String.fromCharCode(0x0009), "\011" ); -new TestCase( SECTION, "\\012", String.fromCharCode(0x000A), "\012" ); -new TestCase( SECTION, "\\013", String.fromCharCode(0x000B), "\013" ); -new TestCase( SECTION, "\\014", String.fromCharCode(0x000C), "\014" ); -new TestCase( SECTION, "\\015", String.fromCharCode(0x000D), "\015" ); -new TestCase( SECTION, "\\016", String.fromCharCode(0x000E), "\016" ); -new TestCase( SECTION, "\\017", String.fromCharCode(0x000F), "\017" ); -new TestCase( SECTION, "\\020", String.fromCharCode(0x0010), "\020" ); -new TestCase( SECTION, "\\042", String.fromCharCode(0x0022), "\042" ); - -new TestCase( SECTION, "\\0", String.fromCharCode(0x0000), "\0" ); -new TestCase( SECTION, "\\1", String.fromCharCode(0x0001), "\1" ); -new TestCase( SECTION, "\\2", String.fromCharCode(0x0002), "\2" ); -new TestCase( SECTION, "\\3", String.fromCharCode(0x0003), "\3" ); -new TestCase( SECTION, "\\4", String.fromCharCode(0x0004), "\4" ); -new TestCase( SECTION, "\\5", String.fromCharCode(0x0005), "\5" ); -new TestCase( SECTION, "\\6", String.fromCharCode(0x0006), "\6" ); -new TestCase( SECTION, "\\7", String.fromCharCode(0x0007), "\7" ); - -new TestCase( SECTION, "\\10", String.fromCharCode(0x0008), "\10" ); -new TestCase( SECTION, "\\11", String.fromCharCode(0x0009), "\11" ); -new TestCase( SECTION, "\\12", String.fromCharCode(0x000A), "\12" ); -new TestCase( SECTION, "\\13", String.fromCharCode(0x000B), "\13" ); -new TestCase( SECTION, "\\14", String.fromCharCode(0x000C), "\14" ); -new TestCase( SECTION, "\\15", String.fromCharCode(0x000D), "\15" ); -new TestCase( SECTION, "\\16", String.fromCharCode(0x000E), "\16" ); -new TestCase( SECTION, "\\17", String.fromCharCode(0x000F), "\17" ); -new TestCase( SECTION, "\\20", String.fromCharCode(0x0010), "\20" ); -new TestCase( SECTION, "\\42", String.fromCharCode(0x0022), "\42" ); - -new TestCase( SECTION, "\\000", String.fromCharCode(0), "\000" ); -new TestCase( SECTION, "\\111", String.fromCharCode(73), "\111" ); -new TestCase( SECTION, "\\222", String.fromCharCode(146), "\222" ); -new TestCase( SECTION, "\\333", String.fromCharCode(219), "\333" ); - -// following line commented out as it causes a compile time error -// new TestCase( SECTION, "\\444", "444", "\444" ); - -// DoubleStringCharacters:DoubleStringCharacter::EscapeSequence::HexEscapeSequence -/* - new TestCase( SECTION, "\\x0", String.fromCharCode(0), "\x0" ); - new TestCase( SECTION, "\\x1", String.fromCharCode(1), "\x1" ); - new TestCase( SECTION, "\\x2", String.fromCharCode(2), "\x2" ); - new TestCase( SECTION, "\\x3", String.fromCharCode(3), "\x3" ); - new TestCase( SECTION, "\\x4", String.fromCharCode(4), "\x4" ); - new TestCase( SECTION, "\\x5", String.fromCharCode(5), "\x5" ); - new TestCase( SECTION, "\\x6", String.fromCharCode(6), "\x6" ); - new TestCase( SECTION, "\\x7", String.fromCharCode(7), "\x7" ); - new TestCase( SECTION, "\\x8", String.fromCharCode(8), "\x8" ); - new TestCase( SECTION, "\\x9", String.fromCharCode(9), "\x9" ); - new TestCase( SECTION, "\\xA", String.fromCharCode(10), "\xA" ); - new TestCase( SECTION, "\\xB", String.fromCharCode(11), "\xB" ); - new TestCase( SECTION, "\\xC", String.fromCharCode(12), "\xC" ); - new TestCase( SECTION, "\\xD", String.fromCharCode(13), "\xD" ); - new TestCase( SECTION, "\\xE", String.fromCharCode(14), "\xE" ); - new TestCase( SECTION, "\\xF", String.fromCharCode(15), "\xF" ); - -*/ -new TestCase( SECTION, "\\xF0", String.fromCharCode(240), "\xF0" ); -new TestCase( SECTION, "\\xE1", String.fromCharCode(225), "\xE1" ); -new TestCase( SECTION, "\\xD2", String.fromCharCode(210), "\xD2" ); -new TestCase( SECTION, "\\xC3", String.fromCharCode(195), "\xC3" ); -new TestCase( SECTION, "\\xB4", String.fromCharCode(180), "\xB4" ); -new TestCase( SECTION, "\\xA5", String.fromCharCode(165), "\xA5" ); -new TestCase( SECTION, "\\x96", String.fromCharCode(150), "\x96" ); -new TestCase( SECTION, "\\x87", String.fromCharCode(135), "\x87" ); -new TestCase( SECTION, "\\x78", String.fromCharCode(120), "\x78" ); -new TestCase( SECTION, "\\x69", String.fromCharCode(105), "\x69" ); -new TestCase( SECTION, "\\x5A", String.fromCharCode(90), "\x5A" ); -new TestCase( SECTION, "\\x4B", String.fromCharCode(75), "\x4B" ); -new TestCase( SECTION, "\\x3C", String.fromCharCode(60), "\x3C" ); -new TestCase( SECTION, "\\x2D", String.fromCharCode(45), "\x2D" ); -new TestCase( SECTION, "\\x1E", String.fromCharCode(30), "\x1E" ); -new TestCase( SECTION, "\\x0F", String.fromCharCode(15), "\x0F" ); - -// string literals only take up to two hext digits. therefore, the third character in this string -// should be interpreted as a StringCharacter and not part of the HextEscapeSequence - -new TestCase( SECTION, "\\xF0F", String.fromCharCode(240)+"F", "\xF0F" ); -new TestCase( SECTION, "\\xE1E", String.fromCharCode(225)+"E", "\xE1E" ); -new TestCase( SECTION, "\\xD2D", String.fromCharCode(210)+"D", "\xD2D" ); -new TestCase( SECTION, "\\xC3C", String.fromCharCode(195)+"C", "\xC3C" ); -new TestCase( SECTION, "\\xB4B", String.fromCharCode(180)+"B", "\xB4B" ); -new TestCase( SECTION, "\\xA5A", String.fromCharCode(165)+"A", "\xA5A" ); -new TestCase( SECTION, "\\x969", String.fromCharCode(150)+"9", "\x969" ); -new TestCase( SECTION, "\\x878", String.fromCharCode(135)+"8", "\x878" ); -new TestCase( SECTION, "\\x787", String.fromCharCode(120)+"7", "\x787" ); -new TestCase( SECTION, "\\x696", String.fromCharCode(105)+"6", "\x696" ); -new TestCase( SECTION, "\\x5A5", String.fromCharCode(90)+"5", "\x5A5" ); -new TestCase( SECTION, "\\x4B4", String.fromCharCode(75)+"4", "\x4B4" ); -new TestCase( SECTION, "\\x3C3", String.fromCharCode(60)+"3", "\x3C3" ); -new TestCase( SECTION, "\\x2D2", String.fromCharCode(45)+"2", "\x2D2" ); -new TestCase( SECTION, "\\x1E1", String.fromCharCode(30)+"1", "\x1E1" ); -new TestCase( SECTION, "\\x0F0", String.fromCharCode(15)+"0", "\x0F0" ); - -// G is out of hex range - -new TestCase( SECTION, "\\xG", "xG", "\xG" ); -new TestCase( SECTION, "\\xCG", "xCG", "\xCG" ); - -// DoubleStringCharacter::EscapeSequence::CharacterEscapeSequence::\ NonEscapeCharacter -new TestCase( SECTION, "\\a", "a", "\a" ); -new TestCase( SECTION, "\\c", "c", "\c" ); -new TestCase( SECTION, "\\d", "d", "\d" ); -new TestCase( SECTION, "\\e", "e", "\e" ); -new TestCase( SECTION, "\\g", "g", "\g" ); -new TestCase( SECTION, "\\h", "h", "\h" ); -new TestCase( SECTION, "\\i", "i", "\i" ); -new TestCase( SECTION, "\\j", "j", "\j" ); -new TestCase( SECTION, "\\k", "k", "\k" ); -new TestCase( SECTION, "\\l", "l", "\l" ); -new TestCase( SECTION, "\\m", "m", "\m" ); -new TestCase( SECTION, "\\o", "o", "\o" ); -new TestCase( SECTION, "\\p", "p", "\p" ); -new TestCase( SECTION, "\\q", "q", "\q" ); -new TestCase( SECTION, "\\s", "s", "\s" ); -new TestCase( SECTION, "\\u", "u", "\u" ); - -new TestCase( SECTION, "\\w", "w", "\w" ); -new TestCase( SECTION, "\\x", "x", "\x" ); -new TestCase( SECTION, "\\y", "y", "\y" ); -new TestCase( SECTION, "\\z", "z", "\z" ); -new TestCase( SECTION, "\\9", "9", "\9" ); - -new TestCase( SECTION, "\\A", "A", "\A" ); -new TestCase( SECTION, "\\B", "B", "\B" ); -new TestCase( SECTION, "\\C", "C", "\C" ); -new TestCase( SECTION, "\\D", "D", "\D" ); -new TestCase( SECTION, "\\E", "E", "\E" ); -new TestCase( SECTION, "\\F", "F", "\F" ); -new TestCase( SECTION, "\\G", "G", "\G" ); -new TestCase( SECTION, "\\H", "H", "\H" ); -new TestCase( SECTION, "\\I", "I", "\I" ); -new TestCase( SECTION, "\\J", "J", "\J" ); -new TestCase( SECTION, "\\K", "K", "\K" ); -new TestCase( SECTION, "\\L", "L", "\L" ); -new TestCase( SECTION, "\\M", "M", "\M" ); -new TestCase( SECTION, "\\N", "N", "\N" ); -new TestCase( SECTION, "\\O", "O", "\O" ); -new TestCase( SECTION, "\\P", "P", "\P" ); -new TestCase( SECTION, "\\Q", "Q", "\Q" ); -new TestCase( SECTION, "\\R", "R", "\R" ); -new TestCase( SECTION, "\\S", "S", "\S" ); -new TestCase( SECTION, "\\T", "T", "\T" ); -new TestCase( SECTION, "\\U", "U", "\U" ); -new TestCase( SECTION, "\\V", "V", "\V" ); -new TestCase( SECTION, "\\W", "W", "\W" ); -new TestCase( SECTION, "\\X", "X", "\X" ); -new TestCase( SECTION, "\\Y", "Y", "\Y" ); -new TestCase( SECTION, "\\Z", "Z", "\Z" ); - -// DoubleStringCharacter::EscapeSequence::UnicodeEscapeSequence - -new TestCase( SECTION, "\\u0020", " ", "\u0020" ); -new TestCase( SECTION, "\\u0021", "!", "\u0021" ); -new TestCase( SECTION, "\\u0022", "\"", "\u0022" ); -new TestCase( SECTION, "\\u0023", "#", "\u0023" ); -new TestCase( SECTION, "\\u0024", "$", "\u0024" ); -new TestCase( SECTION, "\\u0025", "%", "\u0025" ); -new TestCase( SECTION, "\\u0026", "&", "\u0026" ); -new TestCase( SECTION, "\\u0027", "'", "\u0027" ); -new TestCase( SECTION, "\\u0028", "(", "\u0028" ); -new TestCase( SECTION, "\\u0029", ")", "\u0029" ); -new TestCase( SECTION, "\\u002A", "*", "\u002A" ); -new TestCase( SECTION, "\\u002B", "+", "\u002B" ); -new TestCase( SECTION, "\\u002C", ",", "\u002C" ); -new TestCase( SECTION, "\\u002D", "-", "\u002D" ); -new TestCase( SECTION, "\\u002E", ".", "\u002E" ); -new TestCase( SECTION, "\\u002F", "/", "\u002F" ); -new TestCase( SECTION, "\\u0030", "0", "\u0030" ); -new TestCase( SECTION, "\\u0031", "1", "\u0031" ); -new TestCase( SECTION, "\\u0032", "2", "\u0032" ); -new TestCase( SECTION, "\\u0033", "3", "\u0033" ); -new TestCase( SECTION, "\\u0034", "4", "\u0034" ); -new TestCase( SECTION, "\\u0035", "5", "\u0035" ); -new TestCase( SECTION, "\\u0036", "6", "\u0036" ); -new TestCase( SECTION, "\\u0037", "7", "\u0037" ); -new TestCase( SECTION, "\\u0038", "8", "\u0038" ); -new TestCase( SECTION, "\\u0039", "9", "\u0039" ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.8.2-n.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.8.2-n.js deleted file mode 100644 index b8d844e41d..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/7.8.2-n.js +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '7.8.2-n.js'; - -/** - File Name: 7.8.2.js - ECMA Section: 7.8.2 Examples of Automatic Semicolon Insertion - Description: compare some specific examples of the automatic - insertion rules in the EMCA specification. - Author: christine@netscape.com - Date: 15 september 1997 -*/ - -var SECTION="7.8.2"; -var VERSION="ECMA_1" - startTest(); -writeHeaderToLog(SECTION+" "+"Examples of Semicolon Insertion"); - - -// new TestCase( "7.8.2", "{ 1 \n 2 } 3", 3, eval("{ 1 \n 2 } 3") ); - -DESCRIPTION = "{ 1 2 } 3"; -EXPECTED = "error"; - -new TestCase( "7.8.2", "{ 1 2 } 3", "error", eval("{1 2 } 3") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/browser.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/browser.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/shell.js b/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/shell.js deleted file mode 100644 index 4e1d61d68a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/LexicalConventions/shell.js +++ /dev/null @@ -1 +0,0 @@ -gTestsubsuite = 'LexicalConventions'; diff --git a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8-2-n.js b/tests/auto/declarative/parserstress/tests/ecma/Math/15.8-2-n.js deleted file mode 100644 index 40c2ae8d2d..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8-2-n.js +++ /dev/null @@ -1,82 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.8-2-n.js'; - -/** - File Name: 15.8-2.js - ECMA Section: 15.8 The Math Object - - Description: - - The Math object is merely a single object that has some named properties, - some of which are functions. - - The value of the internal [[Prototype]] property of the Math object is the - Object prototype object (15.2.3.1). - - The Math object does not have a [[Construct]] property; it is not possible - to use the Math object as a constructor with the new operator. - - The Math object does not have a [[Call]] property; it is not possible to - invoke the Math object as a function. - - Recall that, in this specification, the phrase "the number value for x" has - a technical meaning defined in section 8.5. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ - -var SECTION = "15.8-2-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The Math Object"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "MYMATH = new Math()"; -EXPECTED = "error"; - -new TestCase( SECTION, - "MYMATH = new Math()", - "error", - eval("MYMATH = new Math()") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8-3-n.js b/tests/auto/declarative/parserstress/tests/ecma/Math/15.8-3-n.js deleted file mode 100644 index f6333d7ec7..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8-3-n.js +++ /dev/null @@ -1,81 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.8-3-n.js'; - -/** - File Name: 15.8-3.js - ECMA Section: 15.8 The Math Object - - Description: - - The Math object is merely a single object that has some named properties, - some of which are functions. - - The value of the internal [[Prototype]] property of the Math object is the - Object prototype object (15.2.3.1). - - The Math object does not have a [[Construct]] property; it is not possible - to use the Math object as a constructor with the new operator. - - The Math object does not have a [[Call]] property; it is not possible to - invoke the Math object as a function. - - Recall that, in this specification, the phrase "the number value for x" has - a technical meaning defined in section 8.5. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "15.8-3-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The Math Object"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "MYMATH = Math()"; -EXPECTED = "error"; - -new TestCase( SECTION, - "MYMATH = Math()", - "error", - eval("MYMATH = Math()") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.1-1.js b/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.1-1.js deleted file mode 100644 index f90f74b9e8..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.1-1.js +++ /dev/null @@ -1,64 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.8.1.1-1.js'; - -/** - File Name: 15.8.1.1-1.js - ECMA Section: 15.8.1.1.js - Description: All value properties of the Math object should have - the attributes [DontEnum, DontDelete, ReadOnly] - - this test checks the ReadOnly attribute of Math.E - - Author: christine@netscape.com - Date: 16 september 1997 -*/ -var SECTION = "15.8.1.1-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Math.E"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "Math.E = 0; Math.E", - 2.7182818284590452354, - eval("Math.E=0;Math.E") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.1-2.js b/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.1-2.js deleted file mode 100644 index 9f136f2fb8..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.1-2.js +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.8.1.1-2.js'; - -/** - File Name: 15.8.1.1-2.js - ECMA Section: 15.8.1.1.js - Description: All value properties of the Math object should have - the attributes [DontEnum, DontDelete, ReadOnly] - - this test checks the DontDelete attribute of Math.E - - Author: christine@netscape.com - Date: 16 september 1997 -*/ -var SECTION = "15.8.1.1-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Math.E"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var MATH_E = 2.7182818284590452354 - new TestCase( SECTION, - "delete(Math.E)", - false, - eval("delete Math.E") ); -new TestCase( SECTION, - "delete(Math.E); Math.E", - MATH_E, - eval("delete Math.E; Math.E") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.2-1.js b/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.2-1.js deleted file mode 100644 index 0cbc65a4fb..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.2-1.js +++ /dev/null @@ -1,64 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.8.1.2-1.js'; - -/** - File Name: 15.8.1.2-1.js - ECMA Section: 15.8.2.js - Description: All value properties of the Math object should have - the attributes [DontEnum, DontDelete, ReadOnly] - - this test checks the ReadOnly attribute of Math.LN10 - - Author: christine@netscape.com - Date: 16 september 1997 -*/ -var SECTION = "15.8.1.2-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Math.LN10"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "Math.LN10=0; Math.LN10", - 2.302585092994046, - eval("Math.LN10=0; Math.LN10") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.2-2.js b/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.2-2.js deleted file mode 100644 index 6937b3520b..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.2-2.js +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.8.1.2-2.js'; - -/** - File Name: 15.8.1.2-1.js - ECMA Section: 15.8.2.js - Description: All value properties of the Math object should have - the attributes [DontEnum, DontDelete, ReadOnly] - - this test checks the DontDelete attribute of Math.LN10 - - Author: christine@netscape.com - Date: 16 september 1997 -*/ - -var SECTION = "15.8.1.2-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Math.LN10"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "delete( Math.LN10 ); Math.LN10", - 2.302585092994046, - eval("delete(Math.LN10); Math.LN10") ); - -new TestCase( SECTION, - "delete( Math.LN10 ); ", - false, - eval("delete(Math.LN10)") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.3-1.js b/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.3-1.js deleted file mode 100644 index 8289cc2a46..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.3-1.js +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.8.1.3-1.js'; - -/** - File Name: 15.8.1.3-1.js - ECMA Section: 15.8.1.3.js - Description: All value properties of the Math object should have - the attributes [DontEnum, DontDelete, ReadOnly] - - this test checks the ReadOnly attribute of Math.LN2 - - Author: christine@netscape.com - Date: 16 september 1997 -*/ - -var SECTION = "15.8.1.3-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Math.LN2"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "Math.LN2=0; Math.LN2", - 0.6931471805599453, - eval("Math.LN2=0; Math.LN2") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.3-2.js b/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.3-2.js deleted file mode 100644 index 24a8b18231..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.3-2.js +++ /dev/null @@ -1,72 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.8.1.3-2.js'; - -/** - File Name: 15.8.1.3-3.js - ECMA Section: 15.8.1.3.js - Description: All value properties of the Math object should have - the attributes [DontEnum, DontDelete, ReadOnly] - - this test checks the DontDelete attribute of Math.LN2 - - Author: christine@netscape.com - Date: 16 september 1997 -*/ - -var SECTION = "15.8.1.3-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Math.LN2"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var MATH_LN2 = 0.6931471805599453; - -new TestCase( SECTION, - "delete(Math.LN2)", - false, - eval("delete(Math.LN2)") ); - -new TestCase( SECTION, - "delete(Math.LN2); Math.LN2", - MATH_LN2, - eval("delete(Math.LN2); Math.LN2") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.4-1.js b/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.4-1.js deleted file mode 100644 index 227dbb3e2a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.4-1.js +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.8.1.4-1.js'; - -/** - File Name: 15.8.1.4-1.js - ECMA Section: 15.8.1.4.js - Description: All value properties of the Math object should have - the attributes [DontEnum, DontDelete, ReadOnly] - - this test checks the ReadOnly attribute of Math.LOG2E - - Author: christine@netscape.com - Date: 16 september 1997 -*/ - -var SECTION = "15.8.1.4-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Math.LOG2E"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "Math.L0G2E=0; Math.LOG2E", - 1.4426950408889634, - eval("Math.LOG2E=0; Math.LOG2E") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.4-2.js b/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.4-2.js deleted file mode 100644 index c9aa98e77a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.4-2.js +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.8.1.4-2.js'; - -/** - File Name: 15.8.1.4-2.js - ECMA Section: 15.8.1.4.js - Description: All value properties of the Math object should have - the attributes [DontEnum, DontDelete, ReadOnly] - - this test checks the DontDelete attribute of Math.LOG2E - - Author: christine@netscape.com - Date: 16 september 1997 -*/ - -var SECTION = "15.8.1.4-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Math.LOG2E"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "delete(Math.L0G2E);Math.LOG2E", - 1.4426950408889634, - eval("delete(Math.LOG2E);Math.LOG2E") ); -new TestCase( SECTION, - "delete(Math.L0G2E)", - false, - eval("delete(Math.LOG2E)") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.5-1.js b/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.5-1.js deleted file mode 100644 index b753025c8a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.5-1.js +++ /dev/null @@ -1,66 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.8.1.5-1.js'; - -/** - File Name: 15.8.1.5-1.js - ECMA Section: 15.8.1.5.js - Description: All value properties of the Math object should have - the attributes [DontEnum, DontDelete, ReadOnly] - - this test checks the ReadOnly attribute of Math.LOG10E - - Author: christine@netscape.com - Date: 16 september 1997 -*/ - - -var SECTION = "15.8.1.5-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Math.LOG10E"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "Math.LOG10E=0; Math.LOG10E", - 0.4342944819032518, - eval("Math.LOG10E=0; Math.LOG10E") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.5-2.js b/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.5-2.js deleted file mode 100644 index c134e4a577..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.5-2.js +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.8.1.5-2.js'; - -/** - File Name: 15.8.1.5-2.js - ECMA Section: 15.8.1.5.js - Description: All value properties of the Math object should have - the attributes [DontEnum, DontDelete, ReadOnly] - - this test checks the DontDelete attribute of Math.LOG10E - - Author: christine@netscape.com - Date: 16 september 1997 -*/ - -var SECTION = "15.8.1.5-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Math.LOG10E"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "delete Math.LOG10E; Math.LOG10E", - 0.4342944819032518, - eval("delete Math.LOG10E; Math.LOG10E") ); - -new TestCase( SECTION, - "delete Math.LOG10E", - false, - eval("delete Math.LOG10E") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.6-1.js b/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.6-1.js deleted file mode 100644 index f2a395618c..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.6-1.js +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.8.1.6-1.js'; - -/** - File Name: 15.8.1.6-1.js - ECMA Section: 15.8.1.6.js - Description: All value properties of the Math object should have - the attributes [DontEnum, DontDelete, ReadOnly] - - this test checks the ReadOnly attribute of Math.PI - - Author: christine@netscape.com - Date: 16 september 1997 -*/ - -var SECTION = "15.8.1.6-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Math.PI"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "Math.PI=0; Math.PI", - 3.1415926535897923846, - eval("Math.PI=0; Math.PI") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.6-2.js b/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.6-2.js deleted file mode 100644 index ba53e78de5..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.6-2.js +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.8.1.6-2.js'; - -/** - File Name: 15.8.1.6-2.js - ECMA Section: 15.8.1.6.js - Description: All value properties of the Math object should have - the attributes [DontEnum, DontDelete, ReadOnly] - - this test checks the DontDelete attribute of Math.PI - - Author: christine@netscape.com - Date: 16 september 1997 -*/ - -var SECTION = "15.8.1.6-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Math.PI"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "delete Math.PI; Math.PI", - 3.1415926535897923846, - eval("delete Math.PI; Math.PI") ); - -new TestCase( SECTION, - "delete Math.PI; Math.PI", - false, - eval("delete Math.PI") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.7-1.js b/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.7-1.js deleted file mode 100644 index aa60aead5b..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.7-1.js +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.8.1.7-1.js'; - -/** - File Name: 15.8.1.7-1.js - ECMA Section: 15.8.1.7.js - Description: All value properties of the Math object should have - the attributes [DontEnum, DontDelete, ReadOnly] - - this test checks the ReadOnly attribute of Math.SQRT1_2 - - Author: christine@netscape.com - Date: 16 september 1997 -*/ - -var SECTION = "15.8.1.7-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Math.SQRT1_2"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "Math.SQRT1_2=0; Math.SQRT1_2", - 0.7071067811865476, - eval("Math.SQRT1_2=0; Math.SQRT1_2") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.7-2.js b/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.7-2.js deleted file mode 100644 index 2f8c45c9f9..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.7-2.js +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.8.1.7-2.js'; - -/** - File Name: 15.8.1.7-2.js - ECMA Section: 15.8.1.7.js - Description: All value properties of the Math object should have - the attributes [DontEnum, DontDelete, ReadOnly] - - this test checks the DontDelete attribute of Math.SQRT1_2 - - Author: christine@netscape.com - Date: 16 september 1997 -*/ - -var SECTION = "15.8.1.7-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Math.SQRT1_2"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "delete Math.SQRT1_2; Math.SQRT1_2", - 0.7071067811865476, - eval("delete Math.SQRT1_2; Math.SQRT1_2") ); - -new TestCase( SECTION, - "delete Math.SQRT1_2", - false, - eval("delete Math.SQRT1_2") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.8-1.js b/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.8-1.js deleted file mode 100644 index 3c5764d019..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.8-1.js +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.8.1.8-1.js'; - -/** - File Name: 15.8.1.8-1.js - ECMA Section: 15.8.1.8.js - Description: All value properties of the Math object should have - the attributes [DontEnum, DontDelete, ReadOnly] - - this test checks the ReadOnly attribute of Math.SQRT2 - - Author: christine@netscape.com - Date: 16 september 1997 -*/ - -var SECTION = "15.8.1.8-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Math.SQRT2"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "Math.SQRT2=0; Math.SQRT2", - 1.4142135623730951, - eval("Math.SQRT2=0; Math.SQRT2") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.8-2.js b/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.8-2.js deleted file mode 100644 index f999dac920..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.8-2.js +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.8.1.8-2.js'; - -/** - File Name: 15.8.1.8-2.js - ECMA Section: 15.8.1.8.js - Description: All value properties of the Math object should have - the attributes [DontEnum, DontDelete, ReadOnly] - - this test checks the DontDelete attribute of Math.SQRT2 - - Author: christine@netscape.com - Date: 16 september 1997 -*/ -var SECTION = "15.8.1.8-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Math.SQRT2"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "delete Math.SQRT2; Math.SQRT2", - 1.4142135623730951, - eval("delete Math.SQRT2; Math.SQRT2") ); - -new TestCase( SECTION, - "delete Math.SQRT2", - false, - eval("delete Math.SQRT2") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.8-3.js b/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.8-3.js deleted file mode 100644 index 0c823aea57..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.8-3.js +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.8.1.8-3.js'; - -/** - File Name: 15.8.1.8-3.js - ECMA Section: 15.8.1.8.js - Description: All value properties of the Math object should have - the attributes [DontEnum, DontDelete, ReadOnly] - - this test checks the DontDelete attribute of Math.SQRT2 - - Author: christine@netscape.com - Date: 16 september 1997 -*/ -var SECTION = "15.8.1.8-3"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Math.SQRT2: DontDelete"); - -new TestCase( SECTION, - "delete Math.SQRT2", - false, - eval("delete Math.SQRT2") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.js b/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.js deleted file mode 100644 index 009325640b..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.1.js +++ /dev/null @@ -1,149 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.8.1.js'; - -/** - File Name: 15.8.1.js - ECMA Section: 15.8.1.js Value Properties of the Math Object - 15.8.1.1 E - 15.8.1.2 LN10 - 15.8.1.3 LN2 - 15.8.1.4 LOG2E - 15.8.1.5 LOG10E - 15.8.1.6 PI - 15.8.1.7 SQRT1_2 - 15.8.1.8 SQRT2 - Description: verify the values of some math constants - Author: christine@netscape.com - Date: 7 july 1997 - -*/ -var SECTION = "15.8.1" - var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Value Properties of the Math Object"; - -writeHeaderToLog( SECTION + " "+ TITLE); - - -new TestCase( "15.8.1.1", "Math.E", - 2.7182818284590452354, - Math.E ); - -new TestCase( "15.8.1.1", - "typeof Math.E", - "number", - typeof Math.E ); - -new TestCase( "15.8.1.2", - "Math.LN10", - 2.302585092994046, - Math.LN10 ); - -new TestCase( "15.8.1.2", - "typeof Math.LN10", - "number", - typeof Math.LN10 ); - -new TestCase( "15.8.1.3", - "Math.LN2", - 0.6931471805599453, - Math.LN2 ); - -new TestCase( "15.8.1.3", - "typeof Math.LN2", - "number", - typeof Math.LN2 ); - -new TestCase( "15.8.1.4", - "Math.LOG2E", - 1.4426950408889634, - Math.LOG2E ); - -new TestCase( "15.8.1.4", - "typeof Math.LOG2E", - "number", - typeof Math.LOG2E ); - -new TestCase( "15.8.1.5", - "Math.LOG10E", - 0.4342944819032518, - Math.LOG10E); - -new TestCase( "15.8.1.5", - "typeof Math.LOG10E", - "number", - typeof Math.LOG10E); - -new TestCase( "15.8.1.6", - "Math.PI", - 3.14159265358979323846, - Math.PI ); - -new TestCase( "15.8.1.6", - "typeof Math.PI", - "number", - typeof Math.PI ); - -new TestCase( "15.8.1.7", - "Math.SQRT1_2", - 0.7071067811865476, - Math.SQRT1_2); - -new TestCase( "15.8.1.7", - "typeof Math.SQRT1_2", - "number", - typeof Math.SQRT1_2); - -new TestCase( "15.8.1.8", - "Math.SQRT2", - 1.4142135623730951, - Math.SQRT2 ); - -new TestCase( "15.8.1.8", - "typeof Math.SQRT2", - "number", - typeof Math.SQRT2 ); - -new TestCase( SECTION, - "var MATHPROPS='';for( p in Math ){ MATHPROPS +=p; };MATHPROPS", - "", - eval("var MATHPROPS='';for( p in Math ){ MATHPROPS +=p; };MATHPROPS") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.1.js b/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.1.js deleted file mode 100644 index 0412742767..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.1.js +++ /dev/null @@ -1,226 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.8.2.1.js'; - -/** - File Name: 15.8.2.1.js - ECMA Section: 15.8.2.1 abs( x ) - Description: return the absolute value of the argument, - which should be the magnitude of the argument - with a positive sign. - - if x is NaN, return NaN - - if x is -0, result is +0 - - if x is -Infinity, result is +Infinity - Author: christine@netscape.com - Date: 7 july 1997 -*/ -var SECTION = "15.8.2.1"; -var VERSION = "ECMA_1"; -var TITLE = "Math.abs()"; -var BUGNUMBER = "77391"; -startTest(); - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "Math.abs.length", - 1, - Math.abs.length ); - -new TestCase( SECTION, - "Math.abs()", - Number.NaN, - Math.abs() ); - -new TestCase( SECTION, - "Math.abs( void 0 )", - Number.NaN, - Math.abs(void 0) ); - -new TestCase( SECTION, - "Math.abs( null )", - 0, - Math.abs(null) ); - -new TestCase( SECTION, - "Math.abs( true )", - 1, - Math.abs(true) ); - -new TestCase( SECTION, - "Math.abs( false )", - 0, - Math.abs(false) ); - -new TestCase( SECTION, - "Math.abs( string primitive)", - Number.NaN, - Math.abs("a string primitive") ); - -new TestCase( SECTION, - "Math.abs( string object )", - Number.NaN, - Math.abs(new String( 'a String object' )) ); - -new TestCase( SECTION, - "Math.abs( Number.NaN )", - Number.NaN, - Math.abs(Number.NaN) ); - -new TestCase( SECTION, - "Math.abs(0)", - 0, - Math.abs( 0 ) ); - -new TestCase( SECTION, - "Math.abs( -0 )", - 0, - Math.abs(-0) ); - -new TestCase( SECTION, - "Infinity/Math.abs(-0)", - Infinity, - Infinity/Math.abs(-0) ); - -new TestCase( SECTION, - "Math.abs( -Infinity )", - Number.POSITIVE_INFINITY, - Math.abs( Number.NEGATIVE_INFINITY ) ); - -new TestCase( SECTION, - "Math.abs( Infinity )", - Number.POSITIVE_INFINITY, - Math.abs( Number.POSITIVE_INFINITY ) ); - -new TestCase( SECTION, - "Math.abs( - MAX_VALUE )", - Number.MAX_VALUE, - Math.abs( - Number.MAX_VALUE ) ); - -new TestCase( SECTION, - "Math.abs( - MIN_VALUE )", - Number.MIN_VALUE, - Math.abs( -Number.MIN_VALUE ) ); - -new TestCase( SECTION, - "Math.abs( MAX_VALUE )", - Number.MAX_VALUE, - Math.abs( Number.MAX_VALUE ) ); - -new TestCase( SECTION, - "Math.abs( MIN_VALUE )", - Number.MIN_VALUE, - Math.abs( Number.MIN_VALUE ) ); - -new TestCase( SECTION, - "Math.abs( -1 )", - 1, - Math.abs( -1 ) ); - -new TestCase( SECTION, - "Math.abs( new Number( -1 ) )", - 1, - Math.abs( new Number(-1) ) ); - -new TestCase( SECTION, - "Math.abs( 1 )", - 1, - Math.abs( 1 ) ); - -new TestCase( SECTION, - "Math.abs( Math.PI )", - Math.PI, - Math.abs( Math.PI ) ); - -new TestCase( SECTION, - "Math.abs( -Math.PI )", - Math.PI, - Math.abs( -Math.PI ) ); - -new TestCase( SECTION, - "Math.abs(-1/100000000)", - 1/100000000, - Math.abs(-1/100000000) ); - -new TestCase( SECTION, - "Math.abs(-Math.pow(2,32))", - Math.pow(2,32), - Math.abs(-Math.pow(2,32)) ); - -new TestCase( SECTION, - "Math.abs(Math.pow(2,32))", - Math.pow(2,32), - Math.abs(Math.pow(2,32)) ); - -new TestCase( SECTION, - "Math.abs( -0xfff )", - 4095, - Math.abs( -0xfff ) ); - -new TestCase( SECTION, - "Math.abs( -0777 )", - 511, - Math.abs(-0777 ) ); - -new TestCase( SECTION, - "Math.abs('-1e-1')", - 0.1, - Math.abs('-1e-1') ); - -new TestCase( SECTION, - "Math.abs('0xff')", - 255, - Math.abs('0xff') ); - -new TestCase( SECTION, - "Math.abs('077')", - 77, - Math.abs('077') ); - -new TestCase( SECTION, - "Math.abs( 'Infinity' )", - Infinity, - Math.abs('Infinity') ); - -new TestCase( SECTION, - "Math.abs( '-Infinity' )", - Infinity, - Math.abs('-Infinity') ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.10.js b/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.10.js deleted file mode 100644 index 05d4c187c9..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.10.js +++ /dev/null @@ -1,153 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.8.2.10.js'; - -/** - File Name: 15.8.2.10.js - ECMA Section: 15.8.2.10 Math.log(x) - Description: return an approximiation to the natural logarithm of - the argument. - special cases: - - if arg is NaN result is NaN - - if arg is <0 result is NaN - - if arg is 0 or -0 result is -Infinity - - if arg is 1 result is 0 - - if arg is Infinity result is Infinity - Author: christine@netscape.com - Date: 7 july 1997 -*/ - -var SECTION = "15.8.2.10"; -var VERSION = "ECMA_1"; -var TITLE = "Math.log(x)"; -var BUGNUMBER = "77391"; - -startTest(); - -writeHeaderToLog( SECTION + " "+ TITLE); - - -new TestCase( SECTION, - "Math.log.length", - 1, - Math.log.length ); - - -new TestCase( SECTION, - "Math.log()", - Number.NaN, - Math.log() ); - -new TestCase( SECTION, - "Math.log(void 0)", - Number.NaN, - Math.log(void 0) ); - -new TestCase( SECTION, - "Math.log(null)", - Number.NEGATIVE_INFINITY, - Math.log(null) ); - -new TestCase( SECTION, - "Math.log(true)", - 0, - Math.log(true) ); - -new TestCase( SECTION, - "Math.log(false)", - -Infinity, - Math.log(false) ); - -new TestCase( SECTION, - "Math.log('0')", - -Infinity, - Math.log('0') ); - -new TestCase( SECTION, - "Math.log('1')", - 0, - Math.log('1') ); - -new TestCase( SECTION, - "Math.log('Infinity')", - Infinity, - Math.log("Infinity") ); - - -new TestCase( SECTION, - "Math.log(NaN)", - Number.NaN, - Math.log(Number.NaN) ); - -new TestCase( SECTION, - "Math.log(-0.0000001)", - Number.NaN, - Math.log(-0.000001) ); - -new TestCase( SECTION, - "Math.log(-1)", - Number.NaN, - Math.log(-1) ); - -new TestCase( SECTION, - "Math.log(0)", - Number.NEGATIVE_INFINITY, - Math.log(0) ); - -new TestCase( SECTION, - "Math.log(-0)", - Number.NEGATIVE_INFINITY, - Math.log(-0)); - -new TestCase( SECTION, - "Math.log(1)", - 0, - Math.log(1) ); - -new TestCase( SECTION, - "Math.log(Infinity)", - Number.POSITIVE_INFINITY, - Math.log(Number.POSITIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.log(-Infinity)", - Number.NaN, - Math.log(Number.NEGATIVE_INFINITY) ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.11.js b/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.11.js deleted file mode 100644 index 5a957b3de4..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.11.js +++ /dev/null @@ -1,200 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.8.2.11.js'; - -/** - File Name: 15.8.2.11.js - ECMA Section: 15.8.2.11 Math.max(x, y) - Description: return the smaller of the two arguments. - special cases: - - if x is NaN or y is NaN return NaN - - if x < y return x - - if y > x return y - - if x is +0 and y is +0 return +0 - - if x is +0 and y is -0 return -0 - - if x is -0 and y is +0 return -0 - - if x is -0 and y is -0 return -0 - Author: christine@netscape.com - Date: 7 july 1997 -*/ - -var SECTION = "15.8.2.11"; -var VERSION = "ECMA_1"; -var TITLE = "Math.max(x, y)"; -var BUGNUMBER="76439"; - -startTest(); - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "Math.max.length", - 2, - Math.max.length ); - -new TestCase( SECTION, - "Math.max()", - -Infinity, - Math.max() ); - -new TestCase( SECTION, - "Math.max(void 0, 1)", - Number.NaN, - Math.max( void 0, 1 ) ); - -new TestCase( SECTION, - "Math.max(void 0, void 0)", - Number.NaN, - Math.max( void 0, void 0 ) ); - -new TestCase( SECTION, - "Math.max(null, 1)", - 1, - Math.max( null, 1 ) ); - -new TestCase( SECTION, - "Math.max(-1, null)", - 0, - Math.max( -1, null ) ); - -new TestCase( SECTION, - "Math.max(true, false)", - 1, - Math.max(true,false) ); - -new TestCase( SECTION, - "Math.max('-99','99')", - 99, - Math.max( "-99","99") ); - -new TestCase( SECTION, - "Math.max(NaN, Infinity)", - Number.NaN, - Math.max(Number.NaN,Number.POSITIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.max(NaN, 0)", - Number.NaN, - Math.max(Number.NaN, 0) ); - -new TestCase( SECTION, - "Math.max('a string', 0)", - Number.NaN, - Math.max("a string", 0) ); - -new TestCase( SECTION, - "Math.max(NaN, 1)", - Number.NaN, - Math.max(Number.NaN,1) ); - -new TestCase( SECTION, - "Math.max('a string',Infinity)", - Number.NaN, - Math.max("a string", Number.POSITIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.max(Infinity, NaN)", - Number.NaN, - Math.max( Number.POSITIVE_INFINITY, Number.NaN) ); - -new TestCase( SECTION, - "Math.max(NaN, NaN)", - Number.NaN, - Math.max(Number.NaN, Number.NaN) ); - -new TestCase( SECTION, - "Math.max(0,NaN)", - Number.NaN, - Math.max(0,Number.NaN) ); - -new TestCase( SECTION, - "Math.max(1, NaN)", - Number.NaN, - Math.max(1, Number.NaN) ); - -new TestCase( SECTION, - "Math.max(0,0)", - 0, - Math.max(0,0) ); - -new TestCase( SECTION, - "Math.max(0,-0)", - 0, - Math.max(0,-0) ); - -new TestCase( SECTION, - "Math.max(-0,0)", - 0, - Math.max(-0,0) ); - -new TestCase( SECTION, - "Math.max(-0,-0)", - -0, - Math.max(-0,-0) ); - -new TestCase( SECTION, - "Infinity/Math.max(-0,-0)", - -Infinity, - Infinity/Math.max(-0,-0) ); - -new TestCase( SECTION, - "Math.max(Infinity, Number.MAX_VALUE)", Number.POSITIVE_INFINITY, - Math.max(Number.POSITIVE_INFINITY, Number.MAX_VALUE) ); - -new TestCase( SECTION, - "Math.max(Infinity, Infinity)", - Number.POSITIVE_INFINITY, - Math.max(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.max(-Infinity,-Infinity)", - Number.NEGATIVE_INFINITY, - Math.max(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.max(1,.99999999999999)", - 1, - Math.max(1,.99999999999999) ); - -new TestCase( SECTION, - "Math.max(-1,-.99999999999999)", - -.99999999999999, - Math.max(-1,-.99999999999999) ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.12.js b/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.12.js deleted file mode 100644 index a33a5aca4a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.12.js +++ /dev/null @@ -1,177 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.8.2.12.js'; - -/** - File Name: 15.8.2.12.js - ECMA Section: 15.8.2.12 Math.min(x, y) - Description: return the smaller of the two arguments. - special cases: - - if x is NaN or y is NaN return NaN - - if x < y return x - - if y > x return y - - if x is +0 and y is +0 return +0 - - if x is +0 and y is -0 return -0 - - if x is -0 and y is +0 return -0 - - if x is -0 and y is -0 return -0 - Author: christine@netscape.com - Date: 7 july 1997 -*/ - - -var SECTION = "15.8.2.12"; -var VERSION = "ECMA_1"; -var TITLE = "Math.min(x, y)"; -var BUGNUMBER="76439"; - -startTest(); - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "Math.min.length", - 2, - Math.min.length ); - -new TestCase( SECTION, - "Math.min()", - Infinity, - Math.min() ); - -new TestCase( SECTION, - "Math.min(void 0, 1)", - Number.NaN, - Math.min( void 0, 1 ) ); - -new TestCase( SECTION, - "Math.min(void 0, void 0)", - Number.NaN, - Math.min( void 0, void 0 ) ); - -new TestCase( SECTION, - "Math.min(null, 1)", - 0, - Math.min( null, 1 ) ); - -new TestCase( SECTION, - "Math.min(-1, null)", - -1, - Math.min( -1, null ) ); - -new TestCase( SECTION, - "Math.min(true, false)", - 0, - Math.min(true,false) ); - -new TestCase( SECTION, - "Math.min('-99','99')", - -99, - Math.min( "-99","99") ); - -new TestCase( SECTION, - "Math.min(NaN,0)", - Number.NaN, - Math.min(Number.NaN,0) ); - -new TestCase( SECTION, - "Math.min(NaN,1)", - Number.NaN, - Math.min(Number.NaN,1) ); - -new TestCase( SECTION, - "Math.min(NaN,-1)", - Number.NaN, - Math.min(Number.NaN,-1) ); - -new TestCase( SECTION, - "Math.min(0,NaN)", - Number.NaN, - Math.min(0,Number.NaN) ); - -new TestCase( SECTION, - "Math.min(1,NaN)", - Number.NaN, - Math.min(1,Number.NaN) ); - -new TestCase( SECTION, - "Math.min(-1,NaN)", - Number.NaN, - Math.min(-1,Number.NaN) ); - -new TestCase( SECTION, - "Math.min(NaN,NaN)", - Number.NaN, - Math.min(Number.NaN,Number.NaN) ); - -new TestCase( SECTION, - "Math.min(1,1.0000000001)", - 1, - Math.min(1,1.0000000001) ); - -new TestCase( SECTION, - "Math.min(1.0000000001,1)", - 1, - Math.min(1.0000000001,1) ); - -new TestCase( SECTION, - "Math.min(0,0)", - 0, - Math.min(0,0) ); - -new TestCase( SECTION, - "Math.min(0,-0)", - -0, - Math.min(0,-0) ); - -new TestCase( SECTION, - "Math.min(-0,-0)", - -0, - Math.min(-0,-0) ); - -new TestCase( SECTION, - "Infinity/Math.min(0,-0)", - -Infinity, - Infinity/Math.min(0,-0) ); - -new TestCase( SECTION, - "Infinity/Math.min(-0,-0)", - -Infinity, - Infinity/Math.min(-0,-0) ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.13.js b/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.13.js deleted file mode 100644 index 341b3e7651..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.13.js +++ /dev/null @@ -1,385 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.8.2.13.js'; - -/** - File Name: 15.8.2.13.js - ECMA Section: 15.8.2.13 Math.pow(x, y) - Description: return an approximation to the result of x - to the power of y. there are many special cases; - refer to the spec. - Author: christine@netscape.com - Date: 9 july 1997 -*/ - -var SECTION = "15.8.2.13"; -var VERSION = "ECMA_1"; -var TITLE = "Math.pow(x, y)"; -var BUGNUMBER="77141"; - -startTest(); - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "Math.pow.length", - 2, - Math.pow.length ); - -new TestCase( SECTION, - "Math.pow()", - Number.NaN, - Math.pow() ); - -new TestCase( SECTION, - "Math.pow(null, null)", - 1, - Math.pow(null,null) ); - -new TestCase( SECTION, - "Math.pow(void 0, void 0)", - Number.NaN, - Math.pow(void 0, void 0)); - -new TestCase( SECTION, - "Math.pow(true, false)", - 1, - Math.pow(true, false) ); - -new TestCase( SECTION, - "Math.pow(false,true)", - 0, - Math.pow(false,true) ); - -new TestCase( SECTION, - "Math.pow('2','32')", - 4294967296, - Math.pow('2','32') ); - -new TestCase( SECTION, - "Math.pow(1,NaN)", - Number.NaN, - Math.pow(1,Number.NaN) ); - -new TestCase( SECTION, - "Math.pow(0,NaN)", - Number.NaN, - Math.pow(0,Number.NaN) ); - -new TestCase( SECTION, - "Math.pow(NaN,0)", - 1, - Math.pow(Number.NaN,0) ); - -new TestCase( SECTION, - "Math.pow(NaN,-0)", - 1, - Math.pow(Number.NaN,-0) ); - -new TestCase( SECTION, - "Math.pow(NaN,1)", - Number.NaN, - Math.pow(Number.NaN, 1) ); - -new TestCase( SECTION, - "Math.pow(NaN,.5)", - Number.NaN, - Math.pow(Number.NaN, .5) ); - -new TestCase( SECTION, - "Math.pow(1.00000001, Infinity)", - Number.POSITIVE_INFINITY, - Math.pow(1.00000001, Number.POSITIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.pow(1.00000001, -Infinity)", - 0, - Math.pow(1.00000001, Number.NEGATIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.pow(-1.00000001, Infinity)", - Number.POSITIVE_INFINITY, - Math.pow(-1.00000001,Number.POSITIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.pow(-1.00000001, -Infinity)", - 0, - Math.pow(-1.00000001,Number.NEGATIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.pow(1, Infinity)", - Number.NaN, - Math.pow(1, Number.POSITIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.pow(1, -Infinity)", - Number.NaN, - Math.pow(1, Number.NEGATIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.pow(-1, Infinity)", - Number.NaN, - Math.pow(-1, Number.POSITIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.pow(-1, -Infinity)", - Number.NaN, - Math.pow(-1, Number.NEGATIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.pow(.0000000009, Infinity)", - 0, - Math.pow(.0000000009, Number.POSITIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.pow(-.0000000009, Infinity)", - 0, - Math.pow(-.0000000009, Number.POSITIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.pow(.0000000009, -Infinity)", - Number.POSITIVE_INFINITY, - Math.pow(-.0000000009, Number.NEGATIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.pow(Infinity, .00000000001)", - Number.POSITIVE_INFINITY, - Math.pow(Number.POSITIVE_INFINITY,.00000000001) ); - -new TestCase( SECTION, - "Math.pow(Infinity, 1)", - Number.POSITIVE_INFINITY, - Math.pow(Number.POSITIVE_INFINITY, 1) ); - -new TestCase( SECTION, - "Math.pow(Infinity, -.00000000001)", - 0, - Math.pow(Number.POSITIVE_INFINITY, -.00000000001) ); - -new TestCase( SECTION, - "Math.pow(Infinity, -1)", - 0, - Math.pow(Number.POSITIVE_INFINITY, -1) ); - -new TestCase( SECTION, - "Math.pow(-Infinity, 1)", - Number.NEGATIVE_INFINITY, - Math.pow(Number.NEGATIVE_INFINITY, 1) ); - -new TestCase( SECTION, - "Math.pow(-Infinity, 333)", - Number.NEGATIVE_INFINITY, - Math.pow(Number.NEGATIVE_INFINITY, 333) ); - -new TestCase( SECTION, - "Math.pow(Infinity, 2)", - Number.POSITIVE_INFINITY, - Math.pow(Number.POSITIVE_INFINITY, 2) ); - -new TestCase( SECTION, - "Math.pow(-Infinity, 666)", - Number.POSITIVE_INFINITY, - Math.pow(Number.NEGATIVE_INFINITY, 666) ); - -new TestCase( SECTION, - "Math.pow(-Infinity, 0.5)", - Number.POSITIVE_INFINITY, - Math.pow(Number.NEGATIVE_INFINITY, 0.5) ); - -new TestCase( SECTION, - "Math.pow(-Infinity, Infinity)", - Number.POSITIVE_INFINITY, - Math.pow(Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.pow(-Infinity, -1)", - -0, - Math.pow(Number.NEGATIVE_INFINITY, -1) ); - -new TestCase( SECTION, - "Infinity/Math.pow(-Infinity, -1)", - -Infinity, - Infinity/Math.pow(Number.NEGATIVE_INFINITY, -1) ); - -new TestCase( SECTION, - "Math.pow(-Infinity, -3)", - -0, - Math.pow(Number.NEGATIVE_INFINITY, -3) ); - -new TestCase( SECTION, - "Math.pow(-Infinity, -2)", - 0, - Math.pow(Number.NEGATIVE_INFINITY, -2) ); - -new TestCase( SECTION, - "Math.pow(-Infinity, -0.5)", - 0, - Math.pow(Number.NEGATIVE_INFINITY,-0.5) ); - -new TestCase( SECTION, - "Math.pow(-Infinity, -Infinity)", - 0, - Math.pow(Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.pow(0, 1)", - 0, - Math.pow(0,1) ); - -new TestCase( SECTION, - "Math.pow(0, 0)", - 1, - Math.pow(0,0) ); - -new TestCase( SECTION, - "Math.pow(1, 0)", - 1, - Math.pow(1,0) ); - -new TestCase( SECTION, - "Math.pow(-1, 0)", - 1, - Math.pow(-1,0) ); - -new TestCase( SECTION, - "Math.pow(0, 0.5)", - 0, - Math.pow(0,0.5) ); - -new TestCase( SECTION, - "Math.pow(0, 1000)", - 0, - Math.pow(0,1000) ); - -new TestCase( SECTION, - "Math.pow(0, Infinity)", - 0, - Math.pow(0, Number.POSITIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.pow(0, -1)", - Number.POSITIVE_INFINITY, - Math.pow(0, -1) ); - -new TestCase( SECTION, - "Math.pow(0, -0.5)", - Number.POSITIVE_INFINITY, - Math.pow(0, -0.5) ); - -new TestCase( SECTION, - "Math.pow(0, -1000)", - Number.POSITIVE_INFINITY, - Math.pow(0, -1000) ); - -new TestCase( SECTION, - "Math.pow(0, -Infinity)", - Number.POSITIVE_INFINITY, - Math.pow(0, Number.NEGATIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.pow(-0, 1)", - -0, - Math.pow(-0, 1) ); - -new TestCase( SECTION, - "Math.pow(-0, 3)", - -0, - Math.pow(-0,3) ); - -new TestCase( SECTION, - "Infinity/Math.pow(-0, 1)", - -Infinity, - Infinity/Math.pow(-0, 1) ); - -new TestCase( SECTION, - "Infinity/Math.pow(-0, 3)", - -Infinity, - Infinity/Math.pow(-0,3) ); - -new TestCase( SECTION, - "Math.pow(-0, 2)", - 0, - Math.pow(-0,2) ); - -new TestCase( SECTION, - "Math.pow(-0, Infinity)", - 0, - Math.pow(-0, Number.POSITIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.pow(-0, -1)", - Number.NEGATIVE_INFINITY, - Math.pow(-0, -1) ); - -new TestCase( SECTION, - "Math.pow(-0, -10001)", - Number.NEGATIVE_INFINITY, - Math.pow(-0, -10001) ); - -new TestCase( SECTION, - "Math.pow(-0, -2)", - Number.POSITIVE_INFINITY, - Math.pow(-0, -2) ); - -new TestCase( SECTION, - "Math.pow(-0, 0.5)", - 0, - Math.pow(-0, 0.5) ); - -new TestCase( SECTION, - "Math.pow(-0, Infinity)", - 0, - Math.pow(-0, Number.POSITIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.pow(-1, 0.5)", - Number.NaN, - Math.pow(-1, 0.5) ); - -new TestCase( SECTION, - "Math.pow(-1, NaN)", - Number.NaN, - Math.pow(-1, Number.NaN) ); - -new TestCase( SECTION, - "Math.pow(-1, -0.5)", - Number.NaN, - Math.pow(-1, -0.5) ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.14.js b/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.14.js deleted file mode 100644 index 1972518c81..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.14.js +++ /dev/null @@ -1,79 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.8.2.14.js'; - -/** - File Name: 15.8.2.14.js - ECMA Section: 15.8.2.14 Math.random() - returns a number value x with a positive sign - with 1 > x >= 0 with approximately uniform - distribution over that range, using an - implementation-dependent algorithm or strategy. - This function takes no arguments. - - Description: - Author: christine@netscape.com - Date: 16 september 1997 -*/ - -var SECTION = "15.8.2.14"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Math.random()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -for ( var item = 0; item < 100; item++ ) { - var testcase = new TestCase( SECTION, - "Math.random()", - "pass", - null ); - testcase.reason = Math.random(); - testcase.actual = "pass"; - - if ( ! ( testcase.reason >= 0) ) { - testcase.actual = "fail"; - } - - if ( ! (testcase.reason < 1) ) { - testcase.actual = "fail"; - } -} - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.15.js b/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.15.js deleted file mode 100644 index a5c36b4e61..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.15.js +++ /dev/null @@ -1,202 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.8.2.15.js'; - -/** - File Name: 15.8.2.15.js - ECMA Section: 15.8.2.15 Math.round(x) - Description: return the greatest number value that is closest to the - argument and is an integer. if two integers are equally - close to the argument. then the result is the number value - that is closer to Infinity. if the argument is an integer, - return the argument. - special cases: - - if x is NaN return NaN - - if x = +0 return +0 - - if x = -0 return -0 - - if x = Infinity return Infinity - - if x = -Infinity return -Infinity - - if 0 < x < 0.5 return 0 - - if -0.5 <= x < 0 return -0 - example: - Math.round( 3.5 ) == 4 - Math.round( -3.5 ) == 3 - also: - - Math.round(x) == Math.floor( x + 0.5 ) - except if x = -0. in that case, Math.round(x) = -0 - - and Math.floor( x+0.5 ) = +0 - - - Author: christine@netscape.com - Date: 7 july 1997 -*/ - -var SECTION = "15.8.2.15"; -var VERSION = "ECMA_1"; -var TITLE = "Math.round(x)"; -var BUGNUMBER="331411"; - -var EXCLUDE = "true"; - -startTest(); - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "Math.round.length", - 1, - Math.round.length ); - -new TestCase( SECTION, - "Math.round()", - Number.NaN, - Math.round() ); - -new TestCase( SECTION, - "Math.round(null)", - 0, - Math.round(0) ); - -new TestCase( SECTION, - "Math.round(void 0)", - Number.NaN, - Math.round(void 0) ); - -new TestCase( SECTION, - "Math.round(true)", - 1, - Math.round(true) ); - -new TestCase( SECTION, - "Math.round(false)", - 0, - Math.round(false) ); - -new TestCase( SECTION, - "Math.round('.99999')", - 1, - Math.round('.99999') ); - -new TestCase( SECTION, - "Math.round('12345e-2')", - 123, - Math.round('12345e-2') ); - -new TestCase( SECTION, - "Math.round(NaN)", - Number.NaN, - Math.round(Number.NaN) ); - -new TestCase( SECTION, - "Math.round(0)", - 0, - Math.round(0) ); - -new TestCase( SECTION, - "Math.round(-0)", - -0, - Math.round(-0)); - -new TestCase( SECTION, - "Infinity/Math.round(-0)", - -Infinity, - Infinity/Math.round(-0) ); - -new TestCase( SECTION, - "Math.round(Infinity)", - Number.POSITIVE_INFINITY, - Math.round(Number.POSITIVE_INFINITY)); - -new TestCase( SECTION, - "Math.round(-Infinity)", - Number.NEGATIVE_INFINITY, - Math.round(Number.NEGATIVE_INFINITY)); - -new TestCase( SECTION, - "Math.round(0.49)", - 0, - Math.round(0.49)); - -new TestCase( SECTION, - "Math.round(0.5)", - 1, - Math.round(0.5)); - -new TestCase( SECTION, - "Math.round(0.51)", - 1, - Math.round(0.51)); - -new TestCase( SECTION, - "Math.round(-0.49)", - -0, - Math.round(-0.49)); - -new TestCase( SECTION, - "Math.round(-0.5)", - -0, - Math.round(-0.5)); - -new TestCase( SECTION, - "Infinity/Math.round(-0.49)", - -Infinity, - Infinity/Math.round(-0.49)); - -new TestCase( SECTION, - "Infinity/Math.round(-0.5)", - -Infinity, - Infinity/Math.round(-0.5)); - -new TestCase( SECTION, - "Math.round(-0.51)", - -1, - Math.round(-0.51)); - -new TestCase( SECTION, - "Math.round(3.5)", - 4, - Math.round(3.5)); - -new TestCase( SECTION, - "Math.round(-3.5)", - -3, - Math.round(-3)); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.16.js b/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.16.js deleted file mode 100644 index deb873cdaa..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.16.js +++ /dev/null @@ -1,132 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.8.2.16.js'; - -/** - File Name: 15.8.2.16.js - ECMA Section: 15.8.2.16 sin( x ) - Description: return an approximation to the sine of the - argument. argument is expressed in radians - Author: christine@netscape.com - Date: 7 july 1997 - -*/ -var SECTION = "15.8.2.16"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Math.sin(x)"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "Math.sin.length", - 1, - Math.sin.length ); - -new TestCase( SECTION, - "Math.sin()", - Number.NaN, - Math.sin() ); - -new TestCase( SECTION, - "Math.sin(null)", - 0, - Math.sin(null) ); - -new TestCase( SECTION, - "Math.sin(void 0)", - Number.NaN, - Math.sin(void 0) ); - -new TestCase( SECTION, - "Math.sin(false)", - 0, - Math.sin(false) ); - -new TestCase( SECTION, - "Math.sin('2.356194490192')", - 0.7071067811865, - Math.sin('2.356194490192') ); - -new TestCase( SECTION, - "Math.sin(NaN)", - Number.NaN, - Math.sin(Number.NaN) ); - -new TestCase( SECTION, - "Math.sin(0)", - 0, - Math.sin(0) ); - -new TestCase( SECTION, - "Math.sin(-0)", - -0, - Math.sin(-0)); - -new TestCase( SECTION, - "Math.sin(Infinity)", - Number.NaN, - Math.sin(Number.POSITIVE_INFINITY)); - -new TestCase( SECTION, - "Math.sin(-Infinity)", - Number.NaN, - Math.sin(Number.NEGATIVE_INFINITY)); - -new TestCase( SECTION, - "Math.sin(0.7853981633974)", - 0.7071067811865, - Math.sin(0.7853981633974)); - -new TestCase( SECTION, - "Math.sin(1.570796326795)", - 1, - Math.sin(1.570796326795)); - -new TestCase( SECTION, - "Math.sin(2.356194490192)", - 0.7071067811865, - Math.sin(2.356194490192)); - -new TestCase( SECTION, - "Math.sin(3.14159265359)", - 0, - Math.sin(3.14159265359)); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.17.js b/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.17.js deleted file mode 100644 index 2f12f1d93b..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.17.js +++ /dev/null @@ -1,217 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.8.2.17.js'; - -/** - File Name: 15.8.2.17.js - ECMA Section: 15.8.2.17 Math.sqrt(x) - Description: return an approximation to the squareroot of the argument. - special cases: - - if x is NaN return NaN - - if x < 0 return NaN - - if x == 0 return 0 - - if x == -0 return -0 - - if x == Infinity return Infinity - Author: christine@netscape.com - Date: 7 july 1997 -*/ - -var SECTION = "15.8.2.17"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Math.sqrt(x)"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "Math.sqrt.length", - 1, - Math.sqrt.length ); - -new TestCase( SECTION, - "Math.sqrt()", - Number.NaN, - Math.sqrt() ); - -new TestCase( SECTION, - "Math.sqrt(void 0)", - Number.NaN, - Math.sqrt(void 0) ); - -new TestCase( SECTION, - "Math.sqrt(null)", - 0, - Math.sqrt(null) ); - -new TestCase( SECTION, - "Math.sqrt(true)", - 1, - Math.sqrt(1) ); - -new TestCase( SECTION, - "Math.sqrt(false)", - 0, - Math.sqrt(false) ); - -new TestCase( SECTION, - "Math.sqrt('225')", - 15, - Math.sqrt('225') ); - -new TestCase( SECTION, - "Math.sqrt(NaN)", - Number.NaN, - Math.sqrt(Number.NaN) ); - -new TestCase( SECTION, - "Math.sqrt(-Infinity)", - Number.NaN, - Math.sqrt(Number.NEGATIVE_INFINITY)); - -new TestCase( SECTION, - "Math.sqrt(-1)", - Number.NaN, - Math.sqrt(-1)); - -new TestCase( SECTION, - "Math.sqrt(-0.5)", - Number.NaN, - Math.sqrt(-0.5)); - -new TestCase( SECTION, - "Math.sqrt(0)", - 0, - Math.sqrt(0)); - -new TestCase( SECTION, - "Math.sqrt(-0)", - -0, - Math.sqrt(-0)); - -new TestCase( SECTION, - "Infinity/Math.sqrt(-0)", - -Infinity, - Infinity/Math.sqrt(-0) ); - -new TestCase( SECTION, - "Math.sqrt(Infinity)", - Number.POSITIVE_INFINITY, - Math.sqrt(Number.POSITIVE_INFINITY)); - -new TestCase( SECTION, - "Math.sqrt(1)", - 1, - Math.sqrt(1)); - -new TestCase( SECTION, - "Math.sqrt(2)", - Math.SQRT2, - Math.sqrt(2)); - -new TestCase( SECTION, - "Math.sqrt(0.5)", - Math.SQRT1_2, - Math.sqrt(0.5)); - -new TestCase( SECTION, - "Math.sqrt(4)", - 2, - Math.sqrt(4)); - -new TestCase( SECTION, - "Math.sqrt(9)", - 3, - Math.sqrt(9)); - -new TestCase( SECTION, - "Math.sqrt(16)", - 4, - Math.sqrt(16)); - -new TestCase( SECTION, - "Math.sqrt(25)", - 5, - Math.sqrt(25)); - -new TestCase( SECTION, - "Math.sqrt(36)", - 6, - Math.sqrt(36)); - -new TestCase( SECTION, - "Math.sqrt(49)", - 7, - Math.sqrt(49)); - -new TestCase( SECTION, - "Math.sqrt(64)", - 8, - Math.sqrt(64)); - -new TestCase( SECTION, - "Math.sqrt(256)", - 16, - Math.sqrt(256)); - -new TestCase( SECTION, - "Math.sqrt(10000)", - 100, - Math.sqrt(10000)); - -new TestCase( SECTION, - "Math.sqrt(65536)", - 256, - Math.sqrt(65536)); - -new TestCase( SECTION, - "Math.sqrt(0.09)", - 0.3, - Math.sqrt(0.09)); - -new TestCase( SECTION, - "Math.sqrt(0.01)", - 0.1, - Math.sqrt(0.01)); - -new TestCase( SECTION, - "Math.sqrt(0.00000001)", - 0.0001, - Math.sqrt(0.00000001)); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.18.js b/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.18.js deleted file mode 100644 index be68ea191f..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.18.js +++ /dev/null @@ -1,165 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.8.2.18.js'; - -/** - File Name: 15.8.2.18.js - ECMA Section: 15.8.2.18 tan( x ) - Description: return an approximation to the tan of the - argument. argument is expressed in radians - special cases: - - if x is NaN result is NaN - - if x is 0 result is 0 - - if x is -0 result is -0 - - if x is Infinity or -Infinity result is NaN - Author: christine@netscape.com - Date: 7 july 1997 -*/ - -var SECTION = "15.8.2.18"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Math.tan(x)"; -var EXCLUDE = "true"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "Math.tan.length", - 1, - Math.tan.length ); - -new TestCase( SECTION, - "Math.tan()", - Number.NaN, - Math.tan() ); - -new TestCase( SECTION, - "Math.tan(void 0)", - Number.NaN, - Math.tan(void 0)); - -new TestCase( SECTION, - "Math.tan(null)", - 0, - Math.tan(null) ); - -new TestCase( SECTION, - "Math.tan(false)", - 0, - Math.tan(false) ); - -new TestCase( SECTION, - "Math.tan(NaN)", - Number.NaN, - Math.tan(Number.NaN) ); - -new TestCase( SECTION, - "Math.tan(0)", - 0, - Math.tan(0)); - -new TestCase( SECTION, - "Math.tan(-0)", - -0, - Math.tan(-0)); - -new TestCase( SECTION, - "Math.tan(Infinity)", - Number.NaN, - Math.tan(Number.POSITIVE_INFINITY)); - -new TestCase( SECTION, - "Math.tan(-Infinity)", - Number.NaN, - Math.tan(Number.NEGATIVE_INFINITY)); - -new TestCase( SECTION, - "Math.tan(Math.PI/4)", - 1, - Math.tan(Math.PI/4)); - -new TestCase( SECTION, - "Math.tan(3*Math.PI/4)", - -1, - Math.tan(3*Math.PI/4)); - -new TestCase( SECTION, - "Math.tan(Math.PI)", - -0, - Math.tan(Math.PI)); - -new TestCase( SECTION, - "Math.tan(5*Math.PI/4)", - 1, - Math.tan(5*Math.PI/4)); - -new TestCase( SECTION, - "Math.tan(7*Math.PI/4)", - -1, - Math.tan(7*Math.PI/4)); - -new TestCase( SECTION, - "Infinity/Math.tan(-0)", - -Infinity, - Infinity/Math.tan(-0) ); - -/* - Arctan (x) ~ PI/2 - 1/x for large x. For x = 1.6x10^16, 1/x is about the last binary digit of double precision PI/2. - That is to say, perturbing PI/2 by this much is about the smallest rounding error possible. - - This suggests that the answer Christine is getting and a real Infinity are "adjacent" results from the tangent function. I - suspect that tan (PI/2 + one ulp) is a negative result about the same size as tan (PI/2) and that this pair are the closest - results to infinity that the algorithm can deliver. - - In any case, my call is that the answer we're seeing is "right". I suggest the test pass on any result this size or larger. - = C = -*/ - -new TestCase( SECTION, - "Math.tan(3*Math.PI/2) >= 5443000000000000", - true, - Math.tan(3*Math.PI/2) >= 5443000000000000 ); - -new TestCase( SECTION, - "Math.tan(Math.PI/2) >= 5443000000000000", - true, - Math.tan(Math.PI/2) >= 5443000000000000 ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.2.js b/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.2.js deleted file mode 100644 index 12fb00ef81..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.2.js +++ /dev/null @@ -1,151 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.8.2.2.js'; - -/** - File Name: 15.8.2.2.js - ECMA Section: 15.8.2.2 acos( x ) - Description: return an approximation to the arc cosine of the - argument. the result is expressed in radians and - range is from +0 to +PI. special cases: - - if x is NaN, return NaN - - if x > 1, the result is NaN - - if x < -1, the result is NaN - - if x == 1, the result is +0 - Author: christine@netscape.com - Date: 7 july 1997 -*/ -var SECTION = "15.8.2.2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Math.acos()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "Math.acos.length", - 1, - Math.acos.length ); - -new TestCase( SECTION, - "Math.acos(void 0)", - Number.NaN, - Math.acos(void 0) ); - -new TestCase( SECTION, - "Math.acos()", - Number.NaN, - Math.acos() ); - -new TestCase( SECTION, - "Math.acos(null)", - Math.PI/2, - Math.acos(null) ); - -new TestCase( SECTION, - "Math.acos(NaN)", - Number.NaN, - Math.acos(Number.NaN) ); - -new TestCase( SECTION, - "Math.acos(a string)", - Number.NaN, - Math.acos("a string") ); - -new TestCase( SECTION, - "Math.acos('0')", - Math.PI/2, - Math.acos('0') ); - -new TestCase( SECTION, - "Math.acos('1')", - 0, - Math.acos('1') ); - -new TestCase( SECTION, - "Math.acos('-1')", - Math.PI, - Math.acos('-1') ); - -new TestCase( SECTION, - "Math.acos(1.00000001)", - Number.NaN, - Math.acos(1.00000001) ); - -new TestCase( SECTION, - "Math.acos(11.00000001)", - Number.NaN, - Math.acos(-1.00000001) ); - -new TestCase( SECTION, - "Math.acos(1)", - 0, - Math.acos(1) ); - -new TestCase( SECTION, - "Math.acos(-1)", - Math.PI, - Math.acos(-1) ); - -new TestCase( SECTION, - "Math.acos(0)", - Math.PI/2, - Math.acos(0) ); - -new TestCase( SECTION, - "Math.acos(-0)", - Math.PI/2, - Math.acos(-0) ); - -new TestCase( SECTION, - "Math.acos(Math.SQRT1_2)", - Math.PI/4, - Math.acos(Math.SQRT1_2)); - -new TestCase( SECTION, - "Math.acos(-Math.SQRT1_2)", - Math.PI/4*3, - Math.acos(-Math.SQRT1_2)); - -new TestCase( SECTION, - "Math.acos(0.9999619230642)", - Math.PI/360, - Math.acos(0.9999619230642)); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.3.js b/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.3.js deleted file mode 100644 index 11c6d73657..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.3.js +++ /dev/null @@ -1,158 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.8.2.3.js'; - -/** - File Name: 15.8.2.3.js - ECMA Section: 15.8.2.3 asin( x ) - Description: return an approximation to the arc sine of the - argument. the result is expressed in radians and - range is from -PI/2 to +PI/2. special cases: - - if x is NaN, the result is NaN - - if x > 1, the result is NaN - - if x < -1, the result is NaN - - if x == +0, the result is +0 - - if x == -0, the result is -0 - Author: christine@netscape.com - Date: 7 july 1997 - -*/ -var SECTION = "15.8.2.3"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Math.asin()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "Math.asin()", - Number.NaN, - Math.asin() ); - -new TestCase( SECTION, - "Math.asin(void 0)", - Number.NaN, - Math.asin(void 0) ); - -new TestCase( SECTION, - "Math.asin(null)", - 0, - Math.asin(null) ); - -new TestCase( SECTION, - "Math.asin(NaN)", - Number.NaN, - Math.asin(Number.NaN) ); - -new TestCase( SECTION, - "Math.asin('string')", - Number.NaN, - Math.asin("string") ); - -new TestCase( SECTION, - "Math.asin('0')", - 0, - Math.asin("0") ); - -new TestCase( SECTION, - "Math.asin('1')", - Math.PI/2, - Math.asin("1") ); - -new TestCase( SECTION, - "Math.asin('-1')", - -Math.PI/2, - Math.asin("-1") ); - -new TestCase( SECTION, - "Math.asin(Math.SQRT1_2+'')", - Math.PI/4, - Math.asin(Math.SQRT1_2+'') ); - -new TestCase( SECTION, - "Math.asin(-Math.SQRT1_2+'')", - -Math.PI/4, - Math.asin(-Math.SQRT1_2+'') ); - -new TestCase( SECTION, - "Math.asin(1.000001)", - Number.NaN, - Math.asin(1.000001) ); - -new TestCase( SECTION, - "Math.asin(-1.000001)", - Number.NaN, - Math.asin(-1.000001) ); - -new TestCase( SECTION, - "Math.asin(0)", - 0, - Math.asin(0) ); - -new TestCase( SECTION, - "Math.asin(-0)", - -0, - Math.asin(-0) ); - -new TestCase( SECTION, - "Infinity/Math.asin(-0)", - -Infinity, - Infinity/Math.asin(-0) ); - -new TestCase( SECTION, - "Math.asin(1)", - Math.PI/2, - Math.asin(1) ); - -new TestCase( SECTION, - "Math.asin(-1)", - -Math.PI/2, - Math.asin(-1) ); - -new TestCase( SECTION, - "Math.asin(Math.SQRT1_2))", - Math.PI/4, - Math.asin(Math.SQRT1_2) ); - -new TestCase( SECTION, - "Math.asin(-Math.SQRT1_2))", - -Math.PI/4, - Math.asin(-Math.SQRT1_2)); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.4.js b/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.4.js deleted file mode 100644 index c67ac6d4ea..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.4.js +++ /dev/null @@ -1,156 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.8.2.4.js'; - -/** - File Name: 15.8.2.4.js - ECMA Section: 15.8.2.4 atan( x ) - Description: return an approximation to the arc tangent of the - argument. the result is expressed in radians and - range is from -PI/2 to +PI/2. special cases: - - if x is NaN, the result is NaN - - if x == +0, the result is +0 - - if x == -0, the result is -0 - - if x == +Infinity, the result is approximately +PI/2 - - if x == -Infinity, the result is approximately -PI/2 - Author: christine@netscape.com - Date: 7 july 1997 - -*/ - -var SECTION = "15.8.2.4"; -var VERSION = "ECMA_1"; -var TITLE = "Math.atan()"; -var BUGNUMBER="77391"; - -startTest(); - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "Math.atan.length", - 1, - Math.atan.length ); - -new TestCase( SECTION, - "Math.atan()", - Number.NaN, - Math.atan() ); - -new TestCase( SECTION, - "Math.atan(void 0)", - Number.NaN, - Math.atan(void 0) ); - -new TestCase( SECTION, - "Math.atan(null)", - 0, - Math.atan(null) ); - -new TestCase( SECTION, - "Math.atan(NaN)", - Number.NaN, - Math.atan(Number.NaN) ); - -new TestCase( SECTION, - "Math.atan('a string')", - Number.NaN, - Math.atan("a string") ); - -new TestCase( SECTION, - "Math.atan('0')", - 0, - Math.atan('0') ); - -new TestCase( SECTION, - "Math.atan('1')", - Math.PI/4, - Math.atan('1') ); - -new TestCase( SECTION, - "Math.atan('-1')", - -Math.PI/4, - Math.atan('-1') ); - -new TestCase( SECTION, - "Math.atan('Infinity)", - Math.PI/2, - Math.atan('Infinity') ); - -new TestCase( SECTION, - "Math.atan('-Infinity)", - -Math.PI/2, - Math.atan('-Infinity') ); - -new TestCase( SECTION, - "Math.atan(0)", - 0, - Math.atan(0) ); - -new TestCase( SECTION, - "Math.atan(-0)", - -0, - Math.atan(-0) ); - -new TestCase( SECTION, - "Infinity/Math.atan(-0)", - -Infinity, - Infinity/Math.atan(-0) ); - -new TestCase( SECTION, - "Math.atan(Infinity)", - Math.PI/2, - Math.atan(Number.POSITIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.atan(-Infinity)", - -Math.PI/2, - Math.atan(Number.NEGATIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.atan(1)", - Math.PI/4, - Math.atan(1) ); - -new TestCase( SECTION, - "Math.atan(-1)", - -Math.PI/4, - Math.atan(-1) ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.5.js b/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.5.js deleted file mode 100644 index 0adc690743..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.5.js +++ /dev/null @@ -1,244 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.8.2.5.js'; - -/** - File Name: 15.8.2.5.js - ECMA Section: 15.8.2.5 atan2( y, x ) - Description: - - Author: christine@netscape.com - Date: 7 july 1997 - -*/ -var SECTION = "15.8.2.5"; -var VERSION = "ECMA_1"; -var TITLE = "Math.atan2(x,y)"; -var BUGNUMBER="76111"; - -startTest(); - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "Math.atan2.length", - 2, - Math.atan2.length ); - -new TestCase( SECTION, - "Math.atan2(NaN, 0)", - Number.NaN, - Math.atan2(Number.NaN,0) ); - -new TestCase( SECTION, - "Math.atan2(null, null)", - 0, - Math.atan2(null, null) ); - -new TestCase( SECTION, - "Math.atan2(void 0, void 0)", - Number.NaN, - Math.atan2(void 0, void 0) ); - -new TestCase( SECTION, - "Math.atan2()", - Number.NaN, - Math.atan2() ); - -new TestCase( SECTION, - "Math.atan2(0, NaN)", - Number.NaN, - Math.atan2(0,Number.NaN) ); - -new TestCase( SECTION, - "Math.atan2(1, 0)", - Math.PI/2, - Math.atan2(1,0) ); - -new TestCase( SECTION, - "Math.atan2(1,-0)", - Math.PI/2, - Math.atan2(1,-0) ); - -new TestCase( SECTION, - "Math.atan2(0,0.001)", - 0, - Math.atan2(0,0.001) ); - -new TestCase( SECTION, - "Math.atan2(0,0)", - 0, - Math.atan2(0,0) ); - -new TestCase( SECTION, - "Math.atan2(0, -0)", - Math.PI, - Math.atan2(0,-0) ); - -new TestCase( SECTION, - "Math.atan2(0, -1)", - Math.PI, - Math.atan2(0, -1) ); - -new TestCase( SECTION, - "Math.atan2(-0, 1)", - -0, - Math.atan2(-0, 1) ); - -new TestCase( SECTION, - "Infinity/Math.atan2(-0, 1)", - -Infinity, - Infinity/Math.atan2(-0,1) ); - -new TestCase( SECTION, - "Math.atan2(-0, 0)", - -0, - Math.atan2(-0,0) ); - -new TestCase( SECTION, - "Math.atan2(-0, -0)", - -Math.PI, - Math.atan2(-0, -0) ); - -new TestCase( SECTION, - "Math.atan2(-0, -1)", - -Math.PI, - Math.atan2(-0, -1) ); - -new TestCase( SECTION, - "Math.atan2(-1, 0)", - -Math.PI/2, - Math.atan2(-1, 0) ); - -new TestCase( SECTION, - "Math.atan2(-1, -0)", - -Math.PI/2, - Math.atan2(-1, -0) ); - -new TestCase( SECTION, - "Math.atan2(1, Infinity)", - 0, - Math.atan2(1, Number.POSITIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.atan2(1,-Infinity)", - Math.PI, - Math.atan2(1, Number.NEGATIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.atan2(-1, Infinity)", - -0, - Math.atan2(-1,Number.POSITIVE_INFINITY) ); - -new TestCase( SECTION, - "Infinity/Math.atan2(-1, Infinity)", - -Infinity, - Infinity/Math.atan2(-1,Infinity) ); - -new TestCase( SECTION, - "Math.atan2(-1,-Infinity)", - -Math.PI, - Math.atan2(-1,Number.NEGATIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.atan2(Infinity, 0)", - Math.PI/2, - Math.atan2(Number.POSITIVE_INFINITY, 0) ); - -new TestCase( SECTION, - "Math.atan2(Infinity, 1)", - Math.PI/2, - Math.atan2(Number.POSITIVE_INFINITY, 1) ); - -new TestCase( SECTION, - "Math.atan2(Infinity,-1)", - Math.PI/2, - Math.atan2(Number.POSITIVE_INFINITY,-1) ); - -new TestCase( SECTION, - "Math.atan2(Infinity,-0)", - Math.PI/2, - Math.atan2(Number.POSITIVE_INFINITY,-0) ); - -new TestCase( SECTION, - "Math.atan2(-Infinity, 0)", - -Math.PI/2, - Math.atan2(Number.NEGATIVE_INFINITY, 0) ); - -new TestCase( SECTION, - "Math.atan2(-Infinity,-0)", - -Math.PI/2, - Math.atan2(Number.NEGATIVE_INFINITY,-0) ); - -new TestCase( SECTION, - "Math.atan2(-Infinity, 1)", - -Math.PI/2, - Math.atan2(Number.NEGATIVE_INFINITY, 1) ); - -new TestCase( SECTION, - "Math.atan2(-Infinity, -1)", - -Math.PI/2, - Math.atan2(Number.NEGATIVE_INFINITY,-1) ); - -new TestCase( SECTION, - "Math.atan2(Infinity, Infinity)", - Math.PI/4, - Math.atan2(Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.atan2(Infinity, -Infinity)", - 3*Math.PI/4, - Math.atan2(Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.atan2(-Infinity, Infinity)", - -Math.PI/4, - Math.atan2(Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.atan2(-Infinity, -Infinity)", - -3*Math.PI/4, - Math.atan2(Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.atan2(-1, 1)", - -Math.PI/4, - Math.atan2( -1, 1) ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.6.js b/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.6.js deleted file mode 100644 index 1c20a1c93e..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.6.js +++ /dev/null @@ -1,232 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.8.2.6.js'; - -/** - File Name: 15.8.2.6.js - ECMA Section: 15.8.2.6 Math.ceil(x) - Description: return the smallest number value that is not less than the - argument and is equal to a mathematical integer. if the - number is already an integer, return the number itself. - special cases: - - if x is NaN return NaN - - if x = +0 return +0 - - if x = 0 return -0 - - if x = Infinity return Infinity - - if x = -Infinity return -Infinity - - if ( -1 < x < 0 ) return -0 - also: - - the value of Math.ceil(x) == -Math.ceil(-x) - Author: christine@netscape.com - Date: 7 july 1997 -*/ -var SECTION = "15.8.2.6"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Math.ceil(x)"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "Math.ceil.length", - 1, - Math.ceil.length ); - -new TestCase( SECTION, - "Math.ceil(NaN)", - Number.NaN, - Math.ceil(Number.NaN) ); - -new TestCase( SECTION, - "Math.ceil(null)", - 0, - Math.ceil(null) ); - -new TestCase( SECTION, - "Math.ceil()", - Number.NaN, - Math.ceil() ); - -new TestCase( SECTION, - "Math.ceil(void 0)", - Number.NaN, - Math.ceil(void 0) ); - -new TestCase( SECTION, - "Math.ceil('0')", - 0, - Math.ceil('0') ); - -new TestCase( SECTION, - "Math.ceil('-0')", - -0, - Math.ceil('-0') ); - -new TestCase( SECTION, - "Infinity/Math.ceil('0')", - Infinity, - Infinity/Math.ceil('0')); - -new TestCase( SECTION, - "Infinity/Math.ceil('-0')", - -Infinity, - Infinity/Math.ceil('-0')); - -new TestCase( SECTION, - "Math.ceil(0)", - 0, - Math.ceil(0) ); - -new TestCase( SECTION, - "Math.ceil(-0)", - -0, - Math.ceil(-0) ); - -new TestCase( SECTION, - "Infinity/Math.ceil(0)", - Infinity, - Infinity/Math.ceil(0)); - -new TestCase( SECTION, - "Infinity/Math.ceil(-0)", - -Infinity, - Infinity/Math.ceil(-0)); - - -new TestCase( SECTION, - "Math.ceil(Infinity)", - Number.POSITIVE_INFINITY, - Math.ceil(Number.POSITIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.ceil(-Infinity)", - Number.NEGATIVE_INFINITY, - Math.ceil(Number.NEGATIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.ceil(-Number.MIN_VALUE)", - -0, - Math.ceil(-Number.MIN_VALUE) ); - -new TestCase( SECTION, - "Infinity/Math.ceil(-Number.MIN_VALUE)", - -Infinity, - Infinity/Math.ceil(-Number.MIN_VALUE) ); - -new TestCase( SECTION, - "Math.ceil(1)", - 1, - Math.ceil(1) ); - -new TestCase( SECTION, - "Math.ceil(-1)", - -1, - Math.ceil(-1) ); - -new TestCase( SECTION, - "Math.ceil(-0.9)", - -0, - Math.ceil(-0.9) ); - -new TestCase( SECTION, - "Infinity/Math.ceil(-0.9)", - -Infinity, - Infinity/Math.ceil(-0.9) ); - -new TestCase( SECTION, - "Math.ceil(0.9 )", - 1, - Math.ceil( 0.9) ); - -new TestCase( SECTION, - "Math.ceil(-1.1)", - -1, - Math.ceil( -1.1)); - -new TestCase( SECTION, - "Math.ceil( 1.1)", - 2, - Math.ceil( 1.1)); - -new TestCase( SECTION, - "Math.ceil(Infinity)", - -Math.floor(-Infinity), - Math.ceil(Number.POSITIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.ceil(-Infinity)", - -Math.floor(Infinity), - Math.ceil(Number.NEGATIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.ceil(-Number.MIN_VALUE)", - -Math.floor(Number.MIN_VALUE), - Math.ceil(-Number.MIN_VALUE) ); - -new TestCase( SECTION, - "Math.ceil(1)", - -Math.floor(-1), - Math.ceil(1) ); - -new TestCase( SECTION, - "Math.ceil(-1)", - -Math.floor(1), - Math.ceil(-1) ); - -new TestCase( SECTION, - "Math.ceil(-0.9)", - -Math.floor(0.9), - Math.ceil(-0.9) ); - -new TestCase( SECTION, - "Math.ceil(0.9 )", - -Math.floor(-0.9), - Math.ceil( 0.9) ); - -new TestCase( SECTION, - "Math.ceil(-1.1)", - -Math.floor(1.1), - Math.ceil( -1.1)); - -new TestCase( SECTION, - "Math.ceil( 1.1)", - -Math.floor(-1.1), - Math.ceil( 1.1)); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.7.js b/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.7.js deleted file mode 100644 index 2b19b5986e..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.7.js +++ /dev/null @@ -1,283 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.8.2.7.js'; - -/** - File Name: 15.8.2.7.js - ECMA Section: 15.8.2.7 cos( x ) - Description: return an approximation to the cosine of the - argument. argument is expressed in radians - Author: christine@netscape.com - Date: 7 july 1997 - -*/ - -var SECTION = "15.8.2.7"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Math.cos(x)"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "Math.cos.length", - 1, - Math.cos.length ); - -new TestCase( SECTION, - "Math.cos()", - Number.NaN, - Math.cos() ); - -new TestCase( SECTION, - "Math.cos(void 0)", - Number.NaN, - Math.cos(void 0) ); - -new TestCase( SECTION, - "Math.cos(false)", - 1, - Math.cos(false) ); - -new TestCase( SECTION, - "Math.cos(null)", - 1, - Math.cos(null) ); - -new TestCase( SECTION, - "Math.cos('0')", - 1, - Math.cos('0') ); - -new TestCase( SECTION, - "Math.cos('Infinity')", - Number.NaN, - Math.cos("Infinity") ); - -new TestCase( SECTION, - "Math.cos('3.14159265359')", - -1, - Math.cos('3.14159265359') ); - -new TestCase( SECTION, - "Math.cos(NaN)", - Number.NaN, - Math.cos(Number.NaN) ); - -new TestCase( SECTION, - "Math.cos(0)", - 1, - Math.cos(0) ); - -new TestCase( SECTION, - "Math.cos(-0)", - 1, - Math.cos(-0) ); - -new TestCase( SECTION, - "Math.cos(Infinity)", - Number.NaN, - Math.cos(Number.POSITIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.cos(-Infinity)", - Number.NaN, - Math.cos(Number.NEGATIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.cos(0.7853981633974)", - 0.7071067811865, - Math.cos(0.7853981633974) ); - -new TestCase( SECTION, - "Math.cos(1.570796326795)", - 0, - Math.cos(1.570796326795) ); - -new TestCase( SECTION, - "Math.cos(2.356194490192)", - -0.7071067811865, - Math.cos(2.356194490192) ); - -new TestCase( SECTION, - "Math.cos(3.14159265359)", - -1, - Math.cos(3.14159265359) ); - -new TestCase( SECTION, - "Math.cos(3.926990816987)", - -0.7071067811865, - Math.cos(3.926990816987) ); - -new TestCase( SECTION, - "Math.cos(4.712388980385)", - 0, - Math.cos(4.712388980385) ); - -new TestCase( SECTION, - "Math.cos(5.497787143782)", - 0.7071067811865, - Math.cos(5.497787143782) ); - -new TestCase( SECTION, - "Math.cos(Math.PI*2)", - 1, - Math.cos(Math.PI*2) ); - -new TestCase( SECTION, - "Math.cos(Math.PI/4)", - Math.SQRT2/2, - Math.cos(Math.PI/4) ); - -new TestCase( SECTION, - "Math.cos(Math.PI/2)", - 0, - Math.cos(Math.PI/2) ); - -new TestCase( SECTION, - "Math.cos(3*Math.PI/4)", - -Math.SQRT2/2, - Math.cos(3*Math.PI/4) ); - -new TestCase( SECTION, - "Math.cos(Math.PI)", - -1, - Math.cos(Math.PI) ); - -new TestCase( SECTION, - "Math.cos(5*Math.PI/4)", - -Math.SQRT2/2, - Math.cos(5*Math.PI/4) ); - -new TestCase( SECTION, - "Math.cos(3*Math.PI/2)", - 0, - Math.cos(3*Math.PI/2) ); - -new TestCase( SECTION, - "Math.cos(7*Math.PI/4)", - Math.SQRT2/2, - Math.cos(7*Math.PI/4) ); - -new TestCase( SECTION, - "Math.cos(Math.PI*2)", - 1, - Math.cos(2*Math.PI) ); - -new TestCase( SECTION, - "Math.cos(-0.7853981633974)", - 0.7071067811865, - Math.cos(-0.7853981633974) ); - -new TestCase( SECTION, - "Math.cos(-1.570796326795)", - 0, - Math.cos(-1.570796326795) ); - -new TestCase( SECTION, - "Math.cos(-2.3561944901920)", - -.7071067811865, - Math.cos(2.3561944901920) ); - -new TestCase( SECTION, - "Math.cos(-3.14159265359)", - -1, - Math.cos(3.14159265359) ); - -new TestCase( SECTION, - "Math.cos(-3.926990816987)", - -0.7071067811865, - Math.cos(3.926990816987) ); - -new TestCase( SECTION, - "Math.cos(-4.712388980385)", - 0, - Math.cos(4.712388980385) ); - -new TestCase( SECTION, - "Math.cos(-5.497787143782)", - 0.7071067811865, - Math.cos(5.497787143782) ); - -new TestCase( SECTION, - "Math.cos(-6.28318530718)", - 1, - Math.cos(6.28318530718) ); - -new TestCase( SECTION, - "Math.cos(-Math.PI/4)", - Math.SQRT2/2, - Math.cos(-Math.PI/4) ); - -new TestCase( SECTION, - "Math.cos(-Math.PI/2)", - 0, - Math.cos(-Math.PI/2) ); - -new TestCase( SECTION, - "Math.cos(-3*Math.PI/4)", - -Math.SQRT2/2, - Math.cos(-3*Math.PI/4) ); - -new TestCase( SECTION, - "Math.cos(-Math.PI)", - -1, - Math.cos(-Math.PI) ); - -new TestCase( SECTION, - "Math.cos(-5*Math.PI/4)", - -Math.SQRT2/2, - Math.cos(-5*Math.PI/4) ); - -new TestCase( SECTION, - "Math.cos(-3*Math.PI/2)", - 0, - Math.cos(-3*Math.PI/2) ); - -new TestCase( SECTION, - "Math.cos(-7*Math.PI/4)", - Math.SQRT2/2, - Math.cos(-7*Math.PI/4) ); - -new TestCase( SECTION, - "Math.cos(-Math.PI*2)", - 1, - Math.cos(-Math.PI*2) ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.8.js b/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.8.js deleted file mode 100644 index 96b6231da2..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.8.js +++ /dev/null @@ -1,134 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.8.2.8.js'; - -/** - File Name: 15.8.2.8.js - ECMA Section: 15.8.2.8 Math.exp(x) - Description: return an approximation to the exponential function of - the argument (e raised to the power of the argument) - special cases: - - if x is NaN return NaN - - if x is 0 return 1 - - if x is -0 return 1 - - if x is Infinity return Infinity - - if x is -Infinity return 0 - Author: christine@netscape.com - Date: 7 july 1997 -*/ - - -var SECTION = "15.8.2.8"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Math.exp(x)"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "Math.exp.length", - 1, - Math.exp.length ); - -new TestCase( SECTION, - "Math.exp()", - Number.NaN, - Math.exp() ); - -new TestCase( SECTION, - "Math.exp(null)", - 1, - Math.exp(null) ); - -new TestCase( SECTION, - "Math.exp(void 0)", - Number.NaN, - Math.exp(void 0) ); - -new TestCase( SECTION, - "Math.exp(1)", - Math.E, - Math.exp(1) ); - -new TestCase( SECTION, - "Math.exp(true)", - Math.E, - Math.exp(true) ); - -new TestCase( SECTION, - "Math.exp(false)", - 1, - Math.exp(false) ); - -new TestCase( SECTION, - "Math.exp('1')", - Math.E, - Math.exp('1') ); - -new TestCase( SECTION, - "Math.exp('0')", - 1, - Math.exp('0') ); - -new TestCase( SECTION, - "Math.exp(NaN)", - Number.NaN, - Math.exp(Number.NaN) ); - -new TestCase( SECTION, - "Math.exp(0)", - 1, - Math.exp(0) ); - -new TestCase( SECTION, - "Math.exp(-0)", - 1, - Math.exp(-0) ); - -new TestCase( SECTION, - "Math.exp(Infinity)", - Number.POSITIVE_INFINITY, - Math.exp(Number.POSITIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.exp(-Infinity)", - 0, - Math.exp(Number.NEGATIVE_INFINITY) ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.9.js b/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.9.js deleted file mode 100644 index b68a57d5bb..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Math/15.8.2.9.js +++ /dev/null @@ -1,191 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.8.2.9.js'; - -/** - File Name: 15.8.2.9.js - ECMA Section: 15.8.2.9 Math.floor(x) - Description: return the greatest number value that is not greater - than the argument and is equal to a mathematical integer. - if the number is already an integer, return the number - itself. special cases: - - if x is NaN return NaN - - if x = +0 return +0 - - if x = -0 return -0 - - if x = Infinity return Infinity - - if x = -Infinity return -Infinity - - if ( -1 < x < 0 ) return -0 - also: - - the value of Math.floor(x) == -Math.ceil(-x) - Author: christine@netscape.com - Date: 7 july 1997 -*/ - -var SECTION = "15.8.2.9"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Math.floor(x)"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "Math.floor.length", - 1, - Math.floor.length ); - -new TestCase( SECTION, - "Math.floor()", - Number.NaN, - Math.floor() ); - -new TestCase( SECTION, - "Math.floor(void 0)", - Number.NaN, - Math.floor(void 0) ); - -new TestCase( SECTION, - "Math.floor(null)", - 0, - Math.floor(null) ); - -new TestCase( SECTION, - "Math.floor(true)", - 1, - Math.floor(true) ); - -new TestCase( SECTION, - "Math.floor(false)", - 0, - Math.floor(false) ); - -new TestCase( SECTION, - "Math.floor('1.1')", - 1, - Math.floor("1.1") ); - -new TestCase( SECTION, - "Math.floor('-1.1')", - -2, - Math.floor("-1.1") ); - -new TestCase( SECTION, - "Math.floor('0.1')", - 0, - Math.floor("0.1") ); - -new TestCase( SECTION, - "Math.floor('-0.1')", - -1, - Math.floor("-0.1") ); - -new TestCase( SECTION, - "Math.floor(NaN)", - Number.NaN, - Math.floor(Number.NaN) ); - -new TestCase( SECTION, - "Math.floor(NaN)==-Math.ceil(-NaN)", - false, - Math.floor(Number.NaN) == -Math.ceil(-Number.NaN) ); - -new TestCase( SECTION, - "Math.floor(0)", - 0, - Math.floor(0) ); - -new TestCase( SECTION, - "Math.floor(0)==-Math.ceil(-0)", - true, - Math.floor(0) == -Math.ceil(-0) ); - -new TestCase( SECTION, - "Math.floor(-0)", - -0, - Math.floor(-0) ); - -new TestCase( SECTION, - "Infinity/Math.floor(-0)", - -Infinity, - Infinity/Math.floor(-0) ); - -new TestCase( SECTION, - "Math.floor(-0)==-Math.ceil(0)", - true, - Math.floor(-0)== -Math.ceil(0) ); - -new TestCase( SECTION, - "Math.floor(Infinity)", - Number.POSITIVE_INFINITY, - Math.floor(Number.POSITIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.floor(Infinity)==-Math.ceil(-Infinity)", - true, - Math.floor(Number.POSITIVE_INFINITY) == -Math.ceil(Number.NEGATIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.floor(-Infinity)", - Number.NEGATIVE_INFINITY, - Math.floor(Number.NEGATIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.floor(-Infinity)==-Math.ceil(Infinity)", - true, - Math.floor(Number.NEGATIVE_INFINITY) == -Math.ceil(Number.POSITIVE_INFINITY) ); - -new TestCase( SECTION, - "Math.floor(0.0000001)", - 0, - Math.floor(0.0000001) ); - -new TestCase( SECTION, - "Math.floor(0.0000001)==-Math.ceil(0.0000001)", true, - Math.floor(0.0000001)==-Math.ceil(-0.0000001) ); - -new TestCase( SECTION, - "Math.floor(-0.0000001)", - -1, - Math.floor(-0.0000001) ); - -new TestCase( SECTION, - "Math.floor(0.0000001)==-Math.ceil(0.0000001)", - true, - Math.floor(-0.0000001)==-Math.ceil(0.0000001) ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Math/browser.js b/tests/auto/declarative/parserstress/tests/ecma/Math/browser.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/auto/declarative/parserstress/tests/ecma/Math/shell.js b/tests/auto/declarative/parserstress/tests/ecma/Math/shell.js deleted file mode 100644 index fbcc5c3f92..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Math/shell.js +++ /dev/null @@ -1 +0,0 @@ -gTestsubsuite = 'Math'; diff --git a/tests/auto/declarative/parserstress/tests/ecma/NativeObjects/browser.js b/tests/auto/declarative/parserstress/tests/ecma/NativeObjects/browser.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/auto/declarative/parserstress/tests/ecma/NativeObjects/shell.js b/tests/auto/declarative/parserstress/tests/ecma/NativeObjects/shell.js deleted file mode 100644 index 4ddb940f71..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/NativeObjects/shell.js +++ /dev/null @@ -1 +0,0 @@ -gTestsubsuite = 'NativeObjects'; diff --git a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.1.js b/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.1.js deleted file mode 100644 index 34cec9f378..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.1.js +++ /dev/null @@ -1,88 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.7.1.js'; - -/** - File Name: 15.7.1.js - ECMA Section: 15.7.1 The Number Constructor Called as a Function - 15.7.1.1 - 15.7.1.2 - - Description: When Number is called as a function rather than as a - constructor, it performs a type conversion. - 15.7.1.1 Return a number value (not a Number object) - computed by ToNumber( value ) - 15.7.1.2 Number() returns 0. - - need to add more test cases. see the gTestcases for - TypeConversion ToNumber. - - Author: christine@netscape.com - Date: 29 september 1997 -*/ - -var SECTION = "15.7.1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The Number Constructor Called as a Function"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase(SECTION, "Number()", 0, Number() ); -new TestCase(SECTION, "Number(void 0)", Number.NaN, Number(void 0) ); -new TestCase(SECTION, "Number(null)", 0, Number(null) ); -new TestCase(SECTION, "Number()", 0, Number() ); -new TestCase(SECTION, "Number(new Number())", 0, Number( new Number() ) ); -new TestCase(SECTION, "Number(0)", 0, Number(0) ); -new TestCase(SECTION, "Number(1)", 1, Number(1) ); -new TestCase(SECTION, "Number(-1)", -1, Number(-1) ); -new TestCase(SECTION, "Number(NaN)", Number.NaN, Number( Number.NaN ) ); -new TestCase(SECTION, "Number('string')", Number.NaN, Number( "string") ); -new TestCase(SECTION, "Number(new String())", 0, Number( new String() ) ); -new TestCase(SECTION, "Number('')", 0, Number( "" ) ); -new TestCase(SECTION, "Number(Infinity)", Number.POSITIVE_INFINITY, Number("Infinity") ); - -new TestCase(SECTION, "Number(new MyObject(100))", 100, Number(new MyObject(100)) ); - -test(); - -function MyObject( value ) { - this.value = value; - this.valueOf = new Function( "return this.value" ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.2.js b/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.2.js deleted file mode 100644 index 4c2c8a298c..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.2.js +++ /dev/null @@ -1,168 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.7.2.js'; - -/** - File Name: 15.7.2.js - ECMA Section: 15.7.2 The Number Constructor - 15.7.2.1 - 15.7.2.2 - - Description: 15.7.2 When Number is called as part of a new - expression, it is a constructor: it initializes - the newly created object. - - 15.7.2.1 The [[Prototype]] property of the newly - constructed object is set to othe original Number - prototype object, the one that is the initial value - of Number.prototype(0). The [[Class]] property is - set to "Number". The [[Value]] property of the - newly constructed object is set to ToNumber(value) - - 15.7.2.2 new Number(). same as in 15.7.2.1, except - the [[Value]] property is set to +0. - - need to add more test cases. see the gTestcases for - TypeConversion ToNumber. - - Author: christine@netscape.com - Date: 29 september 1997 -*/ - -var SECTION = "15.7.2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The Number Constructor"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -// To verify that the object's prototype is the Number.prototype, check to see if the object's -// constructor property is the same as Number.prototype.constructor. - -new TestCase(SECTION, "(new Number()).constructor", Number.prototype.constructor, (new Number()).constructor ); - -new TestCase(SECTION, "typeof (new Number())", "object", typeof (new Number()) ); -new TestCase(SECTION, "(new Number()).valueOf()", 0, (new Number()).valueOf() ); -new TestCase(SECTION, - "NUMB = new Number();NUMB.toString=Object.prototype.toString;NUMB.toString()", - "[object Number]", - eval("NUMB = new Number();NUMB.toString=Object.prototype.toString;NUMB.toString()") ); - -new TestCase(SECTION, "(new Number(0)).constructor", Number.prototype.constructor, (new Number(0)).constructor ); -new TestCase(SECTION, "typeof (new Number(0))", "object", typeof (new Number(0)) ); -new TestCase(SECTION, "(new Number(0)).valueOf()", 0, (new Number(0)).valueOf() ); -new TestCase(SECTION, - "NUMB = new Number(0);NUMB.toString=Object.prototype.toString;NUMB.toString()", - "[object Number]", - eval("NUMB = new Number(0);NUMB.toString=Object.prototype.toString;NUMB.toString()") ); - -new TestCase(SECTION, "(new Number(1)).constructor", Number.prototype.constructor, (new Number(1)).constructor ); -new TestCase(SECTION, "typeof (new Number(1))", "object", typeof (new Number(1)) ); -new TestCase(SECTION, "(new Number(1)).valueOf()", 1, (new Number(1)).valueOf() ); -new TestCase(SECTION, - "NUMB = new Number(1);NUMB.toString=Object.prototype.toString;NUMB.toString()", - "[object Number]", - eval("NUMB = new Number(1);NUMB.toString=Object.prototype.toString;NUMB.toString()") ); - -new TestCase(SECTION, "(new Number(-1)).constructor", Number.prototype.constructor, (new Number(-1)).constructor ); -new TestCase(SECTION, "typeof (new Number(-1))", "object", typeof (new Number(-1)) ); -new TestCase(SECTION, "(new Number(-1)).valueOf()", -1, (new Number(-1)).valueOf() ); -new TestCase(SECTION, - "NUMB = new Number(-1);NUMB.toString=Object.prototype.toString;NUMB.toString()", - "[object Number]", - eval("NUMB = new Number(-1);NUMB.toString=Object.prototype.toString;NUMB.toString()") ); - -new TestCase(SECTION, "(new Number(Number.NaN)).constructor", Number.prototype.constructor, (new Number(Number.NaN)).constructor ); -new TestCase(SECTION, "typeof (new Number(Number.NaN))", "object", typeof (new Number(Number.NaN)) ); -new TestCase(SECTION, "(new Number(Number.NaN)).valueOf()", Number.NaN, (new Number(Number.NaN)).valueOf() ); -new TestCase(SECTION, - "NUMB = new Number(Number.NaN);NUMB.toString=Object.prototype.toString;NUMB.toString()", - "[object Number]", - eval("NUMB = new Number(Number.NaN);NUMB.toString=Object.prototype.toString;NUMB.toString()") ); - -new TestCase(SECTION, "(new Number('string')).constructor", Number.prototype.constructor, (new Number('string')).constructor ); -new TestCase(SECTION, "typeof (new Number('string'))", "object", typeof (new Number('string')) ); -new TestCase(SECTION, "(new Number('string')).valueOf()", Number.NaN, (new Number('string')).valueOf() ); -new TestCase(SECTION, - "NUMB = new Number('string');NUMB.toString=Object.prototype.toString;NUMB.toString()", - "[object Number]", - eval("NUMB = new Number('string');NUMB.toString=Object.prototype.toString;NUMB.toString()") ); - -new TestCase(SECTION, "(new Number(new String())).constructor", Number.prototype.constructor, (new Number(new String())).constructor ); -new TestCase(SECTION, "typeof (new Number(new String()))", "object", typeof (new Number(new String())) ); -new TestCase(SECTION, "(new Number(new String())).valueOf()", 0, (new Number(new String())).valueOf() ); -new TestCase(SECTION, - "NUMB = new Number(new String());NUMB.toString=Object.prototype.toString;NUMB.toString()", - "[object Number]", - eval("NUMB = new Number(new String());NUMB.toString=Object.prototype.toString;NUMB.toString()") ); - -new TestCase(SECTION, "(new Number('')).constructor", Number.prototype.constructor, (new Number('')).constructor ); -new TestCase(SECTION, "typeof (new Number(''))", "object", typeof (new Number('')) ); -new TestCase(SECTION, "(new Number('')).valueOf()", 0, (new Number('')).valueOf() ); -new TestCase(SECTION, - "NUMB = new Number('');NUMB.toString=Object.prototype.toString;NUMB.toString()", - "[object Number]", - eval("NUMB = new Number('');NUMB.toString=Object.prototype.toString;NUMB.toString()") ); - -new TestCase(SECTION, "(new Number(Number.POSITIVE_INFINITY)).constructor", Number.prototype.constructor, (new Number(Number.POSITIVE_INFINITY)).constructor ); -new TestCase(SECTION, "typeof (new Number(Number.POSITIVE_INFINITY))", "object", typeof (new Number(Number.POSITIVE_INFINITY)) ); -new TestCase(SECTION, "(new Number(Number.POSITIVE_INFINITY)).valueOf()", Number.POSITIVE_INFINITY, (new Number(Number.POSITIVE_INFINITY)).valueOf() ); -new TestCase(SECTION, - "NUMB = new Number(Number.POSITIVE_INFINITY);NUMB.toString=Object.prototype.toString;NUMB.toString()", - "[object Number]", - eval("NUMB = new Number(Number.POSITIVE_INFINITY);NUMB.toString=Object.prototype.toString;NUMB.toString()") ); - -new TestCase(SECTION, "(new Number(Number.NEGATIVE_INFINITY)).constructor", Number.prototype.constructor, (new Number(Number.NEGATIVE_INFINITY)).constructor ); -new TestCase(SECTION, "typeof (new Number(Number.NEGATIVE_INFINITY))", "object", typeof (new Number(Number.NEGATIVE_INFINITY)) ); -new TestCase(SECTION, "(new Number(Number.NEGATIVE_INFINITY)).valueOf()", Number.NEGATIVE_INFINITY, (new Number(Number.NEGATIVE_INFINITY)).valueOf() ); -new TestCase(SECTION, - "NUMB = new Number(Number.NEGATIVE_INFINITY);NUMB.toString=Object.prototype.toString;NUMB.toString()", - "[object Number]", - eval("NUMB = new Number(Number.NEGATIVE_INFINITY);NUMB.toString=Object.prototype.toString;NUMB.toString()") ); - - -new TestCase(SECTION, "(new Number()).constructor", Number.prototype.constructor, (new Number()).constructor ); -new TestCase(SECTION, "typeof (new Number())", "object", typeof (new Number()) ); -new TestCase(SECTION, "(new Number()).valueOf()", 0, (new Number()).valueOf() ); -new TestCase(SECTION, - "NUMB = new Number();NUMB.toString=Object.prototype.toString;NUMB.toString()", - "[object Number]", - eval("NUMB = new Number();NUMB.toString=Object.prototype.toString;NUMB.toString()") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.1-1.js b/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.1-1.js deleted file mode 100644 index d275f50a12..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.1-1.js +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.7.3.1-1.js'; - -/** - File Name: 15.7.3.1-2.js - ECMA Section: 15.7.3.1 Number.prototype - Description: All value properties of the Number object should have - the attributes [DontEnum, DontDelete, ReadOnly] - - this test checks the DontDelete attribute of Number.prototype - - Author: christine@netscape.com - Date: 16 september 1997 -*/ - - -var SECTION = "15.7.3.1-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Number.prototype"; - -writeHeaderToLog( SECTION +" "+ TITLE); - -new TestCase(SECTION, - "var NUM_PROT = Number.prototype; delete( Number.prototype ); NUM_PROT == Number.prototype", - true, - eval("var NUM_PROT = Number.prototype; delete( Number.prototype ); NUM_PROT == Number.prototype") ); - -new TestCase(SECTION, - "delete( Number.prototype )", - false, - eval("delete( Number.prototype )") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.1-2.js b/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.1-2.js deleted file mode 100644 index ff26a03e63..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.1-2.js +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.7.3.1-2.js'; - -/** - File Name: 15.7.3.1-2.js - ECMA Section: 15.7.3.1 Number.prototype - Description: All value properties of the Number object should have - the attributes [DontEnum, DontDelete, ReadOnly] - - this test checks the ReadOnly attribute of Number.prototype - - Author: christine@netscape.com - Date: 16 september 1997 -*/ - - -var SECTION = "15.7.3.1-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Number.prototype"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "var NUM_PROT = Number.prototype; Number.prototype = null; Number.prototype == NUM_PROT", - true, - eval("var NUM_PROT = Number.prototype; Number.prototype = null; Number.prototype == NUM_PROT") ); - -new TestCase( SECTION, - "Number.prototype=0; Number.prototype", - Number.prototype, - eval("Number.prototype=0; Number.prototype") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.1-3.js b/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.1-3.js deleted file mode 100644 index 4669e969a7..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.1-3.js +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.7.3.1-3.js'; - -/** - File Name: 15.7.3.1-4.js - ECMA Section: 15.7.3.1 Number.prototype - Description: All value properties of the Number object should have - the attributes [DontEnum, DontDelete, ReadOnly] - - this test checks the DontEnum attribute of Number.prototype - - Author: christine@netscape.com - Date: 16 september 1997 -*/ - -var VERSION = "ECMA_1"; -startTest(); -var SECTION = "15.7.3.1-3"; -var TITLE = "Number.prototype"; - -writeHeaderToLog( SECTION + " Number.prototype: DontEnum Attribute"); - -new TestCase( - SECTION, - "var string = ''; for ( prop in Number ) { string += ( prop == 'prototype' ) ? prop: '' } string;", - "", - eval("var string = ''; for ( prop in Number ) { string += ( prop == 'prototype' ) ? prop : '' } string;") - ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.2-1.js b/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.2-1.js deleted file mode 100644 index 35ff1b25c3..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.2-1.js +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.7.3.2-1.js'; - -/** - File Name: 15.7.3.2-1.js - ECMA Section: 15.7.3.2 Number.MAX_VALUE - Description: All value properties of the Number object should have - the attributes [DontEnum, DontDelete, ReadOnly] - - this test checks the value of MAX_VALUE - - Author: christine@netscape.com - Date: 16 september 1997 -*/ - -var SECTION = "15.7.3.2-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Number.MAX_VALUE"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "Number.MAX_VALUE", - 1.7976931348623157e308, - Number.MAX_VALUE ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.2-2.js b/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.2-2.js deleted file mode 100644 index 980b688bb6..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.2-2.js +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.7.3.2-2.js'; - -/** - File Name: 15.7.3.2-2.js - ECMA Section: 15.7.3.2 Number.MAX_VALUE - Description: All value properties of the Number object should have - the attributes [DontEnum, DontDelete, ReadOnly] - - this test checks the DontDelete attribute of Number.MAX_VALUE - - Author: christine@netscape.com - Date: 16 september 1997 -*/ - -var SECTION = "15.7.3.2-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Number.MAX_VALUE: DontDelete Attribute"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "delete( Number.MAX_VALUE ); Number.MAX_VALUE", - 1.7976931348623157e308, - eval("delete( Number.MAX_VALUE );Number.MAX_VALUE") ); - -new TestCase( SECTION, - "delete( Number.MAX_VALUE )", - false, - eval("delete( Number.MAX_VALUE )") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.2-3.js b/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.2-3.js deleted file mode 100644 index 2f20efe2a8..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.2-3.js +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.7.3.2-3.js'; - -/** - File Name: 15.7.3.2-3.js - ECMA Section: 15.7.3.2 Number.MAX_VALUE - Description: All value properties of the Number object should have - the attributes [DontEnum, DontDelete, ReadOnly] - - this test checks the ReadOnly attribute of Number.MAX_VALUE - - Author: christine@netscape.com - Date: 16 september 1997 -*/ - -var SECTION = "15.7.3.2-3"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Number.MAX_VALUE"; - -writeHeaderToLog( SECTION + " "+ TITLE ); - -var MAX_VAL = 1.7976931348623157e308; - -new TestCase( SECTION, - "Number.MAX_VALUE=0; Number.MAX_VALUE", - MAX_VAL, - eval("Number.MAX_VALUE=0; Number.MAX_VALUE") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.2-4.js b/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.2-4.js deleted file mode 100644 index 04d70ce3a9..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.2-4.js +++ /dev/null @@ -1,64 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.7.3.2-4.js'; - -/** - File Name: 15.7.3.2-4.js - ECMA Section: 15.7.3.2 Number.MAX_VALUE - Description: All value properties of the Number object should have - the attributes [DontEnum, DontDelete, ReadOnly] - - this test checks the DontEnum attribute of Number.MAX_VALUE - - Author: christine@netscape.com - Date: 16 september 1997 -*/ -var SECTION = "15.7.3.2-4"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Number.MAX_VALUE: DontEnum Attribute"; -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "var string = ''; for ( prop in Number ) { string += ( prop == 'MAX_VALUE' ) ? prop : '' } string;", - "", - eval("var string = ''; for ( prop in Number ) { string += ( prop == 'MAX_VALUE' ) ? prop : '' } string;") - ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.3-1.js b/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.3-1.js deleted file mode 100644 index ed7f0e88a9..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.3-1.js +++ /dev/null @@ -1,68 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.7.3.3-1.js'; - -/** - File Name: 15.7.3.3-1.js - ECMA Section: 15.7.3.3 Number.MIN_VALUE - Description: All value properties of the Number object should have - the attributes [DontEnum, DontDelete, ReadOnly] - - this test checks the value of Number.MIN_VALUE - - Author: christine@netscape.com - Date: 16 september 1997 -*/ - - -var SECTION = "15.7.3.3-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Number.MIN_VALUE"; - -writeHeaderToLog( SECTION + " "+ TITLE ); - -var MIN_VAL = 5e-324; - -new TestCase( SECTION, - "Number.MIN_VALUE", - MIN_VAL, - Number.MIN_VALUE ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.3-2.js b/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.3-2.js deleted file mode 100644 index 2b73147c2a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.3-2.js +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.7.3.3-2.js'; - -/** - File Name: 15.7.3.3-2.js - ECMA Section: 15.7.3.3 Number.MIN_VALUE - Description: All value properties of the Number object should have - the attributes [DontEnum, DontDelete, ReadOnly] - - this test checks the DontDelete attribute of Number.MIN_VALUE - - Author: christine@netscape.com - Date: 16 september 1997 -*/ - - -var SECTION = "15.7.3.3-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Number.MIN_VALUE"; - -writeHeaderToLog( SECTION + " "+ TITLE ); - -var MIN_VAL = 5e-324; - -new TestCase( SECTION, - "delete( Number.MIN_VALUE )", - false, - eval("delete( Number.MIN_VALUE )") ); - -new TestCase( SECTION, - "delete( Number.MIN_VALUE ); Number.MIN_VALUE", - MIN_VAL, - eval("delete( Number.MIN_VALUE );Number.MIN_VALUE") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.3-3.js b/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.3-3.js deleted file mode 100644 index d0c98282dd..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.3-3.js +++ /dev/null @@ -1,64 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.7.3.3-3.js'; - -/** - File Name: 15.7.3.3-3.js - ECMA Section: 15.7.3.3 Number.MIN_VALUE - Description: All value properties of the Number object should have - the attributes [DontEnum, DontDelete, ReadOnly] - - this test checks the ReadOnly attribute of Number.MIN_VALUE - - Author: christine@netscape.com - Date: 16 september 1997 -*/ -var SECTION = "15.7.3.3-3"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Number.MIN_VALUE: ReadOnly Attribute"; - -writeHeaderToLog( SECTION + " "+TITLE ); - -new TestCase( SECTION, - "Number.MIN_VALUE=0; Number.MIN_VALUE", - Number.MIN_VALUE, - eval("Number.MIN_VALUE=0; Number.MIN_VALUE" )); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.3-4.js b/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.3-4.js deleted file mode 100644 index e9427c62f2..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.3-4.js +++ /dev/null @@ -1,66 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.7.3.3-4.js'; - -/** - File Name: 15.7.3.3-4.js - ECMA Section: 15.7.3.3 Number.MIN_VALUE - Description: All value properties of the Number object should have - the attributes [DontEnum, DontDelete, ReadOnly] - - this test checks the DontEnum attribute of Number.MIN_VALUE - - Author: christine@netscape.com - Date: 16 september 1997 -*/ - - -var SECTION = "15.7.3.3-4"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Number.MIN_VALUE: DontEnum Attribute"); - -new TestCase( SECTION, - "var string = ''; for ( prop in Number ) { string += ( prop == 'MIN_VALUE' ) ? prop : '' } string;", - "", - eval("var string = ''; for ( prop in Number ) { string += ( prop == 'MIN_VALUE' ) ? prop : '' } string;") - ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.4-1.js b/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.4-1.js deleted file mode 100644 index 6a6835f04d..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.4-1.js +++ /dev/null @@ -1,66 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.7.3.4-1.js'; - -/** - File Name: 15.7.3.4-1.js - ECMA Section: 15.7.3.4 Number.NaN - Description: All value properties of the Number object should have - the attributes [DontEnum, DontDelete, ReadOnly] - - this test checks the value of Number.NaN - - Author: christine@netscape.com - Date: 16 september 1997 -*/ - - -var SECTION = "15.7.3.4-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Number.NaN"; - -writeHeaderToLog( SECTION + " "+ TITLE ); - -new TestCase(SECTION, - "NaN", - NaN, - Number.NaN ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.4-2.js b/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.4-2.js deleted file mode 100644 index fd1e630d54..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.4-2.js +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.7.3.4-2.js'; - -/** - File Name: 15.7.3.4-2.js - ECMA Section: 15.7.3.4 Number.NaN - Description: All value properties of the Number object should have - the attributes [DontEnum, DontDelete, ReadOnly] - - this test checks the DontDelete attribute of Number.NaN - - Author: christine@netscape.com - Date: 16 september 1997 -*/ - - -var SECTION = "15.7.3.4-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Number.NaN"; - -writeHeaderToLog( SECTION + " "+ TITLE ); - -new TestCase(SECTION, - "delete( Number.NaN ); Number.NaN", - NaN, - eval("delete( Number.NaN );Number.NaN" )); - -new TestCase( SECTION, - "delete( Number.NaN )", - false, - eval("delete( Number.NaN )") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.4-3.js b/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.4-3.js deleted file mode 100644 index 6cf1072e20..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.4-3.js +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.7.3.4-3.js'; - -/** - File Name: 15.7.3.4-3.js - ECMA Section: 15.7.3.4 Number.NaN - Description: All value properties of the Number object should have - the attributes [DontEnum, DontDelete, ReadOnly] - - this test checks the ReadOnly attribute of Number.NaN - - Author: christine@netscape.com - Date: 16 september 1997 -*/ - -var SECTION = "15.7.3.4-3"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Number.NaN"; - -writeHeaderToLog( SECTION + " "+ TITLE ); - -new TestCase( SECTION, - "Number.NaN=0; Number.NaN", - Number.NaN, - eval("Number.NaN=0; Number.NaN") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.4-4.js b/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.4-4.js deleted file mode 100644 index 3e1db5b9d2..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.4-4.js +++ /dev/null @@ -1,66 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.7.3.4-4.js'; - -/** - File Name: 15.7.3.4-4.js - ECMA Section: 15.7.3.4 Number.NaN - Description: All value properties of the Number object should have - the attributes [DontEnum, DontDelete, ReadOnly] - - this test checks the DontEnum attribute of Number.NaN - - Author: christine@netscape.com - Date: 16 september 1997 -*/ - -var SECTION = "15.7.3.4-4"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Number.NaN"; - -writeHeaderToLog( SECTION + " " + TITLE); - -new TestCase( SECTION, - "var string = ''; for ( prop in Number ) { string += ( prop == 'NaN' ) ? prop : '' } string;", - "", - eval("var string = ''; for ( prop in Number ) { string += ( prop == 'NaN' ) ? prop : '' } string;") - ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.5-1.js b/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.5-1.js deleted file mode 100644 index 8bcb3e3782..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.5-1.js +++ /dev/null @@ -1,64 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.7.3.5-1.js'; - -/** - File Name: 15.7.3.5-1.js - ECMA Section: 15.7.3.5 Number.NEGATIVE_INFINITY - Description: All value properties of the Number object should have - the attributes [DontEnum, DontDelete, ReadOnly] - - this test checks the value of Number.NEGATIVE_INFINITY - - Author: christine@netscape.com - Date: 16 september 1997 -*/ -var SECTION = "15.7.3.5-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Number.NEGATIVE_INFINITY"; - -writeHeaderToLog( SECTION + " "+TITLE); - -new TestCase(SECTION, - "Number.NEGATIVE_INFINITY", - -Infinity, - Number.NEGATIVE_INFINITY ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.5-2.js b/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.5-2.js deleted file mode 100644 index e0c2c440ac..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.5-2.js +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.7.3.5-2.js'; - -/** - File Name: 15.7.3.5-2.js - ECMA Section: 15.7.3.5 Number.NEGATIVE_INFINITY - Description: All value properties of the Number object should have - the attributes [DontEnum, DontDelete, ReadOnly] - - this test checks the DontDelete attribute of Number.NEGATIVE_INFINITY - - Author: christine@netscape.com - Date: 16 september 1997 -*/ - -var SECTION = "15.7.3.5-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Number.NEGATIVE_INFINITY"; - -writeHeaderToLog( SECTION + " "+TITLE); - -new TestCase( SECTION, - "delete( Number.NEGATIVE_INFINITY )", - false, - eval("delete( Number.NEGATIVE_INFINITY )") ); - -new TestCase( SECTION, - "delete( Number.NEGATIVE_INFINITY ); Number.NEGATIVE_INFINITY", - -Infinity, - eval("delete( Number.NEGATIVE_INFINITY );Number.NEGATIVE_INFINITY") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.5-3.js b/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.5-3.js deleted file mode 100644 index 983cdd3147..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.5-3.js +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.7.3.5-3.js'; - -/** - File Name: 15.7.3.5-3.js - ECMA Section: 15.7.3.5 Number.NEGATIVE_INFINITY - Description: All value properties of the Number object should have - the attributes [DontEnum, DontDelete, ReadOnly] - - this test checks the ReadOnly attribute of Number.NEGATIVE_INFINITY - - Author: christine@netscape.com - Date: 16 september 1997 -*/ - -var SECTION = "15.7.3.5-3"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Number.NEGATIVE_INFINITY"; - -writeHeaderToLog( SECTION + " "+TITLE); - -new TestCase( SECTION, - "Number.NEGATIVE_INFINITY=0; Number.NEGATIVE_INFINITY", - -Infinity, - eval("Number.NEGATIVE_INFINITY=0; Number.NEGATIVE_INFINITY") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.5-4.js b/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.5-4.js deleted file mode 100644 index acf7b0f543..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.5-4.js +++ /dev/null @@ -1,66 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.7.3.5-4.js'; - -/** - File Name: 15.7.3.5-4.js - ECMA Section: 15.7.3.5 Number.NEGATIVE_INFINITY - Description: All value properties of the Number object should have - the attributes [DontEnum, DontDelete, ReadOnly] - - this test checks the DontEnum attribute of Number.NEGATIVE_INFINITY - - Author: christine@netscape.com - Date: 16 september 1997 -*/ - -var SECTION = "15.7.3.5-4"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Number.NEGATIVE_INFINITY"; - -writeHeaderToLog( SECTION + " "+TITLE); - -new TestCase( SECTION, - "var string = ''; for ( prop in Number ) { string += ( prop == 'NEGATIVE_INFINITY' ) ? prop : '' } string;", - "", - eval("var string = ''; for ( prop in Number ) { string += ( prop == 'NEGATIVE_INFINITY' ) ? prop : '' } string;") - ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.6-1.js b/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.6-1.js deleted file mode 100644 index 466267f7d4..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.6-1.js +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.7.3.6-1.js'; - -/** - File Name: 15.7.3.6-1.js - ECMA Section: 15.7.3.6 Number.POSITIVE_INFINITY - Description: All value properties of the Number object should have - the attributes [DontEnum, DontDelete, ReadOnly] - - this test checks the value of Number.POSITIVE_INFINITY - - Author: christine@netscape.com - Date: 16 september 1997 -*/ - -var SECTION = "15.7.3.6-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Number.POSITIVE_INFINITY"; - -writeHeaderToLog( SECTION + " "+TITLE); - -new TestCase( SECTION, - "Number.POSITIVE_INFINITY", - Infinity, - Number.POSITIVE_INFINITY ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.6-2.js b/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.6-2.js deleted file mode 100644 index c3e6dbd0fb..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.6-2.js +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.7.3.6-2.js'; - -/** - File Name: 15.7.3.6-2.js - ECMA Section: 15.7.3.6 Number.POSITIVE_INFINITY - Description: All value properties of the Number object should have - the attributes [DontEnum, DontDelete, ReadOnly] - - this test checks the DontDelete attribute of Number.POSITIVE_INFINITY - - Author: christine@netscape.com - Date: 16 september 1997 -*/ -var SECTION = "15.7.3.6-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Number.POSITIVE_INFINITY"; - -writeHeaderToLog( SECTION + " "+TITLE); - -new TestCase(SECTION, - "delete( Number.POSITIVE_INFINITY )", - false, - eval("delete( Number.POSITIVE_INFINITY )") ); - -new TestCase(SECTION, - "delete( Number.POSITIVE_INFINITY ); Number.POSITIVE_INFINITY", - Infinity, - eval("delete( Number.POSITIVE_INFINITY );Number.POSITIVE_INFINITY") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.6-3.js b/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.6-3.js deleted file mode 100644 index 6055f49374..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.6-3.js +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.7.3.6-3.js'; - -/** - File Name: 15.7.3.6-3.js - ECMA Section: 15.7.3.6 Number.POSITIVE_INFINITY - Description: All value properties of the Number object should have - the attributes [DontEnum, DontDelete, ReadOnly] - - this test checks the ReadOnly attribute of Number.POSITIVE_INFINITY - - Author: christine@netscape.com - Date: 16 september 1997 -*/ - -var SECTION = "15.7.3.6-3"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Number.POSITIVE_INFINITY"; - -writeHeaderToLog( SECTION + " "+TITLE); - -new TestCase( SECTION, - "Number.POSITIVE_INFINITY=0; Number.POSITIVE_INFINITY", - Number.POSITIVE_INFINITY, - eval("Number.POSITIVE_INFINITY=0; Number.POSITIVE_INFINITY") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.6-4.js b/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.6-4.js deleted file mode 100644 index 75fa6ee485..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.6-4.js +++ /dev/null @@ -1,66 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.7.3.6-4.js'; - -/** - File Name: 15.7.3.6-4.js - ECMA Section: 15.7.3.6 Number.POSITIVE_INFINITY - Description: All value properties of the Number object should have - the attributes [DontEnum, DontDelete, ReadOnly] - - this test checks the DontEnum attribute of Number.POSITIVE_INFINITY - - Author: christine@netscape.com - Date: 16 september 1997 -*/ -var SECTION = "15.7.3.6-4"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Number.POSITIVE_INFINITY"; - -writeHeaderToLog( SECTION + " "+TITLE); - -new TestCase( SECTION, - "var string = ''; for ( prop in Number ) { string += ( prop == 'POSITIVE_INFINITY' ) ? prop : '' } string;", - "", - eval("var string = ''; for ( prop in Number ) { string += ( prop == 'POSITIVE_INFINITY' ) ? prop : '' } string;") - ); - - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.js b/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.js deleted file mode 100644 index bc5e7a3fa1..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.3.js +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.7.3.js'; - -/** - File Name: 15.7.3.js - 15.7.3 Properties of the Number Constructor - - Description: The value of the internal [[Prototype]] property - of the Number constructor is the Function prototype - object. The Number constructor also has the internal - [[Call]] and [[Construct]] properties, and the length - property. - - Other properties are in subsequent tests. - - Author: christine@netscape.com - Date: 29 september 1997 -*/ - -var SECTION = "15.7.3"; -var VERSION = "ECMA_2"; -startTest(); -var TITLE = "Properties of the Number Constructor"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase(SECTION, - "Number.length", - 1, - Number.length ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.4-1.js b/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.4-1.js deleted file mode 100644 index 175835987a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.4-1.js +++ /dev/null @@ -1,60 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.7.4-1.js'; - -/** - File Name: 15.7.4-1.js - ECMA Section: 15.7.4.1 Properties of the Number Prototype Object - Description: - Author: christine@netscape.com - Date: 16 september 1997 -*/ - - -var SECTION = "15.7.4-1"; -var VERSION = "ECMA_1"; -startTest(); -writeHeaderToLog( SECTION + "Properties of the Number prototype object"); - -new TestCase(SECTION, "Number.prototype.valueOf()", 0, Number.prototype.valueOf() ); -new TestCase(SECTION, "typeof(Number.prototype)", "object", typeof(Number.prototype) ); -new TestCase(SECTION, "Number.prototype.constructor == Number", true, Number.prototype.constructor == Number ); -// new TestCase(SECTION, "Number.prototype == Number.__proto__", true, Number.prototype == Number.__proto__ ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.4.1.js b/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.4.1.js deleted file mode 100644 index 27c0a0a9e4..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.4.1.js +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.7.4.1.js'; - -/** - File Name: 15.7.4.1.js - ECMA Section: 15.7.4.1.1 Number.prototype.constructor - - Number.prototype.constructor is the built-in Number constructor. - - Description: - Author: christine@netscape.com - Date: 16 september 1997 -*/ -var SECTION = "15.7.4.1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Number.prototype.constructor"; - -writeHeaderToLog( SECTION + " "+TITLE); - -new TestCase( SECTION, - "Number.prototype.constructor", - Number, - Number.prototype.constructor ); -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.4.2-1.js b/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.4.2-1.js deleted file mode 100644 index 531876d980..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.4.2-1.js +++ /dev/null @@ -1,111 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.7.4.2-1.js'; - -/** - File Name: 15.7.4.2.js - ECMA Section: 15.7.4.2.1 Number.prototype.toString() - Description: - If the radix is the number 10 or not supplied, then this number value is - given as an argument to the ToString operator; the resulting string value - is returned. - - If the radix is supplied and is an integer from 2 to 36, but not 10, the - result is a string, the choice of which is implementation dependent. - - The toString function is not generic; it generates a runtime error if its - this value is not a Number object. Therefore it cannot be transferred to - other kinds of objects for use as a method. - - Author: christine@netscape.com - Date: 16 september 1997 -*/ -var SECTION = "15.7.4.2-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Number.prototype.toString()"); - -// the following two lines cause navigator to crash -- cmb 9/16/97 -new TestCase(SECTION, - "Number.prototype.toString()", - "0", - eval("Number.prototype.toString()") ); - -new TestCase(SECTION, - "typeof(Number.prototype.toString())", - "string", - eval("typeof(Number.prototype.toString())") ); - -new TestCase(SECTION, - "s = Number.prototype.toString; o = new Number(); o.toString = s; o.toString()", - "0", - eval("s = Number.prototype.toString; o = new Number(); o.toString = s; o.toString()") ); - -new TestCase(SECTION, - "s = Number.prototype.toString; o = new Number(1); o.toString = s; o.toString()", - "1", - eval("s = Number.prototype.toString; o = new Number(1); o.toString = s; o.toString()") ); - -new TestCase(SECTION, - "s = Number.prototype.toString; o = new Number(-1); o.toString = s; o.toString()", - "-1", - eval("s = Number.prototype.toString; o = new Number(-1); o.toString = s; o.toString()") ); - -new TestCase(SECTION, - "var MYNUM = new Number(255); MYNUM.toString(10)", - "255", - eval("var MYNUM = new Number(255); MYNUM.toString(10)") ); - -new TestCase(SECTION, - "var MYNUM = new Number(Number.NaN); MYNUM.toString(10)", - "NaN", - eval("var MYNUM = new Number(Number.NaN); MYNUM.toString(10)") ); - -new TestCase(SECTION, - "var MYNUM = new Number(Infinity); MYNUM.toString(10)", - "Infinity", - eval("var MYNUM = new Number(Infinity); MYNUM.toString(10)") ); - -new TestCase(SECTION, - "var MYNUM = new Number(-Infinity); MYNUM.toString(10)", - "-Infinity", - eval("var MYNUM = new Number(-Infinity); MYNUM.toString(10)") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.4.2-2-n.js b/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.4.2-2-n.js deleted file mode 100644 index a99b1deb45..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.4.2-2-n.js +++ /dev/null @@ -1,76 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.7.4.2-2-n.js'; - -/** - File Name: 15.7.4.2-2-n.js - ECMA Section: 15.7.4.2.1 Number.prototype.toString() - Description: - If the radix is the number 10 or not supplied, then this number value is - given as an argument to the ToString operator; the resulting string value - is returned. - - If the radix is supplied and is an integer from 2 to 36, but not 10, the - result is a string, the choice of which is implementation dependent. - - The toString function is not generic; it generates a runtime error if its - this value is not a Number object. Therefore it cannot be transferred to - other kinds of objects for use as a method. - - Author: christine@netscape.com - Date: 16 september 1997 -*/ -var SECTION = "15.7.4.2-2-n"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Number.prototype.toString()"); - -DESCRIPTION = "o = new Object(); o.toString = Number.prototype.toString; o.toString()"; -EXPECTED = "error"; - -new TestCase(SECTION, - "o = new Object(); o.toString = Number.prototype.toString; o.toString()", - "error", - eval("o = new Object(); o.toString = Number.prototype.toString; o.toString()") ); - -// new TestCase(SECTION, "o = new String(); o.toString = Number.prototype.toString; o.toString()", "error", eval("o = new String(); o.toString = Number.prototype.toString; o.toString()") ); -// new TestCase(SECTION, "o = 3; o.toString = Number.prototype.toString; o.toString()", "error", eval("o = 3; o.toString = Number.prototype.toString; o.toString()") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.4.2-3-n.js b/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.4.2-3-n.js deleted file mode 100644 index f6148db1cc..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.4.2-3-n.js +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.7.4.2-3-n.js'; - -/** - File Name: 15.7.4.2-3-n.js - ECMA Section: 15.7.4.2.1 Number.prototype.toString() - Description: - If the radix is the number 10 or not supplied, then this number value is - given as an argument to the ToString operator; the resulting string value - is returned. - - If the radix is supplied and is an integer from 2 to 36, but not 10, the - result is a string, the choice of which is implementation dependent. - - The toString function is not generic; it generates a runtime error if its - this value is not a Number object. Therefore it cannot be transferred to - other kinds of objects for use as a method. - - Author: christine@netscape.com - Date: 16 september 1997 -*/ -var SECTION = "15.7.4.2-3-n"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Number.prototype.toString()"); - -DESCRIPTION = "o = new String(); o.toString = Number.prototype.toString; o.toString()"; -EXPECTED = "error"; - -new TestCase(SECTION, - "o = new String(); o.toString = Number.prototype.toString; o.toString()", - "error", - eval("o = new String(); o.toString = Number.prototype.toString; o.toString()") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.4.2-4.js b/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.4.2-4.js deleted file mode 100644 index c2fd40dd17..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.4.2-4.js +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.7.4.2-4.js'; - -/** - File Name: 15.7.4.2-4.js - ECMA Section: 15.7.4.2.1 Number.prototype.toString() - Description: - If the radix is the number 10 or not supplied, then this number value is - given as an argument to the ToString operator; the resulting string value - is returned. - - If the radix is supplied and is an integer from 2 to 36, but not 10, the - result is a string, the choice of which is implementation dependent. - - The toString function is not generic; it generates a runtime error if its - this value is not a Number object. Therefore it cannot be transferred to - other kinds of objects for use as a method. - - Author: christine@netscape.com - Date: 16 september 1997 -*/ -var SECTION = "15.7.4.2-4"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Number.prototype.toString()"); - -new TestCase(SECTION, - "o = 3; o.toString = Number.prototype.toString; o.toString()", - "3", - eval("o = 3; o.toString = Number.prototype.toString; o.toString()") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.4.3-1.js b/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.4.3-1.js deleted file mode 100644 index 755e2281b3..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.4.3-1.js +++ /dev/null @@ -1,97 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.7.4.3-1.js'; - -/** - File Name: 15.7.4.3-1.js - ECMA Section: 15.7.4.3.1 Number.prototype.valueOf() - Description: - Returns this number value. - - The valueOf function is not generic; it generates a runtime error if its - this value is not a Number object. Therefore it cannot be transferred to - other kinds of objects for use as a method. - - Author: christine@netscape.com - Date: 16 september 1997 -*/ -var SECTION = "15.7.4.3-1"; -var VERSION = "ECMA_1"; -startTest(); - - -writeHeaderToLog( SECTION + " Number.prototype.valueOf()"); - -// the following two line causes navigator to crash -- cmb 9/16/97 -new TestCase("SECTION", - "Number.prototype.valueOf()", - 0, - eval("Number.prototype.valueOf()") ); - -new TestCase("SECTION", - "(new Number(1)).valueOf()", - 1, - eval("(new Number(1)).valueOf()") ); - -new TestCase("SECTION", - "(new Number(-1)).valueOf()", - -1, - eval("(new Number(-1)).valueOf()") ); - -new TestCase("SECTION", - "(new Number(0)).valueOf()", - 0, - eval("(new Number(0)).valueOf()") ); - -new TestCase("SECTION", - "(new Number(Number.POSITIVE_INFINITY)).valueOf()", - Number.POSITIVE_INFINITY, - eval("(new Number(Number.POSITIVE_INFINITY)).valueOf()") ); - -new TestCase("SECTION", - "(new Number(Number.NaN)).valueOf()", - Number.NaN, - eval("(new Number(Number.NaN)).valueOf()") ); - -new TestCase("SECTION", - "(new Number()).valueOf()", - 0, - eval("(new Number()).valueOf()") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.4.3-2.js b/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.4.3-2.js deleted file mode 100644 index 1bfed1d4af..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.4.3-2.js +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.7.4.3-2.js'; - -/** - File Name: 15.7.4.3-2.js - ECMA Section: 15.7.4.3.1 Number.prototype.valueOf() - Description: - Returns this number value. - - The valueOf function is not generic; it generates a runtime error if its - this value is not a Number object. Therefore it cannot be transferred to - other kinds of objects for use as a method. - - Author: christine@netscape.com - Date: 16 september 1997 -*/ -var SECTION = "15.7.4.3-2"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Number.prototype.valueOf()"); - -new TestCase(SECTION, - "v = Number.prototype.valueOf; num = 3; num.valueOf = v; num.valueOf()", - 3, - eval("v = Number.prototype.valueOf; num = 3; num.valueOf = v; num.valueOf()") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.4.3-3-n.js b/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.4.3-3-n.js deleted file mode 100644 index 7df413ae48..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Number/15.7.4.3-3-n.js +++ /dev/null @@ -1,72 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.7.4.3-3-n.js'; - -/** - File Name: 15.7.4.3-3.js - ECMA Section: 15.7.4.3.1 Number.prototype.valueOf() - Description: - Returns this number value. - - The valueOf function is not generic; it generates a runtime error if its - this value is not a Number object. Therefore it cannot be transferred to - other kinds of objects for use as a method. - - Author: christine@netscape.com - Date: 16 september 1997 -*/ -var SECTION = "15.7.4.3-3-n"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Number.prototype.valueOf()"); - -// new TestCase("15.7.4.1", "v = Number.prototype.valueOf; num = 3; num.valueOf = v; num.valueOf()", "error", eval("v = Number.prototype.valueOf; num = 3; num.valueOf = v; num.valueOf()") ); - -DESCRIPTION = "v = Number.prototype.valueOf; o = new String('Infinity'); o.valueOf = v; o.valueOf()"; -EXPECTED = "error"; - -new TestCase("15.7.4.1", - "v = Number.prototype.valueOf; o = new String('Infinity'); o.valueOf = v; o.valueOf()", - "error", - eval("v = Number.prototype.valueOf; o = new String('Infinity'); o.valueOf = v; o.valueOf()") ); - -// new TestCase("15.7.4.1", "v = Number.prototype.valueOf; o = new Object(); o.valueOf = v; o.valueOf()", "error", eval("v = Number.prototype.valueOf; o = new Object(); o.valueOf = v; o.valueOf()") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Number/browser.js b/tests/auto/declarative/parserstress/tests/ecma/Number/browser.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/auto/declarative/parserstress/tests/ecma/Number/shell.js b/tests/auto/declarative/parserstress/tests/ecma/Number/shell.js deleted file mode 100644 index 03cca1d551..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Number/shell.js +++ /dev/null @@ -1 +0,0 @@ -gTestsubsuite = 'Number'; diff --git a/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.1.1.js b/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.1.1.js deleted file mode 100644 index 73ddd2894c..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.1.1.js +++ /dev/null @@ -1,146 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.2.1.1.js'; - -/** - File Name: 15.2.1.1.js - ECMA Section: 15.2.1.1 The Object Constructor Called as a Function: - Object(value) - Description: When Object is called as a function rather than as a - constructor, the following steps are taken: - - 1. If value is null or undefined, create and return a - new object with no properties other than internal - properties exactly as if the object constructor - had been called on that same value (15.2.2.1). - 2. Return ToObject (value), whose rules are: - - undefined generate a runtime error - null generate a runtime error - boolean create a new Boolean object whose default - value is the value of the boolean. - number Create a new Number object whose default - value is the value of the number. - string Create a new String object whose default - value is the value of the string. - object Return the input argument (no conversion). - - Author: christine@netscape.com - Date: 17 july 1997 -*/ - -var SECTION = "15.2.1.1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Object( value )"; - -writeHeaderToLog( SECTION + " "+ TITLE); - - -var NULL_OBJECT = Object(null); - -new TestCase( SECTION, "Object(null).valueOf()", NULL_OBJECT, (NULL_OBJECT).valueOf() ); -new TestCase( SECTION, "typeof Object(null)", "object", typeof (Object(null)) ); - -var UNDEFINED_OBJECT = Object( void 0 ); - -new TestCase( SECTION, "Object(void 0).valueOf()", UNDEFINED_OBJECT, (UNDEFINED_OBJECT).valueOf() ); -new TestCase( SECTION, "typeof Object(void 0)", "object", typeof (Object(void 0)) ); - -new TestCase( SECTION, "Object(true).valueOf()", true, (Object(true)).valueOf() ); -new TestCase( SECTION, "typeof Object(true)", "object", typeof Object(true) ); -new TestCase( SECTION, "var MYOB = Object(true); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Boolean]", eval("var MYOB = Object(true); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - -new TestCase( SECTION, "Object(false).valueOf()", false, (Object(false)).valueOf() ); -new TestCase( SECTION, "typeof Object(false)", "object", typeof Object(false) ); -new TestCase( SECTION, "var MYOB = Object(false); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Boolean]", eval("var MYOB = Object(false); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - -new TestCase( SECTION, "Object(0).valueOf()", 0, (Object(0)).valueOf() ); -new TestCase( SECTION, "typeof Object(0)", "object", typeof Object(0) ); -new TestCase( SECTION, "var MYOB = Object(0); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Number]", eval("var MYOB = Object(0); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - -new TestCase( SECTION, "Object(-0).valueOf()", -0, (Object(-0)).valueOf() ); -new TestCase( SECTION, "typeof Object(-0)", "object", typeof Object(-0) ); -new TestCase( SECTION, "var MYOB = Object(-0); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Number]", eval("var MYOB = Object(-0); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - -new TestCase( SECTION, "Object(1).valueOf()", 1, (Object(1)).valueOf() ); -new TestCase( SECTION, "typeof Object(1)", "object", typeof Object(1) ); -new TestCase( SECTION, "var MYOB = Object(1); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Number]", eval("var MYOB = Object(1); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - -new TestCase( SECTION, "Object(-1).valueOf()", -1, (Object(-1)).valueOf() ); -new TestCase( SECTION, "typeof Object(-1)", "object", typeof Object(-1) ); -new TestCase( SECTION, "var MYOB = Object(-1); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Number]", eval("var MYOB = Object(-1); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - -new TestCase( SECTION, "Object(Number.MAX_VALUE).valueOf()", 1.7976931348623157e308, (Object(Number.MAX_VALUE)).valueOf() ); -new TestCase( SECTION, "typeof Object(Number.MAX_VALUE)", "object", typeof Object(Number.MAX_VALUE) ); -new TestCase( SECTION, "var MYOB = Object(Number.MAX_VALUE); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Number]", eval("var MYOB = Object(Number.MAX_VALUE); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - -new TestCase( SECTION, "Object(Number.MIN_VALUE).valueOf()", 5e-324, (Object(Number.MIN_VALUE)).valueOf() ); -new TestCase( SECTION, "typeof Object(Number.MIN_VALUE)", "object", typeof Object(Number.MIN_VALUE) ); -new TestCase( SECTION, "var MYOB = Object(Number.MIN_VALUE); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Number]", eval("var MYOB = Object(Number.MIN_VALUE); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - -new TestCase( SECTION, "Object(Number.POSITIVE_INFINITY).valueOf()", Number.POSITIVE_INFINITY, (Object(Number.POSITIVE_INFINITY)).valueOf() ); -new TestCase( SECTION, "typeof Object(Number.POSITIVE_INFINITY)", "object", typeof Object(Number.POSITIVE_INFINITY) ); -new TestCase( SECTION, "var MYOB = Object(Number.POSITIVE_INFINITY); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Number]", eval("var MYOB = Object(Number.POSITIVE_INFINITY); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - -new TestCase( SECTION, "Object(Number.NEGATIVE_INFINITY).valueOf()", Number.NEGATIVE_INFINITY, (Object(Number.NEGATIVE_INFINITY)).valueOf() ); -new TestCase( SECTION, "typeof Object(Number.NEGATIVE_INFINITY)", "object", typeof Object(Number.NEGATIVE_INFINITY) ); -new TestCase( SECTION, "var MYOB = Object(Number.NEGATIVE_INFINITY); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Number]", eval("var MYOB = Object(Number.NEGATIVE_INFINITY); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - -new TestCase( SECTION, "Object(Number.NaN).valueOf()", Number.NaN, (Object(Number.NaN)).valueOf() ); -new TestCase( SECTION, "typeof Object(Number.NaN)", "object", typeof Object(Number.NaN) ); -new TestCase( SECTION, "var MYOB = Object(Number.NaN); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Number]", eval("var MYOB = Object(Number.NaN); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - -new TestCase( SECTION, "Object('a string').valueOf()", "a string", (Object("a string")).valueOf() ); -new TestCase( SECTION, "typeof Object('a string')", "object", typeof (Object("a string")) ); -new TestCase( SECTION, "var MYOB = Object('a string'); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object String]", eval("var MYOB = Object('a string'); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - -new TestCase( SECTION, "Object('').valueOf()", "", (Object("")).valueOf() ); -new TestCase( SECTION, "typeof Object('')", "object", typeof (Object("")) ); -new TestCase( SECTION, "var MYOB = Object(''); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object String]", eval("var MYOB = Object(''); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - -new TestCase( SECTION, "Object('\\r\\t\\b\\n\\v\\f').valueOf()", "\r\t\b\n\v\f", (Object("\r\t\b\n\v\f")).valueOf() ); -new TestCase( SECTION, "typeof Object('\\r\\t\\b\\n\\v\\f')", "object", typeof (Object("\\r\\t\\b\\n\\v\\f")) ); -new TestCase( SECTION, "var MYOB = Object('\\r\\t\\b\\n\\v\\f'); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object String]", eval("var MYOB = Object('\\r\\t\\b\\n\\v\\f'); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - -new TestCase( SECTION, "Object( '\\\'\\\"\\' ).valueOf()", "\'\"\\", (Object("\'\"\\")).valueOf() ); -new TestCase( SECTION, "typeof Object( '\\\'\\\"\\' )", "object", typeof Object("\'\"\\") ); -// new TestCase( SECTION, "var MYOB = Object( '\\\'\\\"\\' ); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object String]", eval("var MYOB = Object( '\\\'\\\"\\' ); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.1.2.js b/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.1.2.js deleted file mode 100644 index 9e41594430..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.1.2.js +++ /dev/null @@ -1,81 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.2.1.2.js'; - -/** - File Name: 15.2.1.2.js - ECMA Section: 15.2.1.2 The Object Constructor Called as a Function: - Object(value) - Description: When Object is called as a function rather than as a - constructor, the following steps are taken: - - 1. If value is null or undefined, create and return a - new object with no proerties other than internal - properties exactly as if the object constructor - had been called on that same value (15.2.2.1). - 2. Return ToObject (value), whose rules are: - - undefined generate a runtime error - null generate a runtime error - boolean create a new Boolean object whose default - value is the value of the boolean. - number Create a new Number object whose default - value is the value of the number. - string Create a new String object whose default - value is the value of the string. - object Return the input argument (no conversion). - - Author: christine@netscape.com - Date: 17 july 1997 -*/ - -var SECTION = "15.2.1.2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Object()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var MYOB = Object(); - -new TestCase( SECTION, "var MYOB = Object(); MYOB.valueOf()", MYOB, MYOB.valueOf() ); -new TestCase( SECTION, "typeof Object()", "object", typeof (Object(null)) ); -new TestCase( SECTION, "var MYOB = Object(); MYOB.toString()", "[object Object]", eval("var MYOB = Object(); MYOB.toString()") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.2.1.js b/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.2.1.js deleted file mode 100644 index dfdfaeb4ab..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.2.1.js +++ /dev/null @@ -1,138 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.2.2.1.js'; - -/** - File Name: 15.2.2.1.js - ECMA Section: 15.2.2.1 The Object Constructor: new Object( value ) - - 1.If the type of the value is not Object, go to step 4. - 2.If the value is a native ECMAScript object, do not create a new object; simply return value. - 3.If the value is a host object, then actions are taken and a result is returned in an - implementation-dependent manner that may depend on the host object. - 4.If the type of the value is String, return ToObject(value). - 5.If the type of the value is Boolean, return ToObject(value). - 6.If the type of the value is Number, return ToObject(value). - 7.(The type of the value must be Null or Undefined.) Create a new native ECMAScript object. - The [[Prototype]] property of the newly constructed object is set to the Object prototype object. - The [[Class]] property of the newly constructed object is set to "Object". - The newly constructed object has no [[Value]] property. - Return the newly created native object. - - Description: This does not test cases where the object is a host object. - Author: christine@netscape.com - Date: 7 october 1997 -*/ - -var SECTION = "15.2.2.1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "new Object( value )"; - -writeHeaderToLog( SECTION + " "+ TITLE); - - -new TestCase( SECTION, "typeof new Object(null)", "object", typeof new Object(null) ); -new TestCase( SECTION, "MYOB = new Object(null); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Object]", eval("MYOB = new Object(null); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - -new TestCase( SECTION, "typeof new Object(void 0)", "object", typeof new Object(void 0) ); -new TestCase( SECTION, "MYOB = new Object(new Object(void 0)); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Object]", eval("MYOB = new Object(new Object(void 0)); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); - -new TestCase( SECTION, "typeof new Object('string')", "object", typeof new Object('string') ); -new TestCase( SECTION, "MYOB = (new Object('string'); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object String]", eval("MYOB = new Object('string'); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); -new TestCase( SECTION, "(new Object('string').valueOf()", "string", (new Object('string')).valueOf() ); - -new TestCase( SECTION, "typeof new Object('')", "object", typeof new Object('') ); -new TestCase( SECTION, "MYOB = (new Object(''); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object String]", eval("MYOB = new Object(''); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); -new TestCase( SECTION, "(new Object('').valueOf()", "", (new Object('')).valueOf() ); - -new TestCase( SECTION, "typeof new Object(Number.NaN)", "object", typeof new Object(Number.NaN) ); -new TestCase( SECTION, "MYOB = (new Object(Number.NaN); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Number]", eval("MYOB = new Object(Number.NaN); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); -new TestCase( SECTION, "(new Object(Number.NaN).valueOf()", Number.NaN, (new Object(Number.NaN)).valueOf() ); - -new TestCase( SECTION, "typeof new Object(0)", "object", typeof new Object(0) ); -new TestCase( SECTION, "MYOB = (new Object(0); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Number]", eval("MYOB = new Object(0); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); -new TestCase( SECTION, "(new Object(0).valueOf()", 0, (new Object(0)).valueOf() ); - -new TestCase( SECTION, "typeof new Object(-0)", "object", typeof new Object(-0) ); -new TestCase( SECTION, "MYOB = (new Object(-0); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Number]", eval("MYOB = new Object(-0); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); -new TestCase( SECTION, "(new Object(-0).valueOf()", -0, (new Object(-0)).valueOf() ); - -new TestCase( SECTION, "typeof new Object(1)", "object", typeof new Object(1) ); -new TestCase( SECTION, "MYOB = (new Object(1); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Number]", eval("MYOB = new Object(1); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); -new TestCase( SECTION, "(new Object(1).valueOf()", 1, (new Object(1)).valueOf() ); - -new TestCase( SECTION, "typeof new Object(-1)", "object", typeof new Object(-1) ); -new TestCase( SECTION, "MYOB = (new Object(-1); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Number]", eval("MYOB = new Object(-1); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); -new TestCase( SECTION, "(new Object(-1).valueOf()", -1, (new Object(-1)).valueOf() ); - -new TestCase( SECTION, "typeof new Object(true)", "object", typeof new Object(true) ); -new TestCase( SECTION, "MYOB = (new Object(true); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Boolean]", eval("MYOB = new Object(true); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); -new TestCase( SECTION, "(new Object(true).valueOf()", true, (new Object(true)).valueOf() ); - -new TestCase( SECTION, "typeof new Object(false)", "object", typeof new Object(false) ); -new TestCase( SECTION, "MYOB = (new Object(false); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Boolean]", eval("MYOB = new Object(false); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); -new TestCase( SECTION, "(new Object(false).valueOf()", false, (new Object(false)).valueOf() ); - -new TestCase( SECTION, "typeof new Object(Boolean())", "object", typeof new Object(Boolean()) ); -new TestCase( SECTION, "MYOB = (new Object(Boolean()); MYOB.toString = Object.prototype.toString; MYOB.toString()", "[object Boolean]", eval("MYOB = new Object(Boolean()); MYOB.toString = Object.prototype.toString; MYOB.toString()") ); -new TestCase( SECTION, "(new Object(Boolean()).valueOf()", Boolean(), (new Object(Boolean())).valueOf() ); - - -var myglobal = this; -var myobject = new Object( "my new object" ); -var myarray = new Array(); -var myboolean = new Boolean(); -var mynumber = new Number(); -var mystring = new String(); -var myobject = new Object(); -var myfunction = new Function( "x", "return x"); -var mymath = Math; - -new TestCase( SECTION, "myglobal = new Object( this )", myglobal, new Object(this) ); -new TestCase( SECTION, "myobject = new Object('my new object'); new Object(myobject)", myobject, new Object(myobject) ); -new TestCase( SECTION, "myarray = new Array(); new Object(myarray)", myarray, new Object(myarray) ); -new TestCase( SECTION, "myboolean = new Boolean(); new Object(myboolean)", myboolean, new Object(myboolean) ); -new TestCase( SECTION, "mynumber = new Number(); new Object(mynumber)", mynumber, new Object(mynumber) ); -new TestCase( SECTION, "mystring = new String9); new Object(mystring)", mystring, new Object(mystring) ); -new TestCase( SECTION, "myobject = new Object(); new Object(mynobject)", myobject, new Object(myobject) ); -new TestCase( SECTION, "myfunction = new Function(); new Object(myfunction)", myfunction, new Object(myfunction) ); -new TestCase( SECTION, "mymath = Math; new Object(mymath)", mymath, new Object(mymath) ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.2.2.js b/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.2.2.js deleted file mode 100644 index 2a5743a826..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.2.2.js +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.2.2.2.js'; - -/** - File Name: 15.2.2.2.js - ECMA Section: 15.2.2.2 new Object() - Description: - - When the Object constructor is called with no argument, the following - step is taken: - - 1. Create a new native ECMAScript object. - The [[Prototype]] property of the newly constructed object is set to - the Object prototype object. - - The [[Class]] property of the newly constructed object is set - to "Object". - - The newly constructed object has no [[Value]] property. - - Return the newly created native object. - - Author: christine@netscape.com - Date: 7 october 1997 -*/ -var SECTION = "15.2.2.2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "new Object()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "typeof new Object()", "object", typeof new Object() ); -new TestCase( SECTION, "Object.prototype.toString()", "[object Object]", Object.prototype.toString() ); -new TestCase( SECTION, "(new Object()).toString()", "[object Object]", (new Object()).toString() ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.3-1.js b/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.3-1.js deleted file mode 100644 index 5242d7e6a5..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.3-1.js +++ /dev/null @@ -1,64 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.2.3-1.js'; - -/** - File Name: 15.2.3-1.js - ECMA Section: 15.2.3 Properties of the Object Constructor - - Description: The value of the internal [[Prototype]] property of the - Object constructor is the Function prototype object. - - Besides the call and construct propreties and the length - property, the Object constructor has properties described - in 15.2.3.1. - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ -var SECTION = "15.2.3"; -var VERSION = "ECMA_2"; -startTest(); - -writeHeaderToLog( SECTION + " Properties of the Object Constructor"); - -new TestCase( SECTION, "Object.length", 1, Object.length ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.3.1-1.js b/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.3.1-1.js deleted file mode 100644 index 39510b6b22..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.3.1-1.js +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.2.3.1-1.js'; - -/** - File Name: 15.2.3.1-1.js - ECMA Section: 15.2.3.1 Object.prototype - - Description: The initial value of Object.prototype is the built-in - Object prototype object. - - This property shall have the attributes [ DontEnum, - DontDelete ReadOnly ] - - This tests the [DontEnum] property of Object.prototype - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ -var SECTION = "15.2.3.1-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Object.prototype"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "var str = '';for ( p in Object ) { str += p; }; str", - "", - eval( "var str = ''; for ( p in Object ) { str += p; }; str" ) ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.3.1-2.js b/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.3.1-2.js deleted file mode 100644 index a92739f2d1..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.3.1-2.js +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.2.3.1-2.js'; - -/** - File Name: 15.2.3.1-2.js - ECMA Section: 15.2.3.1 Object.prototype - - Description: The initial value of Object.prototype is the built-in - Object prototype object. - - This property shall have the attributes [ DontEnum, - DontDelete ReadOnly ] - - This tests the [DontDelete] property of Object.prototype - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ - -var SECTION = "15.2.3.1-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Object.prototype"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "delete( Object.prototype )", - false, - eval("delete( Object.prototype )") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.3.1-3.js b/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.3.1-3.js deleted file mode 100644 index 0a82c6cd02..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.3.1-3.js +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.2.3.1-3.js'; - -/** - File Name: 15.2.3.1-3.js - ECMA Section: 15.2.3.1 Object.prototype - - Description: The initial value of Object.prototype is the built-in - Object prototype object. - - This property shall have the attributes [ DontEnum, - DontDelete ReadOnly ] - - This tests the [ReadOnly] property of Object.prototype - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ - -var SECTION = "15.2.3.1-3"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Object.prototype"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "Object.prototype = null; Object.prototype", - Object.prototype, - eval("Object.prototype = null; Object.prototype")); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.3.1-4.js b/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.3.1-4.js deleted file mode 100644 index 86be98e1ad..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.3.1-4.js +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.2.3.1-4.js'; - -/** - File Name: 15.2.3.1-4.js - ECMA Section: 15.2.3.1 Object.prototype - - Description: The initial value of Object.prototype is the built-in - Object prototype object. - - This property shall have the attributes [ DontEnum, - DontDelete ReadOnly ] - - This tests the [DontDelete] property of Object.prototype - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ - -var SECTION = "15.2.3.1-4"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Object.prototype"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "delete( Object.prototype ); Object.prototype", - Object.prototype, - eval("delete(Object.prototype); Object.prototype") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.3.js b/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.3.js deleted file mode 100644 index 70a9605c2e..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.3.js +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.2.3.js'; - -/** - File Name: 15.2.3.js - ECMA Section: 15.2.3 Properties of the Object Constructor - - Description: The value of the internal [[Prototype]] property of the - Object constructor is the Function prototype object. - - Besides the call and construct propreties and the length - property, the Object constructor has properties described - in 15.2.3.1. - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ - -var SECTION = "15.2.3"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Properties of the Object Constructor"; - -writeHeaderToLog( SECTION + " " + TITLE); - -// new TestCase( SECTION, "Object.__proto__", Function.prototype, Object.__proto__ ); -new TestCase( SECTION, "Object.length", 1, Object.length ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.4.1.js b/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.4.1.js deleted file mode 100644 index bff668f43c..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.4.1.js +++ /dev/null @@ -1,64 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.2.4.1.js'; - -/** - File Name: 15.2.4.1.js - ECMA Section: 15.2.4 Object.prototype.constructor - - Description: The initial value of the Object.prototype.constructor - is the built-in Object constructor. - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ -var SECTION = "15.2.4.1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Object.prototype.constructor"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "Object.prototype.constructor", - Object, - Object.prototype.constructor ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.4.2.js b/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.4.2.js deleted file mode 100644 index c52a825bb8..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.4.2.js +++ /dev/null @@ -1,130 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.2.4.2.js'; - -/** - File Name: 15.2.4.2.js - ECMA Section: 15.2.4.2 Object.prototype.toString() - - Description: When the toString method is called, the following - steps are taken: - 1. Get the [[Class]] property of this object - 2. Call ToString( Result(1) ) - 3. Compute a string value by concatenating the three - strings "[object " + Result(2) + "]" - 4. Return Result(3). - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ -var SECTION = "15.2.4.2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Object.prototype.toString()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "(new Object()).toString()", "[object Object]", (new Object()).toString() ); - -new TestCase( SECTION, "myvar = this; myvar.toString = Object.prototype.toString; myvar.toString()", - GLOBAL.replace(/ @ 0x[0-9a-fA-F]+ \(native @ 0x[0-9a-fA-F]+\)/, ''), - eval("myvar = this; myvar.toString = Object.prototype.toString; myvar.toString()") - ); - -new TestCase( SECTION, "myvar = MyObject; myvar.toString = Object.prototype.toString; myvar.toString()", - "[object Function]", - eval("myvar = MyObject; myvar.toString = Object.prototype.toString; myvar.toString()") ); - -new TestCase( SECTION, "myvar = new MyObject( true ); myvar.toString = Object.prototype.toString; myvar.toString()", - '[object Object]', - eval("myvar = new MyObject( true ); myvar.toString = Object.prototype.toString; myvar.toString()") ); - -new TestCase( SECTION, "myvar = new Number(0); myvar.toString = Object.prototype.toString; myvar.toString()", - "[object Number]", - eval("myvar = new Number(0); myvar.toString = Object.prototype.toString; myvar.toString()") ); - -new TestCase( SECTION, "myvar = new String(''); myvar.toString = Object.prototype.toString; myvar.toString()", - "[object String]", - eval("myvar = new String(''); myvar.toString = Object.prototype.toString; myvar.toString()") ); - -new TestCase( SECTION, "myvar = Math; myvar.toString = Object.prototype.toString; myvar.toString()", - "[object Math]", - eval("myvar = Math; myvar.toString = Object.prototype.toString; myvar.toString()") ); - -new TestCase( SECTION, "myvar = new Function(); myvar.toString = Object.prototype.toString; myvar.toString()", - "[object Function]", - eval("myvar = new Function(); myvar.toString = Object.prototype.toString; myvar.toString()") ); - -new TestCase( SECTION, "myvar = new Array(); myvar.toString = Object.prototype.toString; myvar.toString()", - "[object Array]", - eval("myvar = new Array(); myvar.toString = Object.prototype.toString; myvar.toString()") ); - -new TestCase( SECTION, "myvar = new Boolean(); myvar.toString = Object.prototype.toString; myvar.toString()", - "[object Boolean]", - eval("myvar = new Boolean(); myvar.toString = Object.prototype.toString; myvar.toString()") ); - -new TestCase( SECTION, "myvar = new Date(); myvar.toString = Object.prototype.toString; myvar.toString()", - "[object Date]", - eval("myvar = new Date(); myvar.toString = Object.prototype.toString; myvar.toString()") ); - -new TestCase( SECTION, "var MYVAR = new Object( this ); MYVAR.toString()", - GLOBAL.replace(/ @ 0x[0-9a-fA-F]+ \(native @ 0x[0-9a-fA-F]+\)/, ''), - eval("var MYVAR = new Object( this ); MYVAR.toString()") - ); - -new TestCase( SECTION, "var MYVAR = new Object(); MYVAR.toString()", - "[object Object]", - eval("var MYVAR = new Object(); MYVAR.toString()") ); - -new TestCase( SECTION, "var MYVAR = new Object(void 0); MYVAR.toString()", - "[object Object]", - eval("var MYVAR = new Object(void 0); MYVAR.toString()") ); - -new TestCase( SECTION, "var MYVAR = new Object(null); MYVAR.toString()", - "[object Object]", - eval("var MYVAR = new Object(null); MYVAR.toString()") ); - - -function MyObject( value ) { - this.value = new Function( "return this.value" ); - this.toString = new Function ( "return this.value+''"); -} - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.4.3.js b/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.4.3.js deleted file mode 100644 index 17c4558679..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/15.2.4.3.js +++ /dev/null @@ -1,117 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.2.4.3.js'; - -/** - File Name: 15.2.4.3.js - ECMA Section: 15.2.4.3 Object.prototype.valueOf() - - Description: As a rule, the valueOf method for an object simply - returns the object; but if the object is a "wrapper" - for a host object, as may perhaps be created by the - Object constructor, then the contained host object - should be returned. - - This only covers native objects. - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ -var SECTION = "15.2.4.3"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Object.prototype.valueOf()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - - -var myarray = new Array(); -myarray.valueOf = Object.prototype.valueOf; -var myboolean = new Boolean(); -myboolean.valueOf = Object.prototype.valueOf; -var myfunction = new Function(); -myfunction.valueOf = Object.prototype.valueOf; -var myobject = new Object(); -myobject.valueOf = Object.prototype.valueOf; -var mymath = Math; -mymath.valueOf = Object.prototype.valueOf; -var mydate = new Date(); -mydate.valueOf = Object.prototype.valueOf; -var mynumber = new Number(); -mynumber.valueOf = Object.prototype.valueOf; -var mystring = new String(); -mystring.valueOf = Object.prototype.valueOf; - -new TestCase( SECTION, "Object.prototype.valueOf.length", 0, Object.prototype.valueOf.length ); - -new TestCase( SECTION, - "myarray = new Array(); myarray.valueOf = Object.prototype.valueOf; myarray.valueOf()", - myarray, - myarray.valueOf() ); -new TestCase( SECTION, - "myboolean = new Boolean(); myboolean.valueOf = Object.prototype.valueOf; myboolean.valueOf()", - myboolean, - myboolean.valueOf() ); -new TestCase( SECTION, - "myfunction = new Function(); myfunction.valueOf = Object.prototype.valueOf; myfunction.valueOf()", - myfunction, - myfunction.valueOf() ); -new TestCase( SECTION, - "myobject = new Object(); myobject.valueOf = Object.prototype.valueOf; myobject.valueOf()", - myobject, - myobject.valueOf() ); -new TestCase( SECTION, - "mymath = Math; mymath.valueOf = Object.prototype.valueOf; mymath.valueOf()", - mymath, - mymath.valueOf() ); -new TestCase( SECTION, - "mynumber = new Number(); mynumber.valueOf = Object.prototype.valueOf; mynumber.valueOf()", - mynumber, - mynumber.valueOf() ); -new TestCase( SECTION, - "mystring = new String(); mystring.valueOf = Object.prototype.valueOf; mystring.valueOf()", - mystring, - mystring.valueOf() ); -new TestCase( SECTION, - "mydate = new Date(); mydate.valueOf = Object.prototype.valueOf; mydate.valueOf()", - mydate, - mydate.valueOf() ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/browser.js b/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/browser.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/shell.js b/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/shell.js deleted file mode 100644 index 1a71207967..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/ObjectObjects/shell.js +++ /dev/null @@ -1 +0,0 @@ -gTestsubsuite = 'ObjectObjects'; diff --git a/tests/auto/declarative/parserstress/tests/ecma/README b/tests/auto/declarative/parserstress/tests/ecma/README deleted file mode 100755 index 91f174ab61..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/README +++ /dev/null @@ -1 +0,0 @@ -ECMA 262 Edition 1 diff --git a/tests/auto/declarative/parserstress/tests/ecma/SourceText/6-1.js b/tests/auto/declarative/parserstress/tests/ecma/SourceText/6-1.js deleted file mode 100644 index 487a47e3aa..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/SourceText/6-1.js +++ /dev/null @@ -1,128 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '6-1.js'; - -/** - File Name: 6-1.js - ECMA Section: Source Text - Description: - - ECMAScript source text is represented as a sequence of characters - representable using the Unicode version 2.0 character encoding. - - SourceCharacter :: - any Unicode character - - However, it is possible to represent every ECMAScript program using - only ASCII characters (which are equivalent to the first 128 Unicode - characters). Non-ASCII Unicode characters may appear only within comments - and string literals. In string literals, any Unicode character may also be - expressed as a Unicode escape sequence consisting of six ASCII characters, - namely \u plus four hexadecimal digits. Within a comment, such an escape - sequence is effectively ignored as part of the comment. Within a string - literal, the Unicode escape sequence contributes one character to the string - value of the literal. - - Note that ECMAScript differs from the Java programming language in the - behavior of Unicode escape sequences. In a Java program, if the Unicode escape - sequence \u000A, for example, occurs within a single-line comment, it is - interpreted as a line terminator (Unicode character 000A is line feed) and - therefore the next character is not part of the comment. Similarly, if the - Unicode escape sequence \u000A occurs within a string literal in a Java - program, it is likewise interpreted as a line terminator, which is not - allowed within a string literal-one must write \n instead of \u000A to - cause a line feed to be part of the string value of a string literal. In - an ECMAScript program, a Unicode escape sequence occurring within a comment - is never interpreted and therefore cannot contribute to termination of the - comment. Similarly, a Unicode escape sequence occurring within a string literal - in an ECMAScript program always contributes a character to the string value of - the literal and is never interpreted as a line terminator or as a quote mark - that might terminate the string literal. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "6-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Source Text"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var testcase = new TestCase( SECTION, - "// the following character should not be interpreted as a line terminator in a comment: \u000A", - 'PASSED', - "PASSED" ); - -// \u000A testcase.actual = "FAILED!"; - -testcase = - new TestCase( SECTION, - "// the following character should not be interpreted as a line terminator in a comment: \\n 'FAILED'", - 'PASSED', - 'PASSED' ); - -// the following character should noy be interpreted as a line terminator: \\n testcase.actual = "FAILED" - -testcase = - new TestCase( SECTION, - "// the following character should not be interpreted as a line terminator in a comment: \\u000A 'FAILED'", - 'PASSED', - 'PASSED' ); - -// the following character should not be interpreted as a line terminator: \u000A testcase.actual = "FAILED" - -testcase = - new TestCase( SECTION, - "// the following character should not be interpreted as a line terminator in a comment: \n 'PASSED'", - 'PASSED', - 'PASSED' ); -// the following character should not be interpreted as a line terminator: \n testcase.actual = 'FAILED' - -testcase = - new TestCase( SECTION, - "// the following character should not be interpreted as a line terminator in a comment: u000D", - 'PASSED', - 'PASSED' ); - -// the following character should not be interpreted as a line terminator: \u000D testcase.actual = "FAILED" - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/SourceText/6-2.js b/tests/auto/declarative/parserstress/tests/ecma/SourceText/6-2.js deleted file mode 100644 index 4044308053..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/SourceText/6-2.js +++ /dev/null @@ -1,131 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '6-2.js'; - -/** - File Name: 6-1.js - ECMA Section: Source Text - Description: - - ECMAScript source text is represented as a sequence of characters - representable using the Unicode version 2.0 character encoding. - - SourceCharacter :: - any Unicode character - - However, it is possible to represent every ECMAScript program using - only ASCII characters (which are equivalent to the first 128 Unicode - characters). Non-ASCII Unicode characters may appear only within comments - and string literals. In string literals, any Unicode character may also be - expressed as a Unicode escape sequence consisting of six ASCII characters, - namely \u plus four hexadecimal digits. Within a comment, such an escape - sequence is effectively ignored as part of the comment. Within a string - literal, the Unicode escape sequence contributes one character to the string - value of the literal. - - Note that ECMAScript differs from the Java programming language in the - behavior of Unicode escape sequences. In a Java program, if the Unicode escape - sequence \u000A, for example, occurs within a single-line comment, it is - interpreted as a line terminator (Unicode character 000A is line feed) and - therefore the next character is not part of the comment. Similarly, if the - Unicode escape sequence \u000A occurs within a string literal in a Java - program, it is likewise interpreted as a line terminator, which is not - allowed within a string literal-one must write \n instead of \u000A to - cause a line feed to be part of the string value of a string literal. In - an ECMAScript program, a Unicode escape sequence occurring within a comment - is never interpreted and therefore cannot contribute to termination of the - comment. Similarly, a Unicode escape sequence occurring within a string literal - in an ECMAScript program always contributes a character to the string value of - the literal and is never interpreted as a line terminator or as a quote mark - that might terminate the string literal. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "6-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Source Text"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -// encoded quotes should not end a quote - -new TestCase( SECTION, - "var s = 'PAS\\u0022SED'; s", - "PAS\"SED", - eval("var s = 'PAS\\u0022SED'; s") ); - -new TestCase( SECTION, - 'var s = "PAS\\u0022SED"; s', - "PAS\"SED", - eval('var s = "PAS\\u0022SED"; s') ); - - -new TestCase( SECTION, - "var s = 'PAS\\u0027SED'; s", - "PAS\'SED", - eval("var s = 'PAS\\u0027SED'; s") ); - - -new TestCase( SECTION, - 'var s = "PAS\\u0027SED"; s', - "PAS\'SED", - eval('var s = "PAS\\u0027SED"; s') ); - -var testcase = new TestCase( SECTION, - 'var s="PAS\\u0027SED"; s', - "PAS\'SED", - "" ); -var s = "PAS\u0027SED"; - -testcase.actual = s; - -testcase = new TestCase( SECTION, - 'var s = "PAS\\u0022SED"; s', - "PAS\"SED", - "" ); -var s = "PAS\u0022SED"; - -testcase.actual = s; - - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/SourceText/browser.js b/tests/auto/declarative/parserstress/tests/ecma/SourceText/browser.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/auto/declarative/parserstress/tests/ecma/SourceText/shell.js b/tests/auto/declarative/parserstress/tests/ecma/SourceText/shell.js deleted file mode 100644 index c8f9f02671..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/SourceText/shell.js +++ /dev/null @@ -1 +0,0 @@ -gTestsubsuite = 'SourceText'; diff --git a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.10-1.js b/tests/auto/declarative/parserstress/tests/ecma/Statements/12.10-1.js deleted file mode 100644 index 7cb13789eb..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.10-1.js +++ /dev/null @@ -1,151 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '12.10-1.js'; - -/** - File Name: 12.10-1.js - ECMA Section: 12.10 The with statement - Description: - WithStatement : - with ( Expression ) Statement - - The with statement adds a computed object to the front of the scope chain - of the current execution context, then executes a statement with this - augmented scope chain, then restores the scope chain. - - Semantics - - The production WithStatement : with ( Expression ) Statement is evaluated - as follows: - 1. Evaluate Expression. - 2. Call GetValue(Result(1)). - 3. Call ToObject(Result(2)). - 4. Add Result(3) to the front of the scope chain. - 5. Evaluate Statement using the augmented scope chain from step 4. - 6. Remove Result(3) from the front of the scope chain. - 7. Return Result(5). - - Discussion - Note that no matter how control leaves the embedded Statement, whether - normally or by some form of abrupt completion, the scope chain is always - restored to its former state. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "12.10-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The with statement"; - -writeHeaderToLog( SECTION + " "+ TITLE); - - -// although the scope chain changes, the this value is immutable for a given -// execution context. - -new TestCase( SECTION, - "with( new Number() ) { this +'' }", - GLOBAL, - eval("with( new Number() ) { this +'' }") ); - -// the object's functions and properties should override those of the -// global object. - -new TestCase( - SECTION, - "var MYOB = new WithObject(true); with (MYOB) { parseInt() }", - true, - eval("var MYOB = new WithObject(true); with (MYOB) { parseInt() }") ); - -new TestCase( - SECTION, - "var MYOB = new WithObject(false); with (MYOB) { NaN }", - false, - eval("var MYOB = new WithObject(false); with (MYOB) { NaN }") ); - -new TestCase( - SECTION, - "var MYOB = new WithObject(NaN); with (MYOB) { Infinity }", - Number.NaN, - eval("var MYOB = new WithObject(NaN); with (MYOB) { Infinity }") ); - -new TestCase( - SECTION, - "var MYOB = new WithObject(false); with (MYOB) { }; Infinity", - Number.POSITIVE_INFINITY, - eval("var MYOB = new WithObject(false); with (MYOB) { }; Infinity") ); - - -new TestCase( - SECTION, - "var MYOB = new WithObject(0); with (MYOB) { delete Infinity; Infinity }", - Number.POSITIVE_INFINITY, - eval("var MYOB = new WithObject(0); with (MYOB) { delete Infinity; Infinity }") ); - -// let us leave the with block via a break. - -new TestCase( - SECTION, - "var MYOB = new WithObject(0); while (true) { with (MYOB) { Infinity; break; } } Infinity", - Number.POSITIVE_INFINITY, - eval("var MYOB = new WithObject(0); while (true) { with (MYOB) { Infinity; break; } } Infinity") ); - - -test(); - -function WithObject( value ) { - this.prop1 = 1; - this.prop2 = new Boolean(true); - this.prop3 = "a string"; - this.value = value; - - // now we will override global functions - - this.parseInt = new Function( "return this.value" ); - this.NaN = value; - this.Infinity = value; - this.unescape = new Function( "return this.value" ); - this.escape = new Function( "return this.value" ); - this.eval = new Function( "return this.value" ); - this.parseFloat = new Function( "return this.value" ); - this.isNaN = new Function( "return this.value" ); - this.isFinite = new Function( "return this.value" ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.10.js b/tests/auto/declarative/parserstress/tests/ecma/Statements/12.10.js deleted file mode 100644 index b8d27c64e9..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.10.js +++ /dev/null @@ -1,61 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '12.10.js'; - -/** - File Name: 12.10-1.js - ECMA Section: 12.10 The with statement - Description: - - Author: christine@netscape.com - Date: 11 september 1997 -*/ -var SECTION = "12.10-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The with statement"; - -writeHeaderToLog( SECTION +" "+ TITLE); - -new TestCase( SECTION, - "var x; with (7) x = valueOf(); typeof x;", - "number", - eval("var x; with(7) x = valueOf(); typeof x;") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.2-1.js b/tests/auto/declarative/parserstress/tests/ecma/Statements/12.2-1.js deleted file mode 100644 index d6f3b97f6d..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.2-1.js +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '12.2-1.js'; - -/** - File Name: 12.2-1.js - ECMA Section: The variable statement - Description: - - If the variable statement occurs inside a FunctionDeclaration, the - variables are defined with function-local scope in that function, as - described in section 10.1.3. Otherwise, they are defined with global - scope, that is, they are created as members of the global object, as - described in section 0. Variables are created when the execution scope - is entered. A Block does not define a new execution scope. Only Program and - FunctionDeclaration produce a new scope. Variables are initialized to the - undefined value when created. A variable with an Initializer is assigned - the value of its AssignmentExpression when the VariableStatement is executed, - not when the variable is created. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "12.2-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The variable statement"; - -writeHeaderToLog( SECTION +" "+ TITLE); - -new TestCase( "SECTION", - "var x = 3; function f() { var a = x; var x = 23; return a; }; f()", - void 0, - eval("var x = 3; function f() { var a = x; var x = 23; return a; }; f()") ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.5-1.js b/tests/auto/declarative/parserstress/tests/ecma/Statements/12.5-1.js deleted file mode 100644 index 0745428c4a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.5-1.js +++ /dev/null @@ -1,102 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '12.5-1.js'; - -/** - File Name: 12.5-1.js - ECMA Section: The if statement - Description: - - The production IfStatement : if ( Expression ) Statement else Statement - is evaluated as follows: - - 1.Evaluate Expression. - 2.Call GetValue(Result(1)). - 3.Call ToBoolean(Result(2)). - 4.If Result(3) is false, go to step 7. - 5.Evaluate the first Statement. - 6.Return Result(5). - 7.Evaluate the second Statement. - 8.Return Result(7). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - - -var SECTION = "12.5-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The if statement"; - -writeHeaderToLog( SECTION + " "+ TITLE); - - -new TestCase( SECTION, - "var MYVAR; if ( true ) MYVAR='PASSED'; else MYVAR= 'FAILED';", - "PASSED", - eval("var MYVAR; if ( true ) MYVAR='PASSED'; else MYVAR= 'FAILED';") ); - -new TestCase( SECTION, - "var MYVAR; if ( false ) MYVAR='FAILED'; else MYVAR= 'PASSED';", - "PASSED", - eval("var MYVAR; if ( false ) MYVAR='FAILED'; else MYVAR= 'PASSED';") ); - -new TestCase( SECTION, - "var MYVAR; if ( new Boolean(true) ) MYVAR='PASSED'; else MYVAR= 'FAILED';", - "PASSED", - eval("var MYVAR; if ( new Boolean(true) ) MYVAR='PASSED'; else MYVAR= 'FAILED';") ); - -new TestCase( SECTION, - "var MYVAR; if ( new Boolean(false) ) MYVAR='PASSED'; else MYVAR= 'FAILED';", - "PASSED", - eval("var MYVAR; if ( new Boolean(false) ) MYVAR='PASSED'; else MYVAR= 'FAILED';") ); - -new TestCase( SECTION, - "var MYVAR; if ( 1 ) MYVAR='PASSED'; else MYVAR= 'FAILED';", - "PASSED", - eval("var MYVAR; if ( 1 ) MYVAR='PASSED'; else MYVAR= 'FAILED';") ); - -new TestCase( SECTION, - "var MYVAR; if ( 0 ) MYVAR='FAILED'; else MYVAR= 'PASSED';", - "PASSED", - eval("var MYVAR; if ( 0 ) MYVAR='FAILED'; else MYVAR= 'PASSED';") ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.5-2.js b/tests/auto/declarative/parserstress/tests/ecma/Statements/12.5-2.js deleted file mode 100644 index 143edb0705..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.5-2.js +++ /dev/null @@ -1,99 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '12.5-2.js'; - -/** - File Name: 12.5-2.js - ECMA Section: The if statement - Description: - - The production IfStatement : if ( Expression ) Statement else Statement - is evaluated as follows: - - 1.Evaluate Expression. - 2.Call GetValue(Result(1)). - 3.Call ToBoolean(Result(2)). - 4.If Result(3) is false, go to step 7. - 5.Evaluate the first Statement. - 6.Return Result(5). - 7.Evaluate the second Statement. - 8.Return Result(7). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "12.5-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The if statement" ; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "var MYVAR; if ( true ) MYVAR='PASSED'; MYVAR", - "PASSED", - eval("var MYVAR; if ( true ) MYVAR='PASSED'; MYVAR") ); - -new TestCase( SECTION, - "var MYVAR; if ( false ) MYVAR='FAILED'; MYVAR;", - "PASSED", - eval("var MYVAR=\"PASSED\"; if ( false ) MYVAR='FAILED'; MYVAR;") ); - -new TestCase( SECTION, - "var MYVAR; if ( new Boolean(true) ) MYVAR='PASSED'; MYVAR", - "PASSED", - eval("var MYVAR; if ( new Boolean(true) ) MYVAR='PASSED'; MYVAR") ); - -new TestCase( SECTION, - "var MYVAR; if ( new Boolean(false) ) MYVAR='PASSED'; MYVAR", - "PASSED", - eval("var MYVAR; if ( new Boolean(false) ) MYVAR='PASSED'; MYVAR") ); - -new TestCase( SECTION, - "var MYVAR; if ( 1 ) MYVAR='PASSED'; MYVAR", - "PASSED", - eval("var MYVAR; if ( 1 ) MYVAR='PASSED'; MYVAR") ); - -new TestCase( SECTION, - "var MYVAR; if ( 0 ) MYVAR='FAILED'; MYVAR;", - "PASSED", - eval("var MYVAR=\"PASSED\"; if ( 0 ) MYVAR='FAILED'; MYVAR;") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.1-1.js b/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.1-1.js deleted file mode 100644 index 97b9afaa82..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.1-1.js +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '12.6.1-1.js'; - -/** - File Name: 12.6.1-1.js - ECMA Section: The while statement - Description: - - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "12.6.1-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The While statement"; -writeHeaderToLog( SECTION + " "+ TITLE); - - -new TestCase( SECTION, - "var MYVAR = 0; while( MYVAR++ < 100) { if ( MYVAR < 100 ) break; } MYVAR ", - 1, - eval("var MYVAR = 0; while( MYVAR++ < 100) { if ( MYVAR < 100 ) break; } MYVAR ")); - -new TestCase( SECTION, - "var MYVAR = 0; while( MYVAR++ < 100) { if ( MYVAR < 100 ) continue; else break; } MYVAR ", - 100, - eval("var MYVAR = 0; while( MYVAR++ < 100) { if ( MYVAR < 100 ) continue; else break; } MYVAR ")); - -new TestCase( SECTION, - "function MYFUN( arg1 ) { while ( arg1++ < 100 ) { if ( arg1 < 100 ) return arg1; } }; MYFUN(1)", - 2, - eval("function MYFUN( arg1 ) { while ( arg1++ < 100 ) { if ( arg1 < 100 ) return arg1; } }; MYFUN(1)")); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.2-1.js b/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.2-1.js deleted file mode 100644 index 2ef9378f5a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.2-1.js +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '12.6.2-1.js'; - -/** - File Name: 12.6.2-1.js - ECMA Section: 12.6.2 The for Statement - - 1. first expression is not present. - 2. second expression is not present - 3. third expression is not present - - - Author: christine@netscape.com - Date: 15 september 1997 -*/ - -var SECTION = "12.6.2-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The for statement"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( "12.6.2-1", "for statement", 99, testprogram() ); - -test(); - - -function testprogram() { - myVar = 0; - - for ( ; ; ) { - if ( ++myVar == 99 ) - break; - } - - return myVar; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.2-2.js b/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.2-2.js deleted file mode 100644 index cc8676cd29..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.2-2.js +++ /dev/null @@ -1,76 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '12.6.2-2.js'; - -/** - File Name: 12.6.2-2.js - ECMA Section: 12.6.2 The for Statement - - 1. first expression is not present. - 2. second expression is not present - 3. third expression is present - - - Author: christine@netscape.com - Date: 15 september 1997 -*/ -var SECTION = "12.6.2-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The for statement"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "for statement", 99, testprogram() ); - -test(); - -function testprogram() { - myVar = 0; - - for ( ; ; myVar++ ) { - if ( myVar < 99 ) { - continue; - } else { - break; - } - } - - return myVar; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.2-3.js b/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.2-3.js deleted file mode 100644 index a16b7aa18e..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.2-3.js +++ /dev/null @@ -1,72 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '12.6.2-3.js'; - -/** - File Name: 12.6.2-3.js - ECMA Section: 12.6.2 The for Statement - - 1. first expression is not present. - 2. second expression is present - 3. third expression is present - - - Author: christine@netscape.com - Date: 15 september 1997 -*/ -var SECTION = "12.6.2-3"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The for statement"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "for statement", 100, testprogram() ); - -test(); - -function testprogram() { - myVar = 0; - - for ( ; myVar < 100 ; myVar++ ) { - continue; - } - - return myVar; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.2-4.js b/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.2-4.js deleted file mode 100644 index 6b1500d3a4..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.2-4.js +++ /dev/null @@ -1,72 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '12.6.2-4.js'; - -/** - File Name: 12.6.2-4.js - ECMA Section: 12.6.2 The for Statement - - 1. first expression is not present. - 2. second expression is present - 3. third expression is present - - - Author: christine@netscape.com - Date: 15 september 1997 -*/ - -var SECTION = "12.6.2-4"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The for statement"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "for statement", 100, testprogram() ); - -test(); - -function testprogram() { - myVar = 0; - - for ( ; myVar < 100 ; myVar++ ) { - } - - return myVar; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.2-5.js b/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.2-5.js deleted file mode 100644 index a6f86ecc88..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.2-5.js +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '12.6.2-5.js'; - -/** - File Name: 12.6.2-5.js - ECMA Section: 12.6.2 The for Statement - - 1. first expression is not present. - 2. second expression is present - 3. third expression is present - - - Author: christine@netscape.com - Date: 15 september 1997 -*/ -var SECTION = "12.6.2-5"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The for statement"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "for statement", 99, testprogram() ); - -test(); - -function testprogram() { - myVar = 0; - - for ( ; myVar < 100 ; myVar++ ) { - if (myVar == 99) - break; - } - - return myVar; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.2-6.js b/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.2-6.js deleted file mode 100644 index 48a4e2e607..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.2-6.js +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '12.6.2-6.js'; - -/** - File Name: 12.6.2-6.js - ECMA Section: 12.6.2 The for Statement - - 1. first expression is present. - 2. second expression is not present - 3. third expression is present - - - Author: christine@netscape.com - Date: 15 september 1997 -*/ -var SECTION = "12.6.2-6"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The for statement"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( "12.6.2-6", "for statement", 256, testprogram() ); - -test(); - -function testprogram() { - var myVar; - - for ( myVar=2; ; myVar *= myVar ) { - - if (myVar > 100) - break; - continue; - } - - return myVar; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.2-7.js b/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.2-7.js deleted file mode 100644 index a14ced0497..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.2-7.js +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '12.6.2-7.js'; - -/** - File Name: 12.6.2-7.js - ECMA Section: 12.6.2 The for Statement - - 1. first expression is present. - 2. second expression is not present - 3. third expression is present - - - Author: christine@netscape.com - Date: 15 september 1997 -*/ -var SECTION = "12.6.2-7"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The for statement"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "for statement", 256, testprogram() ); - -test(); - -function testprogram() { - var myVar; - - for ( myVar=2; myVar < 100 ; myVar *= myVar ) { - - continue; - } - - return myVar; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.2-8.js b/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.2-8.js deleted file mode 100644 index 73d931d838..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.2-8.js +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '12.6.2-8.js'; - -/** - File Name: 12.6.2-8.js - ECMA Section: 12.6.2 The for Statement - - 1. first expression is present. - 2. second expression is present - 3. third expression is present - - - Author: christine@netscape.com - Date: 15 september 1997 -*/ -var SECTION = "12.6.2-8"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The for statement"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "for statement", 256, testprogram() ); - -test(); - -function testprogram() { - var myVar; - - for ( myVar=2; myVar < 256; myVar *= myVar ) { - } - - return myVar; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.2-9-n.js b/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.2-9-n.js deleted file mode 100644 index 3e2f942a22..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.2-9-n.js +++ /dev/null @@ -1,76 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '12.6.2-9-n.js'; - -/** - File Name: 12.6.2-9-n.js - ECMA Section: 12.6.2 The for Statement - - 1. first expression is not present. - 2. second expression is not present - 3. third expression is not present - - - Author: christine@netscape.com - Date: 15 september 1997 -*/ - - -var SECTION = "12.6.2-9-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The for statement"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "for (i)"; -EXPECTED = "error"; - -new TestCase( SECTION, - "for (i)", - "error", - eval("for (i) { }") ); - -/* - for (i) { - } - -*/ -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-1.js b/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-1.js deleted file mode 100644 index 6e23b84a48..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-1.js +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '12.6.3-1.js'; - -/** - File Name: 12.6.3-1.js - ECMA Section: 12.6.3 The for...in Statement - Description: - - Author: christine@netscape.com - Date: 11 september 1997 -*/ - -var SECTION = "12.6.3-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The for..in statement"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "var x; Number.prototype.foo = 34; for ( j in 7 ) x = j; x", - "foo", - eval("var x; Number.prototype.foo = 34; for ( j in 7 ){x = j;} x") ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-10.js b/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-10.js deleted file mode 100644 index 0e74f14ece..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-10.js +++ /dev/null @@ -1,115 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '12.6.3-10.js'; - -/** - File Name: 12.6.3-10.js - ECMA Section: 12.6.3 The for...in Statement - Description: - The production IterationStatement : for ( LeftHandSideExpression in Expression ) - Statement is evaluated as follows: - - 1. Evaluate the Expression. - 2. Call GetValue(Result(1)). - 3. Call ToObject(Result(2)). - 4. Let C be "normal completion". - 5. Get the name of the next property of Result(3) that doesn't have the - DontEnum attribute. If there is no such property, go to step 14. - 6. Evaluate the LeftHandSideExpression (it may be evaluated repeatedly). - 7. Call PutValue(Result(6), Result(5)). PutValue( V, W ): - 1. If Type(V) is not Reference, generate a runtime error. - 2. Call GetBase(V). - 3. If Result(2) is null, go to step 6. - 4. Call the [[Put]] method of Result(2), passing GetPropertyName(V) - for the property name and W for the value. - 5. Return. - 6. Call the [[Put]] method for the global object, passing - GetPropertyName(V) for the property name and W for the value. - 7. Return. - 8. Evaluate Statement. - 9. If Result(8) is a value completion, change C to be "normal completion - after value V" where V is the value carried by Result(8). - 10. If Result(8) is a break completion, go to step 14. - 11. If Result(8) is a continue completion, go to step 5. - 12. If Result(8) is a return completion, return Result(8). - 13. Go to step 5. - 14. Return C. - - Author: christine@netscape.com - Date: 11 september 1997 -*/ -var SECTION = "12.6.3-10"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The for..in statement"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -// for ( LeftHandSideExpression in Expression ) -// LeftHandSideExpression:NewExpression:MemberExpression - -var count = 0; -function f() { count++; return new Array("h","e","l","l","o"); } - -var result = ""; -for ( p in f() ) { result += f()[p] }; - -new TestCase( SECTION, - "count = 0; result = \"\"; "+ - "function f() { count++; return new Array(\"h\",\"e\",\"l\",\"l\",\"o\"); }"+ - "for ( p in f() ) { result += f()[p] }; count", - 6, - count ); - -new TestCase( SECTION, - "result", - "hello", - result ); - -// LeftHandSideExpression:NewExpression:MemberExpression [ Expression ] -// LeftHandSideExpression:NewExpression:MemberExpression . Identifier -// LeftHandSideExpression:NewExpression:new MemberExpression Arguments -// LeftHandSideExpression:NewExpression:PrimaryExpression:( Expression ) -// LeftHandSideExpression:CallExpression:MemberExpression Arguments -// LeftHandSideExpression:CallExpression Arguments -// LeftHandSideExpression:CallExpression [ Expression ] -// LeftHandSideExpression:CallExpression . Identifier - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-11.js b/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-11.js deleted file mode 100644 index efc65ee14e..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-11.js +++ /dev/null @@ -1,98 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '12.6.3-11.js'; - -/** - File Name: 12.6.3-11.js - ECMA Section: 12.6.3 The for...in Statement - Description: - The production IterationStatement : for ( LeftHandSideExpression in Expression ) - Statement is evaluated as follows: - - 1. Evaluate the Expression. - 2. Call GetValue(Result(1)). - 3. Call ToObject(Result(2)). - 4. Let C be "normal completion". - 5. Get the name of the next property of Result(3) that doesn't have the - DontEnum attribute. If there is no such property, go to step 14. - 6. Evaluate the LeftHandSideExpression (it may be evaluated repeatedly). - 7. Call PutValue(Result(6), Result(5)). PutValue( V, W ): - 1. If Type(V) is not Reference, generate a runtime error. - 2. Call GetBase(V). - 3. If Result(2) is null, go to step 6. - 4. Call the [[Put]] method of Result(2), passing GetPropertyName(V) - for the property name and W for the value. - 5. Return. - 6. Call the [[Put]] method for the global object, passing - GetPropertyName(V) for the property name and W for the value. - 7. Return. - 8. Evaluate Statement. - 9. If Result(8) is a value completion, change C to be "normal completion - after value V" where V is the value carried by Result(8). - 10. If Result(8) is a break completion, go to step 14. - 11. If Result(8) is a continue completion, go to step 5. - 12. If Result(8) is a return completion, return Result(8). - 13. Go to step 5. - 14. Return C. - - Author: christine@netscape.com - Date: 11 september 1997 -*/ -var SECTION = "12.6.3-11"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The for..in statement"; - -writeHeaderToLog( SECTION + " "+ TITLE); - - -// 5. Get the name of the next property of Result(3) that doesn't have the -// DontEnum attribute. If there is no such property, go to step 14. - -var result = ""; - -for ( p in Number ) { result += String(p) }; - -new TestCase( SECTION, - "result = \"\"; for ( p in Number ) { result += String(p) };", - "", - result ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-12.js b/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-12.js deleted file mode 100644 index 840ca9da65..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-12.js +++ /dev/null @@ -1,103 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '12.6.3-12.js'; - -/** - File Name: 12.6.3-12.js - ECMA Section: 12.6.3 The for...in Statement - Description: - - This is a regression test for http://bugzilla.mozilla.org/show_bug.cgi?id=9802. - - The production IterationStatement : for ( LeftHandSideExpression in Expression ) - Statement is evaluated as follows: - - 1. Evaluate the Expression. - 2. Call GetValue(Result(1)). - 3. Call ToObject(Result(2)). - 4. Let C be "normal completion". - 5. Get the name of the next property of Result(3) that doesn't have the - DontEnum attribute. If there is no such property, go to step 14. - 6. Evaluate the LeftHandSideExpression (it may be evaluated repeatedly). - 7. Call PutValue(Result(6), Result(5)). PutValue( V, W ): - 1. If Type(V) is not Reference, generate a runtime error. - 2. Call GetBase(V). - 3. If Result(2) is null, go to step 6. - 4. Call the [[Put]] method of Result(2), passing GetPropertyName(V) - for the property name and W for the value. - 5. Return. - 6. Call the [[Put]] method for the global object, passing - GetPropertyName(V) for the property name and W for the value. - 7. Return. - 8. Evaluate Statement. - 9. If Result(8) is a value completion, change C to be "normal completion - after value V" where V is the value carried by Result(8). - 10. If Result(8) is a break completion, go to step 14. - 11. If Result(8) is a continue completion, go to step 5. - 12. If Result(8) is a return completion, return Result(8). - 13. Go to step 5. - 14. Return C. - - Author: christine@netscape.com - Date: 11 september 1997 -*/ -var SECTION = "12.6.3-12"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The for..in statement"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "PASSED"; - -for ( aVar in this ) { - if (aVar == "aVar") { - result = "FAILED" - } -}; - -new TestCase( - SECTION, - "var result=''; for ( aVar in this ) { " + - "if (aVar == 'aVar') {return a failure}; result", - "PASSED", - result ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-19.js b/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-19.js deleted file mode 100644 index 5acbee7127..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-19.js +++ /dev/null @@ -1,117 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '12.6.3-19.js'; - -/** - File Name: 12.6.3-1.js - ECMA Section: 12.6.3 The for...in Statement - Description: - The production IterationStatement : for ( LeftHandSideExpression in Expression ) - Statement is evaluated as follows: - - 1. Evaluate the Expression. - 2. Call GetValue(Result(1)). - 3. Call ToObject(Result(2)). - 4. Let C be "normal completion". - 5. Get the name of the next property of Result(3) that doesn't have the - DontEnum attribute. If there is no such property, go to step 14. - 6. Evaluate the LeftHandSideExpression (it may be evaluated repeatedly). - 7. Call PutValue(Result(6), Result(5)). PutValue( V, W ): - 1. If Type(V) is not Reference, generate a runtime error. - 2. Call GetBase(V). - 3. If Result(2) is null, go to step 6. - 4. Call the [[Put]] method of Result(2), passing GetPropertyName(V) - for the property name and W for the value. - 5. Return. - 6. Call the [[Put]] method for the global object, passing - GetPropertyName(V) for the property name and W for the value. - 7. Return. - 8. Evaluate Statement. - 9. If Result(8) is a value completion, change C to be "normal completion - after value V" where V is the value carried by Result(8). - 10. If Result(8) is a break completion, go to step 14. - 11. If Result(8) is a continue completion, go to step 5. - 12. If Result(8) is a return completion, return Result(8). - 13. Go to step 5. - 14. Return C. - - Author: christine@netscape.com - Date: 11 september 1997 -*/ -var SECTION = "12.6.3-4"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The for..in statement"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -// for ( LeftHandSideExpression in Expression ) -// LeftHandSideExpression:NewExpression:MemberExpression - -var count = 0; -function f() { count++; return new Array("h","e","l","l","o"); } - -var result = ""; -for ( p in f() ) { result += f()[p] }; - -new TestCase( SECTION, - "count = 0; result = \"\"; "+ - "function f() { count++; return new Array(\"h\",\"e\",\"l\",\"l\",\"o\"); }"+ - "for ( p in f() ) { result += f()[p] }; count", - 6, - count ); - -new TestCase( SECTION, - "result", - "hello", - result ); - - - -// LeftHandSideExpression:NewExpression:MemberExpression [ Expression ] -// LeftHandSideExpression:NewExpression:MemberExpression . Identifier -// LeftHandSideExpression:NewExpression:new MemberExpression Arguments -// LeftHandSideExpression:NewExpression:PrimaryExpression:( Expression ) -// LeftHandSideExpression:CallExpression:MemberExpression Arguments -// LeftHandSideExpression:CallExpression Arguments -// LeftHandSideExpression:CallExpression [ Expression ] -// LeftHandSideExpression:CallExpression . Identifier - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-2.js b/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-2.js deleted file mode 100644 index 3ed93dc9a1..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-2.js +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '12.6.3-2.js'; - -/** - File Name: 12.6.3-2.js - ECMA Section: 12.6.3 The for...in Statement - Description: Check the Boolean Object - - - Author: christine@netscape.com - Date: 11 september 1997 -*/ - -var SECTION = "12.6.3-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The for..in statement"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "Boolean.prototype.foo = 34; for ( j in Boolean ) Boolean[j]", - 34, - eval("Boolean.prototype.foo = 34; for ( j in Boolean ) Boolean[j] ") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-3.js b/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-3.js deleted file mode 100644 index f52569bba2..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-3.js +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '12.6.3-3.js'; - -/** - File Name: 12.6.3-3.js - ECMA Section: for..in loops - Description: - - This verifies the fix to - http://scopus.mcom.com/bugsplat/show_bug.cgi?id=112156 - for..in should take general lvalue for first argument - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "12.6.3-3"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The for..in statement"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var o = {}; - -var result = ""; - -for ( o.a in [1,2,3] ) { result += String( [1,2,3][o.a] ); } - -new TestCase( SECTION, - "for ( o.a in [1,2,3] ) { result += String( [1,2,3][o.a] ); } result", - "123", - result ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-4.js b/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-4.js deleted file mode 100644 index c30641f8bb..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-4.js +++ /dev/null @@ -1,202 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '12.6.3-4.js'; - -/** - File Name: 12.6.3-1.js - ECMA Section: 12.6.3 The for...in Statement - Description: - The production IterationStatement : for ( LeftHandSideExpression in Expression ) - Statement is evaluated as follows: - - 1. Evaluate the Expression. - 2. Call GetValue(Result(1)). - 3. Call ToObject(Result(2)). - 4. Let C be "normal completion". - 5. Get the name of the next property of Result(3) that doesn't have the - DontEnum attribute. If there is no such property, go to step 14. - 6. Evaluate the LeftHandSideExpression (it may be evaluated repeatedly). - 7. Call PutValue(Result(6), Result(5)). PutValue( V, W ): - 1. If Type(V) is not Reference, generate a runtime error. - 2. Call GetBase(V). - 3. If Result(2) is null, go to step 6. - 4. Call the [[Put]] method of Result(2), passing GetPropertyName(V) - for the property name and W for the value. - 5. Return. - 6. Call the [[Put]] method for the global object, passing - GetPropertyName(V) for the property name and W for the value. - 7. Return. - 8. Evaluate Statement. - 9. If Result(8) is a value completion, change C to be "normal completion - after value V" where V is the value carried by Result(8). - 10. If Result(8) is a break completion, go to step 14. - 11. If Result(8) is a continue completion, go to step 5. - 12. If Result(8) is a return completion, return Result(8). - 13. Go to step 5. - 14. Return C. - - Author: christine@netscape.com - Date: 11 september 1997 -*/ -var SECTION = "12.6.3-4"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The for..in statement"; -var BUGNUMBER="http://scopus.mcom.com/bugsplat/show_bug.cgi?id=344855"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -// for ( LeftHandSideExpression in Expression ) -// LeftHandSideExpression:NewExpression:MemberExpression - -var o = new MyObject(); -var result = 0; - -for ( MyObject in o ) { - result += o[MyObject]; -} - -new TestCase( SECTION, - "for ( MyObject in o ) { result += o[MyObject] }", - 6, - result ); - -var result = 0; - -for ( value in o ) { - result += o[value]; -} - -new TestCase( SECTION, - "for ( value in o ) { result += o[value]", - 6, - result ); - -var value = "value"; -var result = 0; -for ( value in o ) { - result += o[value]; -} - -new TestCase( SECTION, - "value = \"value\"; for ( value in o ) { result += o[value]", - 6, - result ); - -var value = 0; -var result = 0; -for ( value in o ) { - result += o[value]; -} - -new TestCase( SECTION, - "value = 0; for ( value in o ) { result += o[value]", - 6, - result ); - -// this causes a segv - -var ob = { 0:"hello" }; -var result = 0; -for ( ob[0] in o ) { - result += o[ob[0]]; -} - -new TestCase( SECTION, - "ob = { 0:\"hello\" }; for ( ob[0] in o ) { result += o[ob[0]]", - 6, - result ); - -var result = 0; -for ( ob["0"] in o ) { - result += o[ob["0"]]; -} - -new TestCase( SECTION, - "value = 0; for ( ob[\"0\"] in o ) { result += o[o[\"0\"]]", - 6, - result ); - -var result = 0; -var ob = { value:"hello" }; -for ( ob[value] in o ) { - result += o[ob[value]]; -} - -new TestCase( SECTION, - "ob = { 0:\"hello\" }; for ( ob[value] in o ) { result += o[ob[value]]", - 6, - result ); - -var result = 0; -for ( ob["value"] in o ) { - result += o[ob["value"]]; -} - -new TestCase( SECTION, - "value = 0; for ( ob[\"value\"] in o ) { result += o[ob[\"value\"]]", - 6, - result ); - -var result = 0; -for ( ob.value in o ) { - result += o[ob.value]; -} - -new TestCase( SECTION, - "value = 0; for ( ob.value in o ) { result += o[ob.value]", - 6, - result ); - -// LeftHandSideExpression:NewExpression:MemberExpression [ Expression ] -// LeftHandSideExpression:NewExpression:MemberExpression . Identifier -// LeftHandSideExpression:NewExpression:new MemberExpression Arguments -// LeftHandSideExpression:NewExpression:PrimaryExpression:( Expression ) -// LeftHandSideExpression:CallExpression:MemberExpression Arguments -// LeftHandSideExpression:CallExpression Arguments -// LeftHandSideExpression:CallExpression [ Expression ] -// LeftHandSideExpression:CallExpression . Identifier - -test(); - -function MyObject() { - this.value = 2; - this[0] = 4; - return this; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-5-n.js b/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-5-n.js deleted file mode 100644 index 295d059c39..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-5-n.js +++ /dev/null @@ -1,110 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '12.6.3-5-n.js'; - -/** - File Name: 12.6.3-1.js - ECMA Section: 12.6.3 The for...in Statement - Description: - The production IterationStatement : for ( LeftHandSideExpression in Expression ) - Statement is evaluated as follows: - - 1. Evaluate the Expression. - 2. Call GetValue(Result(1)). - 3. Call ToObject(Result(2)). - 4. Let C be "normal completion". - 5. Get the name of the next property of Result(3) that doesn't have the - DontEnum attribute. If there is no such property, go to step 14. - 6. Evaluate the LeftHandSideExpression ( it may be evaluated repeatedly). - 7. Call PutValue(Result(6), Result(5)). PutValue( V, W ): - 1. If Type(V) is not Reference, generate a runtime error. - 2. Call GetBase(V). - 3. If Result(2) is null, go to step 6. - 4. Call the [[Put]] method of Result(2), passing GetPropertyName(V) - for the property name and W for the value. - 5. Return. - 6. Call the [[Put]] method for the global object, passing - GetPropertyName(V) for the property name and W for the value. - 7. Return. - 8. Evaluate Statement. - 9. If Result(8) is a value completion, change C to be "normal completion - after value V" where V is the value carried by Result(8). - 10. If Result(8) is a break completion, go to step 14. - 11. If Result(8) is a continue completion, go to step 5. - 12. If Result(8) is a return completion, return Result(8). - 13. Go to step 5. - 14. Return C. - - Author: christine@netscape.com - Date: 11 september 1997 -*/ -var SECTION = "12.6.3-4"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The for..in statement"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -// for ( LeftHandSideExpression in Expression ) -// LeftHandSideExpression:NewExpression:MemberExpression - -DESCRIPTION = "more than one member expression"; -EXPECTED = "error"; - -new TestCase( SECTION, - "more than one member expression", - "error", - eval("var o = new MyObject(); var result = 0; for ( var i, p in this) { result += this[p]; }") ); - -/* - var o = new MyObject(); - var result = 0; - - for ( var i, p in this) { - result += this[p]; - } -*/ - -test(); - -function MyObject() { - this.value = 2; - this[0] = 4; - return this; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-6-n.js b/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-6-n.js deleted file mode 100644 index 8cb4c7f638..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-6-n.js +++ /dev/null @@ -1,109 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '12.6.3-6-n.js'; - -/** - File Name: 12.6.3-1.js - ECMA Section: 12.6.3 The for...in Statement - Description: - The production IterationStatement : for ( LeftHandSideExpression in Expression ) - Statement is evaluated as follows: - - 1. Evaluate the Expression. - 2. Call GetValue(Result(1)). - 3. Call ToObject(Result(2)). - 4. Let C be "normal completion". - 5. Get the name of the next property of Result(3) that doesn't have the - DontEnum attribute. If there is no such property, go to step 14. - 6. Evaluate the LeftHandSideExpression ( it may be evaluated repeatedly). - 7. Call PutValue(Result(6), Result(5)). PutValue( V, W ): - 1. If Type(V) is not Reference, generate a runtime error. - 2. Call GetBase(V). - 3. If Result(2) is null, go to step 6. - 4. Call the [[Put]] method of Result(2), passing GetPropertyName(V) - for the property name and W for the value. - 5. Return. - 6. Call the [[Put]] method for the global object, passing - GetPropertyName(V) for the property name and W for the value. - 7. Return. - 8. Evaluate Statement. - 9. If Result(8) is a value completion, change C to be "normal completion - after value V" where V is the value carried by Result(8). - 10. If Result(8) is a break completion, go to step 14. - 11. If Result(8) is a continue completion, go to step 5. - 12. If Result(8) is a return completion, return Result(8). - 13. Go to step 5. - 14. Return C. - - Author: christine@netscape.com - Date: 11 september 1997 -*/ -var SECTION = "12.6.3-4"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The for..in statement"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -// for ( LeftHandSideExpression in Expression ) -// LeftHandSideExpression:NewExpression:MemberExpression - -DESCRIPTION = "bad left-hand side expression"; -EXPECTED = "error"; - -new TestCase( SECTION, - "bad left-hand side expression", - "error", - eval("var o = new MyObject(); var result = 0; for ( this in o) { result += this[p]; }") ); -/* - var o = new MyObject(); - var result = 0; - - for ( this in o) { - result += this[p]; - } -*/ - -test(); - -function MyObject() { - this.value = 2; - this[0] = 4; - return this; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-7-n.js b/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-7-n.js deleted file mode 100644 index 871dd474cb..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-7-n.js +++ /dev/null @@ -1,110 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '12.6.3-7-n.js'; - -/** - File Name: 12.6.3-1.js - ECMA Section: 12.6.3 The for...in Statement - Description: - The production IterationStatement : for ( LeftHandSideExpression in Expression ) - Statement is evaluated as follows: - - 1. Evaluate the Expression. - 2. Call GetValue(Result(1)). - 3. Call ToObject(Result(2)). - 4. Let C be "normal completion". - 5. Get the name of the next property of Result(3) that doesn't have the - DontEnum attribute. If there is no such property, go to step 14. - 6. Evaluate the LeftHandSideExpression ( it may be evaluated repeatedly). - 7. Call PutValue(Result(6), Result(5)). PutValue( V, W ): - 1. If Type(V) is not Reference, generate a runtime error. - 2. Call GetBase(V). - 3. If Result(2) is null, go to step 6. - 4. Call the [[Put]] method of Result(2), passing GetPropertyName(V) - for the property name and W for the value. - 5. Return. - 6. Call the [[Put]] method for the global object, passing - GetPropertyName(V) for the property name and W for the value. - 7. Return. - 8. Evaluate Statement. - 9. If Result(8) is a value completion, change C to be "normal completion - after value V" where V is the value carried by Result(8). - 10. If Result(8) is a break completion, go to step 14. - 11. If Result(8) is a continue completion, go to step 5. - 12. If Result(8) is a return completion, return Result(8). - 13. Go to step 5. - 14. Return C. - - Author: christine@netscape.com - Date: 11 september 1997 -*/ -var SECTION = "12.6.3-4"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The for..in statement"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -// for ( LeftHandSideExpression in Expression ) -// LeftHandSideExpression:NewExpression:MemberExpression - -DESCRIPTION = "bad left-hand side expression"; -EXPECTED = "error"; - -new TestCase( SECTION, - "bad left-hand side expression", - "error", - eval("var o = new MyObject(); var result = 0; for ( \"a\" in o) { result += this[p]; } ") ); - -/* - var o = new MyObject(); - var result = 0; - - for ( "a" in o) { - result += this[p]; - } -*/ - -test(); - -function MyObject() { - this.value = 2; - this[0] = 4; - return this; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-8-n.js b/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-8-n.js deleted file mode 100644 index b75a7b5f37..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-8-n.js +++ /dev/null @@ -1,110 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '12.6.3-8-n.js'; - -/** - File Name: 12.6.3-8-n.js - ECMA Section: 12.6.3 The for...in Statement - Description: - The production IterationStatement : for ( LeftHandSideExpression in Expression ) - Statement is evaluated as follows: - - 1. Evaluate the Expression. - 2. Call GetValue(Result(1)). - 3. Call ToObject(Result(2)). - 4. Let C be "normal completion". - 5. Get the name of the next property of Result(3) that doesn't have the - DontEnum attribute. If there is no such property, go to step 14. - 6. Evaluate the LeftHandSideExpression ( it may be evaluated repeatedly). - 7. Call PutValue(Result(6), Result(5)). PutValue( V, W ): - 1. If Type(V) is not Reference, generate a runtime error. - 2. Call GetBase(V). - 3. If Result(2) is null, go to step 6. - 4. Call the [[Put]] method of Result(2), passing GetPropertyName(V) - for the property name and W for the value. - 5. Return. - 6. Call the [[Put]] method for the global object, passing - GetPropertyName(V) for the property name and W for the value. - 7. Return. - 8. Evaluate Statement. - 9. If Result(8) is a value completion, change C to be "normal completion - after value V" where V is the value carried by Result(8). - 10. If Result(8) is a break completion, go to step 14. - 11. If Result(8) is a continue completion, go to step 5. - 12. If Result(8) is a return completion, return Result(8). - 13. Go to step 5. - 14. Return C. - - Author: christine@netscape.com - Date: 11 september 1997 -*/ -var SECTION = "12.6.3-4"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The for..in statement"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -// for ( LeftHandSideExpression in Expression ) -// LeftHandSideExpression:NewExpression:MemberExpression - -DESCRIPTION = "bad left-hand side expression"; -EXPECTED = "error"; - -new TestCase( SECTION, - "bad left-hand side expression", - "error", - eval("var o = new MyObject(); var result = 0; for ( 1 in o) { result += this[p]; } ") ); - -/* - var o = new MyObject(); - var result = 0; - - for ( 1 in o) { - result += this[p]; - } -*/ - -test(); - -function MyObject() { - this.value = 2; - this[0] = 4; - return this; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-9-n.js b/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-9-n.js deleted file mode 100644 index f83a8ed65a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.6.3-9-n.js +++ /dev/null @@ -1,109 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '12.6.3-9-n.js'; - -/** - File Name: 12.6.3-9-n.js - ECMA Section: 12.6.3 The for...in Statement - Description: - The production IterationStatement : for ( LeftHandSideExpression in Expression ) - Statement is evaluated as follows: - - 1. Evaluate the Expression. - 2. Call GetValue(Result(1)). - 3. Call ToObject(Result(2)). - 4. Let C be "normal completion". - 5. Get the name of the next property of Result(3) that doesn't have the - DontEnum attribute. If there is no such property, go to step 14. - 6. Evaluate the LeftHandSideExpression ( it may be evaluated repeatedly). - 7. Call PutValue(Result(6), Result(5)). PutValue( V, W ): - 1. If Type(V) is not Reference, generate a runtime error. - 2. Call GetBase(V). - 3. If Result(2) is null, go to step 6. - 4. Call the [[Put]] method of Result(2), passing GetPropertyName(V) - for the property name and W for the value. - 5. Return. - 6. Call the [[Put]] method for the global object, passing - GetPropertyName(V) for the property name and W for the value. - 7. Return. - 8. Evaluate Statement. - 9. If Result(8) is a value completion, change C to be "normal completion - after value V" where V is the value carried by Result(8). - 10. If Result(8) is a break completion, go to step 14. - 11. If Result(8) is a continue completion, go to step 5. - 12. If Result(8) is a return completion, return Result(8). - 13. Go to step 5. - 14. Return C. - - Author: christine@netscape.com - Date: 11 september 1997 -*/ -var SECTION = "12.6.3-9-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The for..in statement"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -// for ( LeftHandSideExpression in Expression ) -// LeftHandSideExpression:NewExpression:MemberExpression - -DESCRIPTION = "object is not defined"; -EXPECTED = "error"; - -new TestCase( SECTION, - "object is not defined", - "error", - eval("var o = new MyObject(); var result = 0; for ( var o in foo) { result += this[o]; } ") ); -/* - var o = new MyObject(); - var result = 0; - - for ( var o in foo) { - result += this[o]; - } -*/ - -test(); - -function MyObject() { - this.value = 2; - this[0] = 4; - return this; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.7-1-n.js b/tests/auto/declarative/parserstress/tests/ecma/Statements/12.7-1-n.js deleted file mode 100644 index 7978f3be56..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.7-1-n.js +++ /dev/null @@ -1,64 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '12.7-1-n.js'; - -/** - File Name: 12.7-1-n.js - ECMA Section: 12.7 The continue statement - Description: - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "12.7.1-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The continue statement"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "continue"; -EXPECTED = "error"; - -new TestCase( SECTION, - "continue", - "error", - eval("continue") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.8-1-n.js b/tests/auto/declarative/parserstress/tests/ecma/Statements/12.8-1-n.js deleted file mode 100644 index 29f46cf29e..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.8-1-n.js +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '12.8-1-n.js'; - -/** - File Name: 12.8-1-n.js - ECMA Section: 12.8 The break statement - Description: - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "12.8-1-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The break in statement"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "break"; -EXPECTED = "error"; - -new TestCase( SECTION, - "break", - "error", - eval("break") ); - - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.9-1-n.js b/tests/auto/declarative/parserstress/tests/ecma/Statements/12.9-1-n.js deleted file mode 100644 index 450cb66593..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Statements/12.9-1-n.js +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '12.9-1-n.js'; - -/** - File Name: 12.9-1-n.js - ECMA Section: 12.9 The return statement - Description: - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "12.9-1-n"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " The return statement"); - -DESCRIPTION = "return"; -EXPECTED = "error"; - -new TestCase( SECTION, - "return", - "error", - eval("return") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/Statements/browser.js b/tests/auto/declarative/parserstress/tests/ecma/Statements/browser.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/auto/declarative/parserstress/tests/ecma/Statements/shell.js b/tests/auto/declarative/parserstress/tests/ecma/Statements/shell.js deleted file mode 100644 index 7346f697a5..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Statements/shell.js +++ /dev/null @@ -1 +0,0 @@ -gTestsubsuite = 'Statements'; diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.1.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.1.js deleted file mode 100644 index cf7ab8b420..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.1.js +++ /dev/null @@ -1,134 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.1.js'; - -/** - File Name: 15.5.1.js - ECMA Section: 15.5.1 The String Constructor called as a Function - 15.5.1.1 String(value) - 15.5.1.2 String() - - Description: When String is called as a function rather than as - a constructor, it performs a type conversion. - - String(value) returns a string value (not a String - object) computed by ToString(value) - - String() returns the empty string "" - - Author: christine@netscape.com - Date: 1 october 1997 -*/ - -var SECTION = "15.5.1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The String Constructor Called as a Function"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "String('string primitive')", "string primitive", String('string primitive') ); -new TestCase( SECTION, "String(void 0)", "undefined", String( void 0) ); -new TestCase( SECTION, "String(null)", "null", String( null ) ); -new TestCase( SECTION, "String(true)", "true", String( true) ); -new TestCase( SECTION, "String(false)", "false", String( false ) ); -new TestCase( SECTION, "String(Boolean(true))", "true", String(Boolean(true)) ); -new TestCase( SECTION, "String(Boolean(false))", "false", String(Boolean(false)) ); -new TestCase( SECTION, "String(Boolean())", "false", String(Boolean(false)) ); -new TestCase( SECTION, "String(new Array())", "", String( new Array()) ); -new TestCase( SECTION, "String(new Array(1,2,3))", "1,2,3", String( new Array(1,2,3)) ); - - -new TestCase( SECTION, "String( Number.NaN )", "NaN", String( Number.NaN ) ); -new TestCase( SECTION, "String( 0 )", "0", String( 0 ) ); -new TestCase( SECTION, "String( -0 )", "0", String( -0 ) ); -new TestCase( SECTION, "String( Number.POSITIVE_INFINITY )", "Infinity", String( Number.POSITIVE_INFINITY ) ); -new TestCase( SECTION, "String( Number.NEGATIVE_INFINITY )", "-Infinity", String( Number.NEGATIVE_INFINITY ) ); -new TestCase( SECTION, "String( -1 )", "-1", String( -1 ) ); - -// cases in step 6: integers 1e21 > x >= 1 or -1 >= x > -1e21 - -new TestCase( SECTION, "String( 1 )", "1", String( 1 ) ); -new TestCase( SECTION, "String( 10 )", "10", String( 10 ) ); -new TestCase( SECTION, "String( 100 )", "100", String( 100 ) ); -new TestCase( SECTION, "String( 1000 )", "1000", String( 1000 ) ); -new TestCase( SECTION, "String( 10000 )", "10000", String( 10000 ) ); -new TestCase( SECTION, "String( 10000000000 )", "10000000000", String( 10000000000 ) ); -new TestCase( SECTION, "String( 10000000000000000000 )", "10000000000000000000", String( 10000000000000000000 ) ); -new TestCase( SECTION, "String( 100000000000000000000 )","100000000000000000000",String( 100000000000000000000 ) ); - -new TestCase( SECTION, "String( 12345 )", "12345", String( 12345 ) ); -new TestCase( SECTION, "String( 1234567890 )", "1234567890", String( 1234567890 ) ); - -new TestCase( SECTION, "String( -1 )", "-1", String( -1 ) ); -new TestCase( SECTION, "String( -10 )", "-10", String( -10 ) ); -new TestCase( SECTION, "String( -100 )", "-100", String( -100 ) ); -new TestCase( SECTION, "String( -1000 )", "-1000", String( -1000 ) ); -new TestCase( SECTION, "String( -1000000000 )", "-1000000000", String( -1000000000 ) ); -new TestCase( SECTION, "String( -1000000000000000 )", "-1000000000000000", String( -1000000000000000 ) ); -new TestCase( SECTION, "String( -100000000000000000000 )", "-100000000000000000000", String( -100000000000000000000 ) ); -new TestCase( SECTION, "String( -1000000000000000000000 )", "-1e+21", String( -1000000000000000000000 ) ); - -new TestCase( SECTION, "String( -12345 )", "-12345", String( -12345 ) ); -new TestCase( SECTION, "String( -1234567890 )", "-1234567890", String( -1234567890 ) ); - -// cases in step 7: numbers with a fractional component, 1e21> x >1 or -1 > x > -1e21, -new TestCase( SECTION, "String( 1.0000001 )", "1.0000001", String( 1.0000001 ) ); - - -// cases in step 8: fractions between 1 > x > -1, exclusive of 0 and -0 - -// cases in step 9: numbers with 1 significant digit >= 1e+21 or <= 1e-6 - -new TestCase( SECTION, "String( 1000000000000000000000 )", "1e+21", String( 1000000000000000000000 ) ); -new TestCase( SECTION, "String( 10000000000000000000000 )", "1e+22", String( 10000000000000000000000 ) ); - -// cases in step 10: numbers with more than 1 significant digit >= 1e+21 or <= 1e-6 -new TestCase( SECTION, "String( 1.2345 )", "1.2345", String( 1.2345)); -new TestCase( SECTION, "String( 1.234567890 )", "1.23456789", String( 1.234567890 )); - -new TestCase( SECTION, "String( .12345 )", "0.12345", String(.12345 ) ); -new TestCase( SECTION, "String( .012345 )", "0.012345", String(.012345) ); -new TestCase( SECTION, "String( .0012345 )", "0.0012345", String(.0012345) ); -new TestCase( SECTION, "String( .00012345 )", "0.00012345", String(.00012345) ); -new TestCase( SECTION, "String( .000012345 )", "0.000012345", String(.000012345) ); -new TestCase( SECTION, "String( .0000012345 )", "0.0000012345", String(.0000012345) ); -new TestCase( SECTION, "String( .00000012345 )", "1.2345e-7", String(.00000012345)); - -new TestCase( "15.5.2", "String()", "", String() ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.2.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.2.js deleted file mode 100644 index 062d31cdc2..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.2.js +++ /dev/null @@ -1,110 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.2.js'; - -/** - File Name: 15.5.2.js - ECMA Section: 15.5.2 The String Constructor - 15.5.2.1 new String(value) - 15.5.2.2 new String() - - Description: When String is called as part of a new expression, it - is a constructor; it initializes the newly constructed - object. - - - The prototype property of the newly constructed - object is set to the original String prototype object, - the one that is the intial value of String.prototype - - The internal [[Class]] property of the object is "String" - - The value of the object is ToString(value). - - If no value is specified, its value is the empty string. - - Author: christine@netscape.com - Date: 1 october 1997 -*/ - -var SECTION = "15.5.2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The String Constructor"; - -writeHeaderToLog( SECTION + " "+ TITLE); - - -new TestCase( SECTION, "typeof new String('string primitive')", "object", typeof new String('string primitive') ); -new TestCase( SECTION, "var TESTSTRING = new String('string primitive'); TESTSTRING.toString=Object.prototype.toString;TESTSTRING.toString()", "[object String]", eval("var TESTSTRING = new String('string primitive'); TESTSTRING.toString=Object.prototype.toString;TESTSTRING.toString()") ); -new TestCase( SECTION, "(new String('string primitive')).valueOf()", 'string primitive', (new String('string primitive')).valueOf() ); -new TestCase( SECTION, "(new String('string primitive')).substring", String.prototype.substring, (new String('string primitive')).substring ); - -new TestCase( SECTION, "typeof new String(void 0)", "object", typeof new String(void 0) ); -new TestCase( SECTION, "var TESTSTRING = new String(void 0); TESTSTRING.toString=Object.prototype.toString;TESTSTRING.toString()", "[object String]", eval("var TESTSTRING = new String(void 0); TESTSTRING.toString=Object.prototype.toString;TESTSTRING.toString()") ); -new TestCase( SECTION, "(new String(void 0)).valueOf()", "undefined", (new String(void 0)).valueOf() ); -new TestCase( SECTION, "(new String(void 0)).toString", String.prototype.toString, (new String(void 0)).toString ); - -new TestCase( SECTION, "typeof new String(null)", "object", typeof new String(null) ); -new TestCase( SECTION, "var TESTSTRING = new String(null); TESTSTRING.toString=Object.prototype.toString;TESTSTRING.toString()", "[object String]", eval("var TESTSTRING = new String(null); TESTSTRING.toString=Object.prototype.toString;TESTSTRING.toString()") ); -new TestCase( SECTION, "(new String(null)).valueOf()", "null", (new String(null)).valueOf() ); -new TestCase( SECTION, "(new String(null)).valueOf", String.prototype.valueOf, (new String(null)).valueOf ); - -new TestCase( SECTION, "typeof new String(true)", "object", typeof new String(true) ); -new TestCase( SECTION, "var TESTSTRING = new String(true); TESTSTRING.toString=Object.prototype.toString;TESTSTRING.toString()", "[object String]", eval("var TESTSTRING = new String(true); TESTSTRING.toString=Object.prototype.toString;TESTSTRING.toString()") ); -new TestCase( SECTION, "(new String(true)).valueOf()", "true", (new String(true)).valueOf() ); -new TestCase( SECTION, "(new String(true)).charAt", String.prototype.charAt, (new String(true)).charAt ); - -new TestCase( SECTION, "typeof new String(false)", "object", typeof new String(false) ); -new TestCase( SECTION, "var TESTSTRING = new String(false); TESTSTRING.toString=Object.prototype.toString;TESTSTRING.toString()", "[object String]", eval("var TESTSTRING = new String(false); TESTSTRING.toString=Object.prototype.toString;TESTSTRING.toString()") ); -new TestCase( SECTION, "(new String(false)).valueOf()", "false", (new String(false)).valueOf() ); -new TestCase( SECTION, "(new String(false)).charCodeAt", String.prototype.charCodeAt, (new String(false)).charCodeAt ); - -new TestCase( SECTION, "typeof new String(new Boolean(true))", "object", typeof new String(new Boolean(true)) ); -new TestCase( SECTION, "var TESTSTRING = new String(new Boolean(true)); TESTSTRING.toString=Object.prototype.toString;TESTSTRING.toString()", "[object String]", eval("var TESTSTRING = new String(new Boolean(true)); TESTSTRING.toString=Object.prototype.toString;TESTSTRING.toString()") ); -new TestCase( SECTION, "(new String(new Boolean(true))).valueOf()", "true", (new String(new Boolean(true))).valueOf() ); -new TestCase( SECTION, "(new String(new Boolean(true))).indexOf", String.prototype.indexOf, (new String(new Boolean(true))).indexOf ); - -new TestCase( SECTION, "typeof new String()", "object", typeof new String() ); -new TestCase( SECTION, "var TESTSTRING = new String(); TESTSTRING.toString=Object.prototype.toString;TESTSTRING.toString()", "[object String]", eval("var TESTSTRING = new String(); TESTSTRING.toString=Object.prototype.toString;TESTSTRING.toString()") ); -new TestCase( SECTION, "(new String()).valueOf()", '', (new String()).valueOf() ); -new TestCase( SECTION, "(new String()).lastIndexOf", String.prototype.lastIndexOf, (new String()).lastIndexOf ); - -new TestCase( SECTION, "typeof new String('')", "object", typeof new String('') ); -new TestCase( SECTION, "var TESTSTRING = new String(''); TESTSTRING.toString=Object.prototype.toString;TESTSTRING.toString()", "[object String]", eval("var TESTSTRING = new String(''); TESTSTRING.toString=Object.prototype.toString;TESTSTRING.toString()") ); -new TestCase( SECTION, "(new String('')).valueOf()", '', (new String('')).valueOf() ); -new TestCase( SECTION, "(new String('')).split", String.prototype.split, (new String('')).split ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.3.1-1.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.3.1-1.js deleted file mode 100644 index cc62c9ed51..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.3.1-1.js +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.3.1-1.js'; - -/** - File Name: 15.5.3.1-1.js - ECMA Section: 15.5.3.1 Properties of the String Constructor - - Description: The initial value of String.prototype is the built-in - String prototype object. - - This property shall have the attributes [ DontEnum, - DontDelete, ReadOnly] - - This tests the DontEnum attribute. - - Author: christine@netscape.com - Date: 1 october 1997 -*/ - -var SECTION = "15.5.3.1-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Properties of the String Constructor"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "String.prototype.length", 0, String.prototype.length ); - -new TestCase( SECTION, - "var str='';for ( p in String ) { if ( p == 'prototype' ) str += p; } str", - "", - eval("var str='';for ( p in String ) { if ( p == 'prototype' ) str += p; } str") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.3.1-2.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.3.1-2.js deleted file mode 100644 index b87137a140..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.3.1-2.js +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.3.1-2.js'; - -/** - File Name: 15.5.3.1-2.js - ECMA Section: 15.5.3.1 Properties of the String Constructor - - Description: The initial value of String.prototype is the built-in - String prototype object. - - This property shall have the attributes [ DontEnum, - DontDelete, ReadOnly] - - This tests the ReadOnly attribute. - - Author: christine@netscape.com - Date: 1 october 1997 -*/ - -var SECTION = "15.5.3.1-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Properties of the String Constructor"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "String.prototype=null;String.prototype", - String.prototype, - eval("String.prototype=null;String.prototype") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.3.1-3.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.3.1-3.js deleted file mode 100644 index f94f83db11..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.3.1-3.js +++ /dev/null @@ -1,66 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.3.1-3.js'; - -/** - File Name: 15.5.3.1-3.js - ECMA Section: 15.5.3.1 Properties of the String Constructor - - Description: The initial value of String.prototype is the built-in - String prototype object. - - This property shall have the attributes [ DontEnum, - DontDelete, ReadOnly] - - This tests the DontDelete attribute. - - Author: christine@netscape.com - Date: 1 october 1997 -*/ - -var SECTION = "15.5.3.1-3"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Properties of the String Constructor"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "delete( String.prototype )", false, eval("delete ( String.prototype )") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.3.1-4.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.3.1-4.js deleted file mode 100644 index af8c1b9560..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.3.1-4.js +++ /dev/null @@ -1,66 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.3.1-4.js'; - -/** - File Name: 15.5.3.1-4.js - ECMA Section: 15.5.3.1 Properties of the String Constructor - - Description: The initial value of String.prototype is the built-in - String prototype object. - - This property shall have the attributes [ DontEnum, - DontDelete, ReadOnly] - - This tests the DontDelete attribute. - - Author: christine@netscape.com - Date: 1 october 1997 -*/ - -var SECTION = "15.5.3.1-4"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Properties of the String Constructor"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "delete( String.prototype );String.prototype", String.prototype, eval("delete ( String.prototype );String.prototype") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.3.2-1.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.3.2-1.js deleted file mode 100644 index 17e715bca0..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.3.2-1.js +++ /dev/null @@ -1,190 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.3.2-1.js'; - -/** - File Name: 15.5.3.2-1.js - ECMA Section: 15.5.3.2 String.fromCharCode( char0, char1, ... ) - Description: Return a string value containing as many characters - as the number of arguments. Each argument specifies - one character of the resulting string, with the first - argument specifying the first character, and so on, - from left to right. An argument is converted to a - character by applying the operation ToUint16 and - regarding the resulting 16bit integeras the Unicode - encoding of a character. If no arguments are supplied, - the result is the empty string. - - This test covers Basic Latin (range U+0020 - U+007F) - - Author: christine@netscape.com - Date: 2 october 1997 -*/ - -var SECTION = "15.5.3.2-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "String.fromCharCode()"; - -new TestCase( SECTION, "typeof String.fromCharCode", "function", typeof String.fromCharCode ); -new TestCase( SECTION, "typeof String.prototype.fromCharCode", "undefined", typeof String.prototype.fromCharCode ); -new TestCase( SECTION, "var x = new String(); typeof x.fromCharCode", "undefined", eval("var x = new String(); typeof x.fromCharCode") ); -new TestCase( SECTION, "String.fromCharCode.length", 1, String.fromCharCode.length ); - -new TestCase( SECTION, "String.fromCharCode()", "", String.fromCharCode() ); -new TestCase( SECTION, "String.fromCharCode(0x0020)", " ", String.fromCharCode(0x0020) ); -new TestCase( SECTION, "String.fromCharCode(0x0021)", "!", String.fromCharCode(0x0021) ); -new TestCase( SECTION, "String.fromCharCode(0x0022)", "\"", String.fromCharCode(0x0022) ); -new TestCase( SECTION, "String.fromCharCode(0x0023)", "#", String.fromCharCode(0x0023) ); -new TestCase( SECTION, "String.fromCharCode(0x0024)", "$", String.fromCharCode(0x0024) ); -new TestCase( SECTION, "String.fromCharCode(0x0025)", "%", String.fromCharCode(0x0025) ); -new TestCase( SECTION, "String.fromCharCode(0x0026)", "&", String.fromCharCode(0x0026) ); -new TestCase( SECTION, "String.fromCharCode(0x0027)", "\'", String.fromCharCode(0x0027) ); -new TestCase( SECTION, "String.fromCharCode(0x0028)", "(", String.fromCharCode(0x0028) ); -new TestCase( SECTION, "String.fromCharCode(0x0029)", ")", String.fromCharCode(0x0029) ); -new TestCase( SECTION, "String.fromCharCode(0x002A)", "*", String.fromCharCode(0x002A) ); -new TestCase( SECTION, "String.fromCharCode(0x002B)", "+", String.fromCharCode(0x002B) ); -new TestCase( SECTION, "String.fromCharCode(0x002C)", ",", String.fromCharCode(0x002C) ); -new TestCase( SECTION, "String.fromCharCode(0x002D)", "-", String.fromCharCode(0x002D) ); -new TestCase( SECTION, "String.fromCharCode(0x002E)", ".", String.fromCharCode(0x002E) ); -new TestCase( SECTION, "String.fromCharCode(0x002F)", "/", String.fromCharCode(0x002F) ); - -new TestCase( SECTION, "String.fromCharCode(0x0030)", "0", String.fromCharCode(0x0030) ); -new TestCase( SECTION, "String.fromCharCode(0x0031)", "1", String.fromCharCode(0x0031) ); -new TestCase( SECTION, "String.fromCharCode(0x0032)", "2", String.fromCharCode(0x0032) ); -new TestCase( SECTION, "String.fromCharCode(0x0033)", "3", String.fromCharCode(0x0033) ); -new TestCase( SECTION, "String.fromCharCode(0x0034)", "4", String.fromCharCode(0x0034) ); -new TestCase( SECTION, "String.fromCharCode(0x0035)", "5", String.fromCharCode(0x0035) ); -new TestCase( SECTION, "String.fromCharCode(0x0036)", "6", String.fromCharCode(0x0036) ); -new TestCase( SECTION, "String.fromCharCode(0x0037)", "7", String.fromCharCode(0x0037) ); -new TestCase( SECTION, "String.fromCharCode(0x0038)", "8", String.fromCharCode(0x0038) ); -new TestCase( SECTION, "String.fromCharCode(0x0039)", "9", String.fromCharCode(0x0039) ); -new TestCase( SECTION, "String.fromCharCode(0x003A)", ":", String.fromCharCode(0x003A) ); -new TestCase( SECTION, "String.fromCharCode(0x003B)", ";", String.fromCharCode(0x003B) ); -new TestCase( SECTION, "String.fromCharCode(0x003C)", "<", String.fromCharCode(0x003C) ); -new TestCase( SECTION, "String.fromCharCode(0x003D)", "=", String.fromCharCode(0x003D) ); -new TestCase( SECTION, "String.fromCharCode(0x003E)", ">", String.fromCharCode(0x003E) ); -new TestCase( SECTION, "String.fromCharCode(0x003F)", "?", String.fromCharCode(0x003F) ); - -new TestCase( SECTION, "String.fromCharCode(0x0040)", "@", String.fromCharCode(0x0040) ); -new TestCase( SECTION, "String.fromCharCode(0x0041)", "A", String.fromCharCode(0x0041) ); -new TestCase( SECTION, "String.fromCharCode(0x0042)", "B", String.fromCharCode(0x0042) ); -new TestCase( SECTION, "String.fromCharCode(0x0043)", "C", String.fromCharCode(0x0043) ); -new TestCase( SECTION, "String.fromCharCode(0x0044)", "D", String.fromCharCode(0x0044) ); -new TestCase( SECTION, "String.fromCharCode(0x0045)", "E", String.fromCharCode(0x0045) ); -new TestCase( SECTION, "String.fromCharCode(0x0046)", "F", String.fromCharCode(0x0046) ); -new TestCase( SECTION, "String.fromCharCode(0x0047)", "G", String.fromCharCode(0x0047) ); -new TestCase( SECTION, "String.fromCharCode(0x0048)", "H", String.fromCharCode(0x0048) ); -new TestCase( SECTION, "String.fromCharCode(0x0049)", "I", String.fromCharCode(0x0049) ); -new TestCase( SECTION, "String.fromCharCode(0x004A)", "J", String.fromCharCode(0x004A) ); -new TestCase( SECTION, "String.fromCharCode(0x004B)", "K", String.fromCharCode(0x004B) ); -new TestCase( SECTION, "String.fromCharCode(0x004C)", "L", String.fromCharCode(0x004C) ); -new TestCase( SECTION, "String.fromCharCode(0x004D)", "M", String.fromCharCode(0x004D) ); -new TestCase( SECTION, "String.fromCharCode(0x004E)", "N", String.fromCharCode(0x004E) ); -new TestCase( SECTION, "String.fromCharCode(0x004F)", "O", String.fromCharCode(0x004F) ); - -new TestCase( SECTION, "String.fromCharCode(0x0040)", "@", String.fromCharCode(0x0040) ); -new TestCase( SECTION, "String.fromCharCode(0x0041)", "A", String.fromCharCode(0x0041) ); -new TestCase( SECTION, "String.fromCharCode(0x0042)", "B", String.fromCharCode(0x0042) ); -new TestCase( SECTION, "String.fromCharCode(0x0043)", "C", String.fromCharCode(0x0043) ); -new TestCase( SECTION, "String.fromCharCode(0x0044)", "D", String.fromCharCode(0x0044) ); -new TestCase( SECTION, "String.fromCharCode(0x0045)", "E", String.fromCharCode(0x0045) ); -new TestCase( SECTION, "String.fromCharCode(0x0046)", "F", String.fromCharCode(0x0046) ); -new TestCase( SECTION, "String.fromCharCode(0x0047)", "G", String.fromCharCode(0x0047) ); -new TestCase( SECTION, "String.fromCharCode(0x0048)", "H", String.fromCharCode(0x0048) ); -new TestCase( SECTION, "String.fromCharCode(0x0049)", "I", String.fromCharCode(0x0049) ); -new TestCase( SECTION, "String.fromCharCode(0x004A)", "J", String.fromCharCode(0x004A) ); -new TestCase( SECTION, "String.fromCharCode(0x004B)", "K", String.fromCharCode(0x004B) ); -new TestCase( SECTION, "String.fromCharCode(0x004C)", "L", String.fromCharCode(0x004C) ); -new TestCase( SECTION, "String.fromCharCode(0x004D)", "M", String.fromCharCode(0x004D) ); -new TestCase( SECTION, "String.fromCharCode(0x004E)", "N", String.fromCharCode(0x004E) ); -new TestCase( SECTION, "String.fromCharCode(0x004F)", "O", String.fromCharCode(0x004F) ); - -new TestCase( SECTION, "String.fromCharCode(0x0050)", "P", String.fromCharCode(0x0050) ); -new TestCase( SECTION, "String.fromCharCode(0x0051)", "Q", String.fromCharCode(0x0051) ); -new TestCase( SECTION, "String.fromCharCode(0x0052)", "R", String.fromCharCode(0x0052) ); -new TestCase( SECTION, "String.fromCharCode(0x0053)", "S", String.fromCharCode(0x0053) ); -new TestCase( SECTION, "String.fromCharCode(0x0054)", "T", String.fromCharCode(0x0054) ); -new TestCase( SECTION, "String.fromCharCode(0x0055)", "U", String.fromCharCode(0x0055) ); -new TestCase( SECTION, "String.fromCharCode(0x0056)", "V", String.fromCharCode(0x0056) ); -new TestCase( SECTION, "String.fromCharCode(0x0057)", "W", String.fromCharCode(0x0057) ); -new TestCase( SECTION, "String.fromCharCode(0x0058)", "X", String.fromCharCode(0x0058) ); -new TestCase( SECTION, "String.fromCharCode(0x0059)", "Y", String.fromCharCode(0x0059) ); -new TestCase( SECTION, "String.fromCharCode(0x005A)", "Z", String.fromCharCode(0x005A) ); -new TestCase( SECTION, "String.fromCharCode(0x005B)", "[", String.fromCharCode(0x005B) ); -new TestCase( SECTION, "String.fromCharCode(0x005C)", "\\", String.fromCharCode(0x005C) ); -new TestCase( SECTION, "String.fromCharCode(0x005D)", "]", String.fromCharCode(0x005D) ); -new TestCase( SECTION, "String.fromCharCode(0x005E)", "^", String.fromCharCode(0x005E) ); -new TestCase( SECTION, "String.fromCharCode(0x005F)", "_", String.fromCharCode(0x005F) ); - -new TestCase( SECTION, "String.fromCharCode(0x0060)", "`", String.fromCharCode(0x0060) ); -new TestCase( SECTION, "String.fromCharCode(0x0061)", "a", String.fromCharCode(0x0061) ); -new TestCase( SECTION, "String.fromCharCode(0x0062)", "b", String.fromCharCode(0x0062) ); -new TestCase( SECTION, "String.fromCharCode(0x0063)", "c", String.fromCharCode(0x0063) ); -new TestCase( SECTION, "String.fromCharCode(0x0064)", "d", String.fromCharCode(0x0064) ); -new TestCase( SECTION, "String.fromCharCode(0x0065)", "e", String.fromCharCode(0x0065) ); -new TestCase( SECTION, "String.fromCharCode(0x0066)", "f", String.fromCharCode(0x0066) ); -new TestCase( SECTION, "String.fromCharCode(0x0067)", "g", String.fromCharCode(0x0067) ); -new TestCase( SECTION, "String.fromCharCode(0x0068)", "h", String.fromCharCode(0x0068) ); -new TestCase( SECTION, "String.fromCharCode(0x0069)", "i", String.fromCharCode(0x0069) ); -new TestCase( SECTION, "String.fromCharCode(0x006A)", "j", String.fromCharCode(0x006A) ); -new TestCase( SECTION, "String.fromCharCode(0x006B)", "k", String.fromCharCode(0x006B) ); -new TestCase( SECTION, "String.fromCharCode(0x006C)", "l", String.fromCharCode(0x006C) ); -new TestCase( SECTION, "String.fromCharCode(0x006D)", "m", String.fromCharCode(0x006D) ); -new TestCase( SECTION, "String.fromCharCode(0x006E)", "n", String.fromCharCode(0x006E) ); -new TestCase( SECTION, "String.fromCharCode(0x006F)", "o", String.fromCharCode(0x006F) ); - -new TestCase( SECTION, "String.fromCharCode(0x0070)", "p", String.fromCharCode(0x0070) ); -new TestCase( SECTION, "String.fromCharCode(0x0071)", "q", String.fromCharCode(0x0071) ); -new TestCase( SECTION, "String.fromCharCode(0x0072)", "r", String.fromCharCode(0x0072) ); -new TestCase( SECTION, "String.fromCharCode(0x0073)", "s", String.fromCharCode(0x0073) ); -new TestCase( SECTION, "String.fromCharCode(0x0074)", "t", String.fromCharCode(0x0074) ); -new TestCase( SECTION, "String.fromCharCode(0x0075)", "u", String.fromCharCode(0x0075) ); -new TestCase( SECTION, "String.fromCharCode(0x0076)", "v", String.fromCharCode(0x0076) ); -new TestCase( SECTION, "String.fromCharCode(0x0077)", "w", String.fromCharCode(0x0077) ); -new TestCase( SECTION, "String.fromCharCode(0x0078)", "x", String.fromCharCode(0x0078) ); -new TestCase( SECTION, "String.fromCharCode(0x0079)", "y", String.fromCharCode(0x0079) ); -new TestCase( SECTION, "String.fromCharCode(0x007A)", "z", String.fromCharCode(0x007A) ); -new TestCase( SECTION, "String.fromCharCode(0x007B)", "{", String.fromCharCode(0x007B) ); -new TestCase( SECTION, "String.fromCharCode(0x007C)", "|", String.fromCharCode(0x007C) ); -new TestCase( SECTION, "String.fromCharCode(0x007D)", "}", String.fromCharCode(0x007D) ); -new TestCase( SECTION, "String.fromCharCode(0x007E)", "~", String.fromCharCode(0x007E) ); -// new TestCase( SECTION, "String.fromCharCode(0x0020, 0x007F)", "", String.fromCharCode(0x0040, 0x007F) ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.3.2-2.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.3.2-2.js deleted file mode 100644 index 563623e6e3..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.3.2-2.js +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.3.2-2.js'; - -/** - File Name: 15.5.3.2-2.js - ECMA Section: 15.5.3.2 String.fromCharCode( char0, char1, ... ) - Description: Return a string value containing as many characters - as the number of arguments. Each argument specifies - one character of the resulting string, with the first - argument specifying the first character, and so on, - from left to right. An argument is converted to a - character by applying the operation ToUint16 and - regarding the resulting 16bit integeras the Unicode - encoding of a character. If no arguments are supplied, - the result is the empty string. - - This tests String.fromCharCode with multiple arguments. - - Author: christine@netscape.com - Date: 2 october 1997 -*/ - -var SECTION = "15.5.3.2-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "String.fromCharCode()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "var MYSTRING = String.fromCharCode(eval(\"var args=''; for ( i = 0x0020; i < 0x007f; i++ ) { args += ( i == 0x007e ) ? i : i + ', '; } args;\")); MYSTRING", - " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~", - eval( "var MYSTRING = String.fromCharCode(" + eval("var args=''; for ( i = 0x0020; i < 0x007f; i++ ) { args += ( i == 0x007e ) ? i : i + ', '; } args;") +"); MYSTRING" )); - -new TestCase( SECTION, - "MYSTRING.length", - 0x007f - 0x0020, - MYSTRING.length ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.3.2-3.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.3.2-3.js deleted file mode 100644 index ae41742be2..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.3.2-3.js +++ /dev/null @@ -1,121 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.3.2-3.js'; - -/** - File Name: 15.5.3.2-1.js - ECMA Section: 15.5.3.2 String.fromCharCode( char0, char1, ... ) - Description: Return a string value containing as many characters - as the number of arguments. Each argument specifies - one character of the resulting string, with the first - argument specifying the first character, and so on, - from left to right. An argument is converted to a - character by applying the operation ToUint16 and - regarding the resulting 16bit integeras the Unicode - encoding of a character. If no arguments are supplied, - the result is the empty string. - - This test covers Basic Latin (range U+0020 - U+007F) - - Author: christine@netscape.com - Date: 2 october 1997 -*/ - -var SECTION = "15.5.3.2-3"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "String.fromCharCode()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -for ( CHARCODE = 0; CHARCODE < 256; CHARCODE++ ) { - new TestCase( SECTION, - "(String.fromCharCode(" + CHARCODE +")).charCodeAt(0)", - ToUint16(CHARCODE), - (String.fromCharCode(CHARCODE)).charCodeAt(0) - ); -} -for ( CHARCODE = 256; CHARCODE < 65536; CHARCODE+=333 ) { - new TestCase( SECTION, - "(String.fromCharCode(" + CHARCODE +")).charCodeAt(0)", - ToUint16(CHARCODE), - (String.fromCharCode(CHARCODE)).charCodeAt(0) - ); -} -for ( CHARCODE = 65535; CHARCODE < 65538; CHARCODE++ ) { - new TestCase( SECTION, - "(String.fromCharCode(" + CHARCODE +")).charCodeAt(0)", - ToUint16(CHARCODE), - (String.fromCharCode(CHARCODE)).charCodeAt(0) - ); -} -for ( CHARCODE = Math.pow(2,32)-1; CHARCODE < Math.pow(2,32)+1; CHARCODE++ ) { - new TestCase( SECTION, - "(String.fromCharCode(" + CHARCODE +")).charCodeAt(0)", - ToUint16(CHARCODE), - (String.fromCharCode(CHARCODE)).charCodeAt(0) - ); -} -for ( CHARCODE = 0; CHARCODE > -65536; CHARCODE-=3333 ) { - new TestCase( SECTION, - "(String.fromCharCode(" + CHARCODE +")).charCodeAt(0)", - ToUint16(CHARCODE), - (String.fromCharCode(CHARCODE)).charCodeAt(0) - ); -} -new TestCase( SECTION, "(String.fromCharCode(65535)).charCodeAt(0)", 65535, (String.fromCharCode(65535)).charCodeAt(0) ); -new TestCase( SECTION, "(String.fromCharCode(65536)).charCodeAt(0)", 0, (String.fromCharCode(65536)).charCodeAt(0) ); -new TestCase( SECTION, "(String.fromCharCode(65537)).charCodeAt(0)", 1, (String.fromCharCode(65537)).charCodeAt(0) ); - -test(); - -function ToUint16( num ) { - num = Number( num ); - if ( isNaN( num ) || num == 0 || num == Number.POSITIVE_INFINITY || num == Number.NEGATIVE_INFINITY ) { - return 0; - } - - var sign = ( num < 0 ) ? -1 : 1; - - num = sign * Math.floor( Math.abs( num ) ); - num = num % Math.pow(2,16); - num = ( num > -65536 && num < 0) ? 65536 + num : num; - return num; -} - diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.3.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.3.js deleted file mode 100644 index 5370484568..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.3.js +++ /dev/null @@ -1,66 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.3.js'; - -/** - File Name: 15.5.3.1.js - ECMA Section: 15.5.3 Properties of the String Constructor - - Description: The value of the internal [[Prototype]] property of - the String constructor is the Function prototype - object. - - In addition to the internal [[Call]] and [[Construct]] - properties, the String constructor also has the length - property, as well as properties described in 15.5.3.1 - and 15.5.3.2. - - Author: christine@netscape.com - Date: 1 october 1997 -*/ - -var SECTION = "15.5.3"; -var VERSION = "ECMA_2"; -startTest(); -var passed = true; -writeHeaderToLog( SECTION + " Properties of the String Constructor" ); - -new TestCase( SECTION, "String.length", 1, String.length ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.1.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.1.js deleted file mode 100644 index ae8e12463d..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.1.js +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.1.js'; - -/** - File Name: 15.5.4.1.js - ECMA Section: 15.5.4.1 String.prototype.constructor - - Description: - Author: christine@netscape.com - Date: 28 october 1997 - -*/ -var SECTION = "15.5.4.1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "String.prototype.constructor"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "String.prototype.constructor == String", true, String.prototype.constructor == String ); - -new TestCase( SECTION, "var STRING = new String.prototype.constructor('hi'); STRING.getClass = Object.prototype.toString; STRING.getClass()", - "[object String]", - eval("var STRING = new String.prototype.constructor('hi'); STRING.getClass = Object.prototype.toString; STRING.getClass()") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.10-1.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.10-1.js deleted file mode 100644 index 2647d18cb2..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.10-1.js +++ /dev/null @@ -1,217 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.10-1.js'; - -/** - File Name: 15.5.4.10-1.js - ECMA Section: 15.5.4.10 String.prototype.substring( start, end ) - Description: - - 15.5.4.10 String.prototype.substring(start, end) - - Returns a substring of the result of converting this object to a string, - starting from character position start and running to character position - end of the string. The result is a string value, not a String object. - - If either argument is NaN or negative, it is replaced with zero; if either - argument is larger than the length of the string, it is replaced with the - length of the string. - - If start is larger than end, they are swapped. - - When the substring method is called with two arguments start and end, the - following steps are taken: - - 1. Call ToString, giving it the this value as its argument. - 2. Call ToInteger(start). - 3. Call ToInteger (end). - 4. Compute the number of characters in Result(1). - 5. Compute min(max(Result(2), 0), Result(4)). - 6. Compute min(max(Result(3), 0), Result(4)). - 7. Compute min(Result(5), Result(6)). - 8. Compute max(Result(5), Result(6)). - 9. Return a string whose length is the difference between Result(8) and - Result(7), containing characters from Result(1), namely the characters - with indices Result(7) through Result(8)1, in ascending order. - - Note that the substring function is intentionally generic; it does not require - that its this value be a String object. Therefore it can be transferred to other - kinds of objects for use as a method. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.5.4.10-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "String.prototype.substring( start, end )"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "String.prototype.substring.length", 2, String.prototype.substring.length ); -new TestCase( SECTION, "delete String.prototype.substring.length", false, delete String.prototype.substring.length ); -new TestCase( SECTION, "delete String.prototype.substring.length; String.prototype.substring.length", 2, eval("delete String.prototype.substring.length; String.prototype.substring.length") ); - -// test cases for when substring is called with no arguments. - -// this is a string object - -new TestCase( SECTION, - "var s = new String('this is a string object'); typeof s.substring()", - "string", - eval("var s = new String('this is a string object'); typeof s.substring()") ); - -new TestCase( SECTION, - "var s = new String(''); s.substring(1,0)", - "", - eval("var s = new String(''); s.substring(1,0)") ); - -new TestCase( SECTION, - "var s = new String('this is a string object'); s.substring(true, false)", - "t", - eval("var s = new String('this is a string object'); s.substring(false, true)") ); - -new TestCase( SECTION, - "var s = new String('this is a string object'); s.substring(NaN, Infinity)", - "this is a string object", - eval("var s = new String('this is a string object'); s.substring(NaN, Infinity)") ); - - -new TestCase( SECTION, - "var s = new String('this is a string object'); s.substring(Infinity, NaN)", - "this is a string object", - eval("var s = new String('this is a string object'); s.substring(Infinity, NaN)") ); - - -new TestCase( SECTION, - "var s = new String('this is a string object'); s.substring(Infinity, Infinity)", - "", - eval("var s = new String('this is a string object'); s.substring(Infinity, Infinity)") ); - -new TestCase( SECTION, - "var s = new String('this is a string object'); s.substring(-0.01, 0)", - "", - eval("var s = new String('this is a string object'); s.substring(-0.01,0)") ); - - -new TestCase( SECTION, - "var s = new String('this is a string object'); s.substring(s.length, s.length)", - "", - eval("var s = new String('this is a string object'); s.substring(s.length, s.length)") ); - -new TestCase( SECTION, - "var s = new String('this is a string object'); s.substring(s.length+1, 0)", - "this is a string object", - eval("var s = new String('this is a string object'); s.substring(s.length+1, 0)") ); - - -new TestCase( SECTION, - "var s = new String('this is a string object'); s.substring(-Infinity, -Infinity)", - "", - eval("var s = new String('this is a string object'); s.substring(-Infinity, -Infinity)") ); - -// this is not a String object, start is not an integer - - -new TestCase( SECTION, - "var s = new Array(1,2,3,4,5); s.substring = String.prototype.substring; s.substring(Infinity,-Infinity)", - "1,2,3,4,5", - eval("var s = new Array(1,2,3,4,5); s.substring = String.prototype.substring; s.substring(Infinity,-Infinity)") ); - -new TestCase( SECTION, - "var s = new Array(1,2,3,4,5); s.substring = String.prototype.substring; s.substring(true, false)", - "1", - eval("var s = new Array(1,2,3,4,5); s.substring = String.prototype.substring; s.substring(true, false)") ); - -new TestCase( SECTION, - "var s = new Array(1,2,3,4,5); s.substring = String.prototype.substring; s.substring('4', '5')", - "3", - eval("var s = new Array(1,2,3,4,5); s.substring = String.prototype.substring; s.substring('4', '5')") ); - - -// this is an object object -new TestCase( SECTION, - "var obj = new Object(); obj.substring = String.prototype.substring; obj.substring(8,0)", - "[object ", - eval("var obj = new Object(); obj.substring = String.prototype.substring; obj.substring(8,0)") ); - -new TestCase( SECTION, - "var obj = new Object(); obj.substring = String.prototype.substring; obj.substring(8,obj.toString().length)", - "Object]", - eval("var obj = new Object(); obj.substring = String.prototype.substring; obj.substring(8, obj.toString().length)") ); - -// this is a function object -new TestCase( SECTION, - "var obj = new Function(); obj.substring = String.prototype.substring; obj.toString = Object.prototype.toString; obj.substring(8, Infinity)", - "Function]", - eval("var obj = new Function(); obj.substring = String.prototype.substring; obj.toString = Object.prototype.toString; obj.substring(8,Infinity)") ); -// this is a number object -new TestCase( SECTION, - "var obj = new Number(NaN); obj.substring = String.prototype.substring; obj.substring(Infinity, NaN)", - "NaN", - eval("var obj = new Number(NaN); obj.substring = String.prototype.substring; obj.substring(Infinity, NaN)") ); - -// this is the Math object -new TestCase( SECTION, - "var obj = Math; obj.substring = String.prototype.substring; obj.substring(Math.PI, -10)", - "[ob", - eval("var obj = Math; obj.substring = String.prototype.substring; obj.substring(Math.PI, -10)") ); - -// this is a Boolean object - -new TestCase( SECTION, - "var obj = new Boolean(); obj.substring = String.prototype.substring; obj.substring(new Array(), new Boolean(1))", - "f", - eval("var obj = new Boolean(); obj.substring = String.prototype.substring; obj.substring(new Array(), new Boolean(1))") ); - -// this is a user defined object - -new TestCase( SECTION, - "var obj = new MyObject( void 0 ); obj.substring(0, 100)", - "undefined", - eval( "var obj = new MyObject( void 0 ); obj.substring(0,100)") ); - -test(); - -function MyObject( value ) { - this.value = value; - this.substring = String.prototype.substring; - this.toString = new Function ( "return this.value+''" ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.11-1.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.11-1.js deleted file mode 100644 index a705f3bbda..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.11-1.js +++ /dev/null @@ -1,518 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.11-1.js'; - -/** - File Name: 15.5.4.11-1.js - ECMA Section: 15.5.4.11 String.prototype.toLowerCase() - Description: - - Returns a string equal in length to the length of the result of converting - this object to a string. The result is a string value, not a String object. - - Every character of the result is equal to the corresponding character of the - string, unless that character has a Unicode 2.0 uppercase equivalent, in which - case the uppercase equivalent is used instead. (The canonical Unicode 2.0 case - mapping shall be used, which does not depend on implementation or locale.) - - Note that the toLowerCase function is intentionally generic; it does not require - that its this value be a String object. Therefore it can be transferred to other - kinds of objects for use as a method. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.5.4.11-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "String.prototype.toLowerCase()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "String.prototype.toLowerCase.length", 0, String.prototype.toLowerCase.length ); -new TestCase( SECTION, "delete String.prototype.toLowerCase.length", false, delete String.prototype.toLowerCase.length ); -new TestCase( SECTION, "delete String.prototype.toLowerCase.length; String.prototype.toLowerCase.length", 0, eval("delete String.prototype.toLowerCase.length; String.prototype.toLowerCase.length") ); - -// Basic Latin, Latin-1 Supplement, Latin Extended A -for ( var i = 0; i <= 0x017f; i++ ) { - var U = new Unicode(i); -/* - new TestCase( SECTION, - "var s = new String( String.fromCharCode("+i+") ); s.toLowerCase()", - String.fromCharCode(U.lower), - eval("var s = new String( String.fromCharCode("+i+") ); s.toLowerCase()") ); -*/ - new TestCase( SECTION, - "var s = new String( String.fromCharCode("+i+") ); s.toLowerCase().charCodeAt(0)", - U.lower, - eval("var s = new String( String.fromCharCode(i) ); s.toLowerCase().charCodeAt(0)") ); - -} - -test(); - -function MyObject( value ) { - this.value = value; - this.substring = String.prototype.substring; - this.toString = new Function ( "return this.value+''" ); -} -function Unicode( c ) { - u = GetUnicodeValues( c ); - this.upper = u[0]; - this.lower = u[1] - return this; -} -function GetUnicodeValues( c ) { - u = new Array(); - - u[0] = c; - u[1] = c; - - // upper case Basic Latin - - if ( c >= 0x0041 && c <= 0x005A) { - u[0] = c; - u[1] = c + 32; - return u; - } - - // lower case Basic Latin - if ( c >= 0x0061 && c <= 0x007a ) { - u[0] = c - 32; - u[1] = c; - return u; - } - - // upper case Latin-1 Supplement - if ( (c >= 0x00C0 && c <= 0x00D6) || (c >= 0x00D8 && c<=0x00DE) ) { - u[0] = c; - u[1] = c + 32; - return u; - } - - // lower case Latin-1 Supplement - if ( (c >= 0x00E0 && c <= 0x00F6) || (c >= 0x00F8 && c <= 0x00FE) ) { - u[0] = c - 32; - u[1] = c; - return u; - } - if ( c == 0x00FF ) { - u[0] = 0x0178; - u[1] = c; - return u; - } - // Latin Extended A - if ( (c >= 0x0100 && c < 0x0138) || (c > 0x0149 && c < 0x0178) ) { - // special case for capital I - if ( c == 0x0130 ) { - u[0] = c; - u[1] = 0x0069; - return u; - } - if ( c == 0x0131 ) { - u[0] = 0x0049; - u[1] = c; - return u; - } - - if ( c % 2 == 0 ) { - // if it's even, it's a capital and the lower case is c +1 - u[0] = c; - u[1] = c+1; - } else { - // if it's odd, it's a lower case and upper case is c-1 - u[0] = c-1; - u[1] = c; - } - return u; - } - if ( c == 0x0178 ) { - u[0] = c; - u[1] = 0x00FF; - return u; - } - - if ( (c >= 0x0139 && c < 0x0149) || (c > 0x0178 && c < 0x017F) ) { - if ( c % 2 == 1 ) { - // if it's odd, it's a capital and the lower case is c +1 - u[0] = c; - u[1] = c+1; - } else { - // if it's even, it's a lower case and upper case is c-1 - u[0] = c-1; - u[1] = c; - } - return u; - } - if ( c == 0x017F ) { - u[0] = 0x0053; - u[1] = c; - } - - // Latin Extended B - // need to improve this set - - if ( c >= 0x0200 && c <= 0x0217 ) { - if ( c % 2 == 0 ) { - u[0] = c; - u[1] = c+1; - } else { - u[0] = c-1; - u[1] = c; - } - return u; - } - - // Latin Extended Additional - // Range: U+1E00 to U+1EFF - // http://www.unicode.org/Unicode.charts/glyphless/U1E00.html - - // Spacing Modifier Leters - // Range: U+02B0 to U+02FF - - // Combining Diacritical Marks - // Range: U+0300 to U+036F - - // skip Greek for now - // Greek - // Range: U+0370 to U+03FF - - // Cyrillic - // Range: U+0400 to U+04FF - - if ( (c >= 0x0401 && c <= 0x040C) || ( c>= 0x040E && c <= 0x040F ) ) { - u[0] = c; - u[1] = c + 80; - return u; - } - - - if ( c >= 0x0410 && c <= 0x042F ) { - u[0] = c; - u[1] = c + 32; - return u; - } - - if ( c >= 0x0430 && c<= 0x044F ) { - u[0] = c - 32; - u[1] = c; - return u; - - } - if ( (c >= 0x0451 && c <= 0x045C) || (c >=0x045E && c<= 0x045F) ) { - u[0] = c -80; - u[1] = c; - return u; - } - - if ( c >= 0x0460 && c <= 0x047F ) { - if ( c % 2 == 0 ) { - u[0] = c; - u[1] = c +1; - } else { - u[0] = c - 1; - u[1] = c; - } - return u; - } - - // Armenian - // Range: U+0530 to U+058F - if ( c >= 0x0531 && c <= 0x0556 ) { - u[0] = c; - u[1] = c + 48; - return u; - } - if ( c >= 0x0561 && c < 0x0587 ) { - u[0] = c - 48; - u[1] = c; - return u; - } - - // Hebrew - // Range: U+0590 to U+05FF - - - // Arabic - // Range: U+0600 to U+06FF - - // Devanagari - // Range: U+0900 to U+097F - - - // Bengali - // Range: U+0980 to U+09FF - - - // Gurmukhi - // Range: U+0A00 to U+0A7F - - - // Gujarati - // Range: U+0A80 to U+0AFF - - - // Oriya - // Range: U+0B00 to U+0B7F - // no capital / lower case - - - // Tamil - // Range: U+0B80 to U+0BFF - // no capital / lower case - - - // Telugu - // Range: U+0C00 to U+0C7F - // no capital / lower case - - - // Kannada - // Range: U+0C80 to U+0CFF - // no capital / lower case - - - // Malayalam - // Range: U+0D00 to U+0D7F - - // Thai - // Range: U+0E00 to U+0E7F - - - // Lao - // Range: U+0E80 to U+0EFF - - - // Tibetan - // Range: U+0F00 to U+0FBF - - // Georgian - // Range: U+10A0 to U+10F0 - if ( c >= 0x10A0 && c <= 0x10C5 ) { - u[0] = c; - u[1] = c + 48; - return u; - } - if ( c >= 0x10D0 && c <= 0x10F5 ) { - u[0] = c; - u[1] = c; - return u; - } - - // Hangul Jamo - // Range: U+1100 to U+11FF - - // Greek Extended - // Range: U+1F00 to U+1FFF - // skip for now - - - // General Punctuation - // Range: U+2000 to U+206F - - // Superscripts and Subscripts - // Range: U+2070 to U+209F - - // Currency Symbols - // Range: U+20A0 to U+20CF - - - // Combining Diacritical Marks for Symbols - // Range: U+20D0 to U+20FF - // skip for now - - - // Number Forms - // Range: U+2150 to U+218F - // skip for now - - - // Arrows - // Range: U+2190 to U+21FF - - // Mathematical Operators - // Range: U+2200 to U+22FF - - // Miscellaneous Technical - // Range: U+2300 to U+23FF - - // Control Pictures - // Range: U+2400 to U+243F - - // Optical Character Recognition - // Range: U+2440 to U+245F - - // Enclosed Alphanumerics - // Range: U+2460 to U+24FF - - // Box Drawing - // Range: U+2500 to U+257F - - // Block Elements - // Range: U+2580 to U+259F - - // Geometric Shapes - // Range: U+25A0 to U+25FF - - // Miscellaneous Symbols - // Range: U+2600 to U+26FF - - // Dingbats - // Range: U+2700 to U+27BF - - // CJK Symbols and Punctuation - // Range: U+3000 to U+303F - - // Hiragana - // Range: U+3040 to U+309F - - // Katakana - // Range: U+30A0 to U+30FF - - // Bopomofo - // Range: U+3100 to U+312F - - // Hangul Compatibility Jamo - // Range: U+3130 to U+318F - - // Kanbun - // Range: U+3190 to U+319F - - - // Enclosed CJK Letters and Months - // Range: U+3200 to U+32FF - - // CJK Compatibility - // Range: U+3300 to U+33FF - - // Hangul Syllables - // Range: U+AC00 to U+D7A3 - - // High Surrogates - // Range: U+D800 to U+DB7F - - // Private Use High Surrogates - // Range: U+DB80 to U+DBFF - - // Low Surrogates - // Range: U+DC00 to U+DFFF - - // Private Use Area - // Range: U+E000 to U+F8FF - - // CJK Compatibility Ideographs - // Range: U+F900 to U+FAFF - - // Alphabetic Presentation Forms - // Range: U+FB00 to U+FB4F - - // Arabic Presentation Forms-A - // Range: U+FB50 to U+FDFF - - // Combining Half Marks - // Range: U+FE20 to U+FE2F - - // CJK Compatibility Forms - // Range: U+FE30 to U+FE4F - - // Small Form Variants - // Range: U+FE50 to U+FE6F - - // Arabic Presentation Forms-B - // Range: U+FE70 to U+FEFF - - // Halfwidth and Fullwidth Forms - // Range: U+FF00 to U+FFEF - - if ( c >= 0xFF21 && c <= 0xFF3A ) { - u[0] = c; - u[1] = c + 32; - return u; - } - - if ( c >= 0xFF41 && c <= 0xFF5A ) { - u[0] = c - 32; - u[1] = c; - return u; - } - - // Specials - // Range: U+FFF0 to U+FFFF - - return u; -} - -function DecimalToHexString( n ) { - n = Number( n ); - var h = "0x"; - - for ( var i = 3; i >= 0; i-- ) { - if ( n >= Math.pow(16, i) ){ - var t = Math.floor( n / Math.pow(16, i)); - n -= t * Math.pow(16, i); - if ( t >= 10 ) { - if ( t == 10 ) { - h += "A"; - } - if ( t == 11 ) { - h += "B"; - } - if ( t == 12 ) { - h += "C"; - } - if ( t == 13 ) { - h += "D"; - } - if ( t == 14 ) { - h += "E"; - } - if ( t == 15 ) { - h += "F"; - } - } else { - h += String( t ); - } - } else { - h += "0"; - } - } - - return h; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.11-2.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.11-2.js deleted file mode 100644 index 7377dc8247..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.11-2.js +++ /dev/null @@ -1,515 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.11-2.js'; - -/** - File Name: 15.5.4.11-2.js - ECMA Section: 15.5.4.11 String.prototype.toLowerCase() - Description: - - Returns a string equal in length to the length of the result of converting - this object to a string. The result is a string value, not a String object. - - Every character of the result is equal to the corresponding character of the - string, unless that character has a Unicode 2.0 uppercase equivalent, in which - case the uppercase equivalent is used instead. (The canonical Unicode 2.0 case - mapping shall be used, which does not depend on implementation or locale.) - - Note that the toLowerCase function is intentionally generic; it does not require - that its this value be a String object. Therefore it can be transferred to other - kinds of objects for use as a method. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.5.4.11-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "String.prototype.toLowerCase()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -// Georgian -// Range: U+10A0 to U+10FF -for ( var i = 0x10A0; i <= 0x10FF; i++ ) { - var U = new Unicode( i ); - -/* - new TestCase( SECTION, - "var s = new String( String.fromCharCode("+i+") ); s.toLowerCase()", - String.fromCharCode(U.lower), - eval("var s = new String( String.fromCharCode("+i+") ); s.toLowerCase()") ); -*/ - new TestCase( SECTION, - "var s = new String( String.fromCharCode("+i+") ); s.toLowerCase().charCodeAt(0)", - U.lower, - eval("var s = new String( String.fromCharCode(i) ); s.toLowerCase().charCodeAt(0)") ); -} - -test(); - -function MyObject( value ) { - this.value = value; - this.substring = String.prototype.substring; - this.toString = new Function ( "return this.value+''" ); -} -function Unicode( c ) { - u = GetUnicodeValues( c ); - this.upper = u[0]; - this.lower = u[1] - return this; -} -function GetUnicodeValues( c ) { - u = new Array(); - - u[0] = c; - u[1] = c; - - // upper case Basic Latin - - if ( c >= 0x0041 && c <= 0x005A) { - u[0] = c; - u[1] = c + 32; - return u; - } - - // lower case Basic Latin - if ( c >= 0x0061 && c <= 0x007a ) { - u[0] = c - 32; - u[1] = c; - return u; - } - - // upper case Latin-1 Supplement - if ( (c >= 0x00C0 && c <= 0x00D6) || (c >= 0x00D8 && c<=0x00DE) ) { - u[0] = c; - u[1] = c + 32; - return u; - } - - // lower case Latin-1 Supplement - if ( (c >= 0x00E0 && c <= 0x00F6) || (c >= 0x00F8 && c <= 0x00FE) ) { - u[0] = c - 32; - u[1] = c; - return u; - } - if ( c == 0x00FF ) { - u[0] = 0x0178; - u[1] = c; - return u; - } - // Latin Extended A - if ( (c >= 0x0100 && c < 0x0138) || (c > 0x0149 && c < 0x0178) ) { - // special case for capital I - if ( c == 0x0130 ) { - u[0] = c; - u[1] = 0x0069; - return u; - } - if ( c == 0x0131 ) { - u[0] = 0x0049; - u[1] = c; - return u; - } - - if ( c % 2 == 0 ) { - // if it's even, it's a capital and the lower case is c +1 - u[0] = c; - u[1] = c+1; - } else { - // if it's odd, it's a lower case and upper case is c-1 - u[0] = c-1; - u[1] = c; - } - return u; - } - if ( c == 0x0178 ) { - u[0] = c; - u[1] = 0x00FF; - return u; - } - - if ( (c >= 0x0139 && c < 0x0149) || (c > 0x0178 && c < 0x017F) ) { - if ( c % 2 == 1 ) { - // if it's odd, it's a capital and the lower case is c +1 - u[0] = c; - u[1] = c+1; - } else { - // if it's even, it's a lower case and upper case is c-1 - u[0] = c-1; - u[1] = c; - } - return u; - } - if ( c == 0x017F ) { - u[0] = 0x0053; - u[1] = c; - } - - // Latin Extended B - // need to improve this set - - if ( c >= 0x0200 && c <= 0x0217 ) { - if ( c % 2 == 0 ) { - u[0] = c; - u[1] = c+1; - } else { - u[0] = c-1; - u[1] = c; - } - return u; - } - - // Latin Extended Additional - // Range: U+1E00 to U+1EFF - // http://www.unicode.org/Unicode.charts/glyphless/U1E00.html - - // Spacing Modifier Leters - // Range: U+02B0 to U+02FF - - // Combining Diacritical Marks - // Range: U+0300 to U+036F - - // skip Greek for now - // Greek - // Range: U+0370 to U+03FF - - // Cyrillic - // Range: U+0400 to U+04FF - - if ( (c >= 0x0401 && c <= 0x040C) || ( c>= 0x040E && c <= 0x040F ) ) { - u[0] = c; - u[1] = c + 80; - return u; - } - - - if ( c >= 0x0410 && c <= 0x042F ) { - u[0] = c; - u[1] = c + 32; - return u; - } - - if ( c >= 0x0430 && c<= 0x044F ) { - u[0] = c - 32; - u[1] = c; - return u; - - } - if ( (c >= 0x0451 && c <= 0x045C) || (c >=0x045E && c<= 0x045F) ) { - u[0] = c -80; - u[1] = c; - return u; - } - - if ( c >= 0x0460 && c <= 0x047F ) { - if ( c % 2 == 0 ) { - u[0] = c; - u[1] = c +1; - } else { - u[0] = c - 1; - u[1] = c; - } - return u; - } - - // Armenian - // Range: U+0530 to U+058F - if ( c >= 0x0531 && c <= 0x0556 ) { - u[0] = c; - u[1] = c + 48; - return u; - } - if ( c >= 0x0561 && c < 0x0587 ) { - u[0] = c - 48; - u[1] = c; - return u; - } - - // Hebrew - // Range: U+0590 to U+05FF - - - // Arabic - // Range: U+0600 to U+06FF - - // Devanagari - // Range: U+0900 to U+097F - - - // Bengali - // Range: U+0980 to U+09FF - - - // Gurmukhi - // Range: U+0A00 to U+0A7F - - - // Gujarati - // Range: U+0A80 to U+0AFF - - - // Oriya - // Range: U+0B00 to U+0B7F - // no capital / lower case - - - // Tamil - // Range: U+0B80 to U+0BFF - // no capital / lower case - - - // Telugu - // Range: U+0C00 to U+0C7F - // no capital / lower case - - - // Kannada - // Range: U+0C80 to U+0CFF - // no capital / lower case - - - // Malayalam - // Range: U+0D00 to U+0D7F - - // Thai - // Range: U+0E00 to U+0E7F - - - // Lao - // Range: U+0E80 to U+0EFF - - - // Tibetan - // Range: U+0F00 to U+0FBF - - // Georgian - // Range: U+10A0 to U+10F0 - if ( c >= 0x10A0 && c <= 0x10C5 ) { - u[0] = c; - u[1] = c + 48; - return u; - } - if ( c >= 0x10D0 && c <= 0x10F5 ) { - u[0] = c; - u[1] = c; - return u; - } - - // Hangul Jamo - // Range: U+1100 to U+11FF - - // Greek Extended - // Range: U+1F00 to U+1FFF - // skip for now - - - // General Punctuation - // Range: U+2000 to U+206F - - // Superscripts and Subscripts - // Range: U+2070 to U+209F - - // Currency Symbols - // Range: U+20A0 to U+20CF - - - // Combining Diacritical Marks for Symbols - // Range: U+20D0 to U+20FF - // skip for now - - - // Number Forms - // Range: U+2150 to U+218F - // skip for now - - - // Arrows - // Range: U+2190 to U+21FF - - // Mathematical Operators - // Range: U+2200 to U+22FF - - // Miscellaneous Technical - // Range: U+2300 to U+23FF - - // Control Pictures - // Range: U+2400 to U+243F - - // Optical Character Recognition - // Range: U+2440 to U+245F - - // Enclosed Alphanumerics - // Range: U+2460 to U+24FF - - // Box Drawing - // Range: U+2500 to U+257F - - // Block Elements - // Range: U+2580 to U+259F - - // Geometric Shapes - // Range: U+25A0 to U+25FF - - // Miscellaneous Symbols - // Range: U+2600 to U+26FF - - // Dingbats - // Range: U+2700 to U+27BF - - // CJK Symbols and Punctuation - // Range: U+3000 to U+303F - - // Hiragana - // Range: U+3040 to U+309F - - // Katakana - // Range: U+30A0 to U+30FF - - // Bopomofo - // Range: U+3100 to U+312F - - // Hangul Compatibility Jamo - // Range: U+3130 to U+318F - - // Kanbun - // Range: U+3190 to U+319F - - - // Enclosed CJK Letters and Months - // Range: U+3200 to U+32FF - - // CJK Compatibility - // Range: U+3300 to U+33FF - - // Hangul Syllables - // Range: U+AC00 to U+D7A3 - - // High Surrogates - // Range: U+D800 to U+DB7F - - // Private Use High Surrogates - // Range: U+DB80 to U+DBFF - - // Low Surrogates - // Range: U+DC00 to U+DFFF - - // Private Use Area - // Range: U+E000 to U+F8FF - - // CJK Compatibility Ideographs - // Range: U+F900 to U+FAFF - - // Alphabetic Presentation Forms - // Range: U+FB00 to U+FB4F - - // Arabic Presentation Forms-A - // Range: U+FB50 to U+FDFF - - // Combining Half Marks - // Range: U+FE20 to U+FE2F - - // CJK Compatibility Forms - // Range: U+FE30 to U+FE4F - - // Small Form Variants - // Range: U+FE50 to U+FE6F - - // Arabic Presentation Forms-B - // Range: U+FE70 to U+FEFF - - // Halfwidth and Fullwidth Forms - // Range: U+FF00 to U+FFEF - - if ( c >= 0xFF21 && c <= 0xFF3A ) { - u[0] = c; - u[1] = c + 32; - return u; - } - - if ( c >= 0xFF41 && c <= 0xFF5A ) { - u[0] = c - 32; - u[1] = c; - return u; - } - - // Specials - // Range: U+FFF0 to U+FFFF - - return u; -} - -function DecimalToHexString( n ) { - n = Number( n ); - var h = "0x"; - - for ( var i = 3; i >= 0; i-- ) { - if ( n >= Math.pow(16, i) ){ - var t = Math.floor( n / Math.pow(16, i)); - n -= t * Math.pow(16, i); - if ( t >= 10 ) { - if ( t == 10 ) { - h += "A"; - } - if ( t == 11 ) { - h += "B"; - } - if ( t == 12 ) { - h += "C"; - } - if ( t == 13 ) { - h += "D"; - } - if ( t == 14 ) { - h += "E"; - } - if ( t == 15 ) { - h += "F"; - } - } else { - h += String( t ); - } - } else { - h += "0"; - } - } - - return h; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.11-3.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.11-3.js deleted file mode 100644 index 0a37dcd28a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.11-3.js +++ /dev/null @@ -1,514 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.11-3.js'; - -/** - File Name: 15.5.4.11-2.js - ECMA Section: 15.5.4.11 String.prototype.toLowerCase() - Description: - - Returns a string equal in length to the length of the result of converting - this object to a string. The result is a string value, not a String object. - - Every character of the result is equal to the corresponding character of the - string, unless that character has a Unicode 2.0 uppercase equivalent, in which - case the uppercase equivalent is used instead. (The canonical Unicode 2.0 case - mapping shall be used, which does not depend on implementation or locale.) - - Note that the toLowerCase function is intentionally generic; it does not require - that its this value be a String object. Therefore it can be transferred to other - kinds of objects for use as a method. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.5.4.11-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "String.prototype.toLowerCase()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -// Halfwidth and Fullwidth Forms -// Range: U+FF00 to U+FFEF -for ( var i = 0xFF00; i <= 0xFFEF; i++ ) { - var U = new Unicode(i); -/* - new TestCase( SECTION, - "var s = new String( String.fromCharCode("+i+") ); s.toLowerCase()", - String.fromCharCode(U.lower), - eval("var s = new String( String.fromCharCode("+i+") ); s.toLowerCase()") ); -*/ - new TestCase( SECTION, - "var s = new String( String.fromCharCode("+i+") ); s.toLowerCase().charCodeAt(0)", - U.lower, - eval("var s = new String( String.fromCharCode(i) ); s.toLowerCase().charCodeAt(0)") ); -} - -test(); - -function MyObject( value ) { - this.value = value; - this.substring = String.prototype.substring; - this.toString = new Function ( "return this.value+''" ); -} -function Unicode( c ) { - u = GetUnicodeValues( c ); - this.upper = u[0]; - this.lower = u[1] - return this; -} -function GetUnicodeValues( c ) { - u = new Array(); - - u[0] = c; - u[1] = c; - - // upper case Basic Latin - - if ( c >= 0x0041 && c <= 0x005A) { - u[0] = c; - u[1] = c + 32; - return u; - } - - // lower case Basic Latin - if ( c >= 0x0061 && c <= 0x007a ) { - u[0] = c - 32; - u[1] = c; - return u; - } - - // upper case Latin-1 Supplement - if ( (c >= 0x00C0 && c <= 0x00D6) || (c >= 0x00D8 && c<=0x00DE) ) { - u[0] = c; - u[1] = c + 32; - return u; - } - - // lower case Latin-1 Supplement - if ( (c >= 0x00E0 && c <= 0x00F6) || (c >= 0x00F8 && c <= 0x00FE) ) { - u[0] = c - 32; - u[1] = c; - return u; - } - if ( c == 0x00FF ) { - u[0] = 0x0178; - u[1] = c; - return u; - } - // Latin Extended A - if ( (c >= 0x0100 && c < 0x0138) || (c > 0x0149 && c < 0x0178) ) { - // special case for capital I - if ( c == 0x0130 ) { - u[0] = c; - u[1] = 0x0069; - return u; - } - if ( c == 0x0131 ) { - u[0] = 0x0049; - u[1] = c; - return u; - } - - if ( c % 2 == 0 ) { - // if it's even, it's a capital and the lower case is c +1 - u[0] = c; - u[1] = c+1; - } else { - // if it's odd, it's a lower case and upper case is c-1 - u[0] = c-1; - u[1] = c; - } - return u; - } - if ( c == 0x0178 ) { - u[0] = c; - u[1] = 0x00FF; - return u; - } - - if ( (c >= 0x0139 && c < 0x0149) || (c > 0x0178 && c < 0x017F) ) { - if ( c % 2 == 1 ) { - // if it's odd, it's a capital and the lower case is c +1 - u[0] = c; - u[1] = c+1; - } else { - // if it's even, it's a lower case and upper case is c-1 - u[0] = c-1; - u[1] = c; - } - return u; - } - if ( c == 0x017F ) { - u[0] = 0x0053; - u[1] = c; - } - - // Latin Extended B - // need to improve this set - - if ( c >= 0x0200 && c <= 0x0217 ) { - if ( c % 2 == 0 ) { - u[0] = c; - u[1] = c+1; - } else { - u[0] = c-1; - u[1] = c; - } - return u; - } - - // Latin Extended Additional - // Range: U+1E00 to U+1EFF - // http://www.unicode.org/Unicode.charts/glyphless/U1E00.html - - // Spacing Modifier Leters - // Range: U+02B0 to U+02FF - - // Combining Diacritical Marks - // Range: U+0300 to U+036F - - // skip Greek for now - // Greek - // Range: U+0370 to U+03FF - - // Cyrillic - // Range: U+0400 to U+04FF - - if ( (c >= 0x0401 && c <= 0x040C) || ( c>= 0x040E && c <= 0x040F ) ) { - u[0] = c; - u[1] = c + 80; - return u; - } - - - if ( c >= 0x0410 && c <= 0x042F ) { - u[0] = c; - u[1] = c + 32; - return u; - } - - if ( c >= 0x0430 && c<= 0x044F ) { - u[0] = c - 32; - u[1] = c; - return u; - - } - if ( (c >= 0x0451 && c <= 0x045C) || (c >=0x045E && c<= 0x045F) ) { - u[0] = c -80; - u[1] = c; - return u; - } - - if ( c >= 0x0460 && c <= 0x047F ) { - if ( c % 2 == 0 ) { - u[0] = c; - u[1] = c +1; - } else { - u[0] = c - 1; - u[1] = c; - } - return u; - } - - // Armenian - // Range: U+0530 to U+058F - if ( c >= 0x0531 && c <= 0x0556 ) { - u[0] = c; - u[1] = c + 48; - return u; - } - if ( c >= 0x0561 && c < 0x0587 ) { - u[0] = c - 48; - u[1] = c; - return u; - } - - // Hebrew - // Range: U+0590 to U+05FF - - - // Arabic - // Range: U+0600 to U+06FF - - // Devanagari - // Range: U+0900 to U+097F - - - // Bengali - // Range: U+0980 to U+09FF - - - // Gurmukhi - // Range: U+0A00 to U+0A7F - - - // Gujarati - // Range: U+0A80 to U+0AFF - - - // Oriya - // Range: U+0B00 to U+0B7F - // no capital / lower case - - - // Tamil - // Range: U+0B80 to U+0BFF - // no capital / lower case - - - // Telugu - // Range: U+0C00 to U+0C7F - // no capital / lower case - - - // Kannada - // Range: U+0C80 to U+0CFF - // no capital / lower case - - - // Malayalam - // Range: U+0D00 to U+0D7F - - // Thai - // Range: U+0E00 to U+0E7F - - - // Lao - // Range: U+0E80 to U+0EFF - - - // Tibetan - // Range: U+0F00 to U+0FBF - - // Georgian - // Range: U+10A0 to U+10F0 - if ( c >= 0x10A0 && c <= 0x10C5 ) { - u[0] = c; - u[1] = c + 48; - return u; - } - if ( c >= 0x10D0 && c <= 0x10F5 ) { - u[0] = c; - u[1] = c; - return u; - } - - // Hangul Jamo - // Range: U+1100 to U+11FF - - // Greek Extended - // Range: U+1F00 to U+1FFF - // skip for now - - - // General Punctuation - // Range: U+2000 to U+206F - - // Superscripts and Subscripts - // Range: U+2070 to U+209F - - // Currency Symbols - // Range: U+20A0 to U+20CF - - - // Combining Diacritical Marks for Symbols - // Range: U+20D0 to U+20FF - // skip for now - - - // Number Forms - // Range: U+2150 to U+218F - // skip for now - - - // Arrows - // Range: U+2190 to U+21FF - - // Mathematical Operators - // Range: U+2200 to U+22FF - - // Miscellaneous Technical - // Range: U+2300 to U+23FF - - // Control Pictures - // Range: U+2400 to U+243F - - // Optical Character Recognition - // Range: U+2440 to U+245F - - // Enclosed Alphanumerics - // Range: U+2460 to U+24FF - - // Box Drawing - // Range: U+2500 to U+257F - - // Block Elements - // Range: U+2580 to U+259F - - // Geometric Shapes - // Range: U+25A0 to U+25FF - - // Miscellaneous Symbols - // Range: U+2600 to U+26FF - - // Dingbats - // Range: U+2700 to U+27BF - - // CJK Symbols and Punctuation - // Range: U+3000 to U+303F - - // Hiragana - // Range: U+3040 to U+309F - - // Katakana - // Range: U+30A0 to U+30FF - - // Bopomofo - // Range: U+3100 to U+312F - - // Hangul Compatibility Jamo - // Range: U+3130 to U+318F - - // Kanbun - // Range: U+3190 to U+319F - - - // Enclosed CJK Letters and Months - // Range: U+3200 to U+32FF - - // CJK Compatibility - // Range: U+3300 to U+33FF - - // Hangul Syllables - // Range: U+AC00 to U+D7A3 - - // High Surrogates - // Range: U+D800 to U+DB7F - - // Private Use High Surrogates - // Range: U+DB80 to U+DBFF - - // Low Surrogates - // Range: U+DC00 to U+DFFF - - // Private Use Area - // Range: U+E000 to U+F8FF - - // CJK Compatibility Ideographs - // Range: U+F900 to U+FAFF - - // Alphabetic Presentation Forms - // Range: U+FB00 to U+FB4F - - // Arabic Presentation Forms-A - // Range: U+FB50 to U+FDFF - - // Combining Half Marks - // Range: U+FE20 to U+FE2F - - // CJK Compatibility Forms - // Range: U+FE30 to U+FE4F - - // Small Form Variants - // Range: U+FE50 to U+FE6F - - // Arabic Presentation Forms-B - // Range: U+FE70 to U+FEFF - - // Halfwidth and Fullwidth Forms - // Range: U+FF00 to U+FFEF - - if ( c >= 0xFF21 && c <= 0xFF3A ) { - u[0] = c; - u[1] = c + 32; - return u; - } - - if ( c >= 0xFF41 && c <= 0xFF5A ) { - u[0] = c - 32; - u[1] = c; - return u; - } - - // Specials - // Range: U+FFF0 to U+FFFF - - return u; -} - -function DecimalToHexString( n ) { - n = Number( n ); - var h = "0x"; - - for ( var i = 3; i >= 0; i-- ) { - if ( n >= Math.pow(16, i) ){ - var t = Math.floor( n / Math.pow(16, i)); - n -= t * Math.pow(16, i); - if ( t >= 10 ) { - if ( t == 10 ) { - h += "A"; - } - if ( t == 11 ) { - h += "B"; - } - if ( t == 12 ) { - h += "C"; - } - if ( t == 13 ) { - h += "D"; - } - if ( t == 14 ) { - h += "E"; - } - if ( t == 15 ) { - h += "F"; - } - } else { - h += String( t ); - } - } else { - h += "0"; - } - } - - return h; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.11-4.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.11-4.js deleted file mode 100644 index 1196e61c08..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.11-4.js +++ /dev/null @@ -1,507 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.11-4.js'; - -/** - File Name: 15.5.4.11-2.js - ECMA Section: 15.5.4.11 String.prototype.toLowerCase() - Description: - - Returns a string equal in length to the length of the result of converting - this object to a string. The result is a string value, not a String object. - - Every character of the result is equal to the corresponding character of the - string, unless that character has a Unicode 2.0 uppercase equivalent, in which - case the uppercase equivalent is used instead. (The canonical Unicode 2.0 case - mapping shall be used, which does not depend on implementation or locale.) - - Note that the toLowerCase function is intentionally generic; it does not require - that its this value be a String object. Therefore it can be transferred to other - kinds of objects for use as a method. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.5.4.11-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "String.prototype.toLowerCase()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -// Hiragana (no upper / lower case) -// Range: U+3040 to U+309F - -for ( var i = 0x3040; i <= 0x309F; i++ ) { - var U = new Unicode( i ); -/* - new TestCase( SECTION, - "var s = new String( String.fromCharCode("+i+") ); s.toLowerCase()", - String.fromCharCode(U.lower), - eval("var s = new String( String.fromCharCode("+i+") ); s.toLowerCase()") ); -*/ - new TestCase( SECTION, - "var s = new String( String.fromCharCode("+i+") ); s.toLowerCase().charCodeAt(0)", - U.lower, - eval("var s = new String( String.fromCharCode(i) ); s.toLowerCase().charCodeAt(0)") ); -} - -test(); - -function MyObject( value ) { - this.value = value; - this.substring = String.prototype.substring; - this.toString = new Function ( "return this.value+''" ); -} -function Unicode( c ) { - this.upper = c; - this.lower = c; - - // upper case Basic Latin - - if ( c >= 0x0041 && c <= 0x005A) { - this.upper = c; - this.lower = c + 32; - return this; - } - - // lower case Basic Latin - if ( c >= 0x0061 && c <= 0x007a ) { - this.upper = c - 32; - this.lower = c; - return this; - } - - // upper case Latin-1 Supplement - if ( (c >= 0x00C0 && c <= 0x00D6) || (c >= 0x00D8 && c<=0x00DE) ) { - this.upper = c; - this.lower = c + 32; - return this; - } - - // lower case Latin-1 Supplement - if ( (c >= 0x00E0 && c <= 0x00F6) || (c >= 0x00F8 && c <= 0x00FE) ) { - this.upper = c - 32; - this.lower = c; - return this; - } - if ( c == 0x00FF ) { - this.upper = 0x0178; - this.lower = c; - return this; - } - // Latin Extended A - if ( (c >= 0x0100 && c < 0x0138) || (c > 0x0149 && c < 0x0178) ) { - // special case for capital I - if ( c == 0x0130 ) { - this.upper = c; - this.lower = 0x0069; - return this; - } - if ( c == 0x0131 ) { - this.upper = 0x0049; - this.lower = c; - return this; - } - - if ( c % 2 == 0 ) { - // if it's even, it's a capital and the lower case is c +1 - this.upper = c; - this.lower = c+1; - } else { - // if it's odd, it's a lower case and upper case is c-1 - this.upper = c-1; - this.lower = c; - } - return this; - } - if ( c == 0x0178 ) { - this.upper = c; - this.lower = 0x00FF; - return this; - } - - if ( (c >= 0x0139 && c < 0x0149) || (c > 0x0178 && c < 0x017F) ) { - if ( c % 2 == 1 ) { - // if it's odd, it's a capital and the lower case is c +1 - this.upper = c; - this.lower = c+1; - } else { - // if it's even, it's a lower case and upper case is c-1 - this.upper = c-1; - this.lower = c; - } - return this; - } - if ( c == 0x017F ) { - this.upper = 0x0053; - this.lower = c; - } - - // Latin Extended B - // need to improve this set - - if ( c >= 0x0200 && c <= 0x0217 ) { - if ( c % 2 == 0 ) { - this.upper = c; - this.lower = c+1; - } else { - this.upper = c-1; - this.lower = c; - } - return this; - } - - // Latin Extended Additional - // Range: U+1E00 to U+1EFF - // http://www.unicode.org/Unicode.charts/glyphless/U1E00.html - - // Spacing Modifier Leters - // Range: U+02B0 to U+02FF - - // Combining Diacritical Marks - // Range: U+0300 to U+036F - - // skip Greek for now - // Greek - // Range: U+0370 to U+03FF - - // Cyrillic - // Range: U+0400 to U+04FF - - if ( (c >= 0x0401 && c <= 0x040C) || ( c>= 0x040E && c <= 0x040F ) ) { - this.upper = c; - this.lower = c + 80; - return this; - } - - - if ( c >= 0x0410 && c <= 0x042F ) { - this.upper = c; - this.lower = c + 32; - return this; - } - - if ( c >= 0x0430 && c<= 0x044F ) { - this.upper = c - 32; - this.lower = c; - return this; - - } - if ( (c >= 0x0451 && c <= 0x045C) || (c >=0x045E && c<= 0x045F) ) { - this.upper = c -80; - this.lower = c; - return this; - } - - if ( c >= 0x0460 && c <= 0x047F ) { - if ( c % 2 == 0 ) { - this.upper = c; - this.lower = c +1; - } else { - this.upper = c - 1; - this.lower = c; - } - return this; - } - - // Armenian - // Range: U+0530 to U+058F - if ( c >= 0x0531 && c <= 0x0556 ) { - this.upper = c; - this.lower = c + 48; - return this; - } - if ( c >= 0x0561 && c < 0x0587 ) { - this.upper = c - 48; - this.lower = c; - return this; - } - - // Hebrew - // Range: U+0590 to U+05FF - - - // Arabic - // Range: U+0600 to U+06FF - - // Devanagari - // Range: U+0900 to U+097F - - - // Bengali - // Range: U+0980 to U+09FF - - - // Gurmukhi - // Range: U+0A00 to U+0A7F - - - // Gujarati - // Range: U+0A80 to U+0AFF - - - // Oriya - // Range: U+0B00 to U+0B7F - // no capital / lower case - - - // Tamil - // Range: U+0B80 to U+0BFF - // no capital / lower case - - - // Telugu - // Range: U+0C00 to U+0C7F - // no capital / lower case - - - // Kannada - // Range: U+0C80 to U+0CFF - // no capital / lower case - - - // Malayalam - // Range: U+0D00 to U+0D7F - - // Thai - // Range: U+0E00 to U+0E7F - - - // Lao - // Range: U+0E80 to U+0EFF - - - // Tibetan - // Range: U+0F00 to U+0FBF - - // Georgian - // Range: U+10A0 to U+10F0 - if ( c >= 0x10A0 && c <= 0x10C5 ) { - this.upper = c; - this.lower = c + 48; - return this; - } - if ( c >= 0x10D0 && c <= 0x10F5 ) { - this.upper = c; - this.lower = c; - return this; - } - - // Hangul Jamo - // Range: U+1100 to U+11FF - - // Greek Extended - // Range: U+1F00 to U+1FFF - // skip for now - - - // General Punctuation - // Range: U+2000 to U+206F - - // Superscripts and Subscripts - // Range: U+2070 to U+209F - - // Currency Symbols - // Range: U+20A0 to U+20CF - - - // Combining Diacritical Marks for Symbols - // Range: U+20D0 to U+20FF - // skip for now - - - // Number Forms - // Range: U+2150 to U+218F - // skip for now - - - // Arrows - // Range: U+2190 to U+21FF - - // Mathematical Operators - // Range: U+2200 to U+22FF - - // Miscellaneous Technical - // Range: U+2300 to U+23FF - - // Control Pictures - // Range: U+2400 to U+243F - - // Optical Character Recognition - // Range: U+2440 to U+245F - - // Enclosed Alphanumerics - // Range: U+2460 to U+24FF - - // Box Drawing - // Range: U+2500 to U+257F - - // Block Elements - // Range: U+2580 to U+259F - - // Geometric Shapes - // Range: U+25A0 to U+25FF - - // Miscellaneous Symbols - // Range: U+2600 to U+26FF - - // Dingbats - // Range: U+2700 to U+27BF - - // CJK Symbols and Punctuation - // Range: U+3000 to U+303F - - // Hiragana - // Range: U+3040 to U+309F - - // Katakana - // Range: U+30A0 to U+30FF - - // Bopomofo - // Range: U+3100 to U+312F - - // Hangul Compatibility Jamo - // Range: U+3130 to U+318F - - // Kanbun - // Range: U+3190 to U+319F - - - // Enclosed CJK Letters and Months - // Range: U+3200 to U+32FF - - // CJK Compatibility - // Range: U+3300 to U+33FF - - // Hangul Syllables - // Range: U+AC00 to U+D7A3 - - // High Surrogates - // Range: U+D800 to U+DB7F - - // Private Use High Surrogates - // Range: U+DB80 to U+DBFF - - // Low Surrogates - // Range: U+DC00 to U+DFFF - - // Private Use Area - // Range: U+E000 to U+F8FF - - // CJK Compatibility Ideographs - // Range: U+F900 to U+FAFF - - // Alphabetic Presentation Forms - // Range: U+FB00 to U+FB4F - - // Arabic Presentation Forms-A - // Range: U+FB50 to U+FDFF - - // Combining Half Marks - // Range: U+FE20 to U+FE2F - - // CJK Compatibility Forms - // Range: U+FE30 to U+FE4F - - // Small Form Variants - // Range: U+FE50 to U+FE6F - - // Arabic Presentation Forms-B - // Range: U+FE70 to U+FEFF - - // Halfwidth and Fullwidth Forms - // Range: U+FF00 to U+FFEF - - if ( c >= 0xFF21 && c <= 0xFF3A ) { - this.upper = c; - this.lower = c + 32; - return this; - } - - if ( c >= 0xFF41 && c <= 0xFF5A ) { - this.upper = c - 32; - this.lower = c; - return this; - } - - // Specials - // Range: U+FFF0 to U+FFFF - - return this; -} - -function DecimalToHexString( n ) { - n = Number( n ); - var h = "0x"; - - for ( var i = 3; i >= 0; i-- ) { - if ( n >= Math.pow(16, i) ){ - var t = Math.floor( n / Math.pow(16, i)); - n -= t * Math.pow(16, i); - if ( t >= 10 ) { - if ( t == 10 ) { - h += "A"; - } - if ( t == 11 ) { - h += "B"; - } - if ( t == 12 ) { - h += "C"; - } - if ( t == 13 ) { - h += "D"; - } - if ( t == 14 ) { - h += "E"; - } - if ( t == 15 ) { - h += "F"; - } - } else { - h += String( t ); - } - } else { - h += "0"; - } - } - - return h; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.11-5.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.11-5.js deleted file mode 100644 index eec6410200..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.11-5.js +++ /dev/null @@ -1,520 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.11-5.js'; - -/** - File Name: 15.5.4.11-5.js - ECMA Section: 15.5.4.11 String.prototype.toLowerCase() - Description: - - Returns a string equal in length to the length of the result of converting - this object to a string. The result is a string value, not a String object. - - Every character of the result is equal to the corresponding character of the - string, unless that character has a Unicode 2.0 uppercase equivalent, in which - case the uppercase equivalent is used instead. (The canonical Unicode 2.0 case - mapping shall be used, which does not depend on implementation or locale.) - - Note that the toLowerCase function is intentionally generic; it does not require - that its this value be a String object. Therefore it can be transferred to other - kinds of objects for use as a method. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.5.4.11-5"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "String.prototype.toLowerCase()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "String.prototype.toLowerCase.length", 0, String.prototype.toLowerCase.length ); - -new TestCase( SECTION, "delete String.prototype.toLowerCase.length", false, delete String.prototype.toLowerCase.length ); - -new TestCase( SECTION, "delete String.prototype.toLowerCase.length; String.prototype.toLowerCase.length", 0, eval("delete String.prototype.toLowerCase.length; String.prototype.toLowerCase.length") ); - -// Cyrillic (part) -// Range: U+0400 to U+04FF -for ( var i = 0x0400; i <= 0x047F; i++ ) { - var U = new Unicode( i ); -/* - new TestCase( SECTION, - "var s = new String( String.fromCharCode("+i+") ); s.toLowerCase()", - String.fromCharCode(U.lower), - eval("var s = new String( String.fromCharCode("+i+") ); s.toLowerCase()") ); -*/ - new TestCase( SECTION, - "var s = new String( String.fromCharCode("+i+") ); s.toLowerCase().charCodeAt(0)", - U.lower, - eval("var s = new String( String.fromCharCode(i) ); s.toLowerCase().charCodeAt(0)") ); -} - -test(); - -function MyObject( value ) { - this.value = value; - this.substring = String.prototype.substring; - this.toString = new Function ( "return this.value+''" ); -} -function Unicode( c ) { - u = GetUnicodeValues( c ); - this.upper = u[0]; - this.lower = u[1] - return this; -} -function GetUnicodeValues( c ) { - u = new Array(); - - u[0] = c; - u[1] = c; - - // upper case Basic Latin - - if ( c >= 0x0041 && c <= 0x005A) { - u[0] = c; - u[1] = c + 32; - return u; - } - - // lower case Basic Latin - if ( c >= 0x0061 && c <= 0x007a ) { - u[0] = c - 32; - u[1] = c; - return u; - } - - // upper case Latin-1 Supplement - if ( (c >= 0x00C0 && c <= 0x00D6) || (c >= 0x00D8 && c<=0x00DE) ) { - u[0] = c; - u[1] = c + 32; - return u; - } - - // lower case Latin-1 Supplement - if ( (c >= 0x00E0 && c <= 0x00F6) || (c >= 0x00F8 && c <= 0x00FE) ) { - u[0] = c - 32; - u[1] = c; - return u; - } - if ( c == 0x00FF ) { - u[0] = 0x0178; - u[1] = c; - return u; - } - // Latin Extended A - if ( (c >= 0x0100 && c < 0x0138) || (c > 0x0149 && c < 0x0178) ) { - // special case for capital I - if ( c == 0x0130 ) { - u[0] = c; - u[1] = 0x0069; - return u; - } - if ( c == 0x0131 ) { - u[0] = 0x0049; - u[1] = c; - return u; - } - - if ( c % 2 == 0 ) { - // if it's even, it's a capital and the lower case is c +1 - u[0] = c; - u[1] = c+1; - } else { - // if it's odd, it's a lower case and upper case is c-1 - u[0] = c-1; - u[1] = c; - } - return u; - } - if ( c == 0x0178 ) { - u[0] = c; - u[1] = 0x00FF; - return u; - } - - if ( (c >= 0x0139 && c < 0x0149) || (c > 0x0178 && c < 0x017F) ) { - if ( c % 2 == 1 ) { - // if it's odd, it's a capital and the lower case is c +1 - u[0] = c; - u[1] = c+1; - } else { - // if it's even, it's a lower case and upper case is c-1 - u[0] = c-1; - u[1] = c; - } - return u; - } - if ( c == 0x017F ) { - u[0] = 0x0053; - u[1] = c; - } - - // Latin Extended B - // need to improve this set - - if ( c >= 0x0200 && c <= 0x0217 ) { - if ( c % 2 == 0 ) { - u[0] = c; - u[1] = c+1; - } else { - u[0] = c-1; - u[1] = c; - } - return u; - } - - // Latin Extended Additional - // Range: U+1E00 to U+1EFF - // http://www.unicode.org/Unicode.charts/glyphless/U1E00.html - - // Spacing Modifier Leters - // Range: U+02B0 to U+02FF - - // Combining Diacritical Marks - // Range: U+0300 to U+036F - - // skip Greek for now - // Greek - // Range: U+0370 to U+03FF - - // Cyrillic - // Range: U+0400 to U+04FF - - if ( (c >= 0x0401 && c <= 0x040C) || ( c>= 0x040E && c <= 0x040F ) ) { - u[0] = c; - u[1] = c + 80; - return u; - } - - - if ( c >= 0x0410 && c <= 0x042F ) { - u[0] = c; - u[1] = c + 32; - return u; - } - - if ( c >= 0x0430 && c<= 0x044F ) { - u[0] = c - 32; - u[1] = c; - return u; - - } - if ( (c >= 0x0451 && c <= 0x045C) || (c >=0x045E && c<= 0x045F) ) { - u[0] = c -80; - u[1] = c; - return u; - } - - if ( c >= 0x0460 && c <= 0x047F ) { - if ( c % 2 == 0 ) { - u[0] = c; - u[1] = c +1; - } else { - u[0] = c - 1; - u[1] = c; - } - return u; - } - - // Armenian - // Range: U+0530 to U+058F - if ( c >= 0x0531 && c <= 0x0556 ) { - u[0] = c; - u[1] = c + 48; - return u; - } - if ( c >= 0x0561 && c < 0x0587 ) { - u[0] = c - 48; - u[1] = c; - return u; - } - - // Hebrew - // Range: U+0590 to U+05FF - - - // Arabic - // Range: U+0600 to U+06FF - - // Devanagari - // Range: U+0900 to U+097F - - - // Bengali - // Range: U+0980 to U+09FF - - - // Gurmukhi - // Range: U+0A00 to U+0A7F - - - // Gujarati - // Range: U+0A80 to U+0AFF - - - // Oriya - // Range: U+0B00 to U+0B7F - // no capital / lower case - - - // Tamil - // Range: U+0B80 to U+0BFF - // no capital / lower case - - - // Telugu - // Range: U+0C00 to U+0C7F - // no capital / lower case - - - // Kannada - // Range: U+0C80 to U+0CFF - // no capital / lower case - - - // Malayalam - // Range: U+0D00 to U+0D7F - - // Thai - // Range: U+0E00 to U+0E7F - - - // Lao - // Range: U+0E80 to U+0EFF - - - // Tibetan - // Range: U+0F00 to U+0FBF - - // Georgian - // Range: U+10A0 to U+10F0 - if ( c >= 0x10A0 && c <= 0x10C5 ) { - u[0] = c; - u[1] = c + 48; - return u; - } - if ( c >= 0x10D0 && c <= 0x10F5 ) { - u[0] = c; - u[1] = c; - return u; - } - - // Hangul Jamo - // Range: U+1100 to U+11FF - - // Greek Extended - // Range: U+1F00 to U+1FFF - // skip for now - - - // General Punctuation - // Range: U+2000 to U+206F - - // Superscripts and Subscripts - // Range: U+2070 to U+209F - - // Currency Symbols - // Range: U+20A0 to U+20CF - - - // Combining Diacritical Marks for Symbols - // Range: U+20D0 to U+20FF - // skip for now - - - // Number Forms - // Range: U+2150 to U+218F - // skip for now - - - // Arrows - // Range: U+2190 to U+21FF - - // Mathematical Operators - // Range: U+2200 to U+22FF - - // Miscellaneous Technical - // Range: U+2300 to U+23FF - - // Control Pictures - // Range: U+2400 to U+243F - - // Optical Character Recognition - // Range: U+2440 to U+245F - - // Enclosed Alphanumerics - // Range: U+2460 to U+24FF - - // Box Drawing - // Range: U+2500 to U+257F - - // Block Elements - // Range: U+2580 to U+259F - - // Geometric Shapes - // Range: U+25A0 to U+25FF - - // Miscellaneous Symbols - // Range: U+2600 to U+26FF - - // Dingbats - // Range: U+2700 to U+27BF - - // CJK Symbols and Punctuation - // Range: U+3000 to U+303F - - // Hiragana - // Range: U+3040 to U+309F - - // Katakana - // Range: U+30A0 to U+30FF - - // Bopomofo - // Range: U+3100 to U+312F - - // Hangul Compatibility Jamo - // Range: U+3130 to U+318F - - // Kanbun - // Range: U+3190 to U+319F - - - // Enclosed CJK Letters and Months - // Range: U+3200 to U+32FF - - // CJK Compatibility - // Range: U+3300 to U+33FF - - // Hangul Syllables - // Range: U+AC00 to U+D7A3 - - // High Surrogates - // Range: U+D800 to U+DB7F - - // Private Use High Surrogates - // Range: U+DB80 to U+DBFF - - // Low Surrogates - // Range: U+DC00 to U+DFFF - - // Private Use Area - // Range: U+E000 to U+F8FF - - // CJK Compatibility Ideographs - // Range: U+F900 to U+FAFF - - // Alphabetic Presentation Forms - // Range: U+FB00 to U+FB4F - - // Arabic Presentation Forms-A - // Range: U+FB50 to U+FDFF - - // Combining Half Marks - // Range: U+FE20 to U+FE2F - - // CJK Compatibility Forms - // Range: U+FE30 to U+FE4F - - // Small Form Variants - // Range: U+FE50 to U+FE6F - - // Arabic Presentation Forms-B - // Range: U+FE70 to U+FEFF - - // Halfwidth and Fullwidth Forms - // Range: U+FF00 to U+FFEF - - if ( c >= 0xFF21 && c <= 0xFF3A ) { - u[0] = c; - u[1] = c + 32; - return u; - } - - if ( c >= 0xFF41 && c <= 0xFF5A ) { - u[0] = c - 32; - u[1] = c; - return u; - } - - // Specials - // Range: U+FFF0 to U+FFFF - - return u; -} - -function DecimalToHexString( n ) { - n = Number( n ); - var h = "0x"; - - for ( var i = 3; i >= 0; i-- ) { - if ( n >= Math.pow(16, i) ){ - var t = Math.floor( n / Math.pow(16, i)); - n -= t * Math.pow(16, i); - if ( t >= 10 ) { - if ( t == 10 ) { - h += "A"; - } - if ( t == 11 ) { - h += "B"; - } - if ( t == 12 ) { - h += "C"; - } - if ( t == 13 ) { - h += "D"; - } - if ( t == 14 ) { - h += "E"; - } - if ( t == 15 ) { - h += "F"; - } - } else { - h += String( t ); - } - } else { - h += "0"; - } - } - - return h; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.11-6.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.11-6.js deleted file mode 100644 index e3cc6039d4..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.11-6.js +++ /dev/null @@ -1,516 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.11-6.js'; - -/** - File Name: 15.5.4.11-6.js - ECMA Section: 15.5.4.11 String.prototype.toLowerCase() - Description: - - Returns a string equal in length to the length of the result of converting - this object to a string. The result is a string value, not a String object. - - Every character of the result is equal to the corresponding character of the - string, unless that character has a Unicode 2.0 uppercase equivalent, in which - case the uppercase equivalent is used instead. (The canonical Unicode 2.0 case - mapping shall be used, which does not depend on implementation or locale.) - - Note that the toLowerCase function is intentionally generic; it does not require - that its this value be a String object. Therefore it can be transferred to other - kinds of objects for use as a method. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.5.4.11-6"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "String.prototype.toLowerCase()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -// Armenian -// Range: U+0530 to U+058F -for ( var i = 0x0530; i <= 0x058F; i++ ) { - - var U = new Unicode( i ); -/* - new TestCase( SECTION, - "var s = new String( String.fromCharCode("+i+") ); s.toLowerCase()", - String.fromCharCode(U.lower), - eval("var s = new String( String.fromCharCode("+i+") ); s.toLowerCase()") ); -*/ - new TestCase( SECTION, - "var s = new String( String.fromCharCode("+i+") ); s.toLowerCase().charCodeAt(0)", - U.lower, - eval("var s = new String( String.fromCharCode(i) ); s.toLowerCase().charCodeAt(0)") ); - -} - -test(); - -function MyObject( value ) { - this.value = value; - this.substring = String.prototype.substring; - this.toString = new Function ( "return this.value+''" ); -} -function Unicode( c ) { - u = GetUnicodeValues( c ); - this.upper = u[0]; - this.lower = u[1] - return this; -} -function GetUnicodeValues( c ) { - u = new Array(); - - u[0] = c; - u[1] = c; - - // upper case Basic Latin - - if ( c >= 0x0041 && c <= 0x005A) { - u[0] = c; - u[1] = c + 32; - return u; - } - - // lower case Basic Latin - if ( c >= 0x0061 && c <= 0x007a ) { - u[0] = c - 32; - u[1] = c; - return u; - } - - // upper case Latin-1 Supplement - if ( (c >= 0x00C0 && c <= 0x00D6) || (c >= 0x00D8 && c<=0x00DE) ) { - u[0] = c; - u[1] = c + 32; - return u; - } - - // lower case Latin-1 Supplement - if ( (c >= 0x00E0 && c <= 0x00F6) || (c >= 0x00F8 && c <= 0x00FE) ) { - u[0] = c - 32; - u[1] = c; - return u; - } - if ( c == 0x00FF ) { - u[0] = 0x0178; - u[1] = c; - return u; - } - // Latin Extended A - if ( (c >= 0x0100 && c < 0x0138) || (c > 0x0149 && c < 0x0178) ) { - // special case for capital I - if ( c == 0x0130 ) { - u[0] = c; - u[1] = 0x0069; - return u; - } - if ( c == 0x0131 ) { - u[0] = 0x0049; - u[1] = c; - return u; - } - - if ( c % 2 == 0 ) { - // if it's even, it's a capital and the lower case is c +1 - u[0] = c; - u[1] = c+1; - } else { - // if it's odd, it's a lower case and upper case is c-1 - u[0] = c-1; - u[1] = c; - } - return u; - } - if ( c == 0x0178 ) { - u[0] = c; - u[1] = 0x00FF; - return u; - } - - if ( (c >= 0x0139 && c < 0x0149) || (c > 0x0178 && c < 0x017F) ) { - if ( c % 2 == 1 ) { - // if it's odd, it's a capital and the lower case is c +1 - u[0] = c; - u[1] = c+1; - } else { - // if it's even, it's a lower case and upper case is c-1 - u[0] = c-1; - u[1] = c; - } - return u; - } - if ( c == 0x017F ) { - u[0] = 0x0053; - u[1] = c; - } - - // Latin Extended B - // need to improve this set - - if ( c >= 0x0200 && c <= 0x0217 ) { - if ( c % 2 == 0 ) { - u[0] = c; - u[1] = c+1; - } else { - u[0] = c-1; - u[1] = c; - } - return u; - } - - // Latin Extended Additional - // Range: U+1E00 to U+1EFF - // http://www.unicode.org/Unicode.charts/glyphless/U1E00.html - - // Spacing Modifier Leters - // Range: U+02B0 to U+02FF - - // Combining Diacritical Marks - // Range: U+0300 to U+036F - - // skip Greek for now - // Greek - // Range: U+0370 to U+03FF - - // Cyrillic - // Range: U+0400 to U+04FF - - if ( (c >= 0x0401 && c <= 0x040C) || ( c>= 0x040E && c <= 0x040F ) ) { - u[0] = c; - u[1] = c + 80; - return u; - } - - - if ( c >= 0x0410 && c <= 0x042F ) { - u[0] = c; - u[1] = c + 32; - return u; - } - - if ( c >= 0x0430 && c<= 0x044F ) { - u[0] = c - 32; - u[1] = c; - return u; - - } - if ( (c >= 0x0451 && c <= 0x045C) || (c >=0x045E && c<= 0x045F) ) { - u[0] = c -80; - u[1] = c; - return u; - } - - if ( c >= 0x0460 && c <= 0x047F ) { - if ( c % 2 == 0 ) { - u[0] = c; - u[1] = c +1; - } else { - u[0] = c - 1; - u[1] = c; - } - return u; - } - - // Armenian - // Range: U+0530 to U+058F - if ( c >= 0x0531 && c <= 0x0556 ) { - u[0] = c; - u[1] = c + 48; - return u; - } - if ( c >= 0x0561 && c < 0x0587 ) { - u[0] = c - 48; - u[1] = c; - return u; - } - - // Hebrew - // Range: U+0590 to U+05FF - - - // Arabic - // Range: U+0600 to U+06FF - - // Devanagari - // Range: U+0900 to U+097F - - - // Bengali - // Range: U+0980 to U+09FF - - - // Gurmukhi - // Range: U+0A00 to U+0A7F - - - // Gujarati - // Range: U+0A80 to U+0AFF - - - // Oriya - // Range: U+0B00 to U+0B7F - // no capital / lower case - - - // Tamil - // Range: U+0B80 to U+0BFF - // no capital / lower case - - - // Telugu - // Range: U+0C00 to U+0C7F - // no capital / lower case - - - // Kannada - // Range: U+0C80 to U+0CFF - // no capital / lower case - - - // Malayalam - // Range: U+0D00 to U+0D7F - - // Thai - // Range: U+0E00 to U+0E7F - - - // Lao - // Range: U+0E80 to U+0EFF - - - // Tibetan - // Range: U+0F00 to U+0FBF - - // Georgian - // Range: U+10A0 to U+10F0 - if ( c >= 0x10A0 && c <= 0x10C5 ) { - u[0] = c; - u[1] = c + 48; - return u; - } - if ( c >= 0x10D0 && c <= 0x10F5 ) { - u[0] = c; - u[1] = c; - return u; - } - - // Hangul Jamo - // Range: U+1100 to U+11FF - - // Greek Extended - // Range: U+1F00 to U+1FFF - // skip for now - - - // General Punctuation - // Range: U+2000 to U+206F - - // Superscripts and Subscripts - // Range: U+2070 to U+209F - - // Currency Symbols - // Range: U+20A0 to U+20CF - - - // Combining Diacritical Marks for Symbols - // Range: U+20D0 to U+20FF - // skip for now - - - // Number Forms - // Range: U+2150 to U+218F - // skip for now - - - // Arrows - // Range: U+2190 to U+21FF - - // Mathematical Operators - // Range: U+2200 to U+22FF - - // Miscellaneous Technical - // Range: U+2300 to U+23FF - - // Control Pictures - // Range: U+2400 to U+243F - - // Optical Character Recognition - // Range: U+2440 to U+245F - - // Enclosed Alphanumerics - // Range: U+2460 to U+24FF - - // Box Drawing - // Range: U+2500 to U+257F - - // Block Elements - // Range: U+2580 to U+259F - - // Geometric Shapes - // Range: U+25A0 to U+25FF - - // Miscellaneous Symbols - // Range: U+2600 to U+26FF - - // Dingbats - // Range: U+2700 to U+27BF - - // CJK Symbols and Punctuation - // Range: U+3000 to U+303F - - // Hiragana - // Range: U+3040 to U+309F - - // Katakana - // Range: U+30A0 to U+30FF - - // Bopomofo - // Range: U+3100 to U+312F - - // Hangul Compatibility Jamo - // Range: U+3130 to U+318F - - // Kanbun - // Range: U+3190 to U+319F - - - // Enclosed CJK Letters and Months - // Range: U+3200 to U+32FF - - // CJK Compatibility - // Range: U+3300 to U+33FF - - // Hangul Syllables - // Range: U+AC00 to U+D7A3 - - // High Surrogates - // Range: U+D800 to U+DB7F - - // Private Use High Surrogates - // Range: U+DB80 to U+DBFF - - // Low Surrogates - // Range: U+DC00 to U+DFFF - - // Private Use Area - // Range: U+E000 to U+F8FF - - // CJK Compatibility Ideographs - // Range: U+F900 to U+FAFF - - // Alphabetic Presentation Forms - // Range: U+FB00 to U+FB4F - - // Arabic Presentation Forms-A - // Range: U+FB50 to U+FDFF - - // Combining Half Marks - // Range: U+FE20 to U+FE2F - - // CJK Compatibility Forms - // Range: U+FE30 to U+FE4F - - // Small Form Variants - // Range: U+FE50 to U+FE6F - - // Arabic Presentation Forms-B - // Range: U+FE70 to U+FEFF - - // Halfwidth and Fullwidth Forms - // Range: U+FF00 to U+FFEF - - if ( c >= 0xFF21 && c <= 0xFF3A ) { - u[0] = c; - u[1] = c + 32; - return u; - } - - if ( c >= 0xFF41 && c <= 0xFF5A ) { - u[0] = c - 32; - u[1] = c; - return u; - } - - // Specials - // Range: U+FFF0 to U+FFFF - - return u; -} - -function DecimalToHexString( n ) { - n = Number( n ); - var h = "0x"; - - for ( var i = 3; i >= 0; i-- ) { - if ( n >= Math.pow(16, i) ){ - var t = Math.floor( n / Math.pow(16, i)); - n -= t * Math.pow(16, i); - if ( t >= 10 ) { - if ( t == 10 ) { - h += "A"; - } - if ( t == 11 ) { - h += "B"; - } - if ( t == 12 ) { - h += "C"; - } - if ( t == 13 ) { - h += "D"; - } - if ( t == 14 ) { - h += "E"; - } - if ( t == 15 ) { - h += "F"; - } - } else { - h += String( t ); - } - } else { - h += "0"; - } - } - - return h; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.12-1.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.12-1.js deleted file mode 100644 index ecc497db48..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.12-1.js +++ /dev/null @@ -1,520 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.12-1.js'; - -/** - File Name: 15.5.4.12-1.js - ECMA Section: 15.5.4.12 String.prototype.toUpperCase() - Description: - - Returns a string equal in length to the length of the result of converting - this object to a string. The result is a string value, not a String object. - - Every character of the result is equal to the corresponding character of the - string, unless that character has a Unicode 2.0 uppercase equivalent, in which - case the uppercase equivalent is used instead. (The canonical Unicode 2.0 case - mapping shall be used, which does not depend on implementation or locale.) - - Note that the toUpperCase function is intentionally generic; it does not require - that its this value be a String object. Therefore it can be transferred to other - kinds of objects for use as a method. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.5.4.12-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "String.prototype.toUpperCase()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "String.prototype.toUpperCase.length", 0, String.prototype.toUpperCase.length ); -new TestCase( SECTION, "delete String.prototype.toUpperCase.length", false, delete String.prototype.toUpperCase.length ); -new TestCase( SECTION, "delete String.prototype.toupperCase.length; String.prototype.toupperCase.length", 0, eval("delete String.prototype.toUpperCase.length; String.prototype.toUpperCase.length") ); - -// Basic Latin, Latin-1 Supplement, Latin Extended A -for ( var i = 0; i <= 0x017f; i++ ) { - var U = new Unicode( i ); - - // XXX DF fails in java - - if ( i == 0x00DF ) { - continue; - } - - - new TestCase( SECTION, - "var s = new String( String.fromCharCode("+i+") ); s.toUpperCase().charCodeAt(0)", - U.upper, - eval("var s = new String( String.fromCharCode(i) ); s.toUpperCase().charCodeAt(0)") ); -} - -test(); - - -function MyObject( value ) { - this.value = value; - this.substring = String.prototype.substring; - this.toString = new Function ( "return this.value+''" ); -} -function Unicode( c ) { - u = GetUnicodeValues( c ); - this.upper = u[0]; - this.lower = u[1] - return this; -} -function GetUnicodeValues( c ) { - u = new Array(); - - u[0] = c; - u[1] = c; - - // upper case Basic Latin - - if ( c >= 0x0041 && c <= 0x005A) { - u[0] = c; - u[1] = c + 32; - return u; - } - - // lower case Basic Latin - if ( c >= 0x0061 && c <= 0x007a ) { - u[0] = c - 32; - u[1] = c; - return u; - } - - // upper case Latin-1 Supplement - if ( (c >= 0x00C0 && c <= 0x00D6) || (c >= 0x00D8 && c<=0x00DE) ) { - u[0] = c; - u[1] = c + 32; - return u; - } - - // lower case Latin-1 Supplement - if ( (c >= 0x00E0 && c <= 0x00F6) || (c >= 0x00F8 && c <= 0x00FE) ) { - u[0] = c - 32; - u[1] = c; - return u; - } - if ( c == 0x00FF ) { - u[0] = 0x0178; - u[1] = c; - return u; - } - // Latin Extended A - if ( (c >= 0x0100 && c < 0x0138) || (c > 0x0149 && c < 0x0178) ) { - // special case for capital I - if ( c == 0x0130 ) { - u[0] = c; - u[1] = 0x0069; - return u; - } - if ( c == 0x0131 ) { - u[0] = 0x0049; - u[1] = c; - return u; - } - - if ( c % 2 == 0 ) { - // if it's even, it's a capital and the lower case is c +1 - u[0] = c; - u[1] = c+1; - } else { - // if it's odd, it's a lower case and upper case is c-1 - u[0] = c-1; - u[1] = c; - } - return u; - } - if ( c == 0x0178 ) { - u[0] = c; - u[1] = 0x00FF; - return u; - } - - if ( (c >= 0x0139 && c < 0x0149) || (c > 0x0178 && c < 0x017F) ) { - if ( c % 2 == 1 ) { - // if it's odd, it's a capital and the lower case is c +1 - u[0] = c; - u[1] = c+1; - } else { - // if it's even, it's a lower case and upper case is c-1 - u[0] = c-1; - u[1] = c; - } - return u; - } - if ( c == 0x017F ) { - u[0] = 0x0053; - u[1] = c; - } - - // Latin Extended B - // need to improve this set - - if ( c >= 0x0200 && c <= 0x0217 ) { - if ( c % 2 == 0 ) { - u[0] = c; - u[1] = c+1; - } else { - u[0] = c-1; - u[1] = c; - } - return u; - } - - // Latin Extended Additional - // Range: U+1E00 to U+1EFF - // http://www.unicode.org/Unicode.charts/glyphless/U1E00.html - - // Spacing Modifier Leters - // Range: U+02B0 to U+02FF - - // Combining Diacritical Marks - // Range: U+0300 to U+036F - - // skip Greek for now - // Greek - // Range: U+0370 to U+03FF - - // Cyrillic - // Range: U+0400 to U+04FF - - if ( (c >= 0x0401 && c <= 0x040C) || ( c>= 0x040E && c <= 0x040F ) ) { - u[0] = c; - u[1] = c + 80; - return u; - } - - - if ( c >= 0x0410 && c <= 0x042F ) { - u[0] = c; - u[1] = c + 32; - return u; - } - - if ( c >= 0x0430 && c<= 0x044F ) { - u[0] = c - 32; - u[1] = c; - return u; - - } - if ( (c >= 0x0451 && c <= 0x045C) || (c >=0x045E && c<= 0x045F) ) { - u[0] = c -80; - u[1] = c; - return u; - } - - if ( c >= 0x0460 && c <= 0x047F ) { - if ( c % 2 == 0 ) { - u[0] = c; - u[1] = c +1; - } else { - u[0] = c - 1; - u[1] = c; - } - return u; - } - - // Armenian - // Range: U+0530 to U+058F - if ( c >= 0x0531 && c <= 0x0556 ) { - u[0] = c; - u[1] = c + 48; - return u; - } - if ( c >= 0x0561 && c < 0x0587 ) { - u[0] = c - 48; - u[1] = c; - return u; - } - - // Hebrew - // Range: U+0590 to U+05FF - - - // Arabic - // Range: U+0600 to U+06FF - - // Devanagari - // Range: U+0900 to U+097F - - - // Bengali - // Range: U+0980 to U+09FF - - - // Gurmukhi - // Range: U+0A00 to U+0A7F - - - // Gujarati - // Range: U+0A80 to U+0AFF - - - // Oriya - // Range: U+0B00 to U+0B7F - // no capital / lower case - - - // Tamil - // Range: U+0B80 to U+0BFF - // no capital / lower case - - - // Telugu - // Range: U+0C00 to U+0C7F - // no capital / lower case - - - // Kannada - // Range: U+0C80 to U+0CFF - // no capital / lower case - - - // Malayalam - // Range: U+0D00 to U+0D7F - - // Thai - // Range: U+0E00 to U+0E7F - - - // Lao - // Range: U+0E80 to U+0EFF - - - // Tibetan - // Range: U+0F00 to U+0FBF - - // Georgian - // Range: U+10A0 to U+10F0 - if ( c >= 0x10A0 && c <= 0x10C5 ) { - u[0] = c; - u[1] = c + 48; - return u; - } - if ( c >= 0x10D0 && c <= 0x10F5 ) { - u[0] = c; - u[1] = c; - return u; - } - - // Hangul Jamo - // Range: U+1100 to U+11FF - - // Greek Extended - // Range: U+1F00 to U+1FFF - // skip for now - - - // General Punctuation - // Range: U+2000 to U+206F - - // Superscripts and Subscripts - // Range: U+2070 to U+209F - - // Currency Symbols - // Range: U+20A0 to U+20CF - - - // Combining Diacritical Marks for Symbols - // Range: U+20D0 to U+20FF - // skip for now - - - // Number Forms - // Range: U+2150 to U+218F - // skip for now - - - // Arrows - // Range: U+2190 to U+21FF - - // Mathematical Operators - // Range: U+2200 to U+22FF - - // Miscellaneous Technical - // Range: U+2300 to U+23FF - - // Control Pictures - // Range: U+2400 to U+243F - - // Optical Character Recognition - // Range: U+2440 to U+245F - - // Enclosed Alphanumerics - // Range: U+2460 to U+24FF - - // Box Drawing - // Range: U+2500 to U+257F - - // Block Elements - // Range: U+2580 to U+259F - - // Geometric Shapes - // Range: U+25A0 to U+25FF - - // Miscellaneous Symbols - // Range: U+2600 to U+26FF - - // Dingbats - // Range: U+2700 to U+27BF - - // CJK Symbols and Punctuation - // Range: U+3000 to U+303F - - // Hiragana - // Range: U+3040 to U+309F - - // Katakana - // Range: U+30A0 to U+30FF - - // Bopomofo - // Range: U+3100 to U+312F - - // Hangul Compatibility Jamo - // Range: U+3130 to U+318F - - // Kanbun - // Range: U+3190 to U+319F - - - // Enclosed CJK Letters and Months - // Range: U+3200 to U+32FF - - // CJK Compatibility - // Range: U+3300 to U+33FF - - // Hangul Syllables - // Range: U+AC00 to U+D7A3 - - // High Surrogates - // Range: U+D800 to U+DB7F - - // Private Use High Surrogates - // Range: U+DB80 to U+DBFF - - // Low Surrogates - // Range: U+DC00 to U+DFFF - - // Private Use Area - // Range: U+E000 to U+F8FF - - // CJK Compatibility Ideographs - // Range: U+F900 to U+FAFF - - // Alphabetic Presentation Forms - // Range: U+FB00 to U+FB4F - - // Arabic Presentation Forms-A - // Range: U+FB50 to U+FDFF - - // Combining Half Marks - // Range: U+FE20 to U+FE2F - - // CJK Compatibility Forms - // Range: U+FE30 to U+FE4F - - // Small Form Variants - // Range: U+FE50 to U+FE6F - - // Arabic Presentation Forms-B - // Range: U+FE70 to U+FEFF - - // Halfwidth and Fullwidth Forms - // Range: U+FF00 to U+FFEF - - if ( c >= 0xFF21 && c <= 0xFF3A ) { - u[0] = c; - u[1] = c + 32; - return u; - } - - if ( c >= 0xFF41 && c <= 0xFF5A ) { - u[0] = c - 32; - u[1] = c; - return u; - } - - // Specials - // Range: U+FFF0 to U+FFFF - - return u; -} - -function DecimalToHexString( n ) { - n = Number( n ); - var h = "0x"; - - for ( var i = 3; i >= 0; i-- ) { - if ( n >= Math.pow(16, i) ){ - var t = Math.floor( n / Math.pow(16, i)); - n -= t * Math.pow(16, i); - if ( t >= 10 ) { - if ( t == 10 ) { - h += "A"; - } - if ( t == 11 ) { - h += "B"; - } - if ( t == 12 ) { - h += "C"; - } - if ( t == 13 ) { - h += "D"; - } - if ( t == 14 ) { - h += "E"; - } - if ( t == 15 ) { - h += "F"; - } - } else { - h += String( t ); - } - } else { - h += "0"; - } - } - - return h; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.12-2.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.12-2.js deleted file mode 100644 index c22b87b4dc..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.12-2.js +++ /dev/null @@ -1,518 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.12-2.js'; - -/** - File Name: 15.5.4.12-2.js - ECMA Section: 15.5.4.12 String.prototype.toUpperCase() - Description: - - Returns a string equal in length to the length of the result of converting - this object to a string. The result is a string value, not a String object. - - Every character of the result is equal to the corresponding character of the - string, unless that character has a Unicode 2.0 uppercase equivalent, in which - case the uppercase equivalent is used instead. (The canonical Unicode 2.0 case - mapping shall be used, which does not depend on implementation or locale.) - - Note that the toUpperCase function is intentionally generic; it does not require - that its this value be a String object. Therefore it can be transferred to other - kinds of objects for use as a method. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.5.4.12-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "String.prototype.toUpperCase()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var TEST_STRING = ""; -var EXPECT_STRING = ""; - -// basic latin test - -for ( var i = 0; i < 0x007A; i++ ) { - var u = new Unicode(i); - TEST_STRING += String.fromCharCode(i); - EXPECT_STRING += String.fromCharCode( u.upper ); -} - -// don't print out the value of the strings since they contain control -// characters that break the driver -var isEqual = EXPECT_STRING == (new String( TEST_STRING )).toUpperCase(); - -new TestCase( SECTION, - "isEqual", - true, - isEqual); -test(); - -function MyObject( value ) { - this.value = value; - this.substring = String.prototype.substring; - this.toString = new Function ( "return this.value+''" ); -} -function Unicode( c ) { - u = GetUnicodeValues( c ); - this.upper = u[0]; - this.lower = u[1] - return this; -} -function GetUnicodeValues( c ) { - u = new Array(); - - u[0] = c; - u[1] = c; - - // upper case Basic Latin - - if ( c >= 0x0041 && c <= 0x005A) { - u[0] = c; - u[1] = c + 32; - return u; - } - - // lower case Basic Latin - if ( c >= 0x0061 && c <= 0x007a ) { - u[0] = c - 32; - u[1] = c; - return u; - } - - // upper case Latin-1 Supplement - if ( (c >= 0x00C0 && c <= 0x00D6) || (c >= 0x00D8 && c<=0x00DE) ) { - u[0] = c; - u[1] = c + 32; - return u; - } - - // lower case Latin-1 Supplement - if ( (c >= 0x00E0 && c <= 0x00F6) || (c >= 0x00F8 && c <= 0x00FE) ) { - u[0] = c - 32; - u[1] = c; - return u; - } - if ( c == 0x00FF ) { - u[0] = 0x0178; - u[1] = c; - return u; - } - // Latin Extended A - if ( (c >= 0x0100 && c < 0x0138) || (c > 0x0149 && c < 0x0178) ) { - // special case for capital I - if ( c == 0x0130 ) { - u[0] = c; - u[1] = 0x0069; - return u; - } - if ( c == 0x0131 ) { - u[0] = 0x0049; - u[1] = c; - return u; - } - - if ( c % 2 == 0 ) { - // if it's even, it's a capital and the lower case is c +1 - u[0] = c; - u[1] = c+1; - } else { - // if it's odd, it's a lower case and upper case is c-1 - u[0] = c-1; - u[1] = c; - } - return u; - } - if ( c == 0x0178 ) { - u[0] = c; - u[1] = 0x00FF; - return u; - } - - if ( (c >= 0x0139 && c < 0x0149) || (c > 0x0178 && c < 0x017F) ) { - if ( c % 2 == 1 ) { - // if it's odd, it's a capital and the lower case is c +1 - u[0] = c; - u[1] = c+1; - } else { - // if it's even, it's a lower case and upper case is c-1 - u[0] = c-1; - u[1] = c; - } - return u; - } - if ( c == 0x017F ) { - u[0] = 0x0053; - u[1] = c; - } - - // Latin Extended B - // need to improve this set - - if ( c >= 0x0200 && c <= 0x0217 ) { - if ( c % 2 == 0 ) { - u[0] = c; - u[1] = c+1; - } else { - u[0] = c-1; - u[1] = c; - } - return u; - } - - // Latin Extended Additional - // Range: U+1E00 to U+1EFF - // http://www.unicode.org/Unicode.charts/glyphless/U1E00.html - - // Spacing Modifier Leters - // Range: U+02B0 to U+02FF - - // Combining Diacritical Marks - // Range: U+0300 to U+036F - - // skip Greek for now - // Greek - // Range: U+0370 to U+03FF - - // Cyrillic - // Range: U+0400 to U+04FF - - if ( (c >= 0x0401 && c <= 0x040C) || ( c>= 0x040E && c <= 0x040F ) ) { - u[0] = c; - u[1] = c + 80; - return u; - } - - - if ( c >= 0x0410 && c <= 0x042F ) { - u[0] = c; - u[1] = c + 32; - return u; - } - - if ( c >= 0x0430 && c<= 0x044F ) { - u[0] = c - 32; - u[1] = c; - return u; - - } - if ( (c >= 0x0451 && c <= 0x045C) || (c >=0x045E && c<= 0x045F) ) { - u[0] = c -80; - u[1] = c; - return u; - } - - if ( c >= 0x0460 && c <= 0x047F ) { - if ( c % 2 == 0 ) { - u[0] = c; - u[1] = c +1; - } else { - u[0] = c - 1; - u[1] = c; - } - return u; - } - - // Armenian - // Range: U+0530 to U+058F - if ( c >= 0x0531 && c <= 0x0556 ) { - u[0] = c; - u[1] = c + 48; - return u; - } - if ( c >= 0x0561 && c < 0x0587 ) { - u[0] = c - 48; - u[1] = c; - return u; - } - - // Hebrew - // Range: U+0590 to U+05FF - - - // Arabic - // Range: U+0600 to U+06FF - - // Devanagari - // Range: U+0900 to U+097F - - - // Bengali - // Range: U+0980 to U+09FF - - - // Gurmukhi - // Range: U+0A00 to U+0A7F - - - // Gujarati - // Range: U+0A80 to U+0AFF - - - // Oriya - // Range: U+0B00 to U+0B7F - // no capital / lower case - - - // Tamil - // Range: U+0B80 to U+0BFF - // no capital / lower case - - - // Telugu - // Range: U+0C00 to U+0C7F - // no capital / lower case - - - // Kannada - // Range: U+0C80 to U+0CFF - // no capital / lower case - - - // Malayalam - // Range: U+0D00 to U+0D7F - - // Thai - // Range: U+0E00 to U+0E7F - - - // Lao - // Range: U+0E80 to U+0EFF - - - // Tibetan - // Range: U+0F00 to U+0FBF - - // Georgian - // Range: U+10A0 to U+10F0 - if ( c >= 0x10A0 && c <= 0x10C5 ) { - u[0] = c; - u[1] = c + 48; - return u; - } - if ( c >= 0x10D0 && c <= 0x10F5 ) { - u[0] = c; - u[1] = c; - return u; - } - - // Hangul Jamo - // Range: U+1100 to U+11FF - - // Greek Extended - // Range: U+1F00 to U+1FFF - // skip for now - - - // General Punctuation - // Range: U+2000 to U+206F - - // Superscripts and Subscripts - // Range: U+2070 to U+209F - - // Currency Symbols - // Range: U+20A0 to U+20CF - - - // Combining Diacritical Marks for Symbols - // Range: U+20D0 to U+20FF - // skip for now - - - // Number Forms - // Range: U+2150 to U+218F - // skip for now - - - // Arrows - // Range: U+2190 to U+21FF - - // Mathematical Operators - // Range: U+2200 to U+22FF - - // Miscellaneous Technical - // Range: U+2300 to U+23FF - - // Control Pictures - // Range: U+2400 to U+243F - - // Optical Character Recognition - // Range: U+2440 to U+245F - - // Enclosed Alphanumerics - // Range: U+2460 to U+24FF - - // Box Drawing - // Range: U+2500 to U+257F - - // Block Elements - // Range: U+2580 to U+259F - - // Geometric Shapes - // Range: U+25A0 to U+25FF - - // Miscellaneous Symbols - // Range: U+2600 to U+26FF - - // Dingbats - // Range: U+2700 to U+27BF - - // CJK Symbols and Punctuation - // Range: U+3000 to U+303F - - // Hiragana - // Range: U+3040 to U+309F - - // Katakana - // Range: U+30A0 to U+30FF - - // Bopomofo - // Range: U+3100 to U+312F - - // Hangul Compatibility Jamo - // Range: U+3130 to U+318F - - // Kanbun - // Range: U+3190 to U+319F - - - // Enclosed CJK Letters and Months - // Range: U+3200 to U+32FF - - // CJK Compatibility - // Range: U+3300 to U+33FF - - // Hangul Syllables - // Range: U+AC00 to U+D7A3 - - // High Surrogates - // Range: U+D800 to U+DB7F - - // Private Use High Surrogates - // Range: U+DB80 to U+DBFF - - // Low Surrogates - // Range: U+DC00 to U+DFFF - - // Private Use Area - // Range: U+E000 to U+F8FF - - // CJK Compatibility Ideographs - // Range: U+F900 to U+FAFF - - // Alphabetic Presentation Forms - // Range: U+FB00 to U+FB4F - - // Arabic Presentation Forms-A - // Range: U+FB50 to U+FDFF - - // Combining Half Marks - // Range: U+FE20 to U+FE2F - - // CJK Compatibility Forms - // Range: U+FE30 to U+FE4F - - // Small Form Variants - // Range: U+FE50 to U+FE6F - - // Arabic Presentation Forms-B - // Range: U+FE70 to U+FEFF - - // Halfwidth and Fullwidth Forms - // Range: U+FF00 to U+FFEF - - if ( c >= 0xFF21 && c <= 0xFF3A ) { - u[0] = c; - u[1] = c + 32; - return u; - } - - if ( c >= 0xFF41 && c <= 0xFF5A ) { - u[0] = c - 32; - u[1] = c; - return u; - } - - // Specials - // Range: U+FFF0 to U+FFFF - - return u; -} - -function DecimalToHexString( n ) { - n = Number( n ); - var h = "0x"; - - for ( var i = 3; i >= 0; i-- ) { - if ( n >= Math.pow(16, i) ){ - var t = Math.floor( n / Math.pow(16, i)); - n -= t * Math.pow(16, i); - if ( t >= 10 ) { - if ( t == 10 ) { - h += "A"; - } - if ( t == 11 ) { - h += "B"; - } - if ( t == 12 ) { - h += "C"; - } - if ( t == 13 ) { - h += "D"; - } - if ( t == 14 ) { - h += "E"; - } - if ( t == 15 ) { - h += "F"; - } - } else { - h += String( t ); - } - } else { - h += "0"; - } - } - - return h; -} - diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.12-3.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.12-3.js deleted file mode 100644 index d9d8bc69ce..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.12-3.js +++ /dev/null @@ -1,559 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.12-3.js'; - -/** - File Name: 15.5.4.12-3.js - ECMA Section: 15.5.4.12 String.prototype.toUpperCase() - Description: - - Returns a string equal in length to the length of the result of converting - this object to a string. The result is a string value, not a String object. - - Every character of the result is equal to the corresponding character of the - string, unless that character has a Unicode 2.0 uppercase equivalent, in which - case the uppercase equivalent is used instead. (The canonical Unicode 2.0 case - mapping shall be used, which does not depend on implementation or locale.) - - Note that the toUpperCase function is intentionally generic; it does not require - that its this value be a String object. Therefore it can be transferred to other - kinds of objects for use as a method. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.5.4.12-3"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "String.prototype.toUpperCase()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -// Georgian -// Range: U+10A0 to U+10FF -for ( var i = 0x10A0; i <= 0x10FF; i++ ) { - var U = new Unicode( i ); -/* - new TestCase( SECTION, - "var s = new String( String.fromCharCode("+i+") ); s.toUpperCase()", - String.fromCharCode(U.upper), - eval("var s = new String( String.fromCharCode("+i+") ); s.toUpperCase()") ); -*/ - new TestCase( SECTION, - "var s = new String( String.fromCharCode("+i+") ); s.toUpperCase().charCodeAt(0)", - U.upper, - eval("var s = new String( String.fromCharCode(i) ); s.toUpperCase().charCodeAt(0)") ); - -} - -// Halfwidth and Fullwidth Forms -// Range: U+FF00 to U+FFEF -for ( var i = 0xFF00; i <= 0xFFEF; i++ ) { - new TestCase( SECTION, - "var s = new String( String.fromCharCode("+i+") ); s.toUpperCase()", - eval( "var u = new Unicode( i ); String.fromCharCode(u.upper)" ), - eval("var s = new String( String.fromCharCode("+i+") ); s.toUpperCase()") ); - - new TestCase( SECTION, - "var s = new String( String.fromCharCode("+i+") ); s.toUpperCase().charCodeAt(0)", - eval( "var u = new Unicode( i ); u.upper" ), - eval("var s = new String( String.fromCharCode("+i+") ); s.toUpperCase().charCodeAt(0)") ); -} - -// Hiragana (no upper / lower case) -// Range: U+3040 to U+309F - -for ( var i = 0x3040; i <= 0x309F; i++ ) { - new TestCase( SECTION, - "var s = new String( String.fromCharCode("+i+") ); s.toUpperCase()", - eval( "var u = new Unicode( i ); String.fromCharCode(u.upper)" ), - eval("var s = new String( String.fromCharCode("+i+") ); s.toUpperCase()") ); - - new TestCase( SECTION, - "var s = new String( String.fromCharCode("+i+") ); s.toUpperCase().charCodeAt(0)", - eval( "var u = new Unicode( i ); u.upper" ), - eval("var s = new String( String.fromCharCode("+i+") ); s.toUpperCase().charCodeAt(0)") ); -} - - -/* - var TEST_STRING = ""; - var EXPECT_STRING = ""; - - // basic latin test - - for ( var i = 0; i < 0x007A; i++ ) { - var u = new Unicode(i); - TEST_STRING += String.fromCharCode(i); - EXPECT_STRING += String.fromCharCode( u.upper ); - } -*/ - - -test(); - -function MyObject( value ) { - this.value = value; - this.substring = String.prototype.substring; - this.toString = new Function ( "return this.value+''" ); -} -function Unicode( c ) { - u = GetUnicodeValues( c ); - this.upper = u[0]; - this.lower = u[1] - return this; -} -function GetUnicodeValues( c ) { - u = new Array(); - - u[0] = c; - u[1] = c; - - // upper case Basic Latin - - if ( c >= 0x0041 && c <= 0x005A) { - u[0] = c; - u[1] = c + 32; - return u; - } - - // lower case Basic Latin - if ( c >= 0x0061 && c <= 0x007a ) { - u[0] = c - 32; - u[1] = c; - return u; - } - - // upper case Latin-1 Supplement - if ( (c >= 0x00C0 && c <= 0x00D6) || (c >= 0x00D8 && c<=0x00DE) ) { - u[0] = c; - u[1] = c + 32; - return u; - } - - // lower case Latin-1 Supplement - if ( (c >= 0x00E0 && c <= 0x00F6) || (c >= 0x00F8 && c <= 0x00FE) ) { - u[0] = c - 32; - u[1] = c; - return u; - } - if ( c == 0x00FF ) { - u[0] = 0x0178; - u[1] = c; - return u; - } - // Latin Extended A - if ( (c >= 0x0100 && c < 0x0138) || (c > 0x0149 && c < 0x0178) ) { - // special case for capital I - if ( c == 0x0130 ) { - u[0] = c; - u[1] = 0x0069; - return u; - } - if ( c == 0x0131 ) { - u[0] = 0x0049; - u[1] = c; - return u; - } - - if ( c % 2 == 0 ) { - // if it's even, it's a capital and the lower case is c +1 - u[0] = c; - u[1] = c+1; - } else { - // if it's odd, it's a lower case and upper case is c-1 - u[0] = c-1; - u[1] = c; - } - return u; - } - if ( c == 0x0178 ) { - u[0] = c; - u[1] = 0x00FF; - return u; - } - - if ( (c >= 0x0139 && c < 0x0149) || (c > 0x0178 && c < 0x017F) ) { - if ( c % 2 == 1 ) { - // if it's odd, it's a capital and the lower case is c +1 - u[0] = c; - u[1] = c+1; - } else { - // if it's even, it's a lower case and upper case is c-1 - u[0] = c-1; - u[1] = c; - } - return u; - } - if ( c == 0x017F ) { - u[0] = 0x0053; - u[1] = c; - } - - // Latin Extended B - // need to improve this set - - if ( c >= 0x0200 && c <= 0x0217 ) { - if ( c % 2 == 0 ) { - u[0] = c; - u[1] = c+1; - } else { - u[0] = c-1; - u[1] = c; - } - return u; - } - - // Latin Extended Additional - // Range: U+1E00 to U+1EFF - // http://www.unicode.org/Unicode.charts/glyphless/U1E00.html - - // Spacing Modifier Leters - // Range: U+02B0 to U+02FF - - // Combining Diacritical Marks - // Range: U+0300 to U+036F - - // skip Greek for now - // Greek - // Range: U+0370 to U+03FF - - // Cyrillic - // Range: U+0400 to U+04FF - - if ( (c >= 0x0401 && c <= 0x040C) || ( c>= 0x040E && c <= 0x040F ) ) { - u[0] = c; - u[1] = c + 80; - return u; - } - - - if ( c >= 0x0410 && c <= 0x042F ) { - u[0] = c; - u[1] = c + 32; - return u; - } - - if ( c >= 0x0430 && c<= 0x044F ) { - u[0] = c - 32; - u[1] = c; - return u; - - } - if ( (c >= 0x0451 && c <= 0x045C) || (c >=0x045E && c<= 0x045F) ) { - u[0] = c -80; - u[1] = c; - return u; - } - - if ( c >= 0x0460 && c <= 0x047F ) { - if ( c % 2 == 0 ) { - u[0] = c; - u[1] = c +1; - } else { - u[0] = c - 1; - u[1] = c; - } - return u; - } - - // Armenian - // Range: U+0530 to U+058F - if ( c >= 0x0531 && c <= 0x0556 ) { - u[0] = c; - u[1] = c + 48; - return u; - } - if ( c >= 0x0561 && c < 0x0587 ) { - u[0] = c - 48; - u[1] = c; - return u; - } - - // Hebrew - // Range: U+0590 to U+05FF - - - // Arabic - // Range: U+0600 to U+06FF - - // Devanagari - // Range: U+0900 to U+097F - - - // Bengali - // Range: U+0980 to U+09FF - - - // Gurmukhi - // Range: U+0A00 to U+0A7F - - - // Gujarati - // Range: U+0A80 to U+0AFF - - - // Oriya - // Range: U+0B00 to U+0B7F - // no capital / lower case - - - // Tamil - // Range: U+0B80 to U+0BFF - // no capital / lower case - - - // Telugu - // Range: U+0C00 to U+0C7F - // no capital / lower case - - - // Kannada - // Range: U+0C80 to U+0CFF - // no capital / lower case - - - // Malayalam - // Range: U+0D00 to U+0D7F - - // Thai - // Range: U+0E00 to U+0E7F - - - // Lao - // Range: U+0E80 to U+0EFF - - - // Tibetan - // Range: U+0F00 to U+0FBF - - // Georgian - // Range: U+10A0 to U+10F0 - if ( c >= 0x10A0 && c <= 0x10C5 ) { - u[0] = c; - u[1] = c + 48; - return u; - } - if ( c >= 0x10D0 && c <= 0x10F5 ) { - u[0] = c; - u[1] = c; - return u; - } - - // Hangul Jamo - // Range: U+1100 to U+11FF - - // Greek Extended - // Range: U+1F00 to U+1FFF - // skip for now - - - // General Punctuation - // Range: U+2000 to U+206F - - // Superscripts and Subscripts - // Range: U+2070 to U+209F - - // Currency Symbols - // Range: U+20A0 to U+20CF - - - // Combining Diacritical Marks for Symbols - // Range: U+20D0 to U+20FF - // skip for now - - - // Number Forms - // Range: U+2150 to U+218F - // skip for now - - - // Arrows - // Range: U+2190 to U+21FF - - // Mathematical Operators - // Range: U+2200 to U+22FF - - // Miscellaneous Technical - // Range: U+2300 to U+23FF - - // Control Pictures - // Range: U+2400 to U+243F - - // Optical Character Recognition - // Range: U+2440 to U+245F - - // Enclosed Alphanumerics - // Range: U+2460 to U+24FF - - // Box Drawing - // Range: U+2500 to U+257F - - // Block Elements - // Range: U+2580 to U+259F - - // Geometric Shapes - // Range: U+25A0 to U+25FF - - // Miscellaneous Symbols - // Range: U+2600 to U+26FF - - // Dingbats - // Range: U+2700 to U+27BF - - // CJK Symbols and Punctuation - // Range: U+3000 to U+303F - - // Hiragana - // Range: U+3040 to U+309F - - // Katakana - // Range: U+30A0 to U+30FF - - // Bopomofo - // Range: U+3100 to U+312F - - // Hangul Compatibility Jamo - // Range: U+3130 to U+318F - - // Kanbun - // Range: U+3190 to U+319F - - - // Enclosed CJK Letters and Months - // Range: U+3200 to U+32FF - - // CJK Compatibility - // Range: U+3300 to U+33FF - - // Hangul Syllables - // Range: U+AC00 to U+D7A3 - - // High Surrogates - // Range: U+D800 to U+DB7F - - // Private Use High Surrogates - // Range: U+DB80 to U+DBFF - - // Low Surrogates - // Range: U+DC00 to U+DFFF - - // Private Use Area - // Range: U+E000 to U+F8FF - - // CJK Compatibility Ideographs - // Range: U+F900 to U+FAFF - - // Alphabetic Presentation Forms - // Range: U+FB00 to U+FB4F - - // Arabic Presentation Forms-A - // Range: U+FB50 to U+FDFF - - // Combining Half Marks - // Range: U+FE20 to U+FE2F - - // CJK Compatibility Forms - // Range: U+FE30 to U+FE4F - - // Small Form Variants - // Range: U+FE50 to U+FE6F - - // Arabic Presentation Forms-B - // Range: U+FE70 to U+FEFF - - // Halfwidth and Fullwidth Forms - // Range: U+FF00 to U+FFEF - - if ( c >= 0xFF21 && c <= 0xFF3A ) { - u[0] = c; - u[1] = c + 32; - return u; - } - - if ( c >= 0xFF41 && c <= 0xFF5A ) { - u[0] = c - 32; - u[1] = c; - return u; - } - - // Specials - // Range: U+FFF0 to U+FFFF - - return u; -} - -function DecimalToHexString( n ) { - n = Number( n ); - var h = "0x"; - - for ( var i = 3; i >= 0; i-- ) { - if ( n >= Math.pow(16, i) ){ - var t = Math.floor( n / Math.pow(16, i)); - n -= t * Math.pow(16, i); - if ( t >= 10 ) { - if ( t == 10 ) { - h += "A"; - } - if ( t == 11 ) { - h += "B"; - } - if ( t == 12 ) { - h += "C"; - } - if ( t == 13 ) { - h += "D"; - } - if ( t == 14 ) { - h += "E"; - } - if ( t == 15 ) { - h += "F"; - } - } else { - h += String( t ); - } - } else { - h += "0"; - } - } - - return h; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.12-4.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.12-4.js deleted file mode 100644 index caf5663f07..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.12-4.js +++ /dev/null @@ -1,515 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.12-4.js'; - -/** - File Name: 15.5.4.12-1.js - ECMA Section: 15.5.4.12 String.prototype.toUpperCase() - Description: - - Returns a string equal in length to the length of the result of converting - this object to a string. The result is a string value, not a String object. - - Every character of the result is equal to the corresponding character of the - string, unless that character has a Unicode 2.0 uppercase equivalent, in which - case the uppercase equivalent is used instead. (The canonical Unicode 2.0 case - mapping shall be used, which does not depend on implementation or locale.) - - Note that the toUpperCase function is intentionally generic; it does not require - that its this value be a String object. Therefore it can be transferred to other - kinds of objects for use as a method. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.5.4.12-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "String.prototype.toUpperCase()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -// Cyrillic (part) -// Range: U+0400 to U+04FF -for ( var i = 0x0400; i <= 0x047F; i++ ) { - var U =new Unicode( i ); -/* - new TestCase( SECTION, - "var s = new String( String.fromCharCode("+i+") ); s.toUpperCase()", - U.upper, - eval("var s = new String( String.fromCharCode("+i+") ); s.toUpperCase()") ); -*/ - new TestCase( SECTION, - "var s = new String( String.fromCharCode("+i+") ); s.toUpperCase().charCodeAt(0)", - U.upper, - eval("var s = new String( String.fromCharCode(i) ); s.toUpperCase().charCodeAt(0)") ); - -} - -test(); - -function MyObject( value ) { - this.value = value; - this.substring = String.prototype.substring; - this.toString = new Function ( "return this.value+''" ); -} -function Unicode( c ) { - u = GetUnicodeValues( c ); - this.upper = u[0]; - this.lower = u[1] - return this; -} -function GetUnicodeValues( c ) { - u = new Array(); - - u[0] = c; - u[1] = c; - - // upper case Basic Latin - - if ( c >= 0x0041 && c <= 0x005A) { - u[0] = c; - u[1] = c + 32; - return u; - } - - // lower case Basic Latin - if ( c >= 0x0061 && c <= 0x007a ) { - u[0] = c - 32; - u[1] = c; - return u; - } - - // upper case Latin-1 Supplement - if ( (c >= 0x00C0 && c <= 0x00D6) || (c >= 0x00D8 && c<=0x00DE) ) { - u[0] = c; - u[1] = c + 32; - return u; - } - - // lower case Latin-1 Supplement - if ( (c >= 0x00E0 && c <= 0x00F6) || (c >= 0x00F8 && c <= 0x00FE) ) { - u[0] = c - 32; - u[1] = c; - return u; - } - if ( c == 0x00FF ) { - u[0] = 0x0178; - u[1] = c; - return u; - } - // Latin Extended A - if ( (c >= 0x0100 && c < 0x0138) || (c > 0x0149 && c < 0x0178) ) { - // special case for capital I - if ( c == 0x0130 ) { - u[0] = c; - u[1] = 0x0069; - return u; - } - if ( c == 0x0131 ) { - u[0] = 0x0049; - u[1] = c; - return u; - } - - if ( c % 2 == 0 ) { - // if it's even, it's a capital and the lower case is c +1 - u[0] = c; - u[1] = c+1; - } else { - // if it's odd, it's a lower case and upper case is c-1 - u[0] = c-1; - u[1] = c; - } - return u; - } - if ( c == 0x0178 ) { - u[0] = c; - u[1] = 0x00FF; - return u; - } - - if ( (c >= 0x0139 && c < 0x0149) || (c > 0x0178 && c < 0x017F) ) { - if ( c % 2 == 1 ) { - // if it's odd, it's a capital and the lower case is c +1 - u[0] = c; - u[1] = c+1; - } else { - // if it's even, it's a lower case and upper case is c-1 - u[0] = c-1; - u[1] = c; - } - return u; - } - if ( c == 0x017F ) { - u[0] = 0x0053; - u[1] = c; - } - - // Latin Extended B - // need to improve this set - - if ( c >= 0x0200 && c <= 0x0217 ) { - if ( c % 2 == 0 ) { - u[0] = c; - u[1] = c+1; - } else { - u[0] = c-1; - u[1] = c; - } - return u; - } - - // Latin Extended Additional - // Range: U+1E00 to U+1EFF - // http://www.unicode.org/Unicode.charts/glyphless/U1E00.html - - // Spacing Modifier Leters - // Range: U+02B0 to U+02FF - - // Combining Diacritical Marks - // Range: U+0300 to U+036F - - // skip Greek for now - // Greek - // Range: U+0370 to U+03FF - - // Cyrillic - // Range: U+0400 to U+04FF - - if ( (c >= 0x0401 && c <= 0x040C) || ( c>= 0x040E && c <= 0x040F ) ) { - u[0] = c; - u[1] = c + 80; - return u; - } - - - if ( c >= 0x0410 && c <= 0x042F ) { - u[0] = c; - u[1] = c + 32; - return u; - } - - if ( c >= 0x0430 && c<= 0x044F ) { - u[0] = c - 32; - u[1] = c; - return u; - - } - if ( (c >= 0x0451 && c <= 0x045C) || (c >=0x045E && c<= 0x045F) ) { - u[0] = c -80; - u[1] = c; - return u; - } - - if ( c >= 0x0460 && c <= 0x047F ) { - if ( c % 2 == 0 ) { - u[0] = c; - u[1] = c +1; - } else { - u[0] = c - 1; - u[1] = c; - } - return u; - } - - // Armenian - // Range: U+0530 to U+058F - if ( c >= 0x0531 && c <= 0x0556 ) { - u[0] = c; - u[1] = c + 48; - return u; - } - if ( c >= 0x0561 && c < 0x0587 ) { - u[0] = c - 48; - u[1] = c; - return u; - } - - // Hebrew - // Range: U+0590 to U+05FF - - - // Arabic - // Range: U+0600 to U+06FF - - // Devanagari - // Range: U+0900 to U+097F - - - // Bengali - // Range: U+0980 to U+09FF - - - // Gurmukhi - // Range: U+0A00 to U+0A7F - - - // Gujarati - // Range: U+0A80 to U+0AFF - - - // Oriya - // Range: U+0B00 to U+0B7F - // no capital / lower case - - - // Tamil - // Range: U+0B80 to U+0BFF - // no capital / lower case - - - // Telugu - // Range: U+0C00 to U+0C7F - // no capital / lower case - - - // Kannada - // Range: U+0C80 to U+0CFF - // no capital / lower case - - - // Malayalam - // Range: U+0D00 to U+0D7F - - // Thai - // Range: U+0E00 to U+0E7F - - - // Lao - // Range: U+0E80 to U+0EFF - - - // Tibetan - // Range: U+0F00 to U+0FBF - - // Georgian - // Range: U+10A0 to U+10F0 - if ( c >= 0x10A0 && c <= 0x10C5 ) { - u[0] = c; - u[1] = c + 48; - return u; - } - if ( c >= 0x10D0 && c <= 0x10F5 ) { - u[0] = c; - u[1] = c; - return u; - } - - // Hangul Jamo - // Range: U+1100 to U+11FF - - // Greek Extended - // Range: U+1F00 to U+1FFF - // skip for now - - - // General Punctuation - // Range: U+2000 to U+206F - - // Superscripts and Subscripts - // Range: U+2070 to U+209F - - // Currency Symbols - // Range: U+20A0 to U+20CF - - - // Combining Diacritical Marks for Symbols - // Range: U+20D0 to U+20FF - // skip for now - - - // Number Forms - // Range: U+2150 to U+218F - // skip for now - - - // Arrows - // Range: U+2190 to U+21FF - - // Mathematical Operators - // Range: U+2200 to U+22FF - - // Miscellaneous Technical - // Range: U+2300 to U+23FF - - // Control Pictures - // Range: U+2400 to U+243F - - // Optical Character Recognition - // Range: U+2440 to U+245F - - // Enclosed Alphanumerics - // Range: U+2460 to U+24FF - - // Box Drawing - // Range: U+2500 to U+257F - - // Block Elements - // Range: U+2580 to U+259F - - // Geometric Shapes - // Range: U+25A0 to U+25FF - - // Miscellaneous Symbols - // Range: U+2600 to U+26FF - - // Dingbats - // Range: U+2700 to U+27BF - - // CJK Symbols and Punctuation - // Range: U+3000 to U+303F - - // Hiragana - // Range: U+3040 to U+309F - - // Katakana - // Range: U+30A0 to U+30FF - - // Bopomofo - // Range: U+3100 to U+312F - - // Hangul Compatibility Jamo - // Range: U+3130 to U+318F - - // Kanbun - // Range: U+3190 to U+319F - - - // Enclosed CJK Letters and Months - // Range: U+3200 to U+32FF - - // CJK Compatibility - // Range: U+3300 to U+33FF - - // Hangul Syllables - // Range: U+AC00 to U+D7A3 - - // High Surrogates - // Range: U+D800 to U+DB7F - - // Private Use High Surrogates - // Range: U+DB80 to U+DBFF - - // Low Surrogates - // Range: U+DC00 to U+DFFF - - // Private Use Area - // Range: U+E000 to U+F8FF - - // CJK Compatibility Ideographs - // Range: U+F900 to U+FAFF - - // Alphabetic Presentation Forms - // Range: U+FB00 to U+FB4F - - // Arabic Presentation Forms-A - // Range: U+FB50 to U+FDFF - - // Combining Half Marks - // Range: U+FE20 to U+FE2F - - // CJK Compatibility Forms - // Range: U+FE30 to U+FE4F - - // Small Form Variants - // Range: U+FE50 to U+FE6F - - // Arabic Presentation Forms-B - // Range: U+FE70 to U+FEFF - - // Halfwidth and Fullwidth Forms - // Range: U+FF00 to U+FFEF - - if ( c >= 0xFF21 && c <= 0xFF3A ) { - u[0] = c; - u[1] = c + 32; - return u; - } - - if ( c >= 0xFF41 && c <= 0xFF5A ) { - u[0] = c - 32; - u[1] = c; - return u; - } - - // Specials - // Range: U+FFF0 to U+FFFF - - return u; -} - -function DecimalToHexString( n ) { - n = Number( n ); - var h = "0x"; - - for ( var i = 3; i >= 0; i-- ) { - if ( n >= Math.pow(16, i) ){ - var t = Math.floor( n / Math.pow(16, i)); - n -= t * Math.pow(16, i); - if ( t >= 10 ) { - if ( t == 10 ) { - h += "A"; - } - if ( t == 11 ) { - h += "B"; - } - if ( t == 12 ) { - h += "C"; - } - if ( t == 13 ) { - h += "D"; - } - if ( t == 14 ) { - h += "E"; - } - if ( t == 15 ) { - h += "F"; - } - } else { - h += String( t ); - } - } else { - h += "0"; - } - } - - return h; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.12-5.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.12-5.js deleted file mode 100644 index 2fbed42202..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.12-5.js +++ /dev/null @@ -1,515 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.12-5.js'; - -/** - File Name: 15.5.4.12-1.js - ECMA Section: 15.5.4.12 String.prototype.toUpperCase() - Description: - - Returns a string equal in length to the length of the result of converting - this object to a string. The result is a string value, not a String object. - - Every character of the result is equal to the corresponding character of the - string, unless that character has a Unicode 2.0 uppercase equivalent, in which - case the uppercase equivalent is used instead. (The canonical Unicode 2.0 case - mapping shall be used, which does not depend on implementation or locale.) - - Note that the toUpperCase function is intentionally generic; it does not require - that its this value be a String object. Therefore it can be transferred to other - kinds of objects for use as a method. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.5.4.12-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "String.prototype.toUpperCase()"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -// Armenian -// Range: U+0530 to U+058F -for ( var i = 0x0530; i <= 0x058F; i++ ) { - var U = new Unicode( i ); -/* - new TestCase( SECTION, - "var s = new String( String.fromCharCode("+i+") ); s.toUpperCase()", - String.fromCharCode(U.upper), - eval("var s = new String( String.fromCharCode("+i+") ); s.toUpperCase()") ); -*/ - new TestCase( SECTION, - "var s = new String( String.fromCharCode("+i+") ); s.toUpperCase().charCodeAt(0)", - U.upper, - eval("var s = new String( String.fromCharCode(i) ); s.toUpperCase().charCodeAt(0)") ); - -} - -test(); - -function MyObject( value ) { - this.value = value; - this.substring = String.prototype.substring; - this.toString = new Function ( "return this.value+''" ); -} -function Unicode( c ) { - u = GetUnicodeValues( c ); - this.upper = u[0]; - this.lower = u[1] - return this; -} -function GetUnicodeValues( c ) { - u = new Array(); - - u[0] = c; - u[1] = c; - - // upper case Basic Latin - - if ( c >= 0x0041 && c <= 0x005A) { - u[0] = c; - u[1] = c + 32; - return u; - } - - // lower case Basic Latin - if ( c >= 0x0061 && c <= 0x007a ) { - u[0] = c - 32; - u[1] = c; - return u; - } - - // upper case Latin-1 Supplement - if ( (c >= 0x00C0 && c <= 0x00D6) || (c >= 0x00D8 && c<=0x00DE) ) { - u[0] = c; - u[1] = c + 32; - return u; - } - - // lower case Latin-1 Supplement - if ( (c >= 0x00E0 && c <= 0x00F6) || (c >= 0x00F8 && c <= 0x00FE) ) { - u[0] = c - 32; - u[1] = c; - return u; - } - if ( c == 0x00FF ) { - u[0] = 0x0178; - u[1] = c; - return u; - } - // Latin Extended A - if ( (c >= 0x0100 && c < 0x0138) || (c > 0x0149 && c < 0x0178) ) { - // special case for capital I - if ( c == 0x0130 ) { - u[0] = c; - u[1] = 0x0069; - return u; - } - if ( c == 0x0131 ) { - u[0] = 0x0049; - u[1] = c; - return u; - } - - if ( c % 2 == 0 ) { - // if it's even, it's a capital and the lower case is c +1 - u[0] = c; - u[1] = c+1; - } else { - // if it's odd, it's a lower case and upper case is c-1 - u[0] = c-1; - u[1] = c; - } - return u; - } - if ( c == 0x0178 ) { - u[0] = c; - u[1] = 0x00FF; - return u; - } - - if ( (c >= 0x0139 && c < 0x0149) || (c > 0x0178 && c < 0x017F) ) { - if ( c % 2 == 1 ) { - // if it's odd, it's a capital and the lower case is c +1 - u[0] = c; - u[1] = c+1; - } else { - // if it's even, it's a lower case and upper case is c-1 - u[0] = c-1; - u[1] = c; - } - return u; - } - if ( c == 0x017F ) { - u[0] = 0x0053; - u[1] = c; - } - - // Latin Extended B - // need to improve this set - - if ( c >= 0x0200 && c <= 0x0217 ) { - if ( c % 2 == 0 ) { - u[0] = c; - u[1] = c+1; - } else { - u[0] = c-1; - u[1] = c; - } - return u; - } - - // Latin Extended Additional - // Range: U+1E00 to U+1EFF - // http://www.unicode.org/Unicode.charts/glyphless/U1E00.html - - // Spacing Modifier Leters - // Range: U+02B0 to U+02FF - - // Combining Diacritical Marks - // Range: U+0300 to U+036F - - // skip Greek for now - // Greek - // Range: U+0370 to U+03FF - - // Cyrillic - // Range: U+0400 to U+04FF - - if ( (c >= 0x0401 && c <= 0x040C) || ( c>= 0x040E && c <= 0x040F ) ) { - u[0] = c; - u[1] = c + 80; - return u; - } - - - if ( c >= 0x0410 && c <= 0x042F ) { - u[0] = c; - u[1] = c + 32; - return u; - } - - if ( c >= 0x0430 && c<= 0x044F ) { - u[0] = c - 32; - u[1] = c; - return u; - - } - if ( (c >= 0x0451 && c <= 0x045C) || (c >=0x045E && c<= 0x045F) ) { - u[0] = c -80; - u[1] = c; - return u; - } - - if ( c >= 0x0460 && c <= 0x047F ) { - if ( c % 2 == 0 ) { - u[0] = c; - u[1] = c +1; - } else { - u[0] = c - 1; - u[1] = c; - } - return u; - } - - // Armenian - // Range: U+0530 to U+058F - if ( c >= 0x0531 && c <= 0x0556 ) { - u[0] = c; - u[1] = c + 48; - return u; - } - if ( c >= 0x0561 && c < 0x0587 ) { - u[0] = c - 48; - u[1] = c; - return u; - } - - // Hebrew - // Range: U+0590 to U+05FF - - - // Arabic - // Range: U+0600 to U+06FF - - // Devanagari - // Range: U+0900 to U+097F - - - // Bengali - // Range: U+0980 to U+09FF - - - // Gurmukhi - // Range: U+0A00 to U+0A7F - - - // Gujarati - // Range: U+0A80 to U+0AFF - - - // Oriya - // Range: U+0B00 to U+0B7F - // no capital / lower case - - - // Tamil - // Range: U+0B80 to U+0BFF - // no capital / lower case - - - // Telugu - // Range: U+0C00 to U+0C7F - // no capital / lower case - - - // Kannada - // Range: U+0C80 to U+0CFF - // no capital / lower case - - - // Malayalam - // Range: U+0D00 to U+0D7F - - // Thai - // Range: U+0E00 to U+0E7F - - - // Lao - // Range: U+0E80 to U+0EFF - - - // Tibetan - // Range: U+0F00 to U+0FBF - - // Georgian - // Range: U+10A0 to U+10F0 - if ( c >= 0x10A0 && c <= 0x10C5 ) { - u[0] = c; - u[1] = c + 48; - return u; - } - if ( c >= 0x10D0 && c <= 0x10F5 ) { - u[0] = c; - u[1] = c; - return u; - } - - // Hangul Jamo - // Range: U+1100 to U+11FF - - // Greek Extended - // Range: U+1F00 to U+1FFF - // skip for now - - - // General Punctuation - // Range: U+2000 to U+206F - - // Superscripts and Subscripts - // Range: U+2070 to U+209F - - // Currency Symbols - // Range: U+20A0 to U+20CF - - - // Combining Diacritical Marks for Symbols - // Range: U+20D0 to U+20FF - // skip for now - - - // Number Forms - // Range: U+2150 to U+218F - // skip for now - - - // Arrows - // Range: U+2190 to U+21FF - - // Mathematical Operators - // Range: U+2200 to U+22FF - - // Miscellaneous Technical - // Range: U+2300 to U+23FF - - // Control Pictures - // Range: U+2400 to U+243F - - // Optical Character Recognition - // Range: U+2440 to U+245F - - // Enclosed Alphanumerics - // Range: U+2460 to U+24FF - - // Box Drawing - // Range: U+2500 to U+257F - - // Block Elements - // Range: U+2580 to U+259F - - // Geometric Shapes - // Range: U+25A0 to U+25FF - - // Miscellaneous Symbols - // Range: U+2600 to U+26FF - - // Dingbats - // Range: U+2700 to U+27BF - - // CJK Symbols and Punctuation - // Range: U+3000 to U+303F - - // Hiragana - // Range: U+3040 to U+309F - - // Katakana - // Range: U+30A0 to U+30FF - - // Bopomofo - // Range: U+3100 to U+312F - - // Hangul Compatibility Jamo - // Range: U+3130 to U+318F - - // Kanbun - // Range: U+3190 to U+319F - - - // Enclosed CJK Letters and Months - // Range: U+3200 to U+32FF - - // CJK Compatibility - // Range: U+3300 to U+33FF - - // Hangul Syllables - // Range: U+AC00 to U+D7A3 - - // High Surrogates - // Range: U+D800 to U+DB7F - - // Private Use High Surrogates - // Range: U+DB80 to U+DBFF - - // Low Surrogates - // Range: U+DC00 to U+DFFF - - // Private Use Area - // Range: U+E000 to U+F8FF - - // CJK Compatibility Ideographs - // Range: U+F900 to U+FAFF - - // Alphabetic Presentation Forms - // Range: U+FB00 to U+FB4F - - // Arabic Presentation Forms-A - // Range: U+FB50 to U+FDFF - - // Combining Half Marks - // Range: U+FE20 to U+FE2F - - // CJK Compatibility Forms - // Range: U+FE30 to U+FE4F - - // Small Form Variants - // Range: U+FE50 to U+FE6F - - // Arabic Presentation Forms-B - // Range: U+FE70 to U+FEFF - - // Halfwidth and Fullwidth Forms - // Range: U+FF00 to U+FFEF - - if ( c >= 0xFF21 && c <= 0xFF3A ) { - u[0] = c; - u[1] = c + 32; - return u; - } - - if ( c >= 0xFF41 && c <= 0xFF5A ) { - u[0] = c - 32; - u[1] = c; - return u; - } - - // Specials - // Range: U+FFF0 to U+FFFF - - return u; -} - -function DecimalToHexString( n ) { - n = Number( n ); - var h = "0x"; - - for ( var i = 3; i >= 0; i-- ) { - if ( n >= Math.pow(16, i) ){ - var t = Math.floor( n / Math.pow(16, i)); - n -= t * Math.pow(16, i); - if ( t >= 10 ) { - if ( t == 10 ) { - h += "A"; - } - if ( t == 11 ) { - h += "B"; - } - if ( t == 12 ) { - h += "C"; - } - if ( t == 13 ) { - h += "D"; - } - if ( t == 14 ) { - h += "E"; - } - if ( t == 15 ) { - h += "F"; - } - } else { - h += String( t ); - } - } else { - h += "0"; - } - } - - return h; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.2-1.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.2-1.js deleted file mode 100644 index e607ed51e4..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.2-1.js +++ /dev/null @@ -1,72 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.2-1.js'; - -/** - File Name: 15.5.4.2-1.js - ECMA Section: 15.5.4.2 String.prototype.toString() - - Description: Returns this string value. Note that, for a String - object, the toString() method happens to return the same - thing as the valueOf() method. - - The toString function is not generic; it generates a - runtime error if its this value is not a String object. - Therefore it connot be transferred to the other kinds of - objects for use as a method. - - Author: christine@netscape.com - Date: 1 october 1997 -*/ - -var SECTION = "15.5.4.2-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "String.prototype.toString"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "String.prototype.toString()", "", String.prototype.toString() ); -new TestCase( SECTION, "(new String()).toString()", "", (new String()).toString() ); -new TestCase( SECTION, "(new String(\"\")).toString()", "", (new String("")).toString() ); -new TestCase( SECTION, "(new String( String() )).toString()","", (new String(String())).toString() ); -new TestCase( SECTION, "(new String( \"h e l l o\" )).toString()", "h e l l o", (new String("h e l l o")).toString() ); -new TestCase( SECTION, "(new String( 0 )).toString()", "0", (new String(0)).toString() ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.2-2-n.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.2-2-n.js deleted file mode 100644 index 930c1f8136..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.2-2-n.js +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.2-2-n.js'; - -/** - File Name: 15.5.4.2-2-n.js - ECMA Section: 15.5.4.2 String.prototype.toString() - - Description: Returns this string value. Note that, for a String - object, the toString() method happens to return the same - thing as the valueOf() method. - - The toString function is not generic; it generates a - runtime error if its this value is not a String object. - Therefore it connot be transferred to the other kinds of - objects for use as a method. - - Author: christine@netscape.com - Date: 1 october 1997 -*/ - -var SECTION = "15.5.4.2-3-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "String.prototype.toString"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "var tostr=String.prototype.toString; astring=new Number(); astring.toString = tostr; astring.toString()"; -EXPECTED = "error"; - -new TestCase( SECTION, - "var tostr=String.prototype.toString; astring=new Number(); astring.toString = tostr; astring.toString()", - "error", - eval("var tostr=String.prototype.toString; astring=new Number(); astring.toString = tostr; astring.toString()") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.2-3.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.2-3.js deleted file mode 100644 index 1e306a06f3..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.2-3.js +++ /dev/null @@ -1,83 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.2-3.js'; - -/** - File Name: 15.5.4.2-3.js - ECMA Section: 15.5.4.2 String.prototype.toString() - - Description: Returns this string value. Note that, for a String - object, the toString() method happens to return the same - thing as the valueOf() method. - - The toString function is not generic; it generates a - runtime error if its this value is not a String object. - Therefore it connot be transferred to the other kinds of - objects for use as a method. - - Author: christine@netscape.com - Date: 1 october 1997 -*/ - - -var SECTION = "15.5.4.2-3"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "String.prototype.toString"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "var tostr=String.prototype.toString; astring=new String(); astring.toString = tostr; astring.toString()", - "", - eval("var tostr=String.prototype.toString; astring=new String(); astring.toString = tostr; astring.toString()") ); -new TestCase( SECTION, - "var tostr=String.prototype.toString; astring=new String(0); astring.toString = tostr; astring.toString()", - "0", - eval("var tostr=String.prototype.toString; astring=new String(0); astring.toString = tostr; astring.toString()") ); -new TestCase( SECTION, - "var tostr=String.prototype.toString; astring=new String('hello'); astring.toString = tostr; astring.toString()", - "hello", - eval("var tostr=String.prototype.toString; astring=new String('hello'); astring.toString = tostr; astring.toString()") ); -new TestCase( SECTION, - "var tostr=String.prototype.toString; astring=new String(''); astring.toString = tostr; astring.toString()", - "", - eval("var tostr=String.prototype.toString; astring=new String(''); astring.toString = tostr; astring.toString()") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.2.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.2.js deleted file mode 100644 index 0a1100fc63..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.2.js +++ /dev/null @@ -1,87 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.2.js'; - -/** - File Name: 15.5.4.2.js - ECMA Section: 15.5.4.2 String.prototype.toString - - Description: - Author: christine@netscape.com - Date: 28 october 1997 - -*/ -var SECTION = "15.5.4.2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "String.prototype.tostring"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "String.prototype.toString() == String.prototype.valueOf()", - true, - String.prototype.toString() == String.prototype.valueOf() ); - -new TestCase( SECTION, "String.prototype.toString()", "", String.prototype.toString() ); -new TestCase( SECTION, "String.prototype.toString.length", 0, String.prototype.toString.length ); - - -new TestCase( SECTION, - "TESTSTRING = new String();TESTSTRING.valueOf() == TESTSTRING.toString()", - true, - eval("TESTSTRING = new String();TESTSTRING.valueOf() == TESTSTRING.toString()") ); -new TestCase( SECTION, - "TESTSTRING = new String(true);TESTSTRING.valueOf() == TESTSTRING.toString()", - true, - eval("TESTSTRING = new String(true);TESTSTRING.valueOf() == TESTSTRING.toString()") ); -new TestCase( SECTION, - "TESTSTRING = new String(false);TESTSTRING.valueOf() == TESTSTRING.toString()", - true, - eval("TESTSTRING = new String(false);TESTSTRING.valueOf() == TESTSTRING.toString()") ); -new TestCase( SECTION, - "TESTSTRING = new String(Math.PI);TESTSTRING.valueOf() == TESTSTRING.toString()", - true, - eval("TESTSTRING = new String(Math.PI);TESTSTRING.valueOf() == TESTSTRING.toString()") ); -new TestCase( SECTION, - "TESTSTRING = new String();TESTSTRING.valueOf() == TESTSTRING.toString()", - true, - eval("TESTSTRING = new String();TESTSTRING.valueOf() == TESTSTRING.toString()") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.3-1.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.3-1.js deleted file mode 100644 index b990876fe8..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.3-1.js +++ /dev/null @@ -1,72 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.3-1.js'; - -/** - File Name: 15.5.4.3-1.js - ECMA Section: 15.5.4.3 String.prototype.valueOf() - - Description: Returns this string value. - - The valueOf function is not generic; it generates a - runtime error if its this value is not a String object. - Therefore it connot be transferred to the other kinds of - objects for use as a method. - - Author: christine@netscape.com - Date: 1 october 1997 -*/ - -var SECTION = "15.5.4.3-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "String.prototype.valueOf"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "String.prototype.valueOf.length", 0, String.prototype.valueOf.length ); - -new TestCase( SECTION, "String.prototype.valueOf()", "", String.prototype.valueOf() ); -new TestCase( SECTION, "(new String()).valueOf()", "", (new String()).valueOf() ); -new TestCase( SECTION, "(new String(\"\")).valueOf()", "", (new String("")).valueOf() ); -new TestCase( SECTION, "(new String( String() )).valueOf()","", (new String(String())).valueOf() ); -new TestCase( SECTION, "(new String( \"h e l l o\" )).valueOf()", "h e l l o", (new String("h e l l o")).valueOf() ); -new TestCase( SECTION, "(new String( 0 )).valueOf()", "0", (new String(0)).valueOf() ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.3-2.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.3-2.js deleted file mode 100644 index 4747e013e6..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.3-2.js +++ /dev/null @@ -1,90 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.3-2.js'; - -/** - File Name: 15.5.4.3-2.js - ECMA Section: 15.5.4.3 String.prototype.valueOf() - - Description: Returns this string value. - - The valueOf function is not generic; it generates a - runtime error if its this value is not a String object. - Therefore it connot be transferred to the other kinds of - objects for use as a method. - - Author: christine@netscape.com - Date: 1 october 1997 -*/ - - -var SECTION = "15.5.4.3-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "String.prototype.valueOf"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "var valof=String.prototype.valueOf; astring=new String(); astring.valueOf = valof; astring.valof()", - "", - eval("var valof=String.prototype.valueOf; astring=new String(); astring.valueOf = valof; astring.valueOf()") ); - -new TestCase( SECTION, - "var valof=String.prototype.valueOf; astring=new String(0); astring.valueOf = valof; astring.valof()", - "0", - eval("var valof=String.prototype.valueOf; astring=new String(0); astring.valueOf = valof; astring.valueOf()") ); - -new TestCase( SECTION, - "var valof=String.prototype.valueOf; astring=new String('hello'); astring.valueOf = valof; astring.valof()", - "hello", - eval("var valof=String.prototype.valueOf; astring=new String('hello'); astring.valueOf = valof; astring.valueOf()") ); - -new TestCase( SECTION, - "var valof=String.prototype.valueOf; astring=new String(''); astring.valueOf = valof; astring.valof()", - "", - eval("var valof=String.prototype.valueOf; astring=new String(''); astring.valueOf = valof; astring.valueOf()") ); -/* - new TestCase( SECTION, - "var valof=String.prototype.valueOf; astring=new Number(); astring.valueOf = valof; astring.valof()", - "error", - eval("var valof=String.prototype.valueOf; astring=new Number(); astring.valueOf = valof; astring.valueOf()") ); -*/ - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.3-3-n.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.3-3-n.js deleted file mode 100644 index bdfa52ece0..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.3-3-n.js +++ /dev/null @@ -1,72 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.3-3-n.js'; - -/** - File Name: 15.5.4.3-3-n.js - ECMA Section: 15.5.4.3 String.prototype.valueOf() - - Description: Returns this string value. - - The valueOf function is not generic; it generates a - runtime error if its this value is not a String object. - Therefore it connot be transferred to the other kinds of - objects for use as a method. - - Author: christine@netscape.com - Date: 1 october 1997 -*/ - - -var SECTION = "15.5.4.3-3-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "String.prototype.valueOf"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "var valof=String.prototype.valueOf; astring=new Number(); astring.valueOf = valof; astring.valof()"; -EXPECTED = "error"; - -new TestCase( SECTION, - "var valof=String.prototype.valueOf; astring=new Number(); astring.valueOf = valof; astring.valof()", - "error", - eval("var valof=String.prototype.valueOf; astring=new Number(); astring.valueOf = valof; astring.valueOf()") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.4-1.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.4-1.js deleted file mode 100644 index 5dbffb1d14..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.4-1.js +++ /dev/null @@ -1,92 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.4-1.js'; - -/** - File Name: 15.5.4.4-1.js - ECMA Section: 15.5.4.4 String.prototype.charAt(pos) - Description: Returns a string containing the character at position - pos in the string. If there is no character at that - string, the result is the empty string. The result is - a string value, not a String object. - - When the charAt method is called with one argument, - pos, the following steps are taken: - 1. Call ToString, with this value as its argument - 2. Call ToInteger pos - - In this test, this is a String, pos is an integer, and - all pos are in range. - - Author: christine@netscape.com - Date: 2 october 1997 -*/ -var SECTION = "15.5.4.4-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "String.prototype.charAt"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var TEST_STRING = new String( " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" ); - -var item = 0; -var i; - -for ( i = 0x0020; i < 0x007e; i++, item++) { - new TestCase( SECTION, - "TEST_STRING.charAt("+item+")", - String.fromCharCode( i ), - TEST_STRING.charAt( item ) ); -} - -for ( i = 0x0020; i < 0x007e; i++, item++) { - new TestCase( SECTION, - "TEST_STRING.charAt("+item+") == TEST_STRING.substring( "+item +", "+ (item+1) + ")", - true, - TEST_STRING.charAt( item ) == TEST_STRING.substring( item, item+1 ) - ); -} - -new TestCase( SECTION, "String.prototype.charAt.length", 1, String.prototype.charAt.length ); - -print( "TEST_STRING = new String(\" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\")" ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.4-2.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.4-2.js deleted file mode 100644 index c822a1d5f7..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.4-2.js +++ /dev/null @@ -1,136 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.4-2.js'; - -/** - File Name: 15.5.4.4-1.js - ECMA Section: 15.5.4.4 String.prototype.charAt(pos) - Description: Returns a string containing the character at position - pos in the string. If there is no character at that - string, the result is the empty string. The result is - a string value, not a String object. - - When the charAt method is called with one argument, - pos, the following steps are taken: - 1. Call ToString, with this value as its argument - 2. Call ToInteger pos - 3. Compute the number of characters in Result(1) - 4. If Result(2) is less than 0 is or not less than - Result(3), return the empty string - 5. Return a string of length 1 containing one character - from result (1), the character at position Result(2). - - Note that the charAt function is intentionally generic; - it does not require that its this value be a String - object. Therefore it can be transferred to other kinds - of objects for use as a method. - - Author: christine@netscape.com - Date: 2 october 1997 -*/ -var SECTION = "15.5.4.4-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "String.prototype.charAt"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "x = new Boolean(true); x.charAt=String.prototype.charAt;x.charAt(0)", "t", eval("x = new Boolean(true); x.charAt=String.prototype.charAt;x.charAt(0)") ); -new TestCase( SECTION, "x = new Boolean(true); x.charAt=String.prototype.charAt;x.charAt(1)", "r", eval("x = new Boolean(true); x.charAt=String.prototype.charAt;x.charAt(1)") ); -new TestCase( SECTION, "x = new Boolean(true); x.charAt=String.prototype.charAt;x.charAt(2)", "u", eval("x = new Boolean(true); x.charAt=String.prototype.charAt;x.charAt(2)") ); -new TestCase( SECTION, "x = new Boolean(true); x.charAt=String.prototype.charAt;x.charAt(3)", "e", eval("x = new Boolean(true); x.charAt=String.prototype.charAt;x.charAt(3)") ); -new TestCase( SECTION, "x = new Boolean(true); x.charAt=String.prototype.charAt;x.charAt(4)", "", eval("x = new Boolean(true); x.charAt=String.prototype.charAt;x.charAt(4)") ); -new TestCase( SECTION, "x = new Boolean(true); x.charAt=String.prototype.charAt;x.charAt(-1)", "", eval("x = new Boolean(true); x.charAt=String.prototype.charAt;x.charAt(-1)") ); - -new TestCase( SECTION, "x = new Boolean(true); x.charAt=String.prototype.charAt;x.charAt(true)", "r", eval("x = new Boolean(true); x.charAt=String.prototype.charAt;x.charAt(true)") ); -new TestCase( SECTION, "x = new Boolean(true); x.charAt=String.prototype.charAt;x.charAt(false)", "t", eval("x = new Boolean(true); x.charAt=String.prototype.charAt;x.charAt(false)") ); - -new TestCase( SECTION, "x = new String(); x.charAt(0)", "", eval("x=new String();x.charAt(0)") ); -new TestCase( SECTION, "x = new String(); x.charAt(1)", "", eval("x=new String();x.charAt(1)") ); -new TestCase( SECTION, "x = new String(); x.charAt(-1)", "", eval("x=new String();x.charAt(-1)") ); - -new TestCase( SECTION, "x = new String(); x.charAt(NaN)", "", eval("x=new String();x.charAt(Number.NaN)") ); -new TestCase( SECTION, "x = new String(); x.charAt(Number.POSITIVE_INFINITY)", "", eval("x=new String();x.charAt(Number.POSITIVE_INFINITY)") ); -new TestCase( SECTION, "x = new String(); x.charAt(Number.NEGATIVE_INFINITY)", "", eval("x=new String();x.charAt(Number.NEGATIVE_INFINITY)") ); - -new TestCase( SECTION, "var MYOB = new MyObject(1234567890); MYOB.charAt(0)", "1", eval("var MYOB = new MyObject(1234567890); MYOB.charAt(0)") ); -new TestCase( SECTION, "var MYOB = new MyObject(1234567890); MYOB.charAt(1)", "2", eval("var MYOB = new MyObject(1234567890); MYOB.charAt(1)") ); -new TestCase( SECTION, "var MYOB = new MyObject(1234567890); MYOB.charAt(2)", "3", eval("var MYOB = new MyObject(1234567890); MYOB.charAt(2)") ); -new TestCase( SECTION, "var MYOB = new MyObject(1234567890); MYOB.charAt(3)", "4", eval("var MYOB = new MyObject(1234567890); MYOB.charAt(3)") ); -new TestCase( SECTION, "var MYOB = new MyObject(1234567890); MYOB.charAt(4)", "5", eval("var MYOB = new MyObject(1234567890); MYOB.charAt(4)") ); -new TestCase( SECTION, "var MYOB = new MyObject(1234567890); MYOB.charAt(5)", "6", eval("var MYOB = new MyObject(1234567890); MYOB.charAt(5)") ); -new TestCase( SECTION, "var MYOB = new MyObject(1234567890); MYOB.charAt(6)", "7", eval("var MYOB = new MyObject(1234567890); MYOB.charAt(6)") ); -new TestCase( SECTION, "var MYOB = new MyObject(1234567890); MYOB.charAt(7)", "8", eval("var MYOB = new MyObject(1234567890); MYOB.charAt(7)") ); -new TestCase( SECTION, "var MYOB = new MyObject(1234567890); MYOB.charAt(8)", "9", eval("var MYOB = new MyObject(1234567890); MYOB.charAt(8)") ); -new TestCase( SECTION, "var MYOB = new MyObject(1234567890); MYOB.charAt(9)", "0", eval("var MYOB = new MyObject(1234567890); MYOB.charAt(9)") ); -new TestCase( SECTION, "var MYOB = new MyObject(1234567890); MYOB.charAt(10)", "", eval("var MYOB = new MyObject(1234567890); MYOB.charAt(10)") ); - -new TestCase( SECTION, "var MYOB = new MyObject(1234567890); MYOB.charAt(Math.PI)", "4", eval("var MYOB = new MyObject(1234567890); MYOB.charAt(Math.PI)") ); - -// MyOtherObject.toString will return "[object Object] - -new TestCase( SECTION, "var MYOB = new MyOtherObject(1234567890); MYOB.charAt(0)", "[", eval("var MYOB = new MyOtherObject(1234567890); MYOB.charAt(0)") ); -new TestCase( SECTION, "var MYOB = new MyOtherObject(1234567890); MYOB.charAt(1)", "o", eval("var MYOB = new MyOtherObject(1234567890); MYOB.charAt(1)") ); -new TestCase( SECTION, "var MYOB = new MyOtherObject(1234567890); MYOB.charAt(2)", "b", eval("var MYOB = new MyOtherObject(1234567890); MYOB.charAt(2)") ); -new TestCase( SECTION, "var MYOB = new MyOtherObject(1234567890); MYOB.charAt(3)", "j", eval("var MYOB = new MyOtherObject(1234567890); MYOB.charAt(3)") ); -new TestCase( SECTION, "var MYOB = new MyOtherObject(1234567890); MYOB.charAt(4)", "e", eval("var MYOB = new MyOtherObject(1234567890); MYOB.charAt(4)") ); -new TestCase( SECTION, "var MYOB = new MyOtherObject(1234567890); MYOB.charAt(5)", "c", eval("var MYOB = new MyOtherObject(1234567890); MYOB.charAt(5)") ); -new TestCase( SECTION, "var MYOB = new MyOtherObject(1234567890); MYOB.charAt(6)", "t", eval("var MYOB = new MyOtherObject(1234567890); MYOB.charAt(6)") ); -new TestCase( SECTION, "var MYOB = new MyOtherObject(1234567890); MYOB.charAt(7)", " ", eval("var MYOB = new MyOtherObject(1234567890); MYOB.charAt(7)") ); -new TestCase( SECTION, "var MYOB = new MyOtherObject(1234567890); MYOB.charAt(8)", "O", eval("var MYOB = new MyOtherObject(1234567890); MYOB.charAt(8)") ); -new TestCase( SECTION, "var MYOB = new MyOtherObject(1234567890); MYOB.charAt(9)", "b", eval("var MYOB = new MyOtherObject(1234567890); MYOB.charAt(9)") ); -new TestCase( SECTION, "var MYOB = new MyOtherObject(1234567890); MYOB.charAt(10)", "j", eval("var MYOB = new MyOtherObject(1234567890); MYOB.charAt(10)") ); -new TestCase( SECTION, "var MYOB = new MyOtherObject(1234567890); MYOB.charAt(11)", "e", eval("var MYOB = new MyOtherObject(1234567890); MYOB.charAt(11)") ); -new TestCase( SECTION, "var MYOB = new MyOtherObject(1234567890); MYOB.charAt(12)", "c", eval("var MYOB = new MyOtherObject(1234567890); MYOB.charAt(12)") ); -new TestCase( SECTION, "var MYOB = new MyOtherObject(1234567890); MYOB.charAt(13)", "t", eval("var MYOB = new MyOtherObject(1234567890); MYOB.charAt(13)") ); -new TestCase( SECTION, "var MYOB = new MyOtherObject(1234567890); MYOB.charAt(14)", "]", eval("var MYOB = new MyOtherObject(1234567890); MYOB.charAt(14)") ); - -test(); - -function MyObject( value ) { - this.value = value; - this.valueOf = new Function( "return this.value;" ); - this.toString = new Function( "return this.value +''" ); - this.charAt = String.prototype.charAt; -} -function MyOtherObject(value) { - this.value = value; - this.valueOf = new Function( "return this.value;" ); - this.charAt = String.prototype.charAt; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.4-3.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.4-3.js deleted file mode 100644 index 96b4759c98..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.4-3.js +++ /dev/null @@ -1,112 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.4-3.js'; - -/** - File Name: 15.5.4.4-3.js - ECMA Section: 15.5.4.4 String.prototype.charAt(pos) - Description: Returns a string containing the character at position - pos in the string. If there is no character at that - string, the result is the empty string. The result is - a string value, not a String object. - - When the charAt method is called with one argument, - pos, the following steps are taken: - 1. Call ToString, with this value as its argument - 2. Call ToInteger pos - 3. Compute the number of characters in Result(1) - 4. If Result(2) is less than 0 is or not less than - Result(3), return the empty string - 5. Return a string of length 1 containing one character - from result (1), the character at position Result(2). - - Note that the charAt function is intentionally generic; - it does not require that its this value be a String - object. Therefore it can be transferred to other kinds - of objects for use as a method. - - This tests assiging charAt to a user-defined function. - - Author: christine@netscape.com - Date: 2 october 1997 -*/ -var SECTION = "15.5.4.4-3"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "String.prototype.charAt"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var foo = new MyObject('hello'); - - -new TestCase( SECTION, "var foo = new MyObject('hello'); ", "h", foo.charAt(0) ); -new TestCase( SECTION, "var foo = new MyObject('hello'); ", "e", foo.charAt(1) ); -new TestCase( SECTION, "var foo = new MyObject('hello'); ", "l", foo.charAt(2) ); -new TestCase( SECTION, "var foo = new MyObject('hello'); ", "l", foo.charAt(3) ); -new TestCase( SECTION, "var foo = new MyObject('hello'); ", "o", foo.charAt(4) ); -new TestCase( SECTION, "var foo = new MyObject('hello'); ", "", foo.charAt(-1) ); -new TestCase( SECTION, "var foo = new MyObject('hello'); ", "", foo.charAt(5) ); - -var boo = new MyObject(true); - -new TestCase( SECTION, "var boo = new MyObject(true); ", "t", boo.charAt(0) ); -new TestCase( SECTION, "var boo = new MyObject(true); ", "r", boo.charAt(1) ); -new TestCase( SECTION, "var boo = new MyObject(true); ", "u", boo.charAt(2) ); -new TestCase( SECTION, "var boo = new MyObject(true); ", "e", boo.charAt(3) ); - -var noo = new MyObject( Math.PI ); - -new TestCase( SECTION, "var noo = new MyObject(Math.PI); ", "3", noo.charAt(0) ); -new TestCase( SECTION, "var noo = new MyObject(Math.PI); ", ".", noo.charAt(1) ); -new TestCase( SECTION, "var noo = new MyObject(Math.PI); ", "1", noo.charAt(2) ); -new TestCase( SECTION, "var noo = new MyObject(Math.PI); ", "4", noo.charAt(3) ); -new TestCase( SECTION, "var noo = new MyObject(Math.PI); ", "1", noo.charAt(4) ); -new TestCase( SECTION, "var noo = new MyObject(Math.PI); ", "5", noo.charAt(5) ); -new TestCase( SECTION, "var noo = new MyObject(Math.PI); ", "9", noo.charAt(6) ); - -test(); - -function MyObject (v) { - this.value = v; - this.toString = new Function( "return this.value +'';" ); - this.valueOf = new Function( "return this.value" ); - this.charAt = String.prototype.charAt; -} - diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.4-4.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.4-4.js deleted file mode 100644 index bf9f7a6898..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.4-4.js +++ /dev/null @@ -1,124 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.4-4.js'; - -/** - File Name: 15.5.4.4-4.js - ECMA Section: 15.5.4.4 String.prototype.charAt(pos) - Description: Returns a string containing the character at position - pos in the string. If there is no character at that - string, the result is the empty string. The result is - a string value, not a String object. - - When the charAt method is called with one argument, - pos, the following steps are taken: - 1. Call ToString, with this value as its argument - 2. Call ToInteger pos - 3. Compute the number of characters in Result(1) - 4. If Result(2) is less than 0 is or not less than - Result(3), return the empty string - 5. Return a string of length 1 containing one character - from result (1), the character at position Result(2). - - Note that the charAt function is intentionally generic; - it does not require that its this value be a String - object. Therefore it can be transferred to other kinds - of objects for use as a method. - - This tests assiging charAt to primitive types.. - - Author: christine@netscape.com - Date: 2 october 1997 -*/ -var SECTION = "15.5.4.4-4"; -var VERSION = "ECMA_2"; -startTest(); -var TITLE = "String.prototype.charAt"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "x = new Array(1,2,3); x.charAt = String.prototype.charAt; x.charAt(0)", "1", eval("x=new Array(1,2,3); x.charAt = String.prototype.charAt; x.charAt(0)") ); -new TestCase( SECTION, "x = new Array(1,2,3); x.charAt = String.prototype.charAt; x.charAt(1)", ",", eval("x=new Array(1,2,3); x.charAt = String.prototype.charAt; x.charAt(1)") ); -new TestCase( SECTION, "x = new Array(1,2,3); x.charAt = String.prototype.charAt; x.charAt(2)", "2", eval("x=new Array(1,2,3); x.charAt = String.prototype.charAt; x.charAt(2)") ); -new TestCase( SECTION, "x = new Array(1,2,3); x.charAt = String.prototype.charAt; x.charAt(3)", ",", eval("x=new Array(1,2,3); x.charAt = String.prototype.charAt; x.charAt(3)") ); -new TestCase( SECTION, "x = new Array(1,2,3); x.charAt = String.prototype.charAt; x.charAt(4)", "3", eval("x=new Array(1,2,3); x.charAt = String.prototype.charAt; x.charAt(4)") ); - -new TestCase( SECTION, "x = new Array(); x.charAt = String.prototype.charAt; x.charAt(0)", "", eval("x = new Array(); x.charAt = String.prototype.charAt; x.charAt(0)") ); - -new TestCase( SECTION, "x = new Number(123); x.charAt = String.prototype.charAt; x.charAt(0)", "1", eval("x=new Number(123); x.charAt = String.prototype.charAt; x.charAt(0)") ); -new TestCase( SECTION, "x = new Number(123); x.charAt = String.prototype.charAt; x.charAt(1)", "2", eval("x=new Number(123); x.charAt = String.prototype.charAt; x.charAt(1)") ); -new TestCase( SECTION, "x = new Number(123); x.charAt = String.prototype.charAt; x.charAt(2)", "3", eval("x=new Number(123); x.charAt = String.prototype.charAt; x.charAt(2)") ); - -new TestCase( SECTION, "x = new Object(); x.charAt = String.prototype.charAt; x.charAt(0)", "[", eval("x=new Object(); x.charAt = String.prototype.charAt; x.charAt(0)") ); -new TestCase( SECTION, "x = new Object(); x.charAt = String.prototype.charAt; x.charAt(1)", "o", eval("x=new Object(); x.charAt = String.prototype.charAt; x.charAt(1)") ); -new TestCase( SECTION, "x = new Object(); x.charAt = String.prototype.charAt; x.charAt(2)", "b", eval("x=new Object(); x.charAt = String.prototype.charAt; x.charAt(2)") ); -new TestCase( SECTION, "x = new Object(); x.charAt = String.prototype.charAt; x.charAt(3)", "j", eval("x=new Object(); x.charAt = String.prototype.charAt; x.charAt(3)") ); -new TestCase( SECTION, "x = new Object(); x.charAt = String.prototype.charAt; x.charAt(4)", "e", eval("x=new Object(); x.charAt = String.prototype.charAt; x.charAt(4)") ); -new TestCase( SECTION, "x = new Object(); x.charAt = String.prototype.charAt; x.charAt(5)", "c", eval("x=new Object(); x.charAt = String.prototype.charAt; x.charAt(5)") ); -new TestCase( SECTION, "x = new Object(); x.charAt = String.prototype.charAt; x.charAt(6)", "t", eval("x=new Object(); x.charAt = String.prototype.charAt; x.charAt(6)") ); -new TestCase( SECTION, "x = new Object(); x.charAt = String.prototype.charAt; x.charAt(7)", " ", eval("x=new Object(); x.charAt = String.prototype.charAt; x.charAt(7)") ); -new TestCase( SECTION, "x = new Object(); x.charAt = String.prototype.charAt; x.charAt(8)", "O", eval("x=new Object(); x.charAt = String.prototype.charAt; x.charAt(8)") ); -new TestCase( SECTION, "x = new Object(); x.charAt = String.prototype.charAt; x.charAt(9)", "b", eval("x=new Object(); x.charAt = String.prototype.charAt; x.charAt(9)") ); -new TestCase( SECTION, "x = new Object(); x.charAt = String.prototype.charAt; x.charAt(10)", "j", eval("x=new Object(); x.charAt = String.prototype.charAt; x.charAt(10)") ); -new TestCase( SECTION, "x = new Object(); x.charAt = String.prototype.charAt; x.charAt(11)", "e", eval("x=new Object(); x.charAt = String.prototype.charAt; x.charAt(11)") ); -new TestCase( SECTION, "x = new Object(); x.charAt = String.prototype.charAt; x.charAt(12)", "c", eval("x=new Object(); x.charAt = String.prototype.charAt; x.charAt(12)") ); -new TestCase( SECTION, "x = new Object(); x.charAt = String.prototype.charAt; x.charAt(13)", "t", eval("x=new Object(); x.charAt = String.prototype.charAt; x.charAt(13)") ); -new TestCase( SECTION, "x = new Object(); x.charAt = String.prototype.charAt; x.charAt(14)", "]", eval("x=new Object(); x.charAt = String.prototype.charAt; x.charAt(14)") ); - -new TestCase( SECTION, "x = new Function(); x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(0)", "[", eval("x=new Function(); x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(0)") ); -new TestCase( SECTION, "x = new Function(); x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(1)", "o", eval("x=new Function(); x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(1)") ); -new TestCase( SECTION, "x = new Function(); x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(2)", "b", eval("x=new Function(); x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(2)") ); -new TestCase( SECTION, "x = new Function(); x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(3)", "j", eval("x=new Function(); x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(3)") ); -new TestCase( SECTION, "x = new Function(); x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(4)", "e", eval("x=new Function(); x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(4)") ); -new TestCase( SECTION, "x = new Function(); x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(5)", "c", eval("x=new Function(); x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(5)") ); -new TestCase( SECTION, "x = new Function(); x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(6)", "t", eval("x=new Function(); x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(6)") ); -new TestCase( SECTION, "x = new Function(); x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(7)", " ", eval("x=new Function(); x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(7)") ); -new TestCase( SECTION, "x = new Function(); x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(8)", "F", eval("x=new Function(); x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(8)") ); -new TestCase( SECTION, "x = new Function(); x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(9)", "u", eval("x=new Function(); x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(9)") ); -new TestCase( SECTION, "x = new Function(); x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(10)", "n", eval("x=new Function(); x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(10)") ); -new TestCase( SECTION, "x = new Function(); x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(11)", "c", eval("x=new Function(); x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(11)") ); -new TestCase( SECTION, "x = new Function(); x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(12)", "t", eval("x=new Function(); x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(12)") ); -new TestCase( SECTION, "x = new Function(); x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(13)", "i", eval("x=new Function(); x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(13)") ); -new TestCase( SECTION, "x = new Function(); x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(14)", "o", eval("x=new Function(); x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(14)") ); -new TestCase( SECTION, "x = new Function(); x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(15)", "n", eval("x=new Function(); x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(15)") ); -new TestCase( SECTION, "x = new Function(); x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(16)", "]", eval("x=new Function(); x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(16)") ); -new TestCase( SECTION, "x = new Function(); x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(17)", "", eval("x=new Function(); x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(17)") ); - - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.5-1.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.5-1.js deleted file mode 100644 index a1ba440a60..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.5-1.js +++ /dev/null @@ -1,87 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.5-1.js'; - -/** - File Name: 15.5.4.5.1.js - ECMA Section: 15.5.4.5 String.prototype.charCodeAt(pos) - Description: Returns a number (a nonnegative integer less than 2^16) - representing the Unicode encoding of the character at - position pos in this string. If there is no character - at that position, the number is NaN. - - When the charCodeAt method is called with one argument - pos, the following steps are taken: - 1. Call ToString, giving it the theis value as its - argument - 2. Call ToInteger(pos) - 3. Compute the number of characters in result(1). - 4. If Result(2) is less than 0 or is not less than - Result(3), return NaN. - 5. Return a value of Number type, of positive sign, whose - magnitude is the Unicode encoding of one character - from result 1, namely the characer at position Result - (2), where the first character in Result(1) is - considered to be at position 0. - - Note that the charCodeAt funciton is intentionally - generic; it does not require that its this value be a - String object. Therefore it can be transferred to other - kinds of objects for use as a method. - - Author: christine@netscape.com - Date: 2 october 1997 -*/ -var SECTION = "15.5.4.5-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "String.prototype.charCodeAt"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var TEST_STRING = new String( " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" ); - -for ( j = 0, i = 0x0020; i < 0x007e; i++, j++ ) { - new TestCase( SECTION, "TEST_STRING.charCodeAt("+j+")", i, TEST_STRING.charCodeAt( j ) ); -} - -new TestCase( SECTION, 'TEST_STRING.charCodeAt('+i+')', NaN, TEST_STRING.charCodeAt( i ) ); - - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.5-2.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.5-2.js deleted file mode 100644 index 29cb76152e..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.5-2.js +++ /dev/null @@ -1,121 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.5-2.js'; - -/** - File Name: 15.5.4.5.1.js - ECMA Section: 15.5.4.5 String.prototype.charCodeAt(pos) - Description: Returns a number (a nonnegative integer less than 2^16) - representing the Unicode encoding of the character at - position pos in this string. If there is no character - at that position, the number is NaN. - - When the charCodeAt method is called with one argument - pos, the following steps are taken: - 1. Call ToString, giving it the theis value as its - argument - 2. Call ToInteger(pos) - 3. Compute the number of characters in result(1). - 4. If Result(2) is less than 0 or is not less than - Result(3), return NaN. - 5. Return a value of Number type, of positive sign, whose - magnitude is the Unicode encoding of one character - from result 1, namely the characer at position Result - (2), where the first character in Result(1) is - considered to be at position 0. - - Note that the charCodeAt funciton is intentionally - generic; it does not require that its this value be a - String object. Therefore it can be transferred to other - kinds of objects for use as a method. - - Author: christine@netscape.com - Date: 2 october 1997 -*/ -var SECTION = "15.5.4.5-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "String.prototype.charCodeAt"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var TEST_STRING = new String( " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" ); - -var x; - -new TestCase( SECTION, "x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(0)", 0x0074, eval("x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(0)") ); -new TestCase( SECTION, "x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(1)", 0x0072, eval("x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(1)") ); -new TestCase( SECTION, "x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(2)", 0x0075, eval("x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(2)") ); -new TestCase( SECTION, "x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(3)", 0x0065, eval("x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(3)") ); -new TestCase( SECTION, "x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(4)", Number.NaN, eval("x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(4)") ); -new TestCase( SECTION, "x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(-1)", Number.NaN, eval("x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(-1)") ); - -new TestCase( SECTION, "x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(true)", 0x0072, eval("x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(true)") ); -new TestCase( SECTION, "x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(false)", 0x0074, eval("x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(false)") ); - -new TestCase( SECTION, "x = new String(); x.charCodeAt(0)", Number.NaN, eval("x=new String();x.charCodeAt(0)") ); -new TestCase( SECTION, "x = new String(); x.charCodeAt(1)", Number.NaN, eval("x=new String();x.charCodeAt(1)") ); -new TestCase( SECTION, "x = new String(); x.charCodeAt(-1)", Number.NaN, eval("x=new String();x.charCodeAt(-1)") ); - -new TestCase( SECTION, "x = new String(); x.charCodeAt(NaN)", Number.NaN, eval("x=new String();x.charCodeAt(Number.NaN)") ); -new TestCase( SECTION, "x = new String(); x.charCodeAt(Number.POSITIVE_INFINITY)", Number.NaN, eval("x=new String();x.charCodeAt(Number.POSITIVE_INFINITY)") ); -new TestCase( SECTION, "x = new String(); x.charCodeAt(Number.NEGATIVE_INFINITY)", Number.NaN, eval("x=new String();x.charCodeAt(Number.NEGATIVE_INFINITY)") ); - -new TestCase( SECTION, "x = new Array(1,2,3); x.charCodeAt = String.prototype.charCodeAt; x.charCodeAt(0)", 0x0031, eval("x = new Array(1,2,3); x.charCodeAt = String.prototype.charCodeAt; x.charCodeAt(0)") ); -new TestCase( SECTION, "x = new Array(1,2,3); x.charCodeAt = String.prototype.charCodeAt; x.charCodeAt(1)", 0x002C, eval("x = new Array(1,2,3); x.charCodeAt = String.prototype.charCodeAt; x.charCodeAt(1)") ); -new TestCase( SECTION, "x = new Array(1,2,3); x.charCodeAt = String.prototype.charCodeAt; x.charCodeAt(2)", 0x0032, eval("x = new Array(1,2,3); x.charCodeAt = String.prototype.charCodeAt; x.charCodeAt(2)") ); -new TestCase( SECTION, "x = new Array(1,2,3); x.charCodeAt = String.prototype.charCodeAt; x.charCodeAt(3)", 0x002C, eval("x = new Array(1,2,3); x.charCodeAt = String.prototype.charCodeAt; x.charCodeAt(3)") ); -new TestCase( SECTION, "x = new Array(1,2,3); x.charCodeAt = String.prototype.charCodeAt; x.charCodeAt(4)", 0x0033, eval("x = new Array(1,2,3); x.charCodeAt = String.prototype.charCodeAt; x.charCodeAt(4)") ); -new TestCase( SECTION, "x = new Array(1,2,3); x.charCodeAt = String.prototype.charCodeAt; x.charCodeAt(5)", NaN, eval("x = new Array(1,2,3); x.charCodeAt = String.prototype.charCodeAt; x.charCodeAt(5)") ); - -new TestCase( SECTION, "x = new Function( 'this.charCodeAt = String.prototype.charCodeAt' ); f = new x(); f.charCodeAt(0)", 0x005B, eval("x = new Function( 'this.charCodeAt = String.prototype.charCodeAt' ); f = new x(); f.charCodeAt(0)") ); -new TestCase( SECTION, "x = new Function( 'this.charCodeAt = String.prototype.charCodeAt' ); f = new x(); f.charCodeAt(1)", 0x006F, eval("x = new Function( 'this.charCodeAt = String.prototype.charCodeAt' ); f = new x(); f.charCodeAt(1)") ); -new TestCase( SECTION, "x = new Function( 'this.charCodeAt = String.prototype.charCodeAt' ); f = new x(); f.charCodeAt(2)", 0x0062, eval("x = new Function( 'this.charCodeAt = String.prototype.charCodeAt' ); f = new x(); f.charCodeAt(2)") ); -new TestCase( SECTION, "x = new Function( 'this.charCodeAt = String.prototype.charCodeAt' ); f = new x(); f.charCodeAt(3)", 0x006A, eval("x = new Function( 'this.charCodeAt = String.prototype.charCodeAt' ); f = new x(); f.charCodeAt(3)") ); -new TestCase( SECTION, "x = new Function( 'this.charCodeAt = String.prototype.charCodeAt' ); f = new x(); f.charCodeAt(4)", 0x0065, eval("x = new Function( 'this.charCodeAt = String.prototype.charCodeAt' ); f = new x(); f.charCodeAt(4)") ); -new TestCase( SECTION, "x = new Function( 'this.charCodeAt = String.prototype.charCodeAt' ); f = new x(); f.charCodeAt(5)", 0x0063, eval("x = new Function( 'this.charCodeAt = String.prototype.charCodeAt' ); f = new x(); f.charCodeAt(5)") ); -new TestCase( SECTION, "x = new Function( 'this.charCodeAt = String.prototype.charCodeAt' ); f = new x(); f.charCodeAt(6)", 0x0074, eval("x = new Function( 'this.charCodeAt = String.prototype.charCodeAt' ); f = new x(); f.charCodeAt(6)") ); - -new TestCase( SECTION, "x = new Function( 'this.charCodeAt = String.prototype.charCodeAt' ); f = new x(); f.charCodeAt(7)", 0x0020, eval("x = new Function( 'this.charCodeAt = String.prototype.charCodeAt' ); f = new x(); f.charCodeAt(7)") ); - -new TestCase( SECTION, "x = new Function( 'this.charCodeAt = String.prototype.charCodeAt' ); f = new x(); f.charCodeAt(8)", 0x004F, eval("x = new Function( 'this.charCodeAt = String.prototype.charCodeAt' ); f = new x(); f.charCodeAt(8)") ); -new TestCase( SECTION, "x = new Function( 'this.charCodeAt = String.prototype.charCodeAt' ); f = new x(); f.charCodeAt(9)", 0x0062, eval("x = new Function( 'this.charCodeAt = String.prototype.charCodeAt' ); f = new x(); f.charCodeAt(9)") ); -new TestCase( SECTION, "x = new Function( 'this.charCodeAt = String.prototype.charCodeAt' ); f = new x(); f.charCodeAt(10)", 0x006A, eval("x = new Function( 'this.charCodeAt = String.prototype.charCodeAt' ); f = new x(); f.charCodeAt(10)") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.5-3.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.5-3.js deleted file mode 100644 index 46852f4022..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.5-3.js +++ /dev/null @@ -1,131 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.5-3.js'; - -/** - File Name: 15.5.4.5-3.js - ECMA Section: 15.5.4.5 String.prototype.charCodeAt(pos) - Description: Returns a number (a nonnegative integer less than 2^16) - representing the Unicode encoding of the character at - position pos in this string. If there is no character - at that position, the number is NaN. - - When the charCodeAt method is called with one argument - pos, the following steps are taken: - 1. Call ToString, giving it the theis value as its - argument - 2. Call ToInteger(pos) - 3. Compute the number of characters in result(1). - 4. If Result(2) is less than 0 or is not less than - Result(3), return NaN. - 5. Return a value of Number type, of positive sign, whose - magnitude is the Unicode encoding of one character - from result 1, namely the characer at position Result - (2), where the first character in Result(1) is - considered to be at position 0. - - Note that the charCodeAt funciton is intentionally - generic; it does not require that its this value be a - String object. Therefore it can be transferred to other - kinds of objects for use as a method. - - Author: christine@netscape.com - Date: 2 october 1997 -*/ -var SECTION = "15.5.4.5-3"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "String.prototype.charCodeAt"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var TEST_STRING = new String( " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" ); - - -var foo = new MyObject('hello'); - -new TestCase( SECTION, "var foo = new MyObject('hello');foo.charCodeAt(0)", 0x0068, foo.charCodeAt(0) ); -new TestCase( SECTION, "var foo = new MyObject('hello');foo.charCodeAt(1)", 0x0065, foo.charCodeAt(1) ); -new TestCase( SECTION, "var foo = new MyObject('hello');foo.charCodeAt(2)", 0x006c, foo.charCodeAt(2) ); -new TestCase( SECTION, "var foo = new MyObject('hello');foo.charCodeAt(3)", 0x006c, foo.charCodeAt(3) ); -new TestCase( SECTION, "var foo = new MyObject('hello');foo.charCodeAt(4)", 0x006f, foo.charCodeAt(4) ); -new TestCase( SECTION, "var foo = new MyObject('hello');foo.charCodeAt(-1)", Number.NaN, foo.charCodeAt(-1) ); -new TestCase( SECTION, "var foo = new MyObject('hello');foo.charCodeAt(5)", Number.NaN, foo.charCodeAt(5) ); - -var boo = new MyObject(true); - -new TestCase( SECTION, "var boo = new MyObject(true);boo.charCodeAt(0)", 0x0074, boo.charCodeAt(0) ); -new TestCase( SECTION, "var boo = new MyObject(true);boo.charCodeAt(1)", 0x0072, boo.charCodeAt(1) ); -new TestCase( SECTION, "var boo = new MyObject(true);boo.charCodeAt(2)", 0x0075, boo.charCodeAt(2) ); -new TestCase( SECTION, "var boo = new MyObject(true);boo.charCodeAt(3)", 0x0065, boo.charCodeAt(3) ); - -var noo = new MyObject( Math.PI ); - -new TestCase( SECTION, "var noo = new MyObject(Math.PI);noo.charCodeAt(0)", 0x0033, noo.charCodeAt(0) ); -new TestCase( SECTION, "var noo = new MyObject(Math.PI);noo.charCodeAt(1)", 0x002E, noo.charCodeAt(1) ); -new TestCase( SECTION, "var noo = new MyObject(Math.PI);noo.charCodeAt(2)", 0x0031, noo.charCodeAt(2) ); -new TestCase( SECTION, "var noo = new MyObject(Math.PI);noo.charCodeAt(3)", 0x0034, noo.charCodeAt(3) ); -new TestCase( SECTION, "var noo = new MyObject(Math.PI);noo.charCodeAt(4)", 0x0031, noo.charCodeAt(4) ); -new TestCase( SECTION, "var noo = new MyObject(Math.PI);noo.charCodeAt(5)", 0x0035, noo.charCodeAt(5) ); -new TestCase( SECTION, "var noo = new MyObject(Math.PI);noo.charCodeAt(6)", 0x0039, noo.charCodeAt(6) ); - -var noo = new MyObject( null ); - -new TestCase( SECTION, "var noo = new MyObject(null);noo.charCodeAt(0)", 0x006E, noo.charCodeAt(0) ); -new TestCase( SECTION, "var noo = new MyObject(null);noo.charCodeAt(1)", 0x0075, noo.charCodeAt(1) ); -new TestCase( SECTION, "var noo = new MyObject(null);noo.charCodeAt(2)", 0x006C, noo.charCodeAt(2) ); -new TestCase( SECTION, "var noo = new MyObject(null);noo.charCodeAt(3)", 0x006C, noo.charCodeAt(3) ); -new TestCase( SECTION, "var noo = new MyObject(null);noo.charCodeAt(4)", NaN, noo.charCodeAt(4) ); - -var noo = new MyObject( void 0 ); - -new TestCase( SECTION, "var noo = new MyObject(void 0);noo.charCodeAt(0)", 0x0075, noo.charCodeAt(0) ); -new TestCase( SECTION, "var noo = new MyObject(void 0);noo.charCodeAt(1)", 0x006E, noo.charCodeAt(1) ); -new TestCase( SECTION, "var noo = new MyObject(void 0);noo.charCodeAt(2)", 0x0064, noo.charCodeAt(2) ); -new TestCase( SECTION, "var noo = new MyObject(void 0);noo.charCodeAt(3)", 0x0065, noo.charCodeAt(3) ); -new TestCase( SECTION, "var noo = new MyObject(void 0);noo.charCodeAt(4)", 0x0066, noo.charCodeAt(4) ); - -test(); - - -function MyObject (v) { - this.value = v; - this.toString = new Function ( "return this.value +\"\"" ); - this.charCodeAt = String.prototype.charCodeAt; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.5-4.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.5-4.js deleted file mode 100644 index e1d42c820f..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.5-4.js +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.5-4.js'; - -/** - File Name: 15.5.4.5-4.js - ECMA Section: 15.5.4.5 String.prototype.charCodeAt(pos) - - Description: Returns a nonnegative integer less than 2^16. - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ -var VERSION = "0697"; -startTest(); -var SECTION = "15.5.4.5-4"; - -writeHeaderToLog( SECTION + " String.prototype.charCodeAt(pos)" ); - -var MAXCHARCODE = Math.pow(2,16); -var item=0, CHARCODE; - -for ( CHARCODE=0; CHARCODE <256; CHARCODE++ ) { - new TestCase( SECTION, - "(String.fromCharCode("+CHARCODE+")).charCodeAt(0)", - CHARCODE, - (String.fromCharCode(CHARCODE)).charCodeAt(0) ); -} -for ( CHARCODE=256; CHARCODE < 65536; CHARCODE+=999 ) { - new TestCase( SECTION, - "(String.fromCharCode("+CHARCODE+")).charCodeAt(0)", - CHARCODE, - (String.fromCharCode(CHARCODE)).charCodeAt(0) ); -} - -new TestCase( SECTION, "(String.fromCharCode(65535)).charCodeAt(0)", 65535, (String.fromCharCode(65535)).charCodeAt(0) ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.5-5.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.5-5.js deleted file mode 100644 index cb3ec71e25..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.5-5.js +++ /dev/null @@ -1,106 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.5-5.js'; - -/** - File Name: 15.5.4.5.1.js - ECMA Section: 15.5.4.5 String.prototype.charCodeAt(pos) - Description: Returns a number (a nonnegative integer less than 2^16) - representing the Unicode encoding of the character at - position pos in this string. If there is no character - at that position, the number is NaN. - - When the charCodeAt method is called with one argument - pos, the following steps are taken: - 1. Call ToString, giving it the theis value as its - argument - 2. Call ToInteger(pos) - 3. Compute the number of characters in result(1). - 4. If Result(2) is less than 0 or is not less than - Result(3), return NaN. - 5. Return a value of Number type, of positive sign, whose - magnitude is the Unicode encoding of one character - from result 1, namely the characer at position Result - (2), where the first character in Result(1) is - considered to be at position 0. - - Note that the charCodeAt funciton is intentionally - generic; it does not require that its this value be a - String object. Therefore it can be transferred to other - kinds of objects for use as a method. - - Author: christine@netscape.com - Date: 2 october 1997 -*/ -var SECTION = "15.5.4.5-5"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "String.prototype.charCodeAt"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var TEST_STRING = ""; - -for ( var i = 0x0000; i < 255; i++ ) { - TEST_STRING += String.fromCharCode( i ); -} - -new TestCase( SECTION, "x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(0)", 0x0074, eval("x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(0)") ); -new TestCase( SECTION, "x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(1)", 0x0072, eval("x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(1)") ); -new TestCase( SECTION, "x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(2)", 0x0075, eval("x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(2)") ); -new TestCase( SECTION, "x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(3)", 0x0065, eval("x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(3)") ); -new TestCase( SECTION, "x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(4)", Number.NaN, eval("x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(4)") ); -new TestCase( SECTION, "x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(-1)", Number.NaN, eval("x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(-1)") ); - -new TestCase( SECTION, "x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(true)", 0x0072, eval("x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(true)") ); -new TestCase( SECTION, "x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(false)", 0x0074, eval("x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(false)") ); - -new TestCase( SECTION, "x = new String(); x.charCodeAt(0)", Number.NaN, eval("x=new String();x.charCodeAt(0)") ); -new TestCase( SECTION, "x = new String(); x.charCodeAt(1)", Number.NaN, eval("x=new String();x.charCodeAt(1)") ); -new TestCase( SECTION, "x = new String(); x.charCodeAt(-1)", Number.NaN, eval("x=new String();x.charCodeAt(-1)") ); - -new TestCase( SECTION, "x = new String(); x.charCodeAt(NaN)", Number.NaN, eval("x=new String();x.charCodeAt(Number.NaN)") ); -new TestCase( SECTION, "x = new String(); x.charCodeAt(Number.POSITIVE_INFINITY)", Number.NaN, eval("x=new String();x.charCodeAt(Number.POSITIVE_INFINITY)") ); -new TestCase( SECTION, "x = new String(); x.charCodeAt(Number.NEGATIVE_INFINITY)", Number.NaN, eval("x=new String();x.charCodeAt(Number.NEGATIVE_INFINITY)") ); - -for ( var j = 0; j < 255; j++ ) { - new TestCase( SECTION, "TEST_STRING.charCodeAt("+j+")", j, TEST_STRING.charCodeAt(j) ); -} - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.6-1.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.6-1.js deleted file mode 100644 index 94e34ad5ed..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.6-1.js +++ /dev/null @@ -1,155 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.6-1.js'; - -/** - File Name: 15.5.4.6-1.js - ECMA Section: 15.5.4.6 String.prototype.indexOf( searchString, pos) - Description: If the given searchString appears as a substring of the - result of converting this object to a string, at one or - more positions that are at or to the right of the - specified position, then the index of the leftmost such - position is returned; otherwise -1 is returned. If - positionis undefined or not supplied, 0 is assumed, so - as to search all of the string. - - When the indexOf method is called with two arguments, - searchString and pos, the following steps are taken: - - 1. Call ToString, giving it the this value as its - argument. - 2. Call ToString(searchString). - 3. Call ToInteger(position). (If position is undefined - or not supplied, this step produces the value 0). - 4. Compute the number of characters in Result(1). - 5. Compute min(max(Result(3), 0), Result(4)). - 6. Compute the number of characters in the string that - is Result(2). - 7. Compute the smallest possible integer k not smaller - than Result(5) such that k+Result(6) is not greater - than Result(4), and for all nonnegative integers j - less than Result(6), the character at position k+j - of Result(1) is the same as the character at position - j of Result(2); but if there is no such integer k, - then compute the value -1. - 8. Return Result(7). - - Note that the indexOf function is intentionally generic; - it does not require that its this value be a String object. - Therefore it can be transferred to other kinds of objects - for use as a method. - - Author: christine@netscape.com - Date: 2 october 1997 -*/ -var SECTION = "15.5.4.6-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "String.protoype.indexOf"; - -var TEST_STRING = new String( " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" ); - -writeHeaderToLog( SECTION + " "+ TITLE); - -var j = 0; - -for ( k = 0, i = 0x0020; i < 0x007e; i++, j++, k++ ) { - new TestCase( SECTION, - "String.indexOf(" +String.fromCharCode(i)+ ", 0)", - k, - TEST_STRING.indexOf( String.fromCharCode(i), 0 ) ); -} - -for ( k = 0, i = 0x0020; i < 0x007e; i++, j++, k++ ) { - new TestCase( SECTION, - "String.indexOf("+String.fromCharCode(i)+ ", "+ k +")", - k, - TEST_STRING.indexOf( String.fromCharCode(i), k ) ); -} - -for ( k = 0, i = 0x0020; i < 0x007e; i++, j++, k++ ) { - new TestCase( SECTION, - "String.indexOf("+String.fromCharCode(i)+ ", "+k+1+")", - -1, - TEST_STRING.indexOf( String.fromCharCode(i), k+1 ) ); -} - -for ( k = 0, i = 0x0020; i < 0x007d; i++, j++, k++ ) { - new TestCase( SECTION, - "String.indexOf("+(String.fromCharCode(i) + - String.fromCharCode(i+1)+ - String.fromCharCode(i+2)) +", "+0+")", - k, - TEST_STRING.indexOf( (String.fromCharCode(i)+ - String.fromCharCode(i+1)+ - String.fromCharCode(i+2)), - 0 ) ); -} - -for ( k = 0, i = 0x0020; i < 0x007d; i++, j++, k++ ) { - new TestCase( SECTION, - "String.indexOf("+(String.fromCharCode(i) + - String.fromCharCode(i+1)+ - String.fromCharCode(i+2)) +", "+ k +")", - k, - TEST_STRING.indexOf( (String.fromCharCode(i)+ - String.fromCharCode(i+1)+ - String.fromCharCode(i+2)), - k ) ); -} -for ( k = 0, i = 0x0020; i < 0x007d; i++, j++, k++ ) { - new TestCase( SECTION, - "String.indexOf("+(String.fromCharCode(i) + - String.fromCharCode(i+1)+ - String.fromCharCode(i+2)) +", "+ k+1 +")", - -1, - TEST_STRING.indexOf( (String.fromCharCode(i)+ - String.fromCharCode(i+1)+ - String.fromCharCode(i+2)), - k+1 ) ); -} - -new TestCase( SECTION, "String.indexOf(" +TEST_STRING + ", 0 )", 0, TEST_STRING.indexOf( TEST_STRING, 0 ) ); - -new TestCase( SECTION, "String.indexOf(" +TEST_STRING + ", 1 )", -1, TEST_STRING.indexOf( TEST_STRING, 1 )); - -print( "TEST_STRING = new String(\" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\")" ); - - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.6-2.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.6-2.js deleted file mode 100644 index acaeffb38a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.6-2.js +++ /dev/null @@ -1,259 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.6-2.js'; - -/** - File Name: 15.5.4.6-1.js - ECMA Section: 15.5.4.6 String.prototype.indexOf( searchString, pos) - Description: If the given searchString appears as a substring of the - result of converting this object to a string, at one or - more positions that are at or to the right of the - specified position, then the index of the leftmost such - position is returned; otherwise -1 is returned. If - positionis undefined or not supplied, 0 is assumed, so - as to search all of the string. - - When the indexOf method is called with two arguments, - searchString and pos, the following steps are taken: - - 1. Call ToString, giving it the this value as its - argument. - 2. Call ToString(searchString). - 3. Call ToInteger(position). (If position is undefined - or not supplied, this step produces the value 0). - 4. Compute the number of characters in Result(1). - 5. Compute min(max(Result(3), 0), Result(4)). - 6. Compute the number of characters in the string that - is Result(2). - 7. Compute the smallest possible integer k not smaller - than Result(5) such that k+Result(6) is not greater - than Result(4), and for all nonnegative integers j - less than Result(6), the character at position k+j - of Result(1) is the same as the character at position - j of Result(2); but if there is no such integer k, - then compute the value -1. - 8. Return Result(7). - - Note that the indexOf function is intentionally generic; - it does not require that its this value be a String object. - Therefore it can be transferred to other kinds of objects - for use as a method. - - Author: christine@netscape.com, pschwartau@netscape.com - Date: 02 October 1997 - Modified: 14 July 2002 - Reason: See http://bugzilla.mozilla.org/show_bug.cgi?id=155289 - ECMA-262 Ed.3 Section 15.5.4.7 - The length property of the indexOf method is 1 - * - */ -var SECTION = "15.5.4.6-2"; -var VERSION = "ECMA_1"; -var TITLE = "String.protoype.indexOf"; -var BUGNUMBER="105721"; - -startTest(); - -writeHeaderToLog( SECTION + " "+ TITLE); - - -// the following test regresses http://scopus/bugsplat/show_bug.cgi?id=105721 - -// regress http://scopus/bugsplat/show_bug.cgi?id=105721 - -new TestCase( SECTION, - "function f() { return this; }; function g() { var h = f; return h(); }; g().toString()", - GLOBAL, - g().toString() - ); - - -new TestCase( SECTION, "String.prototype.indexOf.length", 1, String.prototype.indexOf.length ); -new TestCase( SECTION, "String.prototype.indexOf.length = null; String.prototype.indexOf.length", 1, eval("String.prototype.indexOf.length = null; String.prototype.indexOf.length") ); -new TestCase( SECTION, "delete String.prototype.indexOf.length", false, delete String.prototype.indexOf.length ); -new TestCase( SECTION, "delete String.prototype.indexOf.length; String.prototype.indexOf.length", 1, eval("delete String.prototype.indexOf.length; String.prototype.indexOf.length") ); - -new TestCase( SECTION, - "var s = new String(); s.indexOf()", - -1, - eval("var s = new String(); s.indexOf()") ); - -// some Unicode tests. - -// generate a test string. - -var TEST_STRING = ""; - -for ( var u = 0x00A1; u <= 0x00FF; u++ ) { - TEST_STRING += String.fromCharCode( u ); -} - -for ( var u = 0x00A1, i = 0; u <= 0x00FF; u++, i++ ) { - new TestCase( SECTION, - "TEST_STRING.indexOf( " + String.fromCharCode(u) + " )", - i, - TEST_STRING.indexOf( String.fromCharCode(u) ) ); -} -for ( var u = 0x00A1, i = 0; u <= 0x00FF; u++, i++ ) { - new TestCase( SECTION, - "TEST_STRING.indexOf( " + String.fromCharCode(u) + ", void 0 )", - i, - TEST_STRING.indexOf( String.fromCharCode(u), void 0 ) ); -} - - - -var foo = new MyObject('hello'); - -new TestCase( SECTION, "var foo = new MyObject('hello');foo.indexOf('h')", 0, foo.indexOf("h") ); -new TestCase( SECTION, "var foo = new MyObject('hello');foo.indexOf('e')", 1, foo.indexOf("e") ); -new TestCase( SECTION, "var foo = new MyObject('hello');foo.indexOf('l')", 2, foo.indexOf("l") ); -new TestCase( SECTION, "var foo = new MyObject('hello');foo.indexOf('l')", 2, foo.indexOf("l") ); -new TestCase( SECTION, "var foo = new MyObject('hello');foo.indexOf('o')", 4, foo.indexOf("o") ); -new TestCase( SECTION, "var foo = new MyObject('hello');foo.indexOf('X')", -1, foo.indexOf("X") ); -new TestCase( SECTION, "var foo = new MyObject('hello');foo.indexOf(5) ", -1, foo.indexOf(5) ); - -var boo = new MyObject(true); - -new TestCase( SECTION, "var boo = new MyObject(true);boo.indexOf('t')", 0, boo.indexOf("t") ); -new TestCase( SECTION, "var boo = new MyObject(true);boo.indexOf('r')", 1, boo.indexOf("r") ); -new TestCase( SECTION, "var boo = new MyObject(true);boo.indexOf('u')", 2, boo.indexOf("u") ); -new TestCase( SECTION, "var boo = new MyObject(true);boo.indexOf('e')", 3, boo.indexOf("e") ); -new TestCase( SECTION, "var boo = new MyObject(true);boo.indexOf('true')", 0, boo.indexOf("true") ); -new TestCase( SECTION, "var boo = new MyObject(true);boo.indexOf('rue')", 1, boo.indexOf("rue") ); -new TestCase( SECTION, "var boo = new MyObject(true);boo.indexOf('ue')", 2, boo.indexOf("ue") ); -new TestCase( SECTION, "var boo = new MyObject(true);boo.indexOf('oy')", -1, boo.indexOf("oy") ); - - -var noo = new MyObject( Math.PI ); -new TestCase( SECTION, "var noo = new MyObject(Math.PI); noo.indexOf('3') ", 0, noo.indexOf('3') ); -new TestCase( SECTION, "var noo = new MyObject(Math.PI); noo.indexOf('.') ", 1, noo.indexOf('.') ); -new TestCase( SECTION, "var noo = new MyObject(Math.PI); noo.indexOf('1') ", 2, noo.indexOf('1') ); -new TestCase( SECTION, "var noo = new MyObject(Math.PI); noo.indexOf('4') ", 3, noo.indexOf('4') ); -new TestCase( SECTION, "var noo = new MyObject(Math.PI); noo.indexOf('1') ", 2, noo.indexOf('1') ); -new TestCase( SECTION, "var noo = new MyObject(Math.PI); noo.indexOf('5') ", 5, noo.indexOf('5') ); -new TestCase( SECTION, "var noo = new MyObject(Math.PI); noo.indexOf('9') ", 6, noo.indexOf('9') ); - -new TestCase( SECTION, - "var arr = new Array('new','zoo','revue'); arr.indexOf = String.prototype.indexOf; arr.indexOf('new')", - 0, - eval("var arr = new Array('new','zoo','revue'); arr.indexOf = String.prototype.indexOf; arr.indexOf('new')") ); - -new TestCase( SECTION, - "var arr = new Array('new','zoo','revue'); arr.indexOf = String.prototype.indexOf; arr.indexOf(',zoo,')", - 3, - eval("var arr = new Array('new','zoo','revue'); arr.indexOf = String.prototype.indexOf; arr.indexOf(',zoo,')") ); - -new TestCase( SECTION, - "var obj = new Object(); obj.indexOf = String.prototype.indexOf; obj.indexOf('[object Object]')", - 0, - eval("var obj = new Object(); obj.indexOf = String.prototype.indexOf; obj.indexOf('[object Object]')") ); - -new TestCase( SECTION, - "var obj = new Object(); obj.indexOf = String.prototype.indexOf; obj.indexOf('bject')", - 2, - eval("var obj = new Object(); obj.indexOf = String.prototype.indexOf; obj.indexOf('bject')") ); - -new TestCase( SECTION, - "var f = new Object( String.prototype.indexOf ); f('"+GLOBAL+"')", - 0, - eval("var f = new Object( String.prototype.indexOf ); f('"+GLOBAL+"')") ); - -new TestCase( SECTION, - "var f = new Function(); f.toString = Object.prototype.toString; f.indexOf = String.prototype.indexOf; f.indexOf('[object Function]')", - 0, - eval("var f = new Function(); f.toString = Object.prototype.toString; f.indexOf = String.prototype.indexOf; f.indexOf('[object Function]')") ); - -new TestCase( SECTION, - "var b = new Boolean(); b.indexOf = String.prototype.indexOf; b.indexOf('true')", - -1, - eval("var b = new Boolean(); b.indexOf = String.prototype.indexOf; b.indexOf('true')") ); - -new TestCase( SECTION, - "var b = new Boolean(); b.indexOf = String.prototype.indexOf; b.indexOf('false', 1)", - -1, - eval("var b = new Boolean(); b.indexOf = String.prototype.indexOf; b.indexOf('false', 1)") ); - -new TestCase( SECTION, - "var b = new Boolean(); b.indexOf = String.prototype.indexOf; b.indexOf('false', 0)", - 0, - eval("var b = new Boolean(); b.indexOf = String.prototype.indexOf; b.indexOf('false', 0)") ); - -new TestCase( SECTION, - "var n = new Number(1e21); n.indexOf = String.prototype.indexOf; n.indexOf('e')", - 1, - eval("var n = new Number(1e21); n.indexOf = String.prototype.indexOf; n.indexOf('e')") ); - -new TestCase( SECTION, - "var n = new Number(-Infinity); n.indexOf = String.prototype.indexOf; n.indexOf('-')", - 0, - eval("var n = new Number(-Infinity); n.indexOf = String.prototype.indexOf; n.indexOf('-')") ); - -new TestCase( SECTION, - "var n = new Number(0xFF); n.indexOf = String.prototype.indexOf; n.indexOf('5')", - 1, - eval("var n = new Number(0xFF); n.indexOf = String.prototype.indexOf; n.indexOf('5')") ); - -new TestCase( SECTION, - "var m = Math; m.indexOf = String.prototype.indexOf; m.indexOf( 'Math' )", - 8, - eval("var m = Math; m.indexOf = String.prototype.indexOf; m.indexOf( 'Math' )") ); - -// new Date(0) has '31' or '01' at index 8 depending on whether tester is (GMT-) or (GMT+), respectively -new TestCase( SECTION, - "var d = new Date(0); d.indexOf = String.prototype.indexOf; d.getTimezoneOffset()>0 ? d.indexOf('31') : d.indexOf('01')", - 8, - eval("var d = new Date(0); d.indexOf = String.prototype.indexOf; d.getTimezoneOffset()>0 ? d.indexOf('31') : d.indexOf('01')") ); - -test(); - -function f() { - return this; -} -function g() { - var h = f; - return h(); -} - -function MyObject (v) { - this.value = v; - this.toString = new Function ( "return this.value +\"\""); - this.indexOf = String.prototype.indexOf; -} - diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.7-1.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.7-1.js deleted file mode 100644 index 094be2ed62..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.7-1.js +++ /dev/null @@ -1,219 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.7-1.js'; - -/** - File Name: 15.5.4.7-1.js - ECMA Section: 15.5.4.7 String.prototype.lastIndexOf( searchString, pos) - Description: - - If the given searchString appears as a substring of the result of - converting this object to a string, at one or more positions that are - at or to the left of the specified position, then the index of the - rightmost such position is returned; otherwise -1 is returned. If position - is undefined or not supplied, the length of this string value is assumed, - so as to search all of the string. - - When the lastIndexOf method is called with two arguments searchString and - position, the following steps are taken: - - 1.Call ToString, giving it the this value as its argument. - 2.Call ToString(searchString). - 3.Call ToNumber(position). (If position is undefined or not supplied, this step produces the value NaN). - 4.If Result(3) is NaN, use +; otherwise, call ToInteger(Result(3)). - 5.Compute the number of characters in Result(1). - 6.Compute min(max(Result(4), 0), Result(5)). - 7.Compute the number of characters in the string that is Result(2). - 8.Compute the largest possible integer k not larger than Result(6) such that k+Result(7) is not greater - than Result(5), and for all nonnegative integers j less than Result(7), the character at position k+j of - Result(1) is the same as the character at position j of Result(2); but if there is no such integer k, then - compute the value -1. - - 1.Return Result(8). - - Note that the lastIndexOf function is intentionally generic; it does not require that its this value be a - String object. Therefore it can be transferred to other kinds of objects for use as a method. - - Author: christine@netscape.com - Date: 2 october 1997 -*/ -var SECTION = "15.5.4.7-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "String.protoype.lastIndexOf"; - -var TEST_STRING = new String( " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" ); - -writeHeaderToLog( SECTION + " "+ TITLE); - -var j = 0; - -for ( k = 0, i = 0x0021; i < 0x007e; i++, j++, k++ ) { - new TestCase( SECTION, - "String.lastIndexOf(" +String.fromCharCode(i)+ ", 0)", - -1, - TEST_STRING.lastIndexOf( String.fromCharCode(i), 0 ) ); -} - -for ( k = 0, i = 0x0020; i < 0x007e; i++, j++, k++ ) { - new TestCase( SECTION, - "String.lastIndexOf("+String.fromCharCode(i)+ ", "+ k +")", - k, - TEST_STRING.lastIndexOf( String.fromCharCode(i), k ) ); -} - -for ( k = 0, i = 0x0020; i < 0x007e; i++, j++, k++ ) { - new TestCase( SECTION, - "String.lastIndexOf("+String.fromCharCode(i)+ ", "+k+1+")", - k, - TEST_STRING.lastIndexOf( String.fromCharCode(i), k+1 ) ); -} - -for ( k = 9, i = 0x0021; i < 0x007d; i++, j++, k++ ) { - new TestCase( SECTION, - - "String.lastIndexOf("+(String.fromCharCode(i) + - String.fromCharCode(i+1)+ - String.fromCharCode(i+2)) +", "+ 0 + ")", - LastIndexOf( TEST_STRING, String.fromCharCode(i) + - String.fromCharCode(i+1)+String.fromCharCode(i+2), 0), - TEST_STRING.lastIndexOf( (String.fromCharCode(i)+ - String.fromCharCode(i+1)+ - String.fromCharCode(i+2)), - 0 ) ); -} - -for ( k = 0, i = 0x0020; i < 0x007d; i++, j++, k++ ) { - new TestCase( SECTION, - "String.lastIndexOf("+(String.fromCharCode(i) + - String.fromCharCode(i+1)+ - String.fromCharCode(i+2)) +", "+ k +")", - k, - TEST_STRING.lastIndexOf( (String.fromCharCode(i)+ - String.fromCharCode(i+1)+ - String.fromCharCode(i+2)), - k ) ); -} -for ( k = 0, i = 0x0020; i < 0x007d; i++, j++, k++ ) { - new TestCase( SECTION, - "String.lastIndexOf("+(String.fromCharCode(i) + - String.fromCharCode(i+1)+ - String.fromCharCode(i+2)) +", "+ k+1 +")", - k, - TEST_STRING.lastIndexOf( (String.fromCharCode(i)+ - String.fromCharCode(i+1)+ - String.fromCharCode(i+2)), - k+1 ) ); -} -for ( k = 0, i = 0x0020; i < 0x007d; i++, j++, k++ ) { - new TestCase( SECTION, - "String.lastIndexOf("+ - (String.fromCharCode(i) + - String.fromCharCode(i+1)+ - String.fromCharCode(i+2)) +", "+ (k-1) +")", - LastIndexOf( TEST_STRING, String.fromCharCode(i) + - String.fromCharCode(i+1)+String.fromCharCode(i+2), k-1), - TEST_STRING.lastIndexOf( (String.fromCharCode(i)+ - String.fromCharCode(i+1)+ - String.fromCharCode(i+2)), - k-1 ) ); -} - -new TestCase( SECTION, "String.lastIndexOf(" +TEST_STRING + ", 0 )", 0, TEST_STRING.lastIndexOf( TEST_STRING, 0 ) ); - -// new TestCase( SECTION, "String.lastIndexOf(" +TEST_STRING + ", 1 )", 0, TEST_STRING.lastIndexOf( TEST_STRING, 1 )); - -new TestCase( SECTION, "String.lastIndexOf(" +TEST_STRING + ")", 0, TEST_STRING.lastIndexOf( TEST_STRING )); - -print( "TEST_STRING = new String(\" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\")" ); - -test(); - -function LastIndexOf( string, search, position ) { - string = String( string ); - search = String( search ); - - position = Number( position ) - - if ( isNaN( position ) ) { - position = Infinity; - } else { - position = ToInteger( position ); - } - - result5= string.length; - result6 = Math.min(Math.max(position, 0), result5); - result7 = search.length; - - if (result7 == 0) { - return Math.min(position, result5); - } - - result8 = -1; - - for ( k = 0; k <= result6; k++ ) { - if ( k+ result7 > result5 ) { - break; - } - for ( j = 0; j < result7; j++ ) { - if ( string.charAt(k+j) != search.charAt(j) ){ - break; - } else { - if ( j == result7 -1 ) { - result8 = k; - } - } - } - } - - return result8; -} -function ToInteger( n ) { - n = Number( n ); - if ( isNaN(n) ) { - return 0; - } - if ( Math.abs(n) == 0 || Math.abs(n) == Infinity ) { - return n; - } - - var sign = ( n < 0 ) ? -1 : 1; - - return ( sign * Math.floor(Math.abs(n)) ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.7-2.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.7-2.js deleted file mode 100644 index 0252eae00f..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.7-2.js +++ /dev/null @@ -1,217 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.7-2.js'; - -/** - File Name: 15.5.4.7-2.js - ECMA Section: 15.5.4.7 String.prototype.lastIndexOf( searchString, pos) - Description: - - If the given searchString appears as a substring of the result of - converting this object to a string, at one or more positions that are - at or to the left of the specified position, then the index of the - rightmost such position is returned; otherwise -1 is returned. If position - is undefined or not supplied, the length of this string value is assumed, - so as to search all of the string. - - When the lastIndexOf method is called with two arguments searchString and - position, the following steps are taken: - - 1.Call ToString, giving it the this value as its argument. - 2.Call ToString(searchString). - 3.Call ToNumber(position). (If position is undefined or not supplied, this step produces the value NaN). - 4.If Result(3) is NaN, use +; otherwise, call ToInteger(Result(3)). - 5.Compute the number of characters in Result(1). - 6.Compute min(max(Result(4), 0), Result(5)). - 7.Compute the number of characters in the string that is Result(2). - 8.Compute the largest possible integer k not larger than Result(6) such that k+Result(7) is not greater - than Result(5), and for all nonnegative integers j less than Result(7), the character at position k+j of - Result(1) is the same as the character at position j of Result(2); but if there is no such integer k, then - compute the value -1. - - 1.Return Result(8). - - Note that the lastIndexOf function is intentionally generic; it does not require that its this value be a - String object. Therefore it can be transferred to other kinds of objects for use as a method. - - Author: christine@netscape.com, pschwartau@netscape.com - Date: 02 October 1997 - Modified: 14 July 2002 - Reason: See http://bugzilla.mozilla.org/show_bug.cgi?id=155289 - ECMA-262 Ed.3 Section 15.5.4.8 - The length property of the lastIndexOf method is 1 - * - */ -var SECTION = "15.5.4.7-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "String.protoype.lastIndexOf"; - -writeHeaderToLog( SECTION + " "+ TITLE); - - -new TestCase( SECTION, "String.prototype.lastIndexOf.length", 1, String.prototype.lastIndexOf.length ); -new TestCase( SECTION, "delete String.prototype.lastIndexOf.length", false, delete String.prototype.lastIndexOf.length ); -new TestCase( SECTION, "delete String.prototype.lastIndexOf.length; String.prototype.lastIndexOf.length", 1, eval("delete String.prototype.lastIndexOf.length; String.prototype.lastIndexOf.length" ) ); - -new TestCase( SECTION, "var s = new String(''); s.lastIndexOf('', 0)", LastIndexOf("","",0), eval("var s = new String(''); s.lastIndexOf('', 0)") ); -new TestCase( SECTION, "var s = new String(''); s.lastIndexOf('')", LastIndexOf("",""), eval("var s = new String(''); s.lastIndexOf('')") ); -new TestCase( SECTION, "var s = new String('hello'); s.lastIndexOf('', 0)", LastIndexOf("hello","",0), eval("var s = new String('hello'); s.lastIndexOf('',0)") ); -new TestCase( SECTION, "var s = new String('hello'); s.lastIndexOf('')", LastIndexOf("hello",""), eval("var s = new String('hello'); s.lastIndexOf('')") ); - -new TestCase( SECTION, "var s = new String('hello'); s.lastIndexOf('ll')", LastIndexOf("hello","ll"), eval("var s = new String('hello'); s.lastIndexOf('ll')") ); -new TestCase( SECTION, "var s = new String('hello'); s.lastIndexOf('ll', 0)", LastIndexOf("hello","ll",0), eval("var s = new String('hello'); s.lastIndexOf('ll', 0)") ); -new TestCase( SECTION, "var s = new String('hello'); s.lastIndexOf('ll', 1)", LastIndexOf("hello","ll",1), eval("var s = new String('hello'); s.lastIndexOf('ll', 1)") ); -new TestCase( SECTION, "var s = new String('hello'); s.lastIndexOf('ll', 2)", LastIndexOf("hello","ll",2), eval("var s = new String('hello'); s.lastIndexOf('ll', 2)") ); -new TestCase( SECTION, "var s = new String('hello'); s.lastIndexOf('ll', 3)", LastIndexOf("hello","ll",3), eval("var s = new String('hello'); s.lastIndexOf('ll', 3)") ); -new TestCase( SECTION, "var s = new String('hello'); s.lastIndexOf('ll', 4)", LastIndexOf("hello","ll",4), eval("var s = new String('hello'); s.lastIndexOf('ll', 4)") ); -new TestCase( SECTION, "var s = new String('hello'); s.lastIndexOf('ll', 5)", LastIndexOf("hello","ll",5), eval("var s = new String('hello'); s.lastIndexOf('ll', 5)") ); -new TestCase( SECTION, "var s = new String('hello'); s.lastIndexOf('ll', 6)", LastIndexOf("hello","ll",6), eval("var s = new String('hello'); s.lastIndexOf('ll', 6)") ); - -new TestCase( SECTION, "var s = new String('hello'); s.lastIndexOf('ll', 1.5)", LastIndexOf('hello','ll', 1.5), eval("var s = new String('hello'); s.lastIndexOf('ll', 1.5)") ); -new TestCase( SECTION, "var s = new String('hello'); s.lastIndexOf('ll', 2.5)", LastIndexOf('hello','ll', 2.5), eval("var s = new String('hello'); s.lastIndexOf('ll', 2.5)") ); -new TestCase( SECTION, "var s = new String('hello'); s.lastIndexOf('ll', -1)", LastIndexOf('hello','ll', -1), eval("var s = new String('hello'); s.lastIndexOf('ll', -1)") ); -new TestCase( SECTION, "var s = new String('hello'); s.lastIndexOf('ll', -1.5)",LastIndexOf('hello','ll', -1.5), eval("var s = new String('hello'); s.lastIndexOf('ll', -1.5)") ); - -new TestCase( SECTION, "var s = new String('hello'); s.lastIndexOf('ll', -Infinity)", LastIndexOf("hello","ll",-Infinity), eval("var s = new String('hello'); s.lastIndexOf('ll', -Infinity)") ); -new TestCase( SECTION, "var s = new String('hello'); s.lastIndexOf('ll', Infinity)", LastIndexOf("hello","ll",Infinity), eval("var s = new String('hello'); s.lastIndexOf('ll', Infinity)") ); -new TestCase( SECTION, "var s = new String('hello'); s.lastIndexOf('ll', NaN)", LastIndexOf("hello","ll",NaN), eval("var s = new String('hello'); s.lastIndexOf('ll', NaN)") ); -new TestCase( SECTION, "var s = new String('hello'); s.lastIndexOf('ll', -0)", LastIndexOf("hello","ll",-0), eval("var s = new String('hello'); s.lastIndexOf('ll', -0)") ); -for ( var i = 0; i < ( "[object Object]" ).length; i++ ) { - new TestCase( SECTION, - "var o = new Object(); o.lastIndexOf = String.prototype.lastIndexOf; o.lastIndexOf('b', "+ i + ")", - ( i < 2 ? -1 : ( i < 9 ? 2 : 9 )) , - eval("var o = new Object(); o.lastIndexOf = String.prototype.lastIndexOf; o.lastIndexOf('b', "+ i + ")") ); -} -for ( var i = 0; i < 5; i ++ ) { - new TestCase( SECTION, - "var b = new Boolean(); b.lastIndexOf = String.prototype.lastIndexOf; b.lastIndexOf('l', "+ i + ")", - ( i < 2 ? -1 : 2 ), - eval("var b = new Boolean(); b.lastIndexOf = String.prototype.lastIndexOf; b.lastIndexOf('l', "+ i + ")") ); -} -for ( var i = 0; i < 5; i ++ ) { - new TestCase( SECTION, - "var b = new Boolean(); b.toString = Object.prototype.toString; b.lastIndexOf = String.prototype.lastIndexOf; b.lastIndexOf('o', "+ i + ")", - ( i < 1 ? -1 : ( i < 9 ? 1 : ( i < 10 ? 9 : 10 ) ) ), - eval("var b = new Boolean(); b.toString = Object.prototype.toString; b.lastIndexOf = String.prototype.lastIndexOf; b.lastIndexOf('o', "+ i + ")") ); -} -for ( var i = 0; i < 9; i++ ) { - new TestCase( SECTION, - "var n = new Number(Infinity); n.lastIndexOf = String.prototype.lastIndexOf; n.lastIndexOf( 'i', " + i + " )", - ( i < 3 ? -1 : ( i < 5 ? 3 : 5 ) ), - eval("var n = new Number(Infinity); n.lastIndexOf = String.prototype.lastIndexOf; n.lastIndexOf( 'i', " + i + " )") ); -} -var a = new Array( "abc","def","ghi","jkl","mno","pqr","stu","vwx","yz" ); - -for ( var i = 0; i < (a.toString()).length; i++ ) { - new TestCase( SECTION, - "var a = new Array( 'abc','def','ghi','jkl','mno','pqr','stu','vwx','yz' ); a.lastIndexOf = String.prototype.lastIndexOf; a.lastIndexOf( ',mno,p', "+i+" )", - ( i < 15 ? -1 : 15 ), - eval("var a = new Array( 'abc','def','ghi','jkl','mno','pqr','stu','vwx','yz' ); a.lastIndexOf = String.prototype.lastIndexOf; a.lastIndexOf( ',mno,p', "+i+" )") ); -} - -for ( var i = 0; i < 15; i ++ ) { - new TestCase( SECTION, - "var m = Math; m.lastIndexOf = String.prototype.lastIndexOf; m.lastIndexOf('t', "+ i + ")", - ( i < 6 ? -1 : ( i < 10 ? 6 : 10 ) ), - eval("var m = Math; m.lastIndexOf = String.prototype.lastIndexOf; m.lastIndexOf('t', "+ i + ")") ); -} -/* - for ( var i = 0; i < 15; i++ ) { - new TestCase( SECTION, - "var d = new Date(); d.lastIndexOf = String.prototype.lastIndexOf; d.lastIndexOf( '0' )", - ) - } - -*/ - -test(); - -function LastIndexOf( string, search, position ) { - string = String( string ); - search = String( search ); - - position = Number( position ) - - if ( isNaN( position ) ) { - position = Infinity; - } else { - position = ToInteger( position ); - } - - result5= string.length; - result6 = Math.min(Math.max(position, 0), result5); - result7 = search.length; - - if (result7 == 0) { - return Math.min(position, result5); - } - - result8 = -1; - - for ( k = 0; k <= result6; k++ ) { - if ( k+ result7 > result5 ) { - break; - } - for ( j = 0; j < result7; j++ ) { - if ( string.charAt(k+j) != search.charAt(j) ){ - break; - } else { - if ( j == result7 -1 ) { - result8 = k; - } - } - } - } - - return result8; -} -function ToInteger( n ) { - n = Number( n ); - if ( isNaN(n) ) { - return 0; - } - if ( Math.abs(n) == 0 || Math.abs(n) == Infinity ) { - return n; - } - - var sign = ( n < 0 ) ? -1 : 1; - - return ( sign * Math.floor(Math.abs(n)) ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.8-1.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.8-1.js deleted file mode 100644 index 4aa16d5ea0..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.8-1.js +++ /dev/null @@ -1,232 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.8-1.js'; - -/** - File Name: 15.5.4.8-1.js - ECMA Section: 15.5.4.8 String.prototype.split( separator ) - Description: - - Returns an Array object into which substrings of the result of converting - this object to a string have been stored. The substrings are determined by - searching from left to right for occurrences of the given separator; these - occurrences are not part of any substring in the returned array, but serve - to divide up this string value. The separator may be a string of any length. - - As a special case, if the separator is the empty string, the string is split - up into individual characters; the length of the result array equals the - length of the string, and each substring contains one character. - - If the separator is not supplied, then the result array contains just one - string, which is the string. - - Author: christine@netscape.com, pschwartau@netscape.com - Date: 12 November 1997 - Modified: 14 July 2002 - Reason: See http://bugzilla.mozilla.org/show_bug.cgi?id=155289 - ECMA-262 Ed.3 Section 15.5.4.14 - The length property of the split method is 2 - * - */ - -var SECTION = "15.5.4.8-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "String.prototype.split"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "String.prototype.split.length", 2, String.prototype.split.length ); -new TestCase( SECTION, "delete String.prototype.split.length", false, delete String.prototype.split.length ); -new TestCase( SECTION, "delete String.prototype.split.length; String.prototype.split.length", 2, eval("delete String.prototype.split.length; String.prototype.split.length") ); - -// test cases for when split is called with no arguments. - -// this is a string object - -new TestCase( SECTION, - "var s = new String('this is a string object'); typeof s.split()", - "object", - eval("var s = new String('this is a string object'); typeof s.split()") ); - -new TestCase( SECTION, - "var s = new String('this is a string object'); Array.prototype.getClass = Object.prototype.toString; (s.split()).getClass()", - "[object Array]", - eval("var s = new String('this is a string object'); Array.prototype.getClass = Object.prototype.toString; (s.split()).getClass()") ); - -new TestCase( SECTION, - "var s = new String('this is a string object'); s.split().length", - 1, - eval("var s = new String('this is a string object'); s.split().length") ); - -new TestCase( SECTION, - "var s = new String('this is a string object'); s.split()[0]", - "this is a string object", - eval("var s = new String('this is a string object'); s.split()[0]") ); - -// this is an object object -new TestCase( SECTION, - "var obj = new Object(); obj.split = String.prototype.split; typeof obj.split()", - "object", - eval("var obj = new Object(); obj.split = String.prototype.split; typeof obj.split()") ); - -new TestCase( SECTION, - "var obj = new Object(); obj.split = String.prototype.split; Array.prototype.getClass = Object.prototype.toString; obj.getClass()", - "[object Array]", - eval("var obj = new Object(); obj.split = String.prototype.split; Array.prototype.getClass = Object.prototype.toString; obj.split().getClass()") ); - -new TestCase( SECTION, - "var obj = new Object(); obj.split = String.prototype.split; obj.split().length", - 1, - eval("var obj = new Object(); obj.split = String.prototype.split; obj.split().length") ); - -new TestCase( SECTION, - "var obj = new Object(); obj.split = String.prototype.split; obj.split()[0]", - "[object Object]", - eval("var obj = new Object(); obj.split = String.prototype.split; obj.split()[0]") ); - -// this is a function object -new TestCase( SECTION, - "var obj = new Function(); obj.split = String.prototype.split; typeof obj.split()", - "object", - eval("var obj = new Function(); obj.split = String.prototype.split; typeof obj.split()") ); - -new TestCase( SECTION, - "var obj = new Function(); obj.split = String.prototype.split; Array.prototype.getClass = Object.prototype.toString; obj.getClass()", - "[object Array]", - eval("var obj = new Function(); obj.split = String.prototype.split; Array.prototype.getClass = Object.prototype.toString; obj.split().getClass()") ); - -new TestCase( SECTION, - "var obj = new Function(); obj.split = String.prototype.split; obj.split().length", - 1, - eval("var obj = new Function(); obj.split = String.prototype.split; obj.split().length") ); - -new TestCase( SECTION, - "var obj = new Function(); obj.split = String.prototype.split; obj.toString = Object.prototype.toString; obj.split()[0]", - "[object Function]", - eval("var obj = new Function(); obj.split = String.prototype.split; obj.toString = Object.prototype.toString; obj.split()[0]") ); - -// this is a number object -new TestCase( SECTION, - "var obj = new Number(NaN); obj.split = String.prototype.split; typeof obj.split()", - "object", - eval("var obj = new Number(NaN); obj.split = String.prototype.split; typeof obj.split()") ); - -new TestCase( SECTION, - "var obj = new Number(Infinity); obj.split = String.prototype.split; Array.prototype.getClass = Object.prototype.toString; obj.getClass()", - "[object Array]", - eval("var obj = new Number(Infinity); obj.split = String.prototype.split; Array.prototype.getClass = Object.prototype.toString; obj.split().getClass()") ); - -new TestCase( SECTION, - "var obj = new Number(-1234567890); obj.split = String.prototype.split; obj.split().length", - 1, - eval("var obj = new Number(-1234567890); obj.split = String.prototype.split; obj.split().length") ); - -new TestCase( SECTION, - "var obj = new Number(-1e21); obj.split = String.prototype.split; obj.split()[0]", - "-1e+21", - eval("var obj = new Number(-1e21); obj.split = String.prototype.split; obj.split()[0]") ); - - -// this is the Math object -new TestCase( SECTION, - "var obj = Math; obj.split = String.prototype.split; typeof obj.split()", - "object", - eval("var obj = Math; obj.split = String.prototype.split; typeof obj.split()") ); - -new TestCase( SECTION, - "var obj = Math; obj.split = String.prototype.split; Array.prototype.getClass = Object.prototype.toString; obj.getClass()", - "[object Array]", - eval("var obj = Math; obj.split = String.prototype.split; Array.prototype.getClass = Object.prototype.toString; obj.split().getClass()") ); - -new TestCase( SECTION, - "var obj = Math; obj.split = String.prototype.split; obj.split().length", - 1, - eval("var obj = Math; obj.split = String.prototype.split; obj.split().length") ); - -new TestCase( SECTION, - "var obj = Math; obj.split = String.prototype.split; obj.split()[0]", - "[object Math]", - eval("var obj = Math; obj.split = String.prototype.split; obj.split()[0]") ); - -// this is an array object -new TestCase( SECTION, - "var obj = new Array(1,2,3,4,5); obj.split = String.prototype.split; typeof obj.split()", - "object", - eval("var obj = new Array(1,2,3,4,5); obj.split = String.prototype.split; typeof obj.split()") ); - -new TestCase( SECTION, - "var obj = new Array(1,2,3,4,5); obj.split = String.prototype.split; Array.prototype.getClass = Object.prototype.toString; obj.getClass()", - "[object Array]", - eval("var obj = new Array(1,2,3,4,5); obj.split = String.prototype.split; Array.prototype.getClass = Object.prototype.toString; obj.split().getClass()") ); - -new TestCase( SECTION, - "var obj = new Array(1,2,3,4,5); obj.split = String.prototype.split; obj.split().length", - 1, - eval("var obj = new Array(1,2,3,4,5); obj.split = String.prototype.split; obj.split().length") ); - -new TestCase( SECTION, - "var obj = new Array(1,2,3,4,5); obj.split = String.prototype.split; obj.split()[0]", - "1,2,3,4,5", - eval("var obj = new Array(1,2,3,4,5); obj.split = String.prototype.split; obj.split()[0]") ); - -// this is a Boolean object - -new TestCase( SECTION, - "var obj = new Boolean(); obj.split = String.prototype.split; typeof obj.split()", - "object", - eval("var obj = new Boolean(); obj.split = String.prototype.split; typeof obj.split()") ); - -new TestCase( SECTION, - "var obj = new Boolean(); obj.split = String.prototype.split; Array.prototype.getClass = Object.prototype.toString; obj.getClass()", - "[object Array]", - eval("var obj = new Boolean(); obj.split = String.prototype.split; Array.prototype.getClass = Object.prototype.toString; obj.split().getClass()") ); - -new TestCase( SECTION, - "var obj = new Boolean(); obj.split = String.prototype.split; obj.split().length", - 1, - eval("var obj = new Boolean(); obj.split = String.prototype.split; obj.split().length") ); - -new TestCase( SECTION, - "var obj = new Boolean(); obj.split = String.prototype.split; obj.split()[0]", - "false", - eval("var obj = new Boolean(); obj.split = String.prototype.split; obj.split()[0]") ); - - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.8-2.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.8-2.js deleted file mode 100644 index ff33e62ba6..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.8-2.js +++ /dev/null @@ -1,247 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.8-2.js'; - -/** - File Name: 15.5.4.8-2.js - ECMA Section: 15.5.4.8 String.prototype.split( separator ) - Description: - - Returns an Array object into which substrings of the result of converting - this object to a string have been stored. The substrings are determined by - searching from left to right for occurrences of the given separator; these - occurrences are not part of any substring in the returned array, but serve - to divide up this string value. The separator may be a string of any length. - - As a special case, if the separator is the empty string, the string is split - up into individual characters; the length of the result array equals the - length of the string, and each substring contains one character. - - If the separator is not supplied, then the result array contains just one - string, which is the string. - - When the split method is called with one argument separator, the following steps are taken: - - 1. Call ToString, giving it the this value as its argument. - 2. Create a new Array object of length 0 and call it A. - 3. If separator is not supplied, call the [[Put]] method of A with 0 and - Result(1) as arguments, and then return A. - 4. Call ToString(separator). - 5. Compute the number of characters in Result(1). - 6. Compute the number of characters in the string that is Result(4). - 7. Let p be 0. - 8. If Result(6) is zero (the separator string is empty), go to step 17. - 9. Compute the smallest possible integer k not smaller than p such that - k+Result(6) is not greater than Result(5), and for all nonnegative - integers j less than Result(6), the character at position k+j of - Result(1) is the same as the character at position j of Result(2); - but if there is no such integer k, then go to step 14. - 10. Compute a string value equal to the substring of Result(1), consisting - of the characters at positions p through k1, inclusive. - 11. Call the [[Put]] method of A with A.length and Result(10) as arguments. - 12. Let p be k+Result(6). - 13. Go to step 9. - 14. Compute a string value equal to the substring of Result(1), consisting - of the characters from position p to the end of Result(1). - 15. Call the [[Put]] method of A with A.length and Result(14) as arguments. - 16. Return A. - 17. If p equals Result(5), return A. - 18. Compute a string value equal to the substring of Result(1), consisting of - the single character at position p. - 19. Call the [[Put]] method of A with A.length and Result(18) as arguments. - 20. Increase p by 1. - 21. Go to step 17. - - Note that the split function is intentionally generic; it does not require that its this value be a String - object. Therefore it can be transferred to other kinds of objects for use as a method. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.5.4.8-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "String.prototype.split"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -// case where separator is the empty string. - -var TEST_STRING = "this is a string object"; - -new TestCase( SECTION, - "var s = new String( "+ TEST_STRING +" ); s.split('').length", - TEST_STRING.length, - eval("var s = new String( TEST_STRING ); s.split('').length") ); - -for ( var i = 0; i < TEST_STRING.length; i++ ) { - - new TestCase( SECTION, - "var s = new String( "+TEST_STRING+" ); s.split('')["+i+"]", - TEST_STRING.charAt(i), - eval("var s = new String( TEST_STRING ); s.split('')["+i+"]") ); -} - -// case where the value of the separator is undefined. in this case. the value of the separator -// should be ToString( separator ), or "undefined". - -var TEST_STRING = "thisundefinedisundefinedaundefinedstringundefinedobject"; -var EXPECT_STRING = new Array( "this", "is", "a", "string", "object" ); - -new TestCase( SECTION, - "var s = new String( "+ TEST_STRING +" ); s.split(void 0).length", - EXPECT_STRING.length, - eval("var s = new String( TEST_STRING ); s.split(void 0).length") ); - -for ( var i = 0; i < EXPECT_STRING.length; i++ ) { - new TestCase( SECTION, - "var s = new String( "+TEST_STRING+" ); s.split(void 0)["+i+"]", - EXPECT_STRING[i], - eval("var s = new String( TEST_STRING ); s.split(void 0)["+i+"]") ); -} - -// case where the value of the separator is null. in this case the value of the separator is "null". -TEST_STRING = "thisnullisnullanullstringnullobject"; -var EXPECT_STRING = new Array( "this", "is", "a", "string", "object" ); - -new TestCase( SECTION, - "var s = new String( "+ TEST_STRING +" ); s.split(null).length", - EXPECT_STRING.length, - eval("var s = new String( TEST_STRING ); s.split(null).length") ); - -for ( var i = 0; i < EXPECT_STRING.length; i++ ) { - new TestCase( SECTION, - "var s = new String( "+TEST_STRING+" ); s.split(null)["+i+"]", - EXPECT_STRING[i], - eval("var s = new String( TEST_STRING ); s.split(null)["+i+"]") ); -} - -// case where the value of the separator is a boolean. -TEST_STRING = "thistrueistrueatruestringtrueobject"; -var EXPECT_STRING = new Array( "this", "is", "a", "string", "object" ); - -new TestCase( SECTION, - "var s = new String( "+ TEST_STRING +" ); s.split(true).length", - EXPECT_STRING.length, - eval("var s = new String( TEST_STRING ); s.split(true).length") ); - -for ( var i = 0; i < EXPECT_STRING.length; i++ ) { - new TestCase( SECTION, - "var s = new String( "+TEST_STRING+" ); s.split(true)["+i+"]", - EXPECT_STRING[i], - eval("var s = new String( TEST_STRING ); s.split(true)["+i+"]") ); -} - -// case where the value of the separator is a number -TEST_STRING = "this123is123a123string123object"; -var EXPECT_STRING = new Array( "this", "is", "a", "string", "object" ); - -new TestCase( SECTION, - "var s = new String( "+ TEST_STRING +" ); s.split(123).length", - EXPECT_STRING.length, - eval("var s = new String( TEST_STRING ); s.split(123).length") ); - -for ( var i = 0; i < EXPECT_STRING.length; i++ ) { - new TestCase( SECTION, - "var s = new String( "+TEST_STRING+" ); s.split(123)["+i+"]", - EXPECT_STRING[i], - eval("var s = new String( TEST_STRING ); s.split(123)["+i+"]") ); -} - - -// case where the value of the separator is a number -TEST_STRING = "this123is123a123string123object"; -var EXPECT_STRING = new Array( "this", "is", "a", "string", "object" ); - -new TestCase( SECTION, - "var s = new String( "+ TEST_STRING +" ); s.split(123).length", - EXPECT_STRING.length, - eval("var s = new String( TEST_STRING ); s.split(123).length") ); - -for ( var i = 0; i < EXPECT_STRING.length; i++ ) { - new TestCase( SECTION, - "var s = new String( "+TEST_STRING+" ); s.split(123)["+i+"]", - EXPECT_STRING[i], - eval("var s = new String( TEST_STRING ); s.split(123)["+i+"]") ); -} - -// case where the separator is not in the string -TEST_STRING = "this is a string"; -EXPECT_STRING = new Array( "this is a string" ); - -new TestCase( SECTION, - "var s = new String( " + TEST_STRING + " ); s.split(':').length", - 1, - eval("var s = new String( TEST_STRING ); s.split(':').length") ); - -new TestCase( SECTION, - "var s = new String( " + TEST_STRING + " ); s.split(':')[0]", - TEST_STRING, - eval("var s = new String( TEST_STRING ); s.split(':')[0]") ); - -// case where part but not all of separator is in the string. -TEST_STRING = "this is a string"; -EXPECT_STRING = new Array( "this is a string" ); -new TestCase( SECTION, - "var s = new String( " + TEST_STRING + " ); s.split('strings').length", - 1, - eval("var s = new String( TEST_STRING ); s.split('strings').length") ); - -new TestCase( SECTION, - "var s = new String( " + TEST_STRING + " ); s.split('strings')[0]", - TEST_STRING, - eval("var s = new String( TEST_STRING ); s.split('strings')[0]") ); - -// case where the separator is at the end of the string -TEST_STRING = "this is a string"; -EXPECT_STRING = new Array( "this is a " ); -new TestCase( SECTION, - "var s = new String( " + TEST_STRING + " ); s.split('string').length", - 2, - eval("var s = new String( TEST_STRING ); s.split('string').length") ); - -for ( var i = 0; i < EXPECT_STRING.length; i++ ) { - new TestCase( SECTION, - "var s = new String( "+TEST_STRING+" ); s.split('string')["+i+"]", - EXPECT_STRING[i], - eval("var s = new String( TEST_STRING ); s.split('string')["+i+"]") ); -} - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.8-3.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.8-3.js deleted file mode 100644 index fe10284a9c..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.8-3.js +++ /dev/null @@ -1,204 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.8-3.js'; - -/** - File Name: 15.5.4.8-3.js - ECMA Section: 15.5.4.8 String.prototype.split( separator ) - Description: - - Returns an Array object into which substrings of the result of converting - this object to a string have been stored. The substrings are determined by - searching from left to right for occurrences of the given separator; these - occurrences are not part of any substring in the returned array, but serve - to divide up this string value. The separator may be a string of any length. - - As a special case, if the separator is the empty string, the string is split - up into individual characters; the length of the result array equals the - length of the string, and each substring contains one character. - - If the separator is not supplied, then the result array contains just one - string, which is the string. - - When the split method is called with one argument separator, the following steps are taken: - - 1. Call ToString, giving it the this value as its argument. - 2. Create a new Array object of length 0 and call it A. - 3. If separator is not supplied, call the [[Put]] method of A with 0 and - Result(1) as arguments, and then return A. - 4. Call ToString(separator). - 5. Compute the number of characters in Result(1). - 6. Compute the number of characters in the string that is Result(4). - 7. Let p be 0. - 8. If Result(6) is zero (the separator string is empty), go to step 17. - 9. Compute the smallest possible integer k not smaller than p such that - k+Result(6) is not greater than Result(5), and for all nonnegative - integers j less than Result(6), the character at position k+j of - Result(1) is the same as the character at position j of Result(2); - but if there is no such integer k, then go to step 14. - 10. Compute a string value equal to the substring of Result(1), consisting - of the characters at positions p through k1, inclusive. - 11. Call the [[Put]] method of A with A.length and Result(10) as arguments. - 12. Let p be k+Result(6). - 13. Go to step 9. - 14. Compute a string value equal to the substring of Result(1), consisting - of the characters from position p to the end of Result(1). - 15. Call the [[Put]] method of A with A.length and Result(14) as arguments. - 16. Return A. - 17. If p equals Result(5), return A. - 18. Compute a string value equal to the substring of Result(1), consisting of - the single character at position p. - 19. Call the [[Put]] method of A with A.length and Result(18) as arguments. - 20. Increase p by 1. - 21. Go to step 17. - - Note that the split function is intentionally generic; it does not require that its this value be a String - object. Therefore it can be transferred to other kinds of objects for use as a method. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.5.4.8-3"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "String.prototype.split"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var TEST_STRING = ""; -var EXPECT = new Array(); - -// this.toString is the empty string. - -new TestCase( SECTION, - "var s = new String(); s.split().length", - 1, - eval("var s = new String(); s.split().length") ); - -new TestCase( SECTION, - "var s = new String(); s.split()[0]", - "", - eval("var s = new String(); s.split()[0]") ); - -// this.toString() is the empty string, separator is specified. - -new TestCase( SECTION, - "var s = new String(); s.split('').length", - 0, - eval("var s = new String(); s.split('').length") ); - -new TestCase( SECTION, - "var s = new String(); s.split(' ').length", - 1, - eval("var s = new String(); s.split(' ').length") ); - -// this to string is " " -new TestCase( SECTION, - "var s = new String(' '); s.split().length", - 1, - eval("var s = new String(' '); s.split().length") ); - -new TestCase( SECTION, - "var s = new String(' '); s.split()[0]", - " ", - eval("var s = new String(' '); s.split()[0]") ); - -new TestCase( SECTION, - "var s = new String(' '); s.split('').length", - 1, - eval("var s = new String(' '); s.split('').length") ); - -new TestCase( SECTION, - "var s = new String(' '); s.split('')[0]", - " ", - eval("var s = new String(' '); s.split('')[0]") ); - -new TestCase( SECTION, - "var s = new String(' '); s.split(' ').length", - 2, - eval("var s = new String(' '); s.split(' ').length") ); - -new TestCase( SECTION, - "var s = new String(' '); s.split(' ')[0]", - "", - eval("var s = new String(' '); s.split(' ')[0]") ); - -new TestCase( SECTION, - "\"\".split(\"\").length", - 0, - ("".split("")).length ); - -new TestCase( SECTION, - "\"\".split(\"x\").length", - 1, - ("".split("x")).length ); - -new TestCase( SECTION, - "\"\".split(\"x\")[0]", - "", - ("".split("x"))[0] ); - -test(); - -function Split( string, separator ) { - string = String( string ); - - var A = new Array(); - - if ( arguments.length < 2 ) { - A[0] = string; - return A; - } - - separator = String( separator ); - - var str_len = String( string ).length; - var sep_len = String( separator ).length; - - var p = 0; - var k = 0; - - if ( sep_len == 0 ) { - for ( ; p < str_len; p++ ) { - A[A.length] = String( string.charAt(p) ); - } - } - return A; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.9-1.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.9-1.js deleted file mode 100644 index 2184c60f45..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.9-1.js +++ /dev/null @@ -1,202 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.9-1.js'; - -/** - File Name: 15.5.4.9-1.js - ECMA Section: 15.5.4.9 String.prototype.substring( start ) - Description: - - 15.5.4.9 String.prototype.substring(start) - - Returns a substring of the result of converting this object to a string, - starting from character position start and running to the end of the - string. The result is a string value, not a String object. - - If the argument is NaN or negative, it is replaced with zero; if the - argument is larger than the length of the string, it is replaced with the - length of the string. - - When the substring method is called with one argument start, the following - steps are taken: - - 1.Call ToString, giving it the this value as its argument. - 2.Call ToInteger(start). - 3.Compute the number of characters in Result(1). - 4.Compute min(max(Result(2), 0), Result(3)). - 5.Return a string whose length is the difference between Result(3) and Result(4), - containing characters from Result(1), namely the characters with indices Result(4) - through Result(3)1, in ascending order. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.5.4.9-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "String.prototype.substring( start )"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "String.prototype.substring.length", 2, String.prototype.substring.length ); -new TestCase( SECTION, "delete String.prototype.substring.length", false, delete String.prototype.substring.length ); -new TestCase( SECTION, "delete String.prototype.substring.length; String.prototype.substring.length", 2, eval("delete String.prototype.substring.length; String.prototype.substring.length") ); - -// test cases for when substring is called with no arguments. - -// this is a string object - -new TestCase( SECTION, - "var s = new String('this is a string object'); typeof s.substring()", - "string", - eval("var s = new String('this is a string object'); typeof s.substring()") ); - -new TestCase( SECTION, - "var s = new String(''); s.substring()", - "", - eval("var s = new String(''); s.substring()") ); - - -new TestCase( SECTION, - "var s = new String('this is a string object'); s.substring()", - "this is a string object", - eval("var s = new String('this is a string object'); s.substring()") ); - -new TestCase( SECTION, - "var s = new String('this is a string object'); s.substring(NaN)", - "this is a string object", - eval("var s = new String('this is a string object'); s.substring(NaN)") ); - - -new TestCase( SECTION, - "var s = new String('this is a string object'); s.substring(-0.01)", - "this is a string object", - eval("var s = new String('this is a string object'); s.substring(-0.01)") ); - - -new TestCase( SECTION, - "var s = new String('this is a string object'); s.substring(s.length)", - "", - eval("var s = new String('this is a string object'); s.substring(s.length)") ); - -new TestCase( SECTION, - "var s = new String('this is a string object'); s.substring(s.length+1)", - "", - eval("var s = new String('this is a string object'); s.substring(s.length+1)") ); - - -new TestCase( SECTION, - "var s = new String('this is a string object'); s.substring(Infinity)", - "", - eval("var s = new String('this is a string object'); s.substring(Infinity)") ); - -new TestCase( SECTION, - "var s = new String('this is a string object'); s.substring(-Infinity)", - "this is a string object", - eval("var s = new String('this is a string object'); s.substring(-Infinity)") ); - -// this is not a String object, start is not an integer - - -new TestCase( SECTION, - "var s = new Array(1,2,3,4,5); s.substring = String.prototype.substring; s.substring()", - "1,2,3,4,5", - eval("var s = new Array(1,2,3,4,5); s.substring = String.prototype.substring; s.substring()") ); - -new TestCase( SECTION, - "var s = new Array(1,2,3,4,5); s.substring = String.prototype.substring; s.substring(true)", - ",2,3,4,5", - eval("var s = new Array(1,2,3,4,5); s.substring = String.prototype.substring; s.substring(true)") ); - -new TestCase( SECTION, - "var s = new Array(1,2,3,4,5); s.substring = String.prototype.substring; s.substring('4')", - "3,4,5", - eval("var s = new Array(1,2,3,4,5); s.substring = String.prototype.substring; s.substring('4')") ); - -new TestCase( SECTION, - "var s = new Array(); s.substring = String.prototype.substring; s.substring('4')", - "", - eval("var s = new Array(); s.substring = String.prototype.substring; s.substring('4')") ); - -// this is an object object -new TestCase( SECTION, - "var obj = new Object(); obj.substring = String.prototype.substring; obj.substring(8)", - "Object]", - eval("var obj = new Object(); obj.substring = String.prototype.substring; obj.substring(8)") ); - -// this is a function object -new TestCase( SECTION, - "var obj = new Function(); obj.substring = String.prototype.substring; obj.toString = Object.prototype.toString; obj.substring(8)", - "Function]", - eval("var obj = new Function(); obj.substring = String.prototype.substring; obj.toString = Object.prototype.toString; obj.substring(8)") ); -// this is a number object -new TestCase( SECTION, - "var obj = new Number(NaN); obj.substring = String.prototype.substring; obj.substring(false)", - "NaN", - eval("var obj = new Number(NaN); obj.substring = String.prototype.substring; obj.substring(false)") ); - -// this is the Math object -new TestCase( SECTION, - "var obj = Math; obj.substring = String.prototype.substring; obj.substring(Math.PI)", - "ject Math]", - eval("var obj = Math; obj.substring = String.prototype.substring; obj.substring(Math.PI)") ); - -// this is a Boolean object - -new TestCase( SECTION, - "var obj = new Boolean(); obj.substring = String.prototype.substring; obj.substring(new Array())", - "false", - eval("var obj = new Boolean(); obj.substring = String.prototype.substring; obj.substring(new Array())") ); - -// this is a user defined object - -new TestCase( SECTION, - "var obj = new MyObject( null ); obj.substring(0)", - "null", - eval( "var obj = new MyObject( null ); obj.substring(0)") ); - - -test(); - -function MyObject( value ) { - this.value = value; - this.substring = String.prototype.substring; - this.toString = new Function ( "return this.value+''" ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.js deleted file mode 100644 index 063e4e68d1..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.4.js +++ /dev/null @@ -1,108 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.js'; - -/** - File Name: 15.5.4.js - ECMA Section: 15.5.4 Properties of the String prototype object - - Description: - Author: christine@netscape.com - Date: 28 october 1997 - -*/ -var SECTION = "15.5.4"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Properties of the String Prototype objecta"; - -writeHeaderToLog( SECTION + " "+ TITLE); - - -new TestCase( SECTION, - "String.prototype.getClass = Object.prototype.toString; String.prototype.getClass()", - "[object String]", - eval("String.prototype.getClass = Object.prototype.toString; String.prototype.getClass()") ); - -delete String.prototype.getClass; - -new TestCase( SECTION, - "typeof String.prototype", - "object", - typeof String.prototype ); - -new TestCase( SECTION, - "String.prototype.valueOf()", - "", - String.prototype.valueOf() ); - -new TestCase( SECTION, - "String.prototype +''", - "", - String.prototype + '' ); - -new TestCase( SECTION, - "String.prototype.length", - 0, - String.prototype.length ); - -var prop; -var value; - -value = ''; -for (prop in "") -{ - value += prop; -} -new TestCase( SECTION, - 'String "" has no enumerable properties', - '', - value ); - -value = ''; -for (prop in String.prototype) -{ - value += prop; -} -new TestCase( SECTION, - 'String.prototype has no enumerable properties', - '', - value ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.5.1.js b/tests/auto/declarative/parserstress/tests/ecma/String/15.5.5.1.js deleted file mode 100644 index 85d3d24ef2..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/15.5.5.1.js +++ /dev/null @@ -1,88 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.5.1.js'; - -/** - File Name: 15.5.5.1 - ECMA Section: String.length - Description: - - The number of characters in the String value represented by this String - object. - - Once a String object is created, this property is unchanging. It has the - attributes { DontEnum, DontDelete, ReadOnly }. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.5.5.1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "String.length"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "var s = new String(); s.length", - 0, - eval("var s = new String(); s.length") ); - -new TestCase( SECTION, - "var s = new String(); s.length = 10; s.length", - 0, - eval("var s = new String(); s.length = 10; s.length") ); - -new TestCase( SECTION, - "var s = new String(); var props = ''; for ( var p in s ) { props += p; }; props", - "", - eval("var s = new String(); var props = ''; for ( var p in s ) { props += p; }; props") ); - -new TestCase( SECTION, - "var s = new String(); delete s.length", - false, - eval("var s = new String(); delete s.length") ); - -new TestCase( SECTION, - "var s = new String('hello'); delete s.length; s.length", - 5, - eval("var s = new String('hello'); delete s.length; s.length") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/browser.js b/tests/auto/declarative/parserstress/tests/ecma/String/browser.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/auto/declarative/parserstress/tests/ecma/String/shell.js b/tests/auto/declarative/parserstress/tests/ecma/String/shell.js deleted file mode 100644 index 7d850446cc..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/String/shell.js +++ /dev/null @@ -1 +0,0 @@ -gTestsubsuite = 'String'; diff --git a/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.2.js b/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.2.js deleted file mode 100644 index 2d428b9a9e..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.2.js +++ /dev/null @@ -1,138 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): christine@netscape.com - * Jesse Ruderman - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '9.2.js'; - -/** - File Name: 9.2.js - ECMA Section: 9.2 Type Conversion: ToBoolean - Description: rules for converting an argument to a boolean. - undefined false - Null false - Boolean input argument( no conversion ) - Number returns false for 0, -0, and NaN - otherwise return true - String return false if the string is empty - (length is 0) otherwise the result is - true - Object all return true - - Author: christine@netscape.com - Date: 14 july 1997 -*/ -var SECTION = "9.2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "ToBoolean"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -// special cases here - -new TestCase( SECTION, "Boolean()", false, Boolean() ); -new TestCase( SECTION, "Boolean(var x)", false, Boolean(eval("var x")) ); -new TestCase( SECTION, "Boolean(void 0)", false, Boolean(void 0) ); -new TestCase( SECTION, "Boolean(null)", false, Boolean(null) ); -new TestCase( SECTION, "Boolean(false)", false, Boolean(false) ); -new TestCase( SECTION, "Boolean(true)", true, Boolean(true) ); -new TestCase( SECTION, "Boolean(0)", false, Boolean(0) ); -new TestCase( SECTION, "Boolean(-0)", false, Boolean(-0) ); -new TestCase( SECTION, "Boolean(NaN)", false, Boolean(Number.NaN) ); -new TestCase( SECTION, "Boolean('')", false, Boolean("") ); - -// normal test cases here - -new TestCase( SECTION, "Boolean(Infinity)", true, Boolean(Number.POSITIVE_INFINITY) ); -new TestCase( SECTION, "Boolean(-Infinity)", true, Boolean(Number.NEGATIVE_INFINITY) ); -new TestCase( SECTION, "Boolean(Math.PI)", true, Boolean(Math.PI) ); -new TestCase( SECTION, "Boolean(1)", true, Boolean(1) ); -new TestCase( SECTION, "Boolean(-1)", true, Boolean(-1) ); -new TestCase( SECTION, "Boolean([tab])", true, Boolean("\t") ); -new TestCase( SECTION, "Boolean('0')", true, Boolean("0") ); -new TestCase( SECTION, "Boolean('string')", true, Boolean("string") ); - -// ToBoolean (object) should always return true. -new TestCase( SECTION, "Boolean(new String() )", true, Boolean(new String()) ); -new TestCase( SECTION, "Boolean(new String('') )", true, Boolean(new String("")) ); - -new TestCase( SECTION, "Boolean(new Boolean(true))", true, Boolean(new Boolean(true)) ); -new TestCase( SECTION, "Boolean(new Boolean(false))", true, Boolean(new Boolean(false)) ); -new TestCase( SECTION, "Boolean(new Boolean() )", true, Boolean(new Boolean()) ); - -new TestCase( SECTION, "Boolean(new Array())", true, Boolean(new Array()) ); - -new TestCase( SECTION, "Boolean(new Number())", true, Boolean(new Number()) ); -new TestCase( SECTION, "Boolean(new Number(-0))", true, Boolean(new Number(-0)) ); -new TestCase( SECTION, "Boolean(new Number(0))", true, Boolean(new Number(0)) ); -new TestCase( SECTION, "Boolean(new Number(NaN))", true, Boolean(new Number(Number.NaN)) ); - -new TestCase( SECTION, "Boolean(new Number(-1))", true, Boolean(new Number(-1)) ); -new TestCase( SECTION, "Boolean(new Number(Infinity))", true, Boolean(new Number(Number.POSITIVE_INFINITY)) ); -new TestCase( SECTION, "Boolean(new Number(-Infinity))",true, Boolean(new Number(Number.NEGATIVE_INFINITY)) ); - -new TestCase( SECTION, "Boolean(new Object())", true, Boolean(new Object()) ); -new TestCase( SECTION, "Boolean(new Function())", true, Boolean(new Function()) ); -new TestCase( SECTION, "Boolean(new Date())", true, Boolean(new Date()) ); -new TestCase( SECTION, "Boolean(new Date(0))", true, Boolean(new Date(0)) ); -new TestCase( SECTION, "Boolean(Math)", true, Boolean(Math) ); - -// bug 375793 -new TestCase( SECTION, - "NaN ? true : false", - false, - (NaN ? true : false) ); -new TestCase( SECTION, - "1000 % 0 ? true : false", - false, - (1000 % 0 ? true : false) ); -new TestCase( SECTION, - "(function(a,b){ return a % b ? true : false })(1000, 0)", - false, - ((function(a,b){ return a % b ? true : false })(1000, 0)) ); - -new TestCase( SECTION, - "(function(x) { return !(x) })(0/0)", - true, - ((function(x) { return !(x) })(0/0)) ); -new TestCase( SECTION, - "!(0/0)", - true, - (!(0/0)) ); -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.3-1.js b/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.3-1.js deleted file mode 100644 index 9994d6a7cd..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.3-1.js +++ /dev/null @@ -1,100 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '9.3-1.js'; - -/** - File Name: 9.3-1.js - ECMA Section: 9.3 Type Conversion: ToNumber - Description: rules for converting an argument to a number. - see 9.3.1 for cases for converting strings to numbers. - special cases: - undefined NaN - Null NaN - Boolean 1 if true; +0 if false - Number the argument ( no conversion ) - String see test 9.3.1 - Object see test 9.3-1 - - - This tests ToNumber applied to the object type, except - if object is string. See 9.3-2 for - ToNumber( String object). - - Author: christine@netscape.com - Date: 10 july 1997 - -*/ -var SECTION = "9.3-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " ToNumber"); - -// object is Number -new TestCase( SECTION, "Number(new Number())", 0, Number(new Number()) ); -new TestCase( SECTION, "typeof Number(new Number())", "number", typeof Number(new Number()) ); - -new TestCase( SECTION, "Number(new Number(Number.NaN))", Number.NaN, Number(new Number(Number.NaN)) ); -new TestCase( SECTION, "typeof Number(new Number(Number.NaN))","number", typeof Number(new Number(Number.NaN)) ); - -new TestCase( SECTION, "Number(new Number(0))", 0, Number(new Number(0)) ); -new TestCase( SECTION, "typeof Number(new Number(0))", "number", typeof Number(new Number(0)) ); - -new TestCase( SECTION, "Number(new Number(null))", 0, Number(new Number(null)) ); -new TestCase( SECTION, "typeof Number(new Number(null))", "number", typeof Number(new Number(null)) ); - - -// new TestCase( SECTION, "Number(new Number(void 0))", Number.NaN, Number(new Number(void 0)) ); -new TestCase( SECTION, "Number(new Number(true))", 1, Number(new Number(true)) ); -new TestCase( SECTION, "typeof Number(new Number(true))", "number", typeof Number(new Number(true)) ); - -new TestCase( SECTION, "Number(new Number(false))", 0, Number(new Number(false)) ); -new TestCase( SECTION, "typeof Number(new Number(false))", "number", typeof Number(new Number(false)) ); - -// object is boolean -new TestCase( SECTION, "Number(new Boolean(true))", 1, Number(new Boolean(true)) ); -new TestCase( SECTION, "typeof Number(new Boolean(true))", "number", typeof Number(new Boolean(true)) ); - -new TestCase( SECTION, "Number(new Boolean(false))", 0, Number(new Boolean(false)) ); -new TestCase( SECTION, "typeof Number(new Boolean(false))", "number", typeof Number(new Boolean(false)) ); - -// object is array -new TestCase( SECTION, "Number(new Array(2,4,8,16,32))", Number.NaN, Number(new Array(2,4,8,16,32)) ); -new TestCase( SECTION, "typeof Number(new Array(2,4,8,16,32))", "number", typeof Number(new Array(2,4,8,16,32)) ); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.3.1-1.js b/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.3.1-1.js deleted file mode 100644 index da3e8794c0..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.3.1-1.js +++ /dev/null @@ -1,323 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '9.3.1-1.js'; - -/** - File Name: 9.3.1-1.js - ECMA Section: 9.3 Type Conversion: ToNumber - Description: rules for converting an argument to a number. - see 9.3.1 for cases for converting strings to numbers. - special cases: - undefined NaN - Null NaN - Boolean 1 if true; +0 if false - Number the argument ( no conversion ) - String see test 9.3.1 - Object see test 9.3-1 - - - This tests ToNumber applied to the string type - - Author: christine@netscape.com - Date: 10 july 1997 - -*/ -var SECTION = "9.3.1-1"; -var VERSION = "ECMA_1"; -var TITLE = "ToNumber applied to the String type"; -var BUGNUMBER="77391"; - -startTest(); - -writeHeaderToLog( SECTION + " "+ TITLE); - - -// StringNumericLiteral:::StrWhiteSpace:::StrWhiteSpaceChar StrWhiteSpace::: -// -// Name Unicode Value Escape Sequence -// 0X0009 \t -// 0X0020 -// 0X000C \f -// 0X000B -// 0X000D \r -// 0X000A \n -new TestCase( SECTION, "Number('')", 0, Number("") ); -new TestCase( SECTION, "Number(' ')", 0, Number(" ") ); -new TestCase( SECTION, "Number(\\t)", 0, Number("\t") ); -new TestCase( SECTION, "Number(\\n)", 0, Number("\n") ); -new TestCase( SECTION, "Number(\\r)", 0, Number("\r") ); -new TestCase( SECTION, "Number(\\f)", 0, Number("\f") ); - -new TestCase( SECTION, "Number(String.fromCharCode(0x0009)", 0, Number(String.fromCharCode(0x0009)) ); -new TestCase( SECTION, "Number(String.fromCharCode(0x0020)", 0, Number(String.fromCharCode(0x0020)) ); -new TestCase( SECTION, "Number(String.fromCharCode(0x000C)", 0, Number(String.fromCharCode(0x000C)) ); -new TestCase( SECTION, "Number(String.fromCharCode(0x000B)", 0, Number(String.fromCharCode(0x000B)) ); -new TestCase( SECTION, "Number(String.fromCharCode(0x000D)", 0, Number(String.fromCharCode(0x000D)) ); -new TestCase( SECTION, "Number(String.fromCharCode(0x000A)", 0, Number(String.fromCharCode(0x000A)) ); - -// a StringNumericLiteral may be preceeded or followed by whitespace and/or -// line terminators - -new TestCase( SECTION, "Number( ' ' + 999 )", 999, Number( ' '+999) ); -new TestCase( SECTION, "Number( '\\n' + 999 )", 999, Number( '\n' +999) ); -new TestCase( SECTION, "Number( '\\r' + 999 )", 999, Number( '\r' +999) ); -new TestCase( SECTION, "Number( '\\t' + 999 )", 999, Number( '\t' +999) ); -new TestCase( SECTION, "Number( '\\f' + 999 )", 999, Number( '\f' +999) ); - -new TestCase( SECTION, "Number( 999 + ' ' )", 999, Number( 999+' ') ); -new TestCase( SECTION, "Number( 999 + '\\n' )", 999, Number( 999+'\n' ) ); -new TestCase( SECTION, "Number( 999 + '\\r' )", 999, Number( 999+'\r' ) ); -new TestCase( SECTION, "Number( 999 + '\\t' )", 999, Number( 999+'\t' ) ); -new TestCase( SECTION, "Number( 999 + '\\f' )", 999, Number( 999+'\f' ) ); - -new TestCase( SECTION, "Number( '\\n' + 999 + '\\n' )", 999, Number( '\n' +999+'\n' ) ); -new TestCase( SECTION, "Number( '\\r' + 999 + '\\r' )", 999, Number( '\r' +999+'\r' ) ); -new TestCase( SECTION, "Number( '\\t' + 999 + '\\t' )", 999, Number( '\t' +999+'\t' ) ); -new TestCase( SECTION, "Number( '\\f' + 999 + '\\f' )", 999, Number( '\f' +999+'\f' ) ); - -new TestCase( SECTION, "Number( ' ' + '999' )", 999, Number( ' '+'999') ); -new TestCase( SECTION, "Number( '\\n' + '999' )", 999, Number( '\n' +'999') ); -new TestCase( SECTION, "Number( '\\r' + '999' )", 999, Number( '\r' +'999') ); -new TestCase( SECTION, "Number( '\\t' + '999' )", 999, Number( '\t' +'999') ); -new TestCase( SECTION, "Number( '\\f' + '999' )", 999, Number( '\f' +'999') ); - -new TestCase( SECTION, "Number( '999' + ' ' )", 999, Number( '999'+' ') ); -new TestCase( SECTION, "Number( '999' + '\\n' )", 999, Number( '999'+'\n' ) ); -new TestCase( SECTION, "Number( '999' + '\\r' )", 999, Number( '999'+'\r' ) ); -new TestCase( SECTION, "Number( '999' + '\\t' )", 999, Number( '999'+'\t' ) ); -new TestCase( SECTION, "Number( '999' + '\\f' )", 999, Number( '999'+'\f' ) ); - -new TestCase( SECTION, "Number( '\\n' + '999' + '\\n' )", 999, Number( '\n' +'999'+'\n' ) ); -new TestCase( SECTION, "Number( '\\r' + '999' + '\\r' )", 999, Number( '\r' +'999'+'\r' ) ); -new TestCase( SECTION, "Number( '\\t' + '999' + '\\t' )", 999, Number( '\t' +'999'+'\t' ) ); -new TestCase( SECTION, "Number( '\\f' + '999' + '\\f' )", 999, Number( '\f' +'999'+'\f' ) ); - -new TestCase( SECTION, "Number( String.fromCharCode(0x0009) + '99' )", 99, Number( String.fromCharCode(0x0009) + '99' ) ); -new TestCase( SECTION, "Number( String.fromCharCode(0x0020) + '99' )", 99, Number( String.fromCharCode(0x0020) + '99' ) ); -new TestCase( SECTION, "Number( String.fromCharCode(0x000C) + '99' )", 99, Number( String.fromCharCode(0x000C) + '99' ) ); -new TestCase( SECTION, "Number( String.fromCharCode(0x000B) + '99' )", 99, Number( String.fromCharCode(0x000B) + '99' ) ); -new TestCase( SECTION, "Number( String.fromCharCode(0x000D) + '99' )", 99, Number( String.fromCharCode(0x000D) + '99' ) ); -new TestCase( SECTION, "Number( String.fromCharCode(0x000A) + '99' )", 99, Number( String.fromCharCode(0x000A) + '99' ) ); - -new TestCase( SECTION, "Number( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x0009)", 99, Number( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x0009)) ); -new TestCase( SECTION, "Number( String.fromCharCode(0x0020) + '99' + String.fromCharCode(0x0020)", 99, Number( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x0020)) ); -new TestCase( SECTION, "Number( String.fromCharCode(0x000C) + '99' + String.fromCharCode(0x000C)", 99, Number( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x000C)) ); -new TestCase( SECTION, "Number( String.fromCharCode(0x000D) + '99' + String.fromCharCode(0x000D)", 99, Number( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x000D)) ); -new TestCase( SECTION, "Number( String.fromCharCode(0x000B) + '99' + String.fromCharCode(0x000B)", 99, Number( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x000B)) ); -new TestCase( SECTION, "Number( String.fromCharCode(0x000A) + '99' + String.fromCharCode(0x000A)", 99, Number( String.fromCharCode(0x0009) + '99' + String.fromCharCode(0x000A)) ); - -new TestCase( SECTION, "Number( '99' + String.fromCharCode(0x0009)", 99, Number( '99' + String.fromCharCode(0x0009)) ); -new TestCase( SECTION, "Number( '99' + String.fromCharCode(0x0020)", 99, Number( '99' + String.fromCharCode(0x0020)) ); -new TestCase( SECTION, "Number( '99' + String.fromCharCode(0x000C)", 99, Number( '99' + String.fromCharCode(0x000C)) ); -new TestCase( SECTION, "Number( '99' + String.fromCharCode(0x000D)", 99, Number( '99' + String.fromCharCode(0x000D)) ); -new TestCase( SECTION, "Number( '99' + String.fromCharCode(0x000B)", 99, Number( '99' + String.fromCharCode(0x000B)) ); -new TestCase( SECTION, "Number( '99' + String.fromCharCode(0x000A)", 99, Number( '99' + String.fromCharCode(0x000A)) ); - -new TestCase( SECTION, "Number( String.fromCharCode(0x0009) + 99 )", 99, Number( String.fromCharCode(0x0009) + 99 ) ); -new TestCase( SECTION, "Number( String.fromCharCode(0x0020) + 99 )", 99, Number( String.fromCharCode(0x0020) + 99 ) ); -new TestCase( SECTION, "Number( String.fromCharCode(0x000C) + 99 )", 99, Number( String.fromCharCode(0x000C) + 99 ) ); -new TestCase( SECTION, "Number( String.fromCharCode(0x000B) + 99 )", 99, Number( String.fromCharCode(0x000B) + 99 ) ); -new TestCase( SECTION, "Number( String.fromCharCode(0x000D) + 99 )", 99, Number( String.fromCharCode(0x000D) + 99 ) ); -new TestCase( SECTION, "Number( String.fromCharCode(0x000A) + 99 )", 99, Number( String.fromCharCode(0x000A) + 99 ) ); - -new TestCase( SECTION, "Number( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x0009)", 99, Number( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x0009)) ); -new TestCase( SECTION, "Number( String.fromCharCode(0x0020) + 99 + String.fromCharCode(0x0020)", 99, Number( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x0020)) ); -new TestCase( SECTION, "Number( String.fromCharCode(0x000C) + 99 + String.fromCharCode(0x000C)", 99, Number( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x000C)) ); -new TestCase( SECTION, "Number( String.fromCharCode(0x000D) + 99 + String.fromCharCode(0x000D)", 99, Number( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x000D)) ); -new TestCase( SECTION, "Number( String.fromCharCode(0x000B) + 99 + String.fromCharCode(0x000B)", 99, Number( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x000B)) ); -new TestCase( SECTION, "Number( String.fromCharCode(0x000A) + 99 + String.fromCharCode(0x000A)", 99, Number( String.fromCharCode(0x0009) + 99 + String.fromCharCode(0x000A)) ); - -new TestCase( SECTION, "Number( 99 + String.fromCharCode(0x0009)", 99, Number( 99 + String.fromCharCode(0x0009)) ); -new TestCase( SECTION, "Number( 99 + String.fromCharCode(0x0020)", 99, Number( 99 + String.fromCharCode(0x0020)) ); -new TestCase( SECTION, "Number( 99 + String.fromCharCode(0x000C)", 99, Number( 99 + String.fromCharCode(0x000C)) ); -new TestCase( SECTION, "Number( 99 + String.fromCharCode(0x000D)", 99, Number( 99 + String.fromCharCode(0x000D)) ); -new TestCase( SECTION, "Number( 99 + String.fromCharCode(0x000B)", 99, Number( 99 + String.fromCharCode(0x000B)) ); -new TestCase( SECTION, "Number( 99 + String.fromCharCode(0x000A)", 99, Number( 99 + String.fromCharCode(0x000A)) ); - - -// StrNumericLiteral:::StrDecimalLiteral:::Infinity - -new TestCase( SECTION, "Number('Infinity')", Math.pow(10,10000), Number("Infinity") ); -new TestCase( SECTION, "Number('-Infinity')", -Math.pow(10,10000), Number("-Infinity") ); -new TestCase( SECTION, "Number('+Infinity')", Math.pow(10,10000), Number("+Infinity") ); - -// StrNumericLiteral::: StrDecimalLiteral ::: DecimalDigits . DecimalDigits opt ExponentPart opt - -new TestCase( SECTION, "Number('0')", 0, Number("0") ); -new TestCase( SECTION, "Number('-0')", -0, Number("-0") ); -new TestCase( SECTION, "Number('+0')", 0, Number("+0") ); - -new TestCase( SECTION, "Number('1')", 1, Number("1") ); -new TestCase( SECTION, "Number('-1')", -1, Number("-1") ); -new TestCase( SECTION, "Number('+1')", 1, Number("+1") ); - -new TestCase( SECTION, "Number('2')", 2, Number("2") ); -new TestCase( SECTION, "Number('-2')", -2, Number("-2") ); -new TestCase( SECTION, "Number('+2')", 2, Number("+2") ); - -new TestCase( SECTION, "Number('3')", 3, Number("3") ); -new TestCase( SECTION, "Number('-3')", -3, Number("-3") ); -new TestCase( SECTION, "Number('+3')", 3, Number("+3") ); - -new TestCase( SECTION, "Number('4')", 4, Number("4") ); -new TestCase( SECTION, "Number('-4')", -4, Number("-4") ); -new TestCase( SECTION, "Number('+4')", 4, Number("+4") ); - -new TestCase( SECTION, "Number('5')", 5, Number("5") ); -new TestCase( SECTION, "Number('-5')", -5, Number("-5") ); -new TestCase( SECTION, "Number('+5')", 5, Number("+5") ); - -new TestCase( SECTION, "Number('6')", 6, Number("6") ); -new TestCase( SECTION, "Number('-6')", -6, Number("-6") ); -new TestCase( SECTION, "Number('+6')", 6, Number("+6") ); - -new TestCase( SECTION, "Number('7')", 7, Number("7") ); -new TestCase( SECTION, "Number('-7')", -7, Number("-7") ); -new TestCase( SECTION, "Number('+7')", 7, Number("+7") ); - -new TestCase( SECTION, "Number('8')", 8, Number("8") ); -new TestCase( SECTION, "Number('-8')", -8, Number("-8") ); -new TestCase( SECTION, "Number('+8')", 8, Number("+8") ); - -new TestCase( SECTION, "Number('9')", 9, Number("9") ); -new TestCase( SECTION, "Number('-9')", -9, Number("-9") ); -new TestCase( SECTION, "Number('+9')", 9, Number("+9") ); - -new TestCase( SECTION, "Number('3.14159')", 3.14159, Number("3.14159") ); -new TestCase( SECTION, "Number('-3.14159')", -3.14159, Number("-3.14159") ); -new TestCase( SECTION, "Number('+3.14159')", 3.14159, Number("+3.14159") ); - -new TestCase( SECTION, "Number('3.')", 3, Number("3.") ); -new TestCase( SECTION, "Number('-3.')", -3, Number("-3.") ); -new TestCase( SECTION, "Number('+3.')", 3, Number("+3.") ); - -new TestCase( SECTION, "Number('3.e1')", 30, Number("3.e1") ); -new TestCase( SECTION, "Number('-3.e1')", -30, Number("-3.e1") ); -new TestCase( SECTION, "Number('+3.e1')", 30, Number("+3.e1") ); - -new TestCase( SECTION, "Number('3.e+1')", 30, Number("3.e+1") ); -new TestCase( SECTION, "Number('-3.e+1')", -30, Number("-3.e+1") ); -new TestCase( SECTION, "Number('+3.e+1')", 30, Number("+3.e+1") ); - -new TestCase( SECTION, "Number('3.e-1')", .30, Number("3.e-1") ); -new TestCase( SECTION, "Number('-3.e-1')", -.30, Number("-3.e-1") ); -new TestCase( SECTION, "Number('+3.e-1')", .30, Number("+3.e-1") ); - -// StrDecimalLiteral::: .DecimalDigits ExponentPart opt - -new TestCase( SECTION, "Number('.00001')", 0.00001, Number(".00001") ); -new TestCase( SECTION, "Number('+.00001')", 0.00001, Number("+.00001") ); -new TestCase( SECTION, "Number('-0.0001')", -0.00001, Number("-.00001") ); - -new TestCase( SECTION, "Number('.01e2')", 1, Number(".01e2") ); -new TestCase( SECTION, "Number('+.01e2')", 1, Number("+.01e2") ); -new TestCase( SECTION, "Number('-.01e2')", -1, Number("-.01e2") ); - -new TestCase( SECTION, "Number('.01e+2')", 1, Number(".01e+2") ); -new TestCase( SECTION, "Number('+.01e+2')", 1, Number("+.01e+2") ); -new TestCase( SECTION, "Number('-.01e+2')", -1, Number("-.01e+2") ); - -new TestCase( SECTION, "Number('.01e-2')", 0.0001, Number(".01e-2") ); -new TestCase( SECTION, "Number('+.01e-2')", 0.0001, Number("+.01e-2") ); -new TestCase( SECTION, "Number('-.01e-2')", -0.0001, Number("-.01e-2") ); - -// StrDecimalLiteral::: DecimalDigits ExponentPart opt - -new TestCase( SECTION, "Number('1234e5')", 123400000, Number("1234e5") ); -new TestCase( SECTION, "Number('+1234e5')", 123400000, Number("+1234e5") ); -new TestCase( SECTION, "Number('-1234e5')", -123400000, Number("-1234e5") ); - -new TestCase( SECTION, "Number('1234e+5')", 123400000, Number("1234e+5") ); -new TestCase( SECTION, "Number('+1234e+5')", 123400000, Number("+1234e+5") ); -new TestCase( SECTION, "Number('-1234e+5')", -123400000, Number("-1234e+5") ); - -new TestCase( SECTION, "Number('1234e-5')", 0.01234, Number("1234e-5") ); -new TestCase( SECTION, "Number('+1234e-5')", 0.01234, Number("+1234e-5") ); -new TestCase( SECTION, "Number('-1234e-5')", -0.01234, Number("-1234e-5") ); - -// StrNumericLiteral::: HexIntegerLiteral - -new TestCase( SECTION, "Number('0x0')", 0, Number("0x0")); -new TestCase( SECTION, "Number('0x1')", 1, Number("0x1")); -new TestCase( SECTION, "Number('0x2')", 2, Number("0x2")); -new TestCase( SECTION, "Number('0x3')", 3, Number("0x3")); -new TestCase( SECTION, "Number('0x4')", 4, Number("0x4")); -new TestCase( SECTION, "Number('0x5')", 5, Number("0x5")); -new TestCase( SECTION, "Number('0x6')", 6, Number("0x6")); -new TestCase( SECTION, "Number('0x7')", 7, Number("0x7")); -new TestCase( SECTION, "Number('0x8')", 8, Number("0x8")); -new TestCase( SECTION, "Number('0x9')", 9, Number("0x9")); -new TestCase( SECTION, "Number('0xa')", 10, Number("0xa")); -new TestCase( SECTION, "Number('0xb')", 11, Number("0xb")); -new TestCase( SECTION, "Number('0xc')", 12, Number("0xc")); -new TestCase( SECTION, "Number('0xd')", 13, Number("0xd")); -new TestCase( SECTION, "Number('0xe')", 14, Number("0xe")); -new TestCase( SECTION, "Number('0xf')", 15, Number("0xf")); -new TestCase( SECTION, "Number('0xA')", 10, Number("0xA")); -new TestCase( SECTION, "Number('0xB')", 11, Number("0xB")); -new TestCase( SECTION, "Number('0xC')", 12, Number("0xC")); -new TestCase( SECTION, "Number('0xD')", 13, Number("0xD")); -new TestCase( SECTION, "Number('0xE')", 14, Number("0xE")); -new TestCase( SECTION, "Number('0xF')", 15, Number("0xF")); - -new TestCase( SECTION, "Number('0X0')", 0, Number("0X0")); -new TestCase( SECTION, "Number('0X1')", 1, Number("0X1")); -new TestCase( SECTION, "Number('0X2')", 2, Number("0X2")); -new TestCase( SECTION, "Number('0X3')", 3, Number("0X3")); -new TestCase( SECTION, "Number('0X4')", 4, Number("0X4")); -new TestCase( SECTION, "Number('0X5')", 5, Number("0X5")); -new TestCase( SECTION, "Number('0X6')", 6, Number("0X6")); -new TestCase( SECTION, "Number('0X7')", 7, Number("0X7")); -new TestCase( SECTION, "Number('0X8')", 8, Number("0X8")); -new TestCase( SECTION, "Number('0X9')", 9, Number("0X9")); -new TestCase( SECTION, "Number('0Xa')", 10, Number("0Xa")); -new TestCase( SECTION, "Number('0Xb')", 11, Number("0Xb")); -new TestCase( SECTION, "Number('0Xc')", 12, Number("0Xc")); -new TestCase( SECTION, "Number('0Xd')", 13, Number("0Xd")); -new TestCase( SECTION, "Number('0Xe')", 14, Number("0Xe")); -new TestCase( SECTION, "Number('0Xf')", 15, Number("0Xf")); -new TestCase( SECTION, "Number('0XA')", 10, Number("0XA")); -new TestCase( SECTION, "Number('0XB')", 11, Number("0XB")); -new TestCase( SECTION, "Number('0XC')", 12, Number("0XC")); -new TestCase( SECTION, "Number('0XD')", 13, Number("0XD")); -new TestCase( SECTION, "Number('0XE')", 14, Number("0XE")); -new TestCase( SECTION, "Number('0XF')", 15, Number("0XF")); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.3.1-2.js b/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.3.1-2.js deleted file mode 100644 index 911ec84b94..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.3.1-2.js +++ /dev/null @@ -1,87 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '9.3.1-2.js'; - -/** - File Name: 9.3.1-2.js - ECMA Section: 9.3 Type Conversion: ToNumber - Description: rules for converting an argument to a number. - see 9.3.1 for cases for converting strings to numbers. - special cases: - undefined NaN - Null NaN - Boolean 1 if true; +0 if false - Number the argument ( no conversion ) - String see test 9.3.1 - Object see test 9.3-1 - - This tests special cases of ToNumber(string) that are - not covered in 9.3.1-1.js. - - Author: christine@netscape.com - Date: 10 july 1997 - -*/ -var SECTION = "9.3.1-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "ToNumber applied to the String type"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -// A StringNumericLiteral may not use octal notation - -new TestCase( SECTION, "Number(00)", 0, Number("00")); -new TestCase( SECTION, "Number(01)", 1, Number("01")); -new TestCase( SECTION, "Number(02)", 2, Number("02")); -new TestCase( SECTION, "Number(03)", 3, Number("03")); -new TestCase( SECTION, "Number(04)", 4, Number("04")); -new TestCase( SECTION, "Number(05)", 5, Number("05")); -new TestCase( SECTION, "Number(06)", 6, Number("06")); -new TestCase( SECTION, "Number(07)", 7, Number("07")); -new TestCase( SECTION, "Number(010)", 10, Number("010")); -new TestCase( SECTION, "Number(011)", 11, Number("011")); - -// A StringNumericLIteral may have any number of leading 0 digits - -new TestCase( SECTION, "Number(001)", 1, Number("001")); -new TestCase( SECTION, "Number(0001)", 1, Number("0001")); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.3.1-3.js b/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.3.1-3.js deleted file mode 100644 index dc56427395..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.3.1-3.js +++ /dev/null @@ -1,743 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '9.3.1-3.js'; - -/** - File Name: 9.3.1-3.js - ECMA Section: 9.3 Type Conversion: ToNumber - Description: rules for converting an argument to a number. - see 9.3.1 for cases for converting strings to numbers. - special cases: - undefined NaN - Null NaN - Boolean 1 if true; +0 if false - Number the argument ( no conversion ) - String see test 9.3.1 - Object see test 9.3-1 - - - Test cases provided by waldemar. - - - Author: christine@netscape.com - Date: 10 june 1998 - -*/ - -var SECTION = "9.3.1-3"; -var VERSION = "ECMA_1"; -var BUGNUMBER="129087"; - -var TITLE = "Number To String, String To Number"; - -startTest(); - -writeHeaderToLog( SECTION + " "+ TITLE); - -// test case from http://scopus.mcom.com/bugsplat/show_bug.cgi?id=312954 -var z = 0; - -new TestCase( - SECTION, - "var z = 0; print(1/-z)", - -Infinity, - 1/-z ); - - - - - -// test cases from bug http://scopus.mcom.com/bugsplat/show_bug.cgi?id=122882 - - - -new TestCase( SECTION, - '- -"0x80000000"', - 2147483648, - - -"0x80000000" ); - -new TestCase( SECTION, - '- -"0x100000000"', - 4294967296, - - -"0x100000000" ); - -new TestCase( SECTION, - '- "-0x123456789abcde8"', - 81985529216486880, - - "-0x123456789abcde8" ); - -// Convert some large numbers to string - - -new TestCase( SECTION, - "1e2000 +''", - "Infinity", - 1e2000 +"" ); - -new TestCase( SECTION, - "1e2000", - Infinity, - 1e2000 ); - -new TestCase( SECTION, - "-1e2000 +''", - "-Infinity", - -1e2000 +"" ); - -new TestCase( SECTION, - "-\"1e2000\"", - -Infinity, - -"1e2000" ); - -new TestCase( SECTION, - "-\"-1e2000\" +''", - "Infinity", - -"-1e2000" +"" ); - -new TestCase( SECTION, - "1e-2000", - 0, - 1e-2000 ); - -new TestCase( SECTION, - "1/1e-2000", - Infinity, - 1/1e-2000 ); - -// convert some strings to large numbers - -new TestCase( SECTION, - "1/-1e-2000", - -Infinity, - 1/-1e-2000 ); - -new TestCase( SECTION, - "1/\"1e-2000\"", - Infinity, - 1/"1e-2000" ); - -new TestCase( SECTION, - "1/\"-1e-2000\"", - -Infinity, - 1/"-1e-2000" ); - -new TestCase( SECTION, - "parseFloat(\"1e2000\")", - Infinity, - parseFloat("1e2000") ); - -new TestCase( SECTION, - "parseFloat(\"1e-2000\")", - 0, - parseFloat("1e-2000") ); - -new TestCase( SECTION, - "1.7976931348623157E+308", - 1.7976931348623157e+308, - 1.7976931348623157E+308 ); - -new TestCase( SECTION, - "1.7976931348623158e+308", - 1.7976931348623157e+308, - 1.7976931348623158e+308 ); - -new TestCase( SECTION, - "1.7976931348623159e+308", - Infinity, - 1.7976931348623159e+308 ); - -s = - "17976931348623158079372897140530341507993413271003782693617377898044496829276475094664901797758720709633028641669288791094655554785194040263065748867150582068"; - -print("s = " + s); -print("-s = " + (-s)); - -new TestCase( SECTION, - "s = " + s +"; s +="+ - "\"190890200070838367627385484581771153176447573027006985557136695962284291481986083493647529271907416844436551070434271155969950809304288017790417449779\""+ - - +"; s", - "17976931348623158079372897140530341507993413271003782693617377898044496829276475094664901797758720709633028641669288791094655554785194040263065748867150582068190890200070838367627385484581771153176447573027006985557136695962284291481986083493647529271907416844436551070434271155969950809304288017790417449779", - s += - "190890200070838367627385484581771153176447573027006985557136695962284291481986083493647529271907416844436551070434271155969950809304288017790417449779" - ); - -s1 = s+1; - -print("s1 = " + s1); -print("-s1 = " + (-s1)); - -new TestCase( SECTION, - "s1 = s+1; s1", - "179769313486231580793728971405303415079934132710037826936173778980444968292764750946649017977587207096330286416692887910946555547851940402630657488671505820681908902000708383676273854845817711531764475730270069855571366959622842914819860834936475292719074168444365510704342711559699508093042880177904174497791", - s1 ); - -/***** This answer is preferred but -Infinity is also acceptable here *****/ - -new TestCase( SECTION, - "-s1 == Infinity || s1 == 1.7976931348623157e+308", - true, - -s1 == Infinity || s1 == 1.7976931348623157e+308 ); - -s2 = s + 2; - -print("s2 = " + s2); -print("-s2 = " + (-s2)); - -new TestCase( SECTION, - "s2 = s+2; s2", - "179769313486231580793728971405303415079934132710037826936173778980444968292764750946649017977587207096330286416692887910946555547851940402630657488671505820681908902000708383676273854845817711531764475730270069855571366959622842914819860834936475292719074168444365510704342711559699508093042880177904174497792", - s2 ); - -// ***** This answer is preferred but -1.7976931348623157e+308 is also acceptable here ***** -new TestCase( SECTION, - "-s2 == -Infinity || -s2 == -1.7976931348623157e+308 ", - true, - -s2 == -Infinity || -s2 == -1.7976931348623157e+308 ); - -s3 = s+3; - -print("s3 = " + s3); -print("-s3 = " + (-s3)); - -new TestCase( SECTION, - "s3 = s+3; s3", - "179769313486231580793728971405303415079934132710037826936173778980444968292764750946649017977587207096330286416692887910946555547851940402630657488671505820681908902000708383676273854845817711531764475730270069855571366959622842914819860834936475292719074168444365510704342711559699508093042880177904174497793", - s3 ); - -//***** This answer is preferred but -1.7976931348623157e+308 is also acceptable here ***** - -new TestCase( SECTION, - "-s3 == -Infinity || -s3 == -1.7976931348623157e+308", - true, - -s3 == -Infinity || -s3 == -1.7976931348623157e+308 ); - - -//***** This answer is preferred but Infinity is also acceptable here ***** - -new TestCase( SECTION, - "parseInt(s1,10) == 1.7976931348623157e+308 || parseInt(s1,10) == Infinity", - true, - parseInt(s1,10) == 1.7976931348623157e+308 || parseInt(s1,10) == Infinity ); - -//***** This answer is preferred but 1.7976931348623157e+308 is also acceptable here ***** -new TestCase( SECTION, - "parseInt(s2,10) == Infinity || parseInt(s2,10) == 1.7976931348623157e+308", - true , - parseInt(s2,10) == Infinity || parseInt(s2,10) == 1.7976931348623157e+308 ); - -//***** This answer is preferred but Infinity is also acceptable here ***** - -new TestCase( SECTION, - "parseInt(s1) == 1.7976931348623157e+308 || parseInt(s1) == Infinity", - true, - parseInt(s1) == 1.7976931348623157e+308 || parseInt(s1) == Infinity); - -//***** This answer is preferred but 1.7976931348623157e+308 is also acceptable here ***** -new TestCase( SECTION, - "parseInt(s2) == Infinity || parseInt(s2) == 1.7976931348623157e+308", - true, - parseInt(s2) == Infinity || parseInt(s2) == 1.7976931348623157e+308 ); - -new TestCase( SECTION, - "0x12345678", - 305419896, - 0x12345678 ); - -new TestCase( SECTION, - "0x80000000", - 2147483648, - 0x80000000 ); - -new TestCase( SECTION, - "0xffffffff", - 4294967295, - 0xffffffff ); - -new TestCase( SECTION, - "0x100000000", - 4294967296, - 0x100000000 ); - -new TestCase( SECTION, - "077777777777777777", - 2251799813685247, - 077777777777777777 ); - -new TestCase( SECTION, - "077777777777777776", - 2251799813685246, - 077777777777777776 ); - -new TestCase( SECTION, - "0x1fffffffffffff", - 9007199254740991, - 0x1fffffffffffff ); - -new TestCase( SECTION, - "0x20000000000000", - 9007199254740992, - 0x20000000000000 ); - -new TestCase( SECTION, - "0x20123456789abc", - 9027215253084860, - 0x20123456789abc ); - -new TestCase( SECTION, - "0x20123456789abd", - 9027215253084860, - 0x20123456789abd ); - -new TestCase( SECTION, - "0x20123456789abe", - 9027215253084862, - 0x20123456789abe ); - -new TestCase( SECTION, - "0x20123456789abf", - 9027215253084864, - 0x20123456789abf ); - -/***** These test the round-to-nearest-or-even-if-equally-close rule *****/ - -new TestCase( SECTION, - "0x1000000000000080", - 1152921504606847000, - 0x1000000000000080 ); - -new TestCase( SECTION, - "0x1000000000000081", - 1152921504606847200, - 0x1000000000000081 ); - -new TestCase( SECTION, - "0x1000000000000100", - 1152921504606847200, - 0x1000000000000100 ); -new TestCase( SECTION, - "0x100000000000017f", - 1152921504606847200, - 0x100000000000017f ); - -new TestCase( SECTION, - "0x1000000000000180", - 1152921504606847500, - 0x1000000000000180 ); - -new TestCase( SECTION, - "0x1000000000000181", - 1152921504606847500, - 0x1000000000000181 ); - -new TestCase( SECTION, - "0x10000000000001f0", - 1152921504606847500, - 0x10000000000001f0 ); - -new TestCase( SECTION, - "0x1000000000000200", - 1152921504606847500, - 0x1000000000000200 ); - -new TestCase( SECTION, - "0x100000000000027f", - 1152921504606847500, - 0x100000000000027f ); - -new TestCase( SECTION, - "0x1000000000000280", - 1152921504606847500, - 0x1000000000000280 ); - -new TestCase( SECTION, - "0x1000000000000281", - 1152921504606847700, - 0x1000000000000281 ); - -new TestCase( SECTION, - "0x10000000000002ff", - 1152921504606847700, - 0x10000000000002ff ); - -new TestCase( SECTION, - "0x1000000000000300", - 1152921504606847700, - 0x1000000000000300 ); - -new TestCase( SECTION, - "0x10000000000000000", - 18446744073709552000, - 0x10000000000000000 ); - -new TestCase( SECTION, - "parseInt(\"000000100000000100100011010001010110011110001001101010111100\",2)", - 9027215253084860, - parseInt("000000100000000100100011010001010110011110001001101010111100",2) ); - -new TestCase( SECTION, - "parseInt(\"000000100000000100100011010001010110011110001001101010111101\",2)", - 9027215253084860, - parseInt("000000100000000100100011010001010110011110001001101010111101",2) ); - -new TestCase( SECTION, - "parseInt(\"000000100000000100100011010001010110011110001001101010111111\",2)", - 9027215253084864, - parseInt("000000100000000100100011010001010110011110001001101010111111",2) ); - -new TestCase( SECTION, - "parseInt(\"0000001000000001001000110100010101100111100010011010101111010\",2)", - 18054430506169720, - parseInt("0000001000000001001000110100010101100111100010011010101111010",2)); - -new TestCase( SECTION, - "parseInt(\"0000001000000001001000110100010101100111100010011010101111011\",2)", - 18054430506169724, - parseInt("0000001000000001001000110100010101100111100010011010101111011",2) ); - -new TestCase( SECTION, - "parseInt(\"0000001000000001001000110100010101100111100010011010101111100\",2)", - 18054430506169724, - parseInt("0000001000000001001000110100010101100111100010011010101111100",2)); - -new TestCase( SECTION, - "parseInt(\"0000001000000001001000110100010101100111100010011010101111110\",2)", - 18054430506169728, - parseInt("0000001000000001001000110100010101100111100010011010101111110",2)); - -new TestCase( SECTION, - "parseInt(\"yz\",35)", - 34, - parseInt("yz",35) ); - -new TestCase( SECTION, - "parseInt(\"yz\",36)", - 1259, - parseInt("yz",36) ); - -new TestCase( SECTION, - "parseInt(\"yz\",37)", - NaN, - parseInt("yz",37) ); - -new TestCase( SECTION, - "parseInt(\"+77\")", - 77, - parseInt("+77") ); - -new TestCase( SECTION, - "parseInt(\"-77\",9)", - -70, - parseInt("-77",9) ); - -new TestCase( SECTION, - "parseInt(\"\\u20001234\\u2000\")", - 1234, - parseInt("\u20001234\u2000") ); - -new TestCase( SECTION, - "parseInt(\"123456789012345678\")", - 123456789012345680, - parseInt("123456789012345678") ); - -new TestCase( SECTION, - "parseInt(\"9\",8)", - NaN, - parseInt("9",8) ); - -new TestCase( SECTION, - "parseInt(\"1e2\")", - 1, - parseInt("1e2") ); - -new TestCase( SECTION, - "parseInt(\"1.9999999999999999999\")", - 1, - parseInt("1.9999999999999999999") ); - -new TestCase( SECTION, - "parseInt(\"0x10\")", - 16, - parseInt("0x10") ); - -new TestCase( SECTION, - "parseInt(\"0x10\",10)", - 0, - parseInt("0x10",10) ); - -new TestCase( SECTION, - "parseInt(\"0022\")", - 18, - parseInt("0022") ); - -new TestCase( SECTION, - "parseInt(\"0022\",10)", - 22, - parseInt("0022",10) ); - -new TestCase( SECTION, - "parseInt(\"0x1000000000000080\")", - 1152921504606847000, - parseInt("0x1000000000000080") ); - -new TestCase( SECTION, - "parseInt(\"0x1000000000000081\")", - 1152921504606847200, - parseInt("0x1000000000000081") ); - -s = - "0xFFFFFFFFFFFFF80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; - -new TestCase( SECTION, "s = "+ - "\"0xFFFFFFFFFFFFF80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\";"+ - "s", - "0xFFFFFFFFFFFFF80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - s ); - - -new TestCase( SECTION, "s +="+ - "\"0000000000000000000000000000000000000\"; s", - "0xFFFFFFFFFFFFF800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - s += "0000000000000000000000000000000000000" ); - -new TestCase( SECTION, "-s", - -1.7976931348623157e+308, - -s ); - -s = - "0xFFFFFFFFFFFFF80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; - -new TestCase( SECTION, "s ="+ - "\"0xFFFFFFFFFFFFF80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\";"+ - "s", - "0xFFFFFFFFFFFFF80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - s ); - -new TestCase( SECTION, - "s += \"0000000000000000000000000000000000001\"", - "0xFFFFFFFFFFFFF800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", - s += "0000000000000000000000000000000000001" ); - -new TestCase( SECTION, - "-s", - -1.7976931348623157e+308, - -s ); - -s = - "0xFFFFFFFFFFFFFC0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; - -new TestCase( SECTION, - "s ="+ - "\"0xFFFFFFFFFFFFFC0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\";"+ - "s", - "0xFFFFFFFFFFFFFC0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - s ); - - -new TestCase( SECTION, - "s += \"0000000000000000000000000000000000000\"", - "0xFFFFFFFFFFFFFC00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - s += "0000000000000000000000000000000000000"); - - -new TestCase( SECTION, - "-s", - -Infinity, - -s ); - -s = - "0xFFFFFFFFFFFFFB0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; - -new TestCase( SECTION, - "s = "+ - "\"0xFFFFFFFFFFFFFB0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\";s", - "0xFFFFFFFFFFFFFB0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - s); - -new TestCase( SECTION, - "s += \"0000000000000000000000000000000000001\"", - "0xFFFFFFFFFFFFFB00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", - s += "0000000000000000000000000000000000001" ); - -new TestCase( SECTION, - "-s", - -1.7976931348623157e+308, - -s ); - -new TestCase( SECTION, - "s += \"0\"", - "0xFFFFFFFFFFFFFB000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010", - s += "0" ); - -new TestCase( SECTION, - "-s", - -Infinity, - -s ); - -new TestCase( SECTION, - "parseInt(s)", - Infinity, - parseInt(s) ); - -new TestCase( SECTION, - "parseInt(s,32)", - 0, - parseInt(s,32) ); - -new TestCase( SECTION, - "parseInt(s,36)", - Infinity, - parseInt(s,36) ); - -new TestCase( SECTION, - "-\"\"", - 0, - -"" ); - -new TestCase( SECTION, - "-\" \"", - 0, - -" " ); - -new TestCase( SECTION, - "-\"999\"", - -999, - -"999" ); - -new TestCase( SECTION, - "-\" 999\"", - -999, - -" 999" ); - -new TestCase( SECTION, - "-\"\\t999\"", - -999, - -"\t999" ); - -new TestCase( SECTION, - "-\"013 \"", - -13, - -"013 " ); - -new TestCase( SECTION, - "-\"999\\t\"", - -999, - -"999\t" ); - -new TestCase( SECTION, - "-\"-Infinity\"", - Infinity, - -"-Infinity" ); - -new TestCase( SECTION, - "-\"-infinity\"", - NaN, - -"-infinity" ); - - -new TestCase( SECTION, - "-\"+Infinity\"", - -Infinity, - -"+Infinity" ); - -new TestCase( SECTION, - "-\"+Infiniti\"", - NaN, - -"+Infiniti" ); - -new TestCase( SECTION, - "- -\"0x80000000\"", - 2147483648, - - -"0x80000000" ); - -new TestCase( SECTION, - "- -\"0x100000000\"", - 4294967296, - - -"0x100000000" ); - -new TestCase( SECTION, - "- \"-0x123456789abcde8\"", - 81985529216486880, - - "-0x123456789abcde8" ); - -// the following two tests are not strictly ECMA 1.0 - -new TestCase( SECTION, - "-\"\\u20001234\\u2001\"", - -1234, - -"\u20001234\u2001" ); - -new TestCase( SECTION, - "-\"\\u20001234\\0\"", - NaN, - -"\u20001234\0" ); - -new TestCase( SECTION, - "-\"0x10\"", - -16, - -"0x10" ); - -new TestCase( SECTION, - "-\"+\"", - NaN, - -"+" ); - -new TestCase( SECTION, - "-\"-\"", - NaN, - -"-" ); - -new TestCase( SECTION, - "-\"-0-\"", - NaN, - -"-0-" ); - -new TestCase( SECTION, - "-\"1e-\"", - NaN, - -"1e-" ); - -new TestCase( SECTION, - "-\"1e-1\"", - -0.1, - -"1e-1" ); - -test(); - - diff --git a/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.3.js b/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.3.js deleted file mode 100644 index c4b866e7f3..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.3.js +++ /dev/null @@ -1,87 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '9.3.js'; - -/** - File Name: 9.3.js - ECMA Section: 9.3 Type Conversion: ToNumber - Description: rules for converting an argument to a number. - see 9.3.1 for cases for converting strings to numbers. - special cases: - undefined NaN - Null NaN - Boolean 1 if true; +0 if false - Number the argument ( no conversion ) - String see test 9.3.1 - Object see test 9.3-1 - - For ToNumber applied to the String type, see test 9.3.1. - For ToNumber applied to the object type, see test 9.3-1. - - Author: christine@netscape.com - Date: 10 july 1997 - -*/ -var SECTION = "9.3"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "ToNumber"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -// special cases here - -new TestCase( SECTION, "Number()", 0, Number() ); -new TestCase( SECTION, "Number(eval('var x'))", Number.NaN, Number(eval("var x")) ); -new TestCase( SECTION, "Number(void 0)", Number.NaN, Number(void 0) ); -new TestCase( SECTION, "Number(null)", 0, Number(null) ); -new TestCase( SECTION, "Number(true)", 1, Number(true) ); -new TestCase( SECTION, "Number(false)", 0, Number(false) ); -new TestCase( SECTION, "Number(0)", 0, Number(0) ); -new TestCase( SECTION, "Number(-0)", -0, Number(-0) ); -new TestCase( SECTION, "Number(1)", 1, Number(1) ); -new TestCase( SECTION, "Number(-1)", -1, Number(-1) ); -new TestCase( SECTION, "Number(Number.MAX_VALUE)", 1.7976931348623157e308, Number(Number.MAX_VALUE) ); -new TestCase( SECTION, "Number(Number.MIN_VALUE)", 5e-324, Number(Number.MIN_VALUE) ); - -new TestCase( SECTION, "Number(Number.NaN)", Number.NaN, Number(Number.NaN) ); -new TestCase( SECTION, "Number(Number.POSITIVE_INFINITY)", Number.POSITIVE_INFINITY, Number(Number.POSITIVE_INFINITY) ); -new TestCase( SECTION, "Number(Number.NEGATIVE_INFINITY)", Number.NEGATIVE_INFINITY, Number(Number.NEGATIVE_INFINITY) ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.4-1.js b/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.4-1.js deleted file mode 100644 index e99875697a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.4-1.js +++ /dev/null @@ -1,112 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '9.4-1.js'; - -/** - File Name: 9.4-1.js - ECMA Section: 9.4 ToInteger - Description: 1. Call ToNumber on the input argument - 2. If Result(1) is NaN, return +0 - 3. If Result(1) is +0, -0, Infinity, or -Infinity, - return Result(1). - 4. Compute sign(Result(1)) * floor(abs(Result(1))). - 5. Return Result(4). - - To test ToInteger, this test uses new Date(value), - 15.9.3.7. The Date constructor sets the [[Value]] - property of the new object to TimeClip(value), which - uses the rules: - - TimeClip(time) - 1. If time is not finite, return NaN - 2. If abs(Result(1)) > 8.64e15, return NaN - 3. Return an implementation dependent choice of either - ToInteger(Result(2)) or ToInteger(Result(2)) + (+0) - (Adding a positive 0 converts -0 to +0). - - This tests ToInteger for values -8.64e15 > value > 8.64e15, - not including -0 and +0. - - For additional special cases (0, +0, Infinity, -Infinity, - and NaN, see 9.4-2.js). For value is String, see 9.4-3.js. - - Author: christine@netscape.com - Date: 10 july 1997 - -*/ -var SECTION = "9.4-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "ToInteger"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -// some special cases - -new TestCase( SECTION, "td = new Date(Number.NaN); td.valueOf()", Number.NaN, eval("td = new Date(Number.NaN); td.valueOf()") ); -new TestCase( SECTION, "td = new Date(Infinity); td.valueOf()", Number.NaN, eval("td = new Date(Number.POSITIVE_INFINITY); td.valueOf()") ); -new TestCase( SECTION, "td = new Date(-Infinity); td.valueOf()", Number.NaN, eval("td = new Date(Number.NEGATIVE_INFINITY); td.valueOf()") ); -new TestCase( SECTION, "td = new Date(-0); td.valueOf()", -0, eval("td = new Date(-0); td.valueOf()" ) ); -new TestCase( SECTION, "td = new Date(0); td.valueOf()", 0, eval("td = new Date(0); td.valueOf()") ); - -// value is not an integer - -new TestCase( SECTION, "td = new Date(3.14159); td.valueOf()", 3, eval("td = new Date(3.14159); td.valueOf()") ); -new TestCase( SECTION, "td = new Date(Math.PI); td.valueOf()", 3, eval("td = new Date(Math.PI); td.valueOf()") ); -new TestCase( SECTION, "td = new Date(-Math.PI);td.valueOf()", -3, eval("td = new Date(-Math.PI);td.valueOf()") ); -new TestCase( SECTION, "td = new Date(3.14159e2); td.valueOf()", 314, eval("td = new Date(3.14159e2); td.valueOf()") ); - -new TestCase( SECTION, "td = new Date(.692147e1); td.valueOf()", 6, eval("td = new Date(.692147e1);td.valueOf()") ); -new TestCase( SECTION, "td = new Date(-.692147e1);td.valueOf()", -6, eval("td = new Date(-.692147e1);td.valueOf()") ); - -// value is not a number - -new TestCase( SECTION, "td = new Date(true); td.valueOf()", 1, eval("td = new Date(true); td.valueOf()" ) ); -new TestCase( SECTION, "td = new Date(false); td.valueOf()", 0, eval("td = new Date(false); td.valueOf()") ); - -new TestCase( SECTION, "td = new Date(new Number(Math.PI)); td.valueOf()", 3, eval("td = new Date(new Number(Math.PI)); td.valueOf()") ); -new TestCase( SECTION, "td = new Date(new Number(Math.PI)); td.valueOf()", 3, eval("td = new Date(new Number(Math.PI)); td.valueOf()") ); - -// edge cases -new TestCase( SECTION, "td = new Date(8.64e15); td.valueOf()", 8.64e15, eval("td = new Date(8.64e15); td.valueOf()") ); -new TestCase( SECTION, "td = new Date(-8.64e15); td.valueOf()", -8.64e15, eval("td = new Date(-8.64e15); td.valueOf()") ); -new TestCase( SECTION, "td = new Date(8.64e-15); td.valueOf()", 0, eval("td = new Date(8.64e-15); td.valueOf()") ); -new TestCase( SECTION, "td = new Date(-8.64e-15); td.valueOf()", 0, eval("td = new Date(-8.64e-15); td.valueOf()") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.4-2.js b/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.4-2.js deleted file mode 100644 index 9b26a67fac..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.4-2.js +++ /dev/null @@ -1,112 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '9.4-2.js'; - -/** - File Name: 9.4-1.js - ECMA Section: 9.4 ToInteger - Description: 1. Call ToNumber on the input argument - 2. If Result(1) is NaN, return +0 - 3. If Result(1) is +0, -0, Infinity, or -Infinity, - return Result(1). - 4. Compute sign(Result(1)) * floor(abs(Result(1))). - 5. Return Result(4). - - To test ToInteger, this test uses new Date(value), - 15.9.3.7. The Date constructor sets the [[Value]] - property of the new object to TimeClip(value), which - uses the rules: - - TimeClip(time) - 1. If time is not finite, return NaN - 2. If abs(Result(1)) > 8.64e15, return NaN - 3. Return an implementation dependent choice of either - ToInteger(Result(2)) or ToInteger(Result(2)) + (+0) - (Adding a positive 0 converts -0 to +0). - - This tests ToInteger for values -8.64e15 > value > 8.64e15, - not including -0 and +0. - - For additional special cases (0, +0, Infinity, -Infinity, - and NaN, see 9.4-2.js). For value is String, see 9.4-3.js. - - Author: christine@netscape.com - Date: 10 july 1997 - -*/ -var SECTION = "9.4-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "ToInteger"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -// some special cases - -new TestCase( SECTION, "td = new Date(Number.NaN); td.valueOf()", Number.NaN, eval("td = new Date(Number.NaN); td.valueOf()") ); -new TestCase( SECTION, "td = new Date(Infinity); td.valueOf()", Number.NaN, eval("td = new Date(Number.POSITIVE_INFINITY); td.valueOf()") ); -new TestCase( SECTION, "td = new Date(-Infinity); td.valueOf()", Number.NaN, eval("td = new Date(Number.NEGATIVE_INFINITY); td.valueOf()") ); -new TestCase( SECTION, "td = new Date(-0); td.valueOf()", -0, eval("td = new Date(-0); td.valueOf()" ) ); -new TestCase( SECTION, "td = new Date(0); td.valueOf()", 0, eval("td = new Date(0); td.valueOf()") ); - -// value is not an integer - -new TestCase( SECTION, "td = new Date(3.14159); td.valueOf()", 3, eval("td = new Date(3.14159); td.valueOf()") ); -new TestCase( SECTION, "td = new Date(Math.PI); td.valueOf()", 3, eval("td = new Date(Math.PI); td.valueOf()") ); -new TestCase( SECTION, "td = new Date(-Math.PI);td.valueOf()", -3, eval("td = new Date(-Math.PI);td.valueOf()") ); -new TestCase( SECTION, "td = new Date(3.14159e2); td.valueOf()", 314, eval("td = new Date(3.14159e2); td.valueOf()") ); - -new TestCase( SECTION, "td = new Date(.692147e1); td.valueOf()", 6, eval("td = new Date(.692147e1);td.valueOf()") ); -new TestCase( SECTION, "td = new Date(-.692147e1);td.valueOf()", -6, eval("td = new Date(-.692147e1);td.valueOf()") ); - -// value is not a number - -new TestCase( SECTION, "td = new Date(true); td.valueOf()", 1, eval("td = new Date(true); td.valueOf()" ) ); -new TestCase( SECTION, "td = new Date(false); td.valueOf()", 0, eval("td = new Date(false); td.valueOf()") ); - -new TestCase( SECTION, "td = new Date(new Number(Math.PI)); td.valueOf()", 3, eval("td = new Date(new Number(Math.PI)); td.valueOf()") ); -new TestCase( SECTION, "td = new Date(new Number(Math.PI)); td.valueOf()", 3, eval("td = new Date(new Number(Math.PI)); td.valueOf()") ); - -// edge cases -new TestCase( SECTION, "td = new Date(8.64e15); td.valueOf()", 8.64e15, eval("td = new Date(8.64e15); td.valueOf()") ); -new TestCase( SECTION, "td = new Date(-8.64e15); td.valueOf()", -8.64e15, eval("td = new Date(-8.64e15); td.valueOf()") ); -new TestCase( SECTION, "td = new Date(8.64e-15); td.valueOf()", 0, eval("td = new Date(8.64e-15); td.valueOf()") ); -new TestCase( SECTION, "td = new Date(-8.64e-15); td.valueOf()", 0, eval("td = new Date(-8.64e-15); td.valueOf()") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.5-2.js b/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.5-2.js deleted file mode 100644 index 2773052340..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.5-2.js +++ /dev/null @@ -1,173 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '9.5-2.js'; - -/** - File Name: 9.5-2.js - ECMA Section: 9.5 Type Conversion: ToInt32 - Description: rules for converting an argument to a signed 32 bit integer - - this test uses << 0 to convert the argument to a 32bit - integer. - - The operator ToInt32 converts its argument to one of 2^32 - integer values in the range -2^31 through 2^31 inclusive. - This operator functions as follows: - - 1 call ToNumber on argument - 2 if result is NaN, 0, -0, return 0 - 3 compute (sign (result(1)) * floor(abs(result 1))) - 4 compute result(3) modulo 2^32: - 5 if result(4) is greater than or equal to 2^31, return - result(5)-2^32. otherwise, return result(5) - - special cases: - -0 returns 0 - Infinity returns 0 - -Infinity returns 0 - ToInt32(ToUint32(x)) == ToInt32(x) for all values of x - Numbers greater than 2^31 (see step 5 above) - (note http://bugzilla.mozilla.org/show_bug.cgi?id=120083) - - Author: christine@netscape.com - Date: 17 july 1997 -*/ -var SECTION = "9.5-2"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " ToInt32"); - -new TestCase( SECTION, "0 << 0", 0, 0 << 0 ); -new TestCase( SECTION, "-0 << 0", 0, -0 << 0 ); -new TestCase( SECTION, "Infinity << 0", 0, "Infinity" << 0 ); -new TestCase( SECTION, "-Infinity << 0", 0, "-Infinity" << 0 ); -new TestCase( SECTION, "Number.POSITIVE_INFINITY << 0", 0, Number.POSITIVE_INFINITY << 0 ); -new TestCase( SECTION, "Number.NEGATIVE_INFINITY << 0", 0, Number.NEGATIVE_INFINITY << 0 ); -new TestCase( SECTION, "Number.NaN << 0", 0, Number.NaN << 0 ); - -new TestCase( SECTION, "Number.MIN_VALUE << 0", 0, Number.MIN_VALUE << 0 ); -new TestCase( SECTION, "-Number.MIN_VALUE << 0", 0, -Number.MIN_VALUE << 0 ); -new TestCase( SECTION, "0.1 << 0", 0, 0.1 << 0 ); -new TestCase( SECTION, "-0.1 << 0", 0, -0.1 << 0 ); -new TestCase( SECTION, "1 << 0", 1, 1 << 0 ); -new TestCase( SECTION, "1.1 << 0", 1, 1.1 << 0 ); -new TestCase( SECTION, "-1 << 0", ToInt32(-1), -1 << 0 ); - - -new TestCase( SECTION, "2147483647 << 0", ToInt32(2147483647), 2147483647 << 0 ); -new TestCase( SECTION, "2147483648 << 0", ToInt32(2147483648), 2147483648 << 0 ); -new TestCase( SECTION, "2147483649 << 0", ToInt32(2147483649), 2147483649 << 0 ); - -new TestCase( SECTION, "(Math.pow(2,31)-1) << 0", ToInt32(2147483647), (Math.pow(2,31)-1) << 0 ); -new TestCase( SECTION, "Math.pow(2,31) << 0", ToInt32(2147483648), Math.pow(2,31) << 0 ); -new TestCase( SECTION, "(Math.pow(2,31)+1) << 0", ToInt32(2147483649), (Math.pow(2,31)+1) << 0 ); - -new TestCase( SECTION, "(Math.pow(2,32)-1) << 0", ToInt32(4294967295), (Math.pow(2,32)-1) << 0 ); -new TestCase( SECTION, "(Math.pow(2,32)) << 0", ToInt32(4294967296), (Math.pow(2,32)) << 0 ); -new TestCase( SECTION, "(Math.pow(2,32)+1) << 0", ToInt32(4294967297), (Math.pow(2,32)+1) << 0 ); - -new TestCase( SECTION, "4294967295 << 0", ToInt32(4294967295), 4294967295 << 0 ); -new TestCase( SECTION, "4294967296 << 0", ToInt32(4294967296), 4294967296 << 0 ); -new TestCase( SECTION, "4294967297 << 0", ToInt32(4294967297), 4294967297 << 0 ); - -new TestCase( SECTION, "'2147483647' << 0", ToInt32(2147483647), '2147483647' << 0 ); -new TestCase( SECTION, "'2147483648' << 0", ToInt32(2147483648), '2147483648' << 0 ); -new TestCase( SECTION, "'2147483649' << 0", ToInt32(2147483649), '2147483649' << 0 ); - -new TestCase( SECTION, "'4294967295' << 0", ToInt32(4294967295), '4294967295' << 0 ); -new TestCase( SECTION, "'4294967296' << 0", ToInt32(4294967296), '4294967296' << 0 ); -new TestCase( SECTION, "'4294967297' << 0", ToInt32(4294967297), '4294967297' << 0 ); - -new TestCase( SECTION, "-2147483647 << 0", ToInt32(-2147483647), -2147483647 << 0 ); -new TestCase( SECTION, "-2147483648 << 0", ToInt32(-2147483648), -2147483648 << 0 ); -new TestCase( SECTION, "-2147483649 << 0", ToInt32(-2147483649), -2147483649 << 0 ); - -new TestCase( SECTION, "-4294967295 << 0", ToInt32(-4294967295), -4294967295 << 0 ); -new TestCase( SECTION, "-4294967296 << 0", ToInt32(-4294967296), -4294967296 << 0 ); -new TestCase( SECTION, "-4294967297 << 0", ToInt32(-4294967297), -4294967297 << 0 ); - -/* - * Numbers between 2^31 and 2^32 will have a negative ToInt32 per ECMA (see step 5 of introduction) - * (These are by stevechapel@earthlink.net; cf. http://bugzilla.mozilla.org/show_bug.cgi?id=120083) - */ -new TestCase( SECTION, "2147483648.25 << 0", ToInt32(2147483648.25), 2147483648.25 << 0 ); -new TestCase( SECTION, "2147483648.5 << 0", ToInt32(2147483648.5), 2147483648.5 << 0 ); -new TestCase( SECTION, "2147483648.75 << 0", ToInt32(2147483648.75), 2147483648.75 << 0 ); -new TestCase( SECTION, "4294967295.25 << 0", ToInt32(4294967295.25), 4294967295.25 << 0 ); -new TestCase( SECTION, "4294967295.5 << 0", ToInt32(4294967295.5), 4294967295.5 << 0 ); -new TestCase( SECTION, "4294967295.75 << 0", ToInt32(4294967295.75), 4294967295.75 << 0 ); -new TestCase( SECTION, "3000000000.25 << 0", ToInt32(3000000000.25), 3000000000.25 << 0 ); -new TestCase( SECTION, "3000000000.5 << 0", ToInt32(3000000000.5), 3000000000.5 << 0 ); -new TestCase( SECTION, "3000000000.75 << 0", ToInt32(3000000000.75), 3000000000.75 << 0 ); - -/* - * Numbers between - 2^31 and - 2^32 - */ -new TestCase( SECTION, "-2147483648.25 << 0", ToInt32(-2147483648.25), -2147483648.25 << 0 ); -new TestCase( SECTION, "-2147483648.5 << 0", ToInt32(-2147483648.5), -2147483648.5 << 0 ); -new TestCase( SECTION, "-2147483648.75 << 0", ToInt32(-2147483648.75), -2147483648.75 << 0 ); -new TestCase( SECTION, "-4294967295.25 << 0", ToInt32(-4294967295.25), -4294967295.25 << 0 ); -new TestCase( SECTION, "-4294967295.5 << 0", ToInt32(-4294967295.5), -4294967295.5 << 0 ); -new TestCase( SECTION, "-4294967295.75 << 0", ToInt32(-4294967295.75), -4294967295.75 << 0 ); -new TestCase( SECTION, "-3000000000.25 << 0", ToInt32(-3000000000.25), -3000000000.25 << 0 ); -new TestCase( SECTION, "-3000000000.5 << 0", ToInt32(-3000000000.5), -3000000000.5 << 0 ); -new TestCase( SECTION, "-3000000000.75 << 0", ToInt32(-3000000000.75), -3000000000.75 << 0 ); - - -test(); - -function ToInt32( 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) )) % Math.pow(2,32); - if ( sign == -1 ) { - n = ( n < -Math.pow(2,31) ) ? n + Math.pow(2,32) : n; - } else{ - n = ( n >= Math.pow(2,31) ) ? n - Math.pow(2,32) : n; - } - - return ( n ); -} - diff --git a/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.6.js b/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.6.js deleted file mode 100644 index 3d958b3f9d..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.6.js +++ /dev/null @@ -1,140 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '9.6.js'; - -/** - File Name: 9.6.js - ECMA Section: 9.6 Type Conversion: ToUint32 - Description: rules for converting an argument to an unsigned - 32 bit integer - - this test uses >>> 0 to convert the argument to - an unsigned 32bit integer. - - 1 call ToNumber on argument - 2 if result is NaN, 0, -0, Infinity, -Infinity - return 0 - 3 compute (sign (result(1)) * floor(abs(result 1))) - 4 compute result(3) modulo 2^32: - 5 return result(4) - - special cases: - -0 returns 0 - Infinity returns 0 - -Infinity returns 0 - 0 returns 0 - ToInt32(ToUint32(x)) == ToInt32(x) for all values of x - ** NEED TO DO THIS PART IN A SEPARATE TEST FILE ** - - - Author: christine@netscape.com - Date: 17 july 1997 -*/ - -var SECTION = "9.6"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Type Conversion: ToUint32"); - -new TestCase( SECTION, "0 >>> 0", 0, 0 >>> 0 ); -// new TestCase( SECTION, "+0 >>> 0", 0, +0 >>> 0); -new TestCase( SECTION, "-0 >>> 0", 0, -0 >>> 0 ); -new TestCase( SECTION, "'Infinity' >>> 0", 0, "Infinity" >>> 0 ); -new TestCase( SECTION, "'-Infinity' >>> 0", 0, "-Infinity" >>> 0); -new TestCase( SECTION, "'+Infinity' >>> 0", 0, "+Infinity" >>> 0 ); -new TestCase( SECTION, "Number.POSITIVE_INFINITY >>> 0", 0, Number.POSITIVE_INFINITY >>> 0 ); -new TestCase( SECTION, "Number.NEGATIVE_INFINITY >>> 0", 0, Number.NEGATIVE_INFINITY >>> 0 ); -new TestCase( SECTION, "Number.NaN >>> 0", 0, Number.NaN >>> 0 ); - -new TestCase( SECTION, "Number.MIN_VALUE >>> 0", 0, Number.MIN_VALUE >>> 0 ); -new TestCase( SECTION, "-Number.MIN_VALUE >>> 0", 0, Number.MIN_VALUE >>> 0 ); -new TestCase( SECTION, "0.1 >>> 0", 0, 0.1 >>> 0 ); -new TestCase( SECTION, "-0.1 >>> 0", 0, -0.1 >>> 0 ); -new TestCase( SECTION, "1 >>> 0", 1, 1 >>> 0 ); -new TestCase( SECTION, "1.1 >>> 0", 1, 1.1 >>> 0 ); - -new TestCase( SECTION, "-1.1 >>> 0", ToUint32(-1.1), -1.1 >>> 0 ); -new TestCase( SECTION, "-1 >>> 0", ToUint32(-1), -1 >>> 0 ); - -new TestCase( SECTION, "2147483647 >>> 0", ToUint32(2147483647), 2147483647 >>> 0 ); -new TestCase( SECTION, "2147483648 >>> 0", ToUint32(2147483648), 2147483648 >>> 0 ); -new TestCase( SECTION, "2147483649 >>> 0", ToUint32(2147483649), 2147483649 >>> 0 ); - -new TestCase( SECTION, "4294967295 >>> 0", ToUint32(4294967295), 4294967295 >>> 0 ); -new TestCase( SECTION, "4294967296 >>> 0", ToUint32(4294967296), 4294967296 >>> 0 ); -new TestCase( SECTION, "4294967297 >>> 0", ToUint32(4294967297), 4294967297 >>> 0 ); - -new TestCase( SECTION, "-2147483647 >>> 0", ToUint32(-2147483647), -2147483647 >>> 0 ); -new TestCase( SECTION, "-2147483648 >>> 0", ToUint32(-2147483648), -2147483648 >>> 0 ); -new TestCase( SECTION, "-2147483649 >>> 0", ToUint32(-2147483649), -2147483649 >>> 0 ); - -new TestCase( SECTION, "-4294967295 >>> 0", ToUint32(-4294967295), -4294967295 >>> 0 ); -new TestCase( SECTION, "-4294967296 >>> 0", ToUint32(-4294967296), -4294967296 >>> 0 ); -new TestCase( SECTION, "-4294967297 >>> 0", ToUint32(-4294967297), -4294967297 >>> 0 ); - -new TestCase( SECTION, "'2147483647' >>> 0", ToUint32(2147483647), '2147483647' >>> 0 ); -new TestCase( SECTION, "'2147483648' >>> 0", ToUint32(2147483648), '2147483648' >>> 0 ); -new TestCase( SECTION, "'2147483649' >>> 0", ToUint32(2147483649), '2147483649' >>> 0 ); - -new TestCase( SECTION, "'4294967295' >>> 0", ToUint32(4294967295), '4294967295' >>> 0 ); -new TestCase( SECTION, "'4294967296' >>> 0", ToUint32(4294967296), '4294967296' >>> 0 ); -new TestCase( SECTION, "'4294967297' >>> 0", ToUint32(4294967297), '4294967297' >>> 0 ); - - -test(); - -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 ); -} - diff --git a/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.7.js b/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.7.js deleted file mode 100644 index 34e4857fd7..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.7.js +++ /dev/null @@ -1,160 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '9.7.js'; - -/** - File Name: 9.7.js - ECMA Section: 9.7 Type Conversion: ToInt16 - Description: rules for converting an argument to an unsigned - 16 bit integer in the range 0 to 2^16-1. - - this test uses String.prototype.fromCharCode() and - String.prototype.charCodeAt() to test ToInt16. - - special cases: - -0 returns 0 - Infinity returns 0 - -Infinity returns 0 - 0 returns 0 - - Author: christine@netscape.com - Date: 17 july 1997 -*/ -var SECTION = "9.7"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " Type Conversion: ToInt16"); - -/* - new TestCase( "9.7", "String.fromCharCode(0).charCodeAt(0)", 0, String.fromCharCode(0).charCodeAt(0) ); - new TestCase( "9.7", "String.fromCharCode(-0).charCodeAt(0)", 0, String.fromCharCode(-0).charCodeAt(0) ); - new TestCase( "9.7", "String.fromCharCode(1).charCodeAt(0)", 1, String.fromCharCode(1).charCodeAt(0) ); - new TestCase( "9.7", "String.fromCharCode(64).charCodeAt(0)", 64, String.fromCharCode(64).charCodeAt(0) ); - new TestCase( "9.7", "String.fromCharCode(126).charCodeAt(0)", 126, String.fromCharCode(126).charCodeAt(0) ); - new TestCase( "9.7", "String.fromCharCode(127).charCodeAt(0)", 127, String.fromCharCode(127).charCodeAt(0) ); - new TestCase( "9.7", "String.fromCharCode(128).charCodeAt(0)", 128, String.fromCharCode(128).charCodeAt(0) ); - new TestCase( "9.7", "String.fromCharCode(130).charCodeAt(0)", 130, String.fromCharCode(130).charCodeAt(0) ); - new TestCase( "9.7", "String.fromCharCode(255).charCodeAt(0)", 255, String.fromCharCode(255).charCodeAt(0) ); - new TestCase( "9.7", "String.fromCharCode(256).charCodeAt(0)", 256, String.fromCharCode(256).charCodeAt(0) ); - new TestCase( "9.7", "String.fromCharCode(Math.pow(2,16)-1).charCodeAt(0)", 65535, String.fromCharCode(Math.pow(2,16)-1).charCodeAt(0) ); - new TestCase( "9.7", "String.fromCharCode(Math.pow(2,16)).charCodeAt(0)", 0, String.fromCharCode(Math.pow(2,16)).charCodeAt(0) ); -*/ - - -new TestCase( "9.7", "String.fromCharCode(0).charCodeAt(0)", ToInt16(0), String.fromCharCode(0).charCodeAt(0) ); -new TestCase( "9.7", "String.fromCharCode(-0).charCodeAt(0)", ToInt16(0), String.fromCharCode(-0).charCodeAt(0) ); -new TestCase( "9.7", "String.fromCharCode(1).charCodeAt(0)", ToInt16(1), String.fromCharCode(1).charCodeAt(0) ); -new TestCase( "9.7", "String.fromCharCode(64).charCodeAt(0)", ToInt16(64), String.fromCharCode(64).charCodeAt(0) ); -new TestCase( "9.7", "String.fromCharCode(126).charCodeAt(0)", ToInt16(126), String.fromCharCode(126).charCodeAt(0) ); -new TestCase( "9.7", "String.fromCharCode(127).charCodeAt(0)", ToInt16(127), String.fromCharCode(127).charCodeAt(0) ); -new TestCase( "9.7", "String.fromCharCode(128).charCodeAt(0)", ToInt16(128), String.fromCharCode(128).charCodeAt(0) ); -new TestCase( "9.7", "String.fromCharCode(130).charCodeAt(0)", ToInt16(130), String.fromCharCode(130).charCodeAt(0) ); -new TestCase( "9.7", "String.fromCharCode(255).charCodeAt(0)", ToInt16(255), String.fromCharCode(255).charCodeAt(0) ); -new TestCase( "9.7", "String.fromCharCode(256).charCodeAt(0)", ToInt16(256), String.fromCharCode(256).charCodeAt(0) ); - -new TestCase( "9.7", "String.fromCharCode(Math.pow(2,16)-1).charCodeAt(0)", 65535, String.fromCharCode(Math.pow(2,16)-1).charCodeAt(0) ); -new TestCase( "9.7", "String.fromCharCode(Math.pow(2,16)).charCodeAt(0)", 0, String.fromCharCode(Math.pow(2,16)).charCodeAt(0) ); - -new TestCase( "9.7", "String.fromCharCode(65535).charCodeAt(0)", ToInt16(65535), String.fromCharCode(65535).charCodeAt(0) ); -new TestCase( "9.7", "String.fromCharCode(65536).charCodeAt(0)", ToInt16(65536), String.fromCharCode(65536).charCodeAt(0) ); -new TestCase( "9.7", "String.fromCharCode(65537).charCodeAt(0)", ToInt16(65537), String.fromCharCode(65537).charCodeAt(0) ); - -new TestCase( "9.7", "String.fromCharCode(131071).charCodeAt(0)", ToInt16(131071), String.fromCharCode(131071).charCodeAt(0) ); -new TestCase( "9.7", "String.fromCharCode(131072).charCodeAt(0)", ToInt16(131072), String.fromCharCode(131072).charCodeAt(0) ); -new TestCase( "9.7", "String.fromCharCode(131073).charCodeAt(0)", ToInt16(131073), String.fromCharCode(131073).charCodeAt(0) ); - -new TestCase( "9.7", "String.fromCharCode('65535').charCodeAt(0)", 65535, String.fromCharCode("65535").charCodeAt(0) ); -new TestCase( "9.7", "String.fromCharCode('65536').charCodeAt(0)", 0, String.fromCharCode("65536").charCodeAt(0) ); - -new TestCase( "9.7", "String.fromCharCode(-1).charCodeAt(0)", ToInt16(-1), String.fromCharCode(-1).charCodeAt(0) ); -new TestCase( "9.7", "String.fromCharCode(-64).charCodeAt(0)", ToInt16(-64), String.fromCharCode(-64).charCodeAt(0) ); -new TestCase( "9.7", "String.fromCharCode(-126).charCodeAt(0)", ToInt16(-126), String.fromCharCode(-126).charCodeAt(0) ); -new TestCase( "9.7", "String.fromCharCode(-127).charCodeAt(0)", ToInt16(-127), String.fromCharCode(-127).charCodeAt(0) ); -new TestCase( "9.7", "String.fromCharCode(-128).charCodeAt(0)", ToInt16(-128), String.fromCharCode(-128).charCodeAt(0) ); -new TestCase( "9.7", "String.fromCharCode(-130).charCodeAt(0)", ToInt16(-130), String.fromCharCode(-130).charCodeAt(0) ); -new TestCase( "9.7", "String.fromCharCode(-255).charCodeAt(0)", ToInt16(-255), String.fromCharCode(-255).charCodeAt(0) ); -new TestCase( "9.7", "String.fromCharCode(-256).charCodeAt(0)", ToInt16(-256), String.fromCharCode(-256).charCodeAt(0) ); - -new TestCase( "9.7", "String.fromCharCode(-Math.pow(2,16)-1).charCodeAt(0)", 65535, String.fromCharCode(-Math.pow(2,16)-1).charCodeAt(0) ); -new TestCase( "9.7", "String.fromCharCode(-Math.pow(2,16)).charCodeAt(0)", 0, String.fromCharCode(-Math.pow(2,16)).charCodeAt(0) ); - -new TestCase( "9.7", "String.fromCharCode(-65535).charCodeAt(0)", ToInt16(-65535), String.fromCharCode(-65535).charCodeAt(0) ); -new TestCase( "9.7", "String.fromCharCode(-65536).charCodeAt(0)", ToInt16(-65536), String.fromCharCode(-65536).charCodeAt(0) ); -new TestCase( "9.7", "String.fromCharCode(-65537).charCodeAt(0)", ToInt16(-65537), String.fromCharCode(-65537).charCodeAt(0) ); - -new TestCase( "9.7", "String.fromCharCode(-131071).charCodeAt(0)", ToInt16(-131071), String.fromCharCode(-131071).charCodeAt(0) ); -new TestCase( "9.7", "String.fromCharCode(-131072).charCodeAt(0)", ToInt16(-131072), String.fromCharCode(-131072).charCodeAt(0) ); -new TestCase( "9.7", "String.fromCharCode(-131073).charCodeAt(0)", ToInt16(-131073), String.fromCharCode(-131073).charCodeAt(0) ); - -new TestCase( "9.7", "String.fromCharCode('-65535').charCodeAt(0)", ToInt16(-65535), String.fromCharCode("-65535").charCodeAt(0) ); -new TestCase( "9.7", "String.fromCharCode('-65536').charCodeAt(0)", ToInt16(-65536), String.fromCharCode("-65536").charCodeAt(0) ); - - -// new TestCase( "9.7", "String.fromCharCode(2147483648).charCodeAt(0)", ToInt16(2147483648), String.fromCharCode(2147483648).charCodeAt(0) ); - - - -// the following test cases cause a runtime error. see: http://scopus.mcom.com/bugsplat/show_bug.cgi?id=78878 - -// new TestCase( "9.7", "String.fromCharCode(Infinity).charCodeAt(0)", 0, String.fromCharCode("Infinity").charCodeAt(0) ); -// new TestCase( "9.7", "String.fromCharCode(-Infinity).charCodeAt(0)", 0, String.fromCharCode("-Infinity").charCodeAt(0) ); -// new TestCase( "9.7", "String.fromCharCode(NaN).charCodeAt(0)", 0, String.fromCharCode(Number.NaN).charCodeAt(0) ); -// new TestCase( "9.7", "String.fromCharCode(Number.POSITIVE_INFINITY).charCodeAt(0)", 0, String.fromCharCode(Number.POSITIVE_INFINITY).charCodeAt(0) ); -// new TestCase( "9.7", "String.fromCharCode(Number.NEGATIVE_INFINITY).charCodeAt(0)", 0, String.fromCharCode(Number.NEGATIVE_INFINITY).charCodeAt(0) ); - -test(); - -function ToInt16( num ) { - num = Number( num ); - if ( isNaN( num ) || num == 0 || num == Number.POSITIVE_INFINITY || num == Number.NEGATIVE_INFINITY ) { - return 0; - } - - var sign = ( num < 0 ) ? -1 : 1; - - num = sign * Math.floor( Math.abs( num ) ); - - num = num % Math.pow(2,16); - - num = ( num > -65536 && num < 0) ? 65536 + num : num; - - return num; -} - diff --git a/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.8.1.js b/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.8.1.js deleted file mode 100644 index 897dc59f6f..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.8.1.js +++ /dev/null @@ -1,167 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '9.8.1.js'; - -/** - File Name: 9.8.1.js - ECMA Section: 9.8.1 ToString Applied to the Number Type - Description: The operator ToString convers a number m to string - as follows: - - 1. if m is NaN, return the string "NaN" - 2. if m is +0 or -0, return the string "0" - 3. if m is less than zero, return the string - concatenation of the string "-" and ToString(-m). - 4. If m is Infinity, return the string "Infinity". - 5. Otherwise, let n, k, and s be integers such that - k >= 1, 10k1 <= s < 10k, the number value for s10nk - is m, and k is as small as possible. Note that k is - the number of digits in the decimal representation - of s, that s is not divisible by 10, and that the - least significant digit of s is not necessarily - uniquely determined by these criteria. - 6. If k <= n <= 21, return the string consisting of the - k digits of the decimal representation of s (in order, - with no leading zeroes), followed by n-k occurences - of the character '0'. - 7. If 0 < n <= 21, return the string consisting of the - most significant n digits of the decimal - representation of s, followed by a decimal point - '.', followed by the remaining kn digits of the - decimal representation of s. - 8. If 6 < n <= 0, return the string consisting of the - character '0', followed by a decimal point '.', - followed by n occurences of the character '0', - followed by the k digits of the decimal - representation of s. - 9. Otherwise, if k = 1, return the string consisting - of the single digit of s, followed by lowercase - character 'e', followed by a plus sign '+' or minus - sign '' according to whether n1 is positive or - negative, followed by the decimal representation - of the integer abs(n1) (with no leading zeros). - 10. Return the string consisting of the most significant - digit of the decimal representation of s, followed - by a decimal point '.', followed by the remaining k1 - digits of the decimal representation of s, followed - by the lowercase character 'e', followed by a plus - sign '+' or minus sign '' according to whether n1 is - positive or negative, followed by the decimal - representation of the integer abs(n1) (with no - leading zeros). - - Note that if x is any number value other than 0, then - ToNumber(ToString(x)) is exactly the same number value as x. - - As noted, the least significant digit of s is not always - uniquely determined by the requirements listed in step 5. - The following specification for step 5 was considered, but - not adopted: - - Author: christine@netscape.com - Date: 10 july 1997 -*/ - -var SECTION = "9.8.1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " ToString applied to the Number type"); - -new TestCase( SECTION, "Number.NaN", "NaN", Number.NaN + "" ); -new TestCase( SECTION, "0", "0", 0 + "" ); -new TestCase( SECTION, "-0", "0", -0 + "" ); -new TestCase( SECTION, "Number.POSITIVE_INFINITY", "Infinity", Number.POSITIVE_INFINITY + "" ); -new TestCase( SECTION, "Number.NEGATIVE_INFINITY", "-Infinity", Number.NEGATIVE_INFINITY + "" ); -new TestCase( SECTION, "-1", "-1", -1 + "" ); - -// cases in step 6: integers 1e21 > x >= 1 or -1 >= x > -1e21 - -new TestCase( SECTION, "1", "1", 1 + "" ); -new TestCase( SECTION, "10", "10", 10 + "" ); -new TestCase( SECTION, "100", "100", 100 + "" ); -new TestCase( SECTION, "1000", "1000", 1000 + "" ); -new TestCase( SECTION, "10000", "10000", 10000 + "" ); -new TestCase( SECTION, "10000000000", "10000000000", 10000000000 + "" ); -new TestCase( SECTION, "10000000000000000000", "10000000000000000000", 10000000000000000000 + "" ); -new TestCase( SECTION, "100000000000000000000","100000000000000000000",100000000000000000000 + "" ); - -new TestCase( SECTION, "12345", "12345", 12345 + "" ); -new TestCase( SECTION, "1234567890", "1234567890", 1234567890 + "" ); - -new TestCase( SECTION, "-1", "-1", -1 + "" ); -new TestCase( SECTION, "-10", "-10", -10 + "" ); -new TestCase( SECTION, "-100", "-100", -100 + "" ); -new TestCase( SECTION, "-1000", "-1000", -1000 + "" ); -new TestCase( SECTION, "-1000000000", "-1000000000", -1000000000 + "" ); -new TestCase( SECTION, "-1000000000000000", "-1000000000000000", -1000000000000000 + "" ); -new TestCase( SECTION, "-100000000000000000000", "-100000000000000000000", -100000000000000000000 + "" ); -new TestCase( SECTION, "-1000000000000000000000", "-1e+21", -1000000000000000000000 + "" ); - -new TestCase( SECTION, "-12345", "-12345", -12345 + "" ); -new TestCase( SECTION, "-1234567890", "-1234567890", -1234567890 + "" ); - -// cases in step 7: numbers with a fractional component, 1e21> x >1 or -1 > x > -1e21, -new TestCase( SECTION, "1.0000001", "1.0000001", 1.0000001 + "" ); - -// cases in step 8: fractions between 1 > x > -1, exclusive of 0 and -0 - -// cases in step 9: numbers with 1 significant digit >= 1e+21 or <= 1e-6 - -new TestCase( SECTION, "1000000000000000000000", "1e+21", 1000000000000000000000 + "" ); -new TestCase( SECTION, "10000000000000000000000", "1e+22", 10000000000000000000000 + "" ); - -// cases in step 10: numbers with more than 1 significant digit >= 1e+21 or <= 1e-6 - -new TestCase( SECTION, "1.2345", "1.2345", String( 1.2345)); -new TestCase( SECTION, "1.234567890", "1.23456789", String( 1.234567890 )); - - -new TestCase( SECTION, ".12345", "0.12345", String(.12345 ) ); -new TestCase( SECTION, ".012345", "0.012345", String(.012345) ); -new TestCase( SECTION, ".0012345", "0.0012345", String(.0012345) ); -new TestCase( SECTION, ".00012345", "0.00012345", String(.00012345) ); -new TestCase( SECTION, ".000012345", "0.000012345", String(.000012345) ); -new TestCase( SECTION, ".0000012345", "0.0000012345", String(.0000012345) ); -new TestCase( SECTION, ".00000012345", "1.2345e-7", String(.00000012345)); - -new TestCase( SECTION, "-1e21", "-1e+21", String(-1e21) ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.9-1.js b/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.9-1.js deleted file mode 100644 index ea22980767..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/9.9-1.js +++ /dev/null @@ -1,119 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '9.9-1.js'; - -/** - File Name: 9.9-1.js - ECMA Section: 9.9 Type Conversion: ToObject - Description: - - undefined generate a runtime error - null generate a runtime error - boolean create a new Boolean object whose default - value is the value of the boolean. - number Create a new Number object whose default - value is the value of the number. - string Create a new String object whose default - value is the value of the string. - object Return the input argument (no conversion). - Author: christine@netscape.com - Date: 17 july 1997 -*/ - -var VERSION = "ECMA_1"; -startTest(); -var SECTION = "9.9-1"; - -writeHeaderToLog( SECTION + " Type Conversion: ToObject" ); - -new TestCase( SECTION, "Object(true).valueOf()", true, (Object(true)).valueOf() ); -new TestCase( SECTION, "typeof Object(true)", "object", typeof Object(true) ); - -new TestCase( SECTION, "Object(false).valueOf()", false, (Object(false)).valueOf() ); -new TestCase( SECTION, "typeof Object(false)", "object", typeof Object(false) ); - -new TestCase( SECTION, "Object(0).valueOf()", 0, (Object(0)).valueOf() ); -new TestCase( SECTION, "typeof Object(0)", "object", typeof Object(0) ); - -new TestCase( SECTION, "Object(-0).valueOf()", -0, (Object(-0)).valueOf() ); -new TestCase( SECTION, "typeof Object(-0)", "object", typeof Object(-0) ); - -new TestCase( SECTION, "Object(1).valueOf()", 1, (Object(1)).valueOf() ); -new TestCase( SECTION, "typeof Object(1)", "object", typeof Object(1) ); - -new TestCase( SECTION, "Object(-1).valueOf()", -1, (Object(-1)).valueOf() ); -new TestCase( SECTION, "typeof Object(-1)", "object", typeof Object(-1) ); - -new TestCase( SECTION, "Object(Number.MAX_VALUE).valueOf()", 1.7976931348623157e308, (Object(Number.MAX_VALUE)).valueOf() ); -new TestCase( SECTION, "typeof Object(Number.MAX_VALUE)", "object", typeof Object(Number.MAX_VALUE) ); - -new TestCase( SECTION, "Object(Number.MIN_VALUE).valueOf()", 5e-324, (Object(Number.MIN_VALUE)).valueOf() ); -new TestCase( SECTION, "typeof Object(Number.MIN_VALUE)", "object", typeof Object(Number.MIN_VALUE) ); - -new TestCase( SECTION, "Object(Number.POSITIVE_INFINITY).valueOf()", Number.POSITIVE_INFINITY, (Object(Number.POSITIVE_INFINITY)).valueOf() ); -new TestCase( SECTION, "typeof Object(Number.POSITIVE_INFINITY)", "object", typeof Object(Number.POSITIVE_INFINITY) ); - -new TestCase( SECTION, "Object(Number.NEGATIVE_INFINITY).valueOf()", Number.NEGATIVE_INFINITY, (Object(Number.NEGATIVE_INFINITY)).valueOf() ); -new TestCase( SECTION, "typeof Object(Number.NEGATIVE_INFINITY)", "object", typeof Object(Number.NEGATIVE_INFINITY) ); - -new TestCase( SECTION, "Object(Number.NaN).valueOf()", Number.NaN, (Object(Number.NaN)).valueOf() ); -new TestCase( SECTION, "typeof Object(Number.NaN)", "object", typeof Object(Number.NaN) ); - -new TestCase( SECTION, "Object('a string').valueOf()", "a string", (Object("a string")).valueOf() ); -new TestCase( SECTION, "typeof Object('a string')", "object", typeof (Object("a string")) ); - -new TestCase( SECTION, "Object('').valueOf()", "", (Object("")).valueOf() ); -new TestCase( SECTION, "typeof Object('')", "object", typeof (Object("")) ); - -new TestCase( SECTION, "Object('\\r\\t\\b\\n\\v\\f').valueOf()", "\r\t\b\n\v\f", (Object("\r\t\b\n\v\f")).valueOf() ); -new TestCase( SECTION, "typeof Object('\\r\\t\\b\\n\\v\\f')", "object", typeof (Object("\\r\\t\\b\\n\\v\\f")) ); - -new TestCase( SECTION, "Object( '\\\'\\\"\\' ).valueOf()", "\'\"\\", (Object("\'\"\\")).valueOf() ); -new TestCase( SECTION, "typeof Object( '\\\'\\\"\\' )", "object", typeof Object("\'\"\\") ); - -new TestCase( SECTION, "Object( new MyObject(true) ).valueOf()", true, eval("Object( new MyObject(true) ).valueOf()") ); -new TestCase( SECTION, "typeof Object( new MyObject(true) )", "object", eval("typeof Object( new MyObject(true) )") ); -new TestCase( SECTION, "(Object( new MyObject(true) )).toString()", "[object Object]", eval("(Object( new MyObject(true) )).toString()") ); - -test(); - -function MyObject( value ) { - this.value = value; - this.valueOf = new Function ( "return this.value" ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/browser.js b/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/browser.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/shell.js b/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/shell.js deleted file mode 100644 index 49ce60f627..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/TypeConversion/shell.js +++ /dev/null @@ -1 +0,0 @@ -gTestsubsuite = 'TypeConversion'; diff --git a/tests/auto/declarative/parserstress/tests/ecma/Types/8.1.js b/tests/auto/declarative/parserstress/tests/ecma/Types/8.1.js deleted file mode 100644 index 7abcb93c02..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Types/8.1.js +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '8.1.js'; - -/** - File Name: 8.1.js - ECMA Section: The undefined type - Description: - - The Undefined type has exactly one value, called undefined. Any variable - that has not been assigned a value is of type Undefined. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "8.1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The undefined type"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "var x; typeof x", - "undefined", - eval("var x; typeof x") ); - -new TestCase( SECTION, - "var x; typeof x == 'undefined", - true, - eval("var x; typeof x == 'undefined'") ); - -new TestCase( SECTION, - "var x; x == void 0", - true, - eval("var x; x == void 0") ); -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Types/8.4.js b/tests/auto/declarative/parserstress/tests/ecma/Types/8.4.js deleted file mode 100644 index 7d3465f8b2..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Types/8.4.js +++ /dev/null @@ -1,130 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '8.4.js'; - -/** - File Name: 8.4.js - ECMA Section: The String type - Description: - - The String type is the set of all finite ordered sequences of zero or more - Unicode characters. Each character is regarded as occupying a position - within the sequence. These positions are identified by nonnegative - integers. The leftmost character (if any) is at position 0, the next - character (if any) at position 1, and so on. The length of a string is the - number of distinct positions within it. The empty string has length zero - and therefore contains no characters. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "8.4"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The String type"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "var s = ''; s.length", - 0, - eval("var s = ''; s.length") ); - -new TestCase( SECTION, - "var s = ''; s.charAt(0)", - "", - eval("var s = ''; s.charAt(0)") ); - - -for ( var i = 0x0041, TEST_STRING = "", EXPECT_STRING = ""; i < 0x007B; i++ ) { - TEST_STRING += ("\\u"+ DecimalToHexString( i ) ); - EXPECT_STRING += String.fromCharCode(i); -} - -new TestCase( SECTION, - "var s = '" + TEST_STRING+ "'; s", - EXPECT_STRING, - eval("var s = '" + TEST_STRING+ "'; s") ); - -new TestCase( SECTION, - "var s = '" + TEST_STRING+ "'; s.length", - 0x007B-0x0041, - eval("var s = '" + TEST_STRING+ "'; s.length") ); - -test(); - -function DecimalToHexString( n ) { - n = Number( n ); - var h = ""; - - for ( var i = 3; i >= 0; i-- ) { - if ( n >= Math.pow(16, i) ){ - var t = Math.floor( n / Math.pow(16, i)); - n -= t * Math.pow(16, i); - if ( t >= 10 ) { - if ( t == 10 ) { - h += "A"; - } - if ( t == 11 ) { - h += "B"; - } - if ( t == 12 ) { - h += "C"; - } - if ( t == 13 ) { - h += "D"; - } - if ( t == 14 ) { - h += "E"; - } - if ( t == 15 ) { - h += "F"; - } - } else { - h += String( t ); - } - } else { - h += "0"; - } - } - - return h; -} - diff --git a/tests/auto/declarative/parserstress/tests/ecma/Types/8.6.2.1-1.js b/tests/auto/declarative/parserstress/tests/ecma/Types/8.6.2.1-1.js deleted file mode 100644 index c06999c42c..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Types/8.6.2.1-1.js +++ /dev/null @@ -1,78 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '8.6.2.1-1.js'; - -/** - File Name: 8.6.2.1-1.js - ECMA Section: 8.6.2.1 Get (Value) - Description: - - When the [[Get]] method of O is called with property name P, the following - steps are taken: - - 1. If O doesn't have a property with name P, go to step 4. - 2. Get the value of the property. - 3. Return Result(2). - 4. If the [[Prototype]] of O is null, return undefined. - 5. Call the [[Get]] method of [[Prototype]] with property name P. - 6. Return Result(5). - - This tests [[Get]] (Value). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "8.6.2.1-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " [[Get]] (Value)"); - -new TestCase( SECTION, "var OBJ = new MyObject(true); OBJ.valueOf()", true, eval("var OBJ = new MyObject(true); OBJ.valueOf()") ); - -new TestCase( SECTION, "var OBJ = new MyObject(Number.POSITIVE_INFINITY); OBJ.valueOf()", Number.POSITIVE_INFINITY, eval("var OBJ = new MyObject(Number.POSITIVE_INFINITY); OBJ.valueOf()") ); - -new TestCase( SECTION, "var OBJ = new MyObject('string'); OBJ.valueOf()", 'string', eval("var OBJ = new MyObject('string'); OBJ.valueOf()") ); - -test(); - -function MyObject( value ) { - this.valueOf = new Function( "return this.value" ); - this.value = value; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/Types/browser.js b/tests/auto/declarative/parserstress/tests/ecma/Types/browser.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/auto/declarative/parserstress/tests/ecma/Types/shell.js b/tests/auto/declarative/parserstress/tests/ecma/Types/shell.js deleted file mode 100644 index a16b996e00..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/Types/shell.js +++ /dev/null @@ -1 +0,0 @@ -gTestsubsuite = 'Types'; diff --git a/tests/auto/declarative/parserstress/tests/ecma/browser.js b/tests/auto/declarative/parserstress/tests/ecma/browser.js deleted file mode 100644 index 60e48ceed8..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/browser.js +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * JavaScript test library shared functions file for running the tests - * in the browser. Overrides the shell's print function with document.write - * and make everything HTML pretty. - * - * To run the tests in the browser, use the mkhtml.pl script to generate - * html pages that include the shell.js, browser.js (this file), and the - * test js file in script tags. - * - * The source of the page that is generated should look something like this: - * - * - * - */ - -/* - * The earlier versions of the test code used exceptions - * to terminate the test script in "negative" test cases - * before the failure reporting code could run. In order - * to be able to capture errors for the "negative" case - * where the exception is a sign the test actually passed, - * the err online handler will assume that any error is a - * failure unless gExceptionExpected is true. - */ - diff --git a/tests/auto/declarative/parserstress/tests/ecma/extensions/10.1.4-9.js b/tests/auto/declarative/parserstress/tests/ecma/extensions/10.1.4-9.js deleted file mode 100644 index 91982de20c..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/extensions/10.1.4-9.js +++ /dev/null @@ -1,110 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '10.1.4-9.js'; - -/** - File Name: 10.1.4-9.js - ECMA Section: 10.1.4 Scope Chain and Identifier Resolution - Description: - Every execution context has associated with it a scope chain. This is - logically a list of objects that are searched when binding an Identifier. - When control enters an execution context, the scope chain is created and - is populated with an initial set of objects, depending on the type of - code. When control leaves the execution context, the scope chain is - destroyed. - - During execution, the scope chain of the execution context is affected - only by WithStatement. When execution enters a with block, the object - specified in the with statement is added to the front of the scope chain. - When execution leaves a with block, whether normally or via a break or - continue statement, the object is removed from the scope chain. The object - being removed will always be the first object in the scope chain. - - During execution, the syntactic production PrimaryExpression : Identifier - is evaluated using the following algorithm: - - 1. Get the next object in the scope chain. If there isn't one, go to step 5. - 2. Call the [[HasProperty]] method of Result(l), passing the Identifier as - the property. - 3. If Result(2) is true, return a value of type Reference whose base object - is Result(l) and whose property name is the Identifier. - 4. Go to step 1. - 5. Return a value of type Reference whose base object is null and whose - property name is the Identifier. - The result of binding an identifier is always a value of type Reference with - its member name component equal to the identifier string. - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "10.1.4-9"; -var VERSION = "ECMA_2"; -startTest(); - -writeHeaderToLog( SECTION + " Scope Chain and Identifier Resolution"); - -new TestCase( SECTION, "NEW_PROPERTY = " ); - -test(); - -function test() { - for ( gTc=0; gTc < gTestcases.length; gTc++ ) { - - var MYOBJECT = new MyObject(); - var RESULT = "hello"; - - with ( MYOBJECT ) { - NEW_PROPERTY = RESULT; - } - gTestcases[gTc].actual = NEW_PROPERTY; - gTestcases[gTc].expect = RESULT; - - gTestcases[gTc].passed = writeTestCaseResult( - gTestcases[gTc].expect, - gTestcases[gTc].actual, - gTestcases[gTc].description +" = "+ - gTestcases[gTc].actual ); - - gTestcases[gTc].reason += ( gTestcases[gTc].passed ) ? "" : "wrong value "; - } - stopTest(); - return ( gTestcases ); -} -function MyObject( n ) { - this.__proto__ = Number.prototype; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/extensions/10.1.6.js b/tests/auto/declarative/parserstress/tests/ecma/extensions/10.1.6.js deleted file mode 100644 index 99fd4a7ff1..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/extensions/10.1.6.js +++ /dev/null @@ -1,127 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '10.1.6.js'; - -/** - File Name: 10.1.6 - ECMA Section: Activation Object - Description: - - If the function object being invoked has an arguments property, let x be - the value of that property; the activation object is also given an internal - property [[OldArguments]] whose initial value is x; otherwise, an arguments - property is created for the function object but the activation object is - not given an [[OldArguments]] property. Next, arguments object described - below (the same one stored in the arguments property of the activation - object) is used as the new value of the arguments property of the function - object. This new value is installed even if the arguments property already - exists and has the ReadOnly attribute (as it will for native Function - objects). (These actions are taken to provide compatibility with a form of - program syntax that is now discouraged: to access the arguments object for - function f within the body of f by using the expression f.arguments. - The recommended way to access the arguments object for function f within - the body of f is simply to refer to the variable arguments.) - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "10.1.6"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Activation Object"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var arguments = "FAILED!"; - -var ARG_STRING = "value of the argument property"; - -new TestCase( SECTION, - "(new TestObject(0,1,2,3,4,5)).length", - 6, - (new TestObject(0,1,2,3,4,5)).length ); - -for ( i = 0; i < 6; i++ ) { - - new TestCase( SECTION, - "(new TestObject(0,1,2,3,4,5))["+i+"]", - i, - (new TestObject(0,1,2,3,4,5))[i]); -} - - -// The current object already has an arguments property. - -new TestCase( SECTION, - "(new AnotherTestObject(1,2,3)).arguments", - ARG_STRING, - (new AnotherTestObject(1,2,3)).arguments ); - -// The function invoked with [[Call]] - -new TestCase( SECTION, - "TestFunction(1,2,3)", - ARG_STRING, - TestFunction() + '' ); - - -test(); - - - -function Prototype() { - this.arguments = ARG_STRING; -} -function TestObject() { - this.__proto__ = new Prototype(); - return arguments; -} -function AnotherTestObject() { - this.__proto__ = new Prototype(); - return this; -} -function TestFunction() { - arguments = ARG_STRING; - return arguments; -} -function AnotherTestFunction() { - this.__proto__ = new Prototype(); - return this; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/extensions/10.1.8-1.js b/tests/auto/declarative/parserstress/tests/ecma/extensions/10.1.8-1.js deleted file mode 100644 index adfc8d5df5..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/extensions/10.1.8-1.js +++ /dev/null @@ -1,135 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '10.1.8-1.js'; - -/** - File Name: 10.1.8 - ECMA Section: Arguments Object - Description: - - When control enters an execution context for declared function code, - anonymous code, or implementation-supplied code, an arguments object is - created and initialized as follows: - - The [[Prototype]] of the arguments object is to the original Object - prototype object, the one that is the initial value of Object.prototype - (section 15.2.3.1). - - A property is created with name callee and property attributes {DontEnum}. - The initial value of this property is the function object being executed. - This allows anonymous functions to be recursive. - - A property is created with name length and property attributes {DontEnum}. - The initial value of this property is the number of actual parameter values - supplied by the caller. - - For each non-negative integer, iarg, less than the value of the length - property, a property is created with name ToString(iarg) and property - attributes { DontEnum }. The initial value of this property is the value - of the corresponding actual parameter supplied by the caller. The first - actual parameter value corresponds to iarg = 0, the second to iarg = 1 and - so on. In the case when iarg is less than the number of formal parameters - for the function object, this property shares its value with the - corresponding property of the activation object. This means that changing - this property changes the corresponding property of the activation object - and vice versa. The value sharing mechanism depends on the implementation. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "10.1.8"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Arguments Object"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var ARG_STRING = "value of the argument property"; - -new TestCase( SECTION, - "GetCallee()", - GetCallee, - GetCallee() ); - -var LIMIT = 100; - -for ( var i = 0, args = "" ; i < LIMIT; i++ ) { - args += String(i) + ( i+1 < LIMIT ? "," : "" ); - -} - -var LENGTH = eval( "GetLength("+ args +")" ); - -new TestCase( SECTION, - "GetLength("+args+")", - 100, - LENGTH ); - -var ARGUMENTS = eval( "GetArguments( " +args+")" ); - -for ( var i = 0; i < 100; i++ ) { - new TestCase( SECTION, - "GetArguments("+args+")["+i+"]", - i, - ARGUMENTS[i] ); -} - -test(); - -function TestFunction() { - var arg_proto = arguments.__proto__; -} -function GetCallee() { - var c = arguments.callee; - return c; -} -function GetArguments() { - var a = arguments; - return a; -} -function GetLength() { - var l = arguments.length; - return l; -} - -function AnotherTestFunction() { - this.__proto__ = new Prototype(); - return this; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/extensions/11.6.1-1.js b/tests/auto/declarative/parserstress/tests/ecma/extensions/11.6.1-1.js deleted file mode 100644 index e467157441..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/extensions/11.6.1-1.js +++ /dev/null @@ -1,145 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.6.1-1.js'; - -/** - File Name: 11.6.1-1.js - ECMA Section: 11.6.1 The addition operator ( + ) - Description: - - The addition operator either performs string concatenation or numeric - addition. - - The production AdditiveExpression : AdditiveExpression + MultiplicativeExpression - is evaluated as follows: - - 1. Evaluate AdditiveExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate MultiplicativeExpression. - 4. Call GetValue(Result(3)). - 5. Call ToPrimitive(Result(2)). - 6. Call ToPrimitive(Result(4)). - 7. If Type(Result(5)) is String or Type(Result(6)) is String, go to step 12. - (Note that this step differs from step 3 in the algorithm for comparison - for the relational operators in using or instead of and.) - 8. Call ToNumber(Result(5)). - 9. Call ToNumber(Result(6)). - 10. Apply the addition operation to Result(8) and Result(9). See the discussion below (11.6.3). - 11. Return Result(10). - 12. Call ToString(Result(5)). - 13. Call ToString(Result(6)). - 14. Concatenate Result(12) followed by Result(13). - 15. Return Result(14). - - Note that no hint is provided in the calls to ToPrimitive in steps 5 and 6. - All native ECMAScript objects except Date objects handle the absence of a - hint as if the hint Number were given; Date objects handle the absence of a - hint as if the hint String were given. Host objects may handle the absence - of a hint in some other manner. - - This test does not cover cases where the Additive or Mulplicative expression - ToPrimitive is string. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.6.1-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " The Addition operator ( + )"); - -// tests for "MyValuelessObject", where the value is -// set in the object's prototype, not the object itself. - -new TestCase( SECTION, - "var EXP_1 = new MyValuelessObject(true); var EXP_2 = new MyValuelessObject(false); EXP_1 + EXP_2", - 1, - eval("var EXP_1 = new MyValuelessObject(true); var EXP_2 = new MyValuelessObject(false); EXP_1 + EXP_2") ); - -new TestCase( SECTION, - "var EXP_1 = new MyValuelessObject(new Boolean(true)); var EXP_2 = new MyValuelessObject(new Boolean(false)); EXP_1 + EXP_2", - "truefalse", - eval("var EXP_1 = new MyValuelessObject(new Boolean(true)); var EXP_2 = new MyValuelessObject(new Boolean(false)); EXP_1 + EXP_2") ); - -// tests for "MyValuelessObject", where the value is -// set in the object's prototype, not the object itself. - - -new TestCase( SECTION, - "var EXP_1 = new MyValuelessObject(100); var EXP_2 = new MyValuelessObject(-1); EXP_1 + EXP_2", - 99, - eval("var EXP_1 = new MyValuelessObject(100); var EXP_2 = new MyValuelessObject(-1); EXP_1 + EXP_2") ); - -new TestCase( SECTION, - "var EXP_1 = new MyValuelessObject(new Number(100)); var EXP_2 = new MyValuelessObject(new Number(-1)); EXP_1 + EXP_2", - "100-1", - eval("var EXP_1 = new MyValuelessObject(new Number(100)); var EXP_2 = new MyValuelessObject(new Number(-1)); EXP_1 + EXP_2") ); - -new TestCase( SECTION, - "var EXP_1 = new MyValuelessObject( new MyValuelessObject( new Boolean(true) ) ); EXP_1 + EXP_1", - "truetrue", - eval("var EXP_1 = new MyValuelessObject( new MyValuelessObject( new Boolean(true) ) ); EXP_1 + EXP_1") ); - -test(); - -function MyProtoValuelessObject() { - this.valueOf = new Function ( "" ); - this.__proto__ = null; -} - -function MyProtolessObject( value ) { - this.valueOf = new Function( "return this.value" ); - this.__proto__ = null; - this.value = value; -} - -function MyValuelessObject(value) { - this.__proto__ = new MyPrototypeObject(value); -} -function MyPrototypeObject(value) { - this.valueOf = new Function( "return this.value;" ); - this.toString = new Function( "return (this.value + '');" ); - this.value = value; -} - -function MyObject( value ) { - this.valueOf = new Function( "return this.value" ); - this.value = value; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/extensions/11.6.1-2.js b/tests/auto/declarative/parserstress/tests/ecma/extensions/11.6.1-2.js deleted file mode 100644 index a486885b7f..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/extensions/11.6.1-2.js +++ /dev/null @@ -1,136 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.6.1-2.js'; - -/** - File Name: 11.6.1-2.js - ECMA Section: 11.6.1 The addition operator ( + ) - Description: - - The addition operator either performs string concatenation or numeric - addition. - - The production AdditiveExpression : AdditiveExpression + MultiplicativeExpression - is evaluated as follows: - - 1. Evaluate AdditiveExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate MultiplicativeExpression. - 4. Call GetValue(Result(3)). - 5. Call ToPrimitive(Result(2)). - 6. Call ToPrimitive(Result(4)). - 7. If Type(Result(5)) is String or Type(Result(6)) is String, go to step 12. - (Note that this step differs from step 3 in the algorithm for comparison - for the relational operators in using or instead of and.) - 8. Call ToNumber(Result(5)). - 9. Call ToNumber(Result(6)). - 10. Apply the addition operation to Result(8) and Result(9). See the discussion below (11.6.3). - 11. Return Result(10). - 12. Call ToString(Result(5)). - 13. Call ToString(Result(6)). - 14. Concatenate Result(12) followed by Result(13). - 15. Return Result(14). - - Note that no hint is provided in the calls to ToPrimitive in steps 5 and 6. - All native ECMAScript objects except Date objects handle the absence of a - hint as if the hint Number were given; Date objects handle the absence of a - hint as if the hint String were given. Host objects may handle the absence - of a hint in some other manner. - - This test does only covers cases where the Additive or Mulplicative expression - ToPrimitive is a string. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.6.1-2"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " The Addition operator ( + )"); - -// tests for "MyValuelessObject", where the value is -// set in the object's prototype, not the object itself. - -new TestCase( SECTION, - "var EXP_1 = new MyValuelessObject('string'); var EXP_2 = new MyValuelessObject(false); EXP_1 + EXP_2", - "stringfalse", - eval("var EXP_1 = new MyValuelessObject('string'); var EXP_2 = new MyValuelessObject(false); EXP_1 + EXP_2") ); - -new TestCase( SECTION, - "var EXP_1 = new MyValuelessObject(new String('string')); var EXP_2 = new MyValuelessObject(new Boolean(false)); EXP_1 + EXP_2", - "stringfalse", - eval("var EXP_1 = new MyValuelessObject(new String('string')); var EXP_2 = new MyValuelessObject(new Boolean(false)); EXP_1 + EXP_2") ); - -// tests for "MyValuelessObject", where the value is -// set in the object's prototype, not the object itself. - -new TestCase( SECTION, - "var EXP_1 = new MyValuelessObject(100); var EXP_2 = new MyValuelessObject('string'); EXP_1 + EXP_2", - "100string", - eval("var EXP_1 = new MyValuelessObject(100); var EXP_2 = new MyValuelessObject('string'); EXP_1 + EXP_2") ); - -new TestCase( SECTION, - "var EXP_1 = new MyValuelessObject(new String('string')); var EXP_2 = new MyValuelessObject(new Number(-1)); EXP_1 + EXP_2", - "string-1", - eval("var EXP_1 = new MyValuelessObject(new String('string')); var EXP_2 = new MyValuelessObject(new Number(-1)); EXP_1 + EXP_2") ); - -test(); - -function MyProtoValuelessObject() { - this.valueOf = new Function ( "" ); - this.__proto__ = null; -} -function MyProtolessObject( value ) { - this.valueOf = new Function( "return this.value" ); - this.__proto__ = null; - this.value = value; -} -function MyValuelessObject(value) { - this.__proto__ = new MyPrototypeObject(value); -} -function MyPrototypeObject(value) { - this.valueOf = new Function( "return this.value;" ); - this.toString = new Function( "return (this.value + '');" ); - this.value = value; -} -function MyObject( value ) { - this.valueOf = new Function( "return this.value" ); - this.value = value; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/extensions/11.6.1-3.js b/tests/auto/declarative/parserstress/tests/ecma/extensions/11.6.1-3.js deleted file mode 100644 index 7d66e58530..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/extensions/11.6.1-3.js +++ /dev/null @@ -1,137 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.6.1-3.js'; - -/** - File Name: 11.6.1-3.js - ECMA Section: 11.6.1 The addition operator ( + ) - Description: - - The addition operator either performs string concatenation or numeric - addition. - - The production AdditiveExpression : AdditiveExpression + MultiplicativeExpression - is evaluated as follows: - - 1. Evaluate AdditiveExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate MultiplicativeExpression. - 4. Call GetValue(Result(3)). - 5. Call ToPrimitive(Result(2)). - 6. Call ToPrimitive(Result(4)). - 7. If Type(Result(5)) is String or Type(Result(6)) is String, go to step 12. - (Note that this step differs from step 3 in the algorithm for comparison - for the relational operators in using or instead of and.) - 8. Call ToNumber(Result(5)). - 9. Call ToNumber(Result(6)). - 10. Apply the addition operation to Result(8) and Result(9). See the discussion below (11.6.3). - 11. Return Result(10). - 12. Call ToString(Result(5)). - 13. Call ToString(Result(6)). - 14. Concatenate Result(12) followed by Result(13). - 15. Return Result(14). - - Note that no hint is provided in the calls to ToPrimitive in steps 5 and 6. - All native ECMAScript objects except Date objects handle the absence of a - hint as if the hint Number were given; Date objects handle the absence of a - hint as if the hint String were given. Host objects may handle the absence - of a hint in some other manner. - - This test does only covers cases where the Additive or Mulplicative expression - is a Date. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.6.1-3"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " The Addition operator ( + )"); - -// tests for a boolean primitive and a boolean object, and -// "MyValuelessObject", where the value is set in the object's -// prototype, not the object itself. - -var DATE1 = new Date(); - -var MYOB1 = new MyObject( DATE1 ); -var MYOB2 = new MyValuelessObject( DATE1 ); -var MYOB3 = new MyProtolessObject( DATE1 ); -var MYOB4 = new MyProtoValuelessObject( DATE1 ); - -new TestCase( SECTION, - "MYOB2 = new MyValuelessObject(DATE1); MYOB3 + 'string'", - DATE1.toString() + "string", - MYOB2 + 'string' ); - -new TestCase( SECTION, - "MYOB2 = new MyValuelessObject(DATE1); MYOB3 + new String('string')", - DATE1.toString() + "string", - MYOB2 + new String('string') ); -/* - new TestCase( SECTION, - "MYOB3 = new MyProtolessObject(DATE1); MYOB3 + new Boolean(true)", - DATE1.toString() + "true", - MYOB3 + new Boolean(true) ); -*/ - -test(); - -function MyProtoValuelessObject() { - this.valueOf = new Function ( "" ); - this.__proto__ = null; -} -function MyProtolessObject( value ) { - this.valueOf = new Function( "return this.value" ); - this.__proto__ = null; - this.value = value; -} -function MyValuelessObject(value) { - this.__proto__ = new MyPrototypeObject(value); -} -function MyPrototypeObject(value) { - this.valueOf = new Function( "return this.value;" ); - this.toString = new Function( "return (this.value + '');" ); - this.value = value; -} -function MyObject( value ) { - this.valueOf = new Function( "return this.value" ); - this.value = value; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/extensions/11.6.2-1.js b/tests/auto/declarative/parserstress/tests/ecma/extensions/11.6.2-1.js deleted file mode 100644 index be8a6f6c98..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/extensions/11.6.2-1.js +++ /dev/null @@ -1,124 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '11.6.2-1.js'; - -/** - File Name: 11.6.2-1.js - ECMA Section: 11.6.2 The Subtraction operator ( - ) - Description: - - The production AdditiveExpression : AdditiveExpression - - MultiplicativeExpression is evaluated as follows: - - 1. Evaluate AdditiveExpression. - 2. Call GetValue(Result(1)). - 3. Evaluate MultiplicativeExpression. - 4. Call GetValue(Result(3)). - 5. Call ToNumber(Result(2)). - 6. Call ToNumber(Result(4)). - 7. Apply the subtraction operation to Result(5) and Result(6). See the - discussion below (11.6.3). - 8. Return Result(7). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "11.6.2-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " The subtraction operator ( - )"); - -// tests "MyValuelessObject", where the value is -// set in the object's prototype, not the object itself. - - -new TestCase( SECTION, - "var EXP_1 = new MyValuelessObject(true); var EXP_2 = new MyValuelessObject(false); EXP_1 - EXP_2", - 1, - eval("var EXP_1 = new MyValuelessObject(true); var EXP_2 = new MyValuelessObject(false); EXP_1 - EXP_2") ); - -new TestCase( SECTION, - "var EXP_1 = new MyValuelessObject(new Boolean(true)); var EXP_2 = new MyValuelessObject(new Boolean(false)); EXP_1 - EXP_2", - Number.NaN, - eval("var EXP_1 = new MyValuelessObject(new Boolean(true)); var EXP_2 = new MyValuelessObject(new Boolean(false)); EXP_1 - EXP_2") ); - -// tests "MyValuelessObject", where the value is -// set in the object's prototype, not the object itself. - -new TestCase( SECTION, - "var EXP_1 = new MyValuelessObject(100); var EXP_2 = new MyValuelessObject(1); EXP_1 - EXP_2", - 99, - eval("var EXP_1 = new MyValuelessObject(100); var EXP_2 = new MyValuelessObject(1); EXP_1 - EXP_2") ); -/* - new TestCase( SECTION, - "var EXP_1 = new MyValuelessObject(new Number(100)); var EXP_2 = new MyValuelessObject(new Number(1)); EXP_1 - EXP_2", - Number.NaN, - eval("var EXP_1 = new MyValuelessObject(new Number(100)); var EXP_2 = new MyValuelessObject(new Number(1)); EXP_1 - EXP_2") ); -*/ -// same thing with string! - -test(); - -function MyProtoValuelessObject() { - this.valueOf = new Function ( "" ); - this.__proto__ = null; -} -function MyProtolessObject( value ) { - this.valueOf = new Function( "return this.value" ); - this.__proto__ = null; - this.value = value; -} -function MyValuelessObject(value) { - this.__proto__ = new MyPrototypeObject(value); -} -function MyPrototypeObject(value) { - this.valueOf = new Function( "return this.value;" ); - this.toString = new Function( "return (this.value + '');" ); - this.value = value; -} -function MyObject( value ) { - this.valueOf = new Function( "return this.value" ); - this.value = value; -} -function MyOtherObject( value ) { - this.valueOf = new Function( "return this.value" ); - this.toString = new Function ( "return this.value + ''" ); - this.value = value; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/extensions/15-1.js b/tests/auto/declarative/parserstress/tests/ecma/extensions/15-1.js deleted file mode 100644 index fc037873a5..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/extensions/15-1.js +++ /dev/null @@ -1,94 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15-1.js'; - -/** - File Name: 15.js - ECMA Section: 15 Native ECMAScript Objects - Description: Every built-in prototype object has the Object prototype - object, which is the value of the expression - Object.prototype (15.2.3.1) as the value of its internal - [[Prototype]] property, except the Object prototype - object itself. - - Every native object associated with a program-created - function also has the Object prototype object as the - value of its internal [[Prototype]] property. - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ -var SECTION = "15-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Native ECMAScript Objects"; - -writeHeaderToLog( SECTION + " "+ TITLE); -/* - new TestCase( SECTION, "Function.prototype.__proto__", Object.prototype, Function.prototype.__proto__ ); - new TestCase( SECTION, "Array.prototype.__proto__", Object.prototype, Array.prototype.__proto__ ); - new TestCase( SECTION, "String.prototype.__proto__", Object.prototype, String.prototype.__proto__ ); - new TestCase( SECTION, "Boolean.prototype.__proto__", Object.prototype, Boolean.prototype.__proto__ ); - new TestCase( SECTION, "Number.prototype.__proto__", Object.prototype, Number.prototype.__proto__ ); -// new TestCase( SECTION, "Math.prototype.__proto__", Object.prototype, Math.prototype.__proto__ ); -new TestCase( SECTION, "Date.prototype.__proto__", Object.prototype, Date.prototype.__proto__ ); -new TestCase( SECTION, "TestCase.prototype.__proto__", Object.prototype, TestCase.prototype.__proto__ ); - -new TestCase( SECTION, "MyObject.prototype.__proto__", Object.prototype, MyObject.prototype.__proto__ ); -*/ -new TestCase( SECTION, "Function.prototype.__proto__ == Object.prototype", true, Function.prototype.__proto__ == Object.prototype ); -new TestCase( SECTION, "Array.prototype.__proto__ == Object.prototype", true, Array.prototype.__proto__ == Object.prototype ); -new TestCase( SECTION, "String.prototype.__proto__ == Object.prototype", true, String.prototype.__proto__ == Object.prototype ); -new TestCase( SECTION, "Boolean.prototype.__proto__ == Object.prototype", true, Boolean.prototype.__proto__ == Object.prototype ); -new TestCase( SECTION, "Number.prototype.__proto__ == Object.prototype", true, Number.prototype.__proto__ == Object.prototype ); -// new TestCase( SECTION, "Math.prototype.__proto__ == Object.prototype", true, Math.prototype.__proto__ == Object.prototype ); -new TestCase( SECTION, "Date.prototype.__proto__ == Object.prototype", true, Date.prototype.__proto__ == Object.prototype ); -new TestCase( SECTION, "TestCase.prototype.__proto__ == Object.prototype", true, TestCase.prototype.__proto__ == Object.prototype ); - -new TestCase( SECTION, "MyObject.prototype.__proto__ == Object.prototype", true, MyObject.prototype.__proto__ == Object.prototype ); - - -test(); - - -function MyObject( value ) { - this.value = value; - this.valueOf = new Function( "return this.value" ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/extensions/15-2.js b/tests/auto/declarative/parserstress/tests/ecma/extensions/15-2.js deleted file mode 100644 index e403e46e8e..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/extensions/15-2.js +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15-2.js'; - -/** - File Name: 15-2.js - ECMA Section: 15 Native ECMAScript Objects - - Description: Every built-in function and every built-in constructor - has the Function prototype object, which is the value of - the expression Function.prototype as the value of its - internal [[Prototype]] property, except the Function - prototype object itself. - - That is, the __proto__ property of builtin functions and - constructors should be the Function.prototype object. - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ -var SECTION = "15-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Native ECMAScript Objects"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "Object.__proto__", Function.prototype, Object.__proto__ ); -new TestCase( SECTION, "Array.__proto__", Function.prototype, Array.__proto__ ); -new TestCase( SECTION, "String.__proto__", Function.prototype, String.__proto__ ); -new TestCase( SECTION, "Boolean.__proto__", Function.prototype, Boolean.__proto__ ); -new TestCase( SECTION, "Number.__proto__", Function.prototype, Number.__proto__ ); -new TestCase( SECTION, "Date.__proto__", Function.prototype, Date.__proto__ ); -new TestCase( SECTION, "TestCase.__proto__", Function.prototype, TestCase.__proto__ ); - -new TestCase( SECTION, "eval.__proto__", Function.prototype, eval.__proto__ ); -new TestCase( SECTION, "Math.pow.__proto__", Function.prototype, Math.pow.__proto__ ); -new TestCase( SECTION, "String.prototype.indexOf.__proto__", Function.prototype, String.prototype.indexOf.__proto__ ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.1.2.1-1.js b/tests/auto/declarative/parserstress/tests/ecma/extensions/15.1.2.1-1.js deleted file mode 100644 index c3fe679e5e..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.1.2.1-1.js +++ /dev/null @@ -1,88 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.1.2.1-1.js'; - -/** - File Name: 15.1.2.1-1.js - ECMA Section: 15.1.2.1 eval(x) - - if x is not a string object, return x. - Description: - Author: christine@netscape.com - Date: 16 september 1997 -*/ -var SECTION = "15.1.2.1-1"; -var VERSION = "ECMA_1"; -var TITLE = "eval(x)"; -var BUGNUMBER = "none"; - -startTest(); - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "eval.length", 1, eval.length ); -new TestCase( SECTION, "delete eval.length", false, delete eval.length ); -new TestCase( SECTION, "var PROPS = ''; for ( p in eval ) { PROPS += p }; PROPS", "prototype", eval("var PROPS = ''; for ( p in eval ) { PROPS += p }; PROPS") ); -new TestCase( SECTION, "eval.length = null; eval.length", 1, eval( "eval.length = null; eval.length") ); -// new TestCase( SECTION, "eval.__proto__", Function.prototype, eval.__proto__ ); - -// test cases where argument is not a string. should return the argument. - -new TestCase( SECTION, "eval()", void 0, eval() ); -new TestCase( SECTION, "eval(void 0)", void 0, eval( void 0) ); -new TestCase( SECTION, "eval(null)", null, eval( null ) ); -new TestCase( SECTION, "eval(true)", true, eval( true ) ); -new TestCase( SECTION, "eval(false)", false, eval( false ) ); - -new TestCase( SECTION, "typeof eval(new String('Infinity/-0')", "object", typeof eval(new String('Infinity/-0')) ); - -new TestCase( SECTION, "eval([1,2,3,4,5,6])", "1,2,3,4,5,6", ""+eval([1,2,3,4,5,6]) ); -new TestCase( SECTION, "eval(new Array(0,1,2,3)", "1,2,3", ""+ eval(new Array(1,2,3)) ); -new TestCase( SECTION, "eval(1)", 1, eval(1) ); -new TestCase( SECTION, "eval(0)", 0, eval(0) ); -new TestCase( SECTION, "eval(-1)", -1, eval(-1) ); -new TestCase( SECTION, "eval(Number.NaN)", Number.NaN, eval(Number.NaN) ); -new TestCase( SECTION, "eval(Number.MIN_VALUE)", 5e-308, eval(Number.MIN_VALUE) ); -new TestCase( SECTION, "eval(-Number.MIN_VALUE)", -5e-308, eval(-Number.MIN_VALUE) ); -new TestCase( SECTION, "eval(Number.POSITIVE_INFINITY)", Number.POSITIVE_INFINITY, eval(Number.POSITIVE_INFINITY) ); -new TestCase( SECTION, "eval(Number.NEGATIVE_INFINITY)", Number.NEGATIVE_INFINITY, eval(Number.NEGATIVE_INFINITY) ); -new TestCase( SECTION, "eval( 4294967296 )", 4294967296, eval(4294967296) ); -new TestCase( SECTION, "eval( 2147483648 )", 2147483648, eval(2147483648) ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.2.1.1.js b/tests/auto/declarative/parserstress/tests/ecma/extensions/15.2.1.1.js deleted file mode 100644 index f4f821877d..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.2.1.1.js +++ /dev/null @@ -1,82 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.2.1.1.js'; - -/** - File Name: 15.2.1.1.js - ECMA Section: 15.2.1.1 The Object Constructor Called as a Function: - Object(value) - Description: When Object is called as a function rather than as a - constructor, the following steps are taken: - - 1. If value is null or undefined, create and return a - new object with no properties other than internal - properties exactly as if the object constructor - had been called on that same value (15.2.2.1). - 2. Return ToObject (value), whose rules are: - - undefined generate a runtime error - null generate a runtime error - boolean create a new Boolean object whose default - value is the value of the boolean. - number Create a new Number object whose default - value is the value of the number. - string Create a new String object whose default - value is the value of the string. - object Return the input argument (no conversion). - - Author: christine@netscape.com - Date: 17 july 1997 -*/ - -var SECTION = "15.2.1.1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Object( value )"; - -writeHeaderToLog( SECTION + " "+ TITLE); - - -var NULL_OBJECT = Object(null); - -new TestCase( SECTION, "Object(null).__proto__", Object.prototype, (Object(null)).__proto__ ); - -new TestCase( SECTION, "Object(void 0).__proto__", Object.prototype, (Object(void 0)).__proto__ ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.2.3-1.js b/tests/auto/declarative/parserstress/tests/ecma/extensions/15.2.3-1.js deleted file mode 100644 index 6d49db2481..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.2.3-1.js +++ /dev/null @@ -1,64 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.2.3-1.js'; - -/** - File Name: 15.2.3-1.js - ECMA Section: 15.2.3 Properties of the Object Constructor - - Description: The value of the internal [[Prototype]] property of the - Object constructor is the Function prototype object. - - Besides the call and construct propreties and the length - property, the Object constructor has properties described - in 15.2.3.1. - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ -var SECTION = "15.2.3"; -var VERSION = "ECMA_2"; -startTest(); - -writeHeaderToLog( SECTION + " Properties of the Object Constructor"); - -new TestCase( SECTION, "Object.__proto__", Function.prototype, Object.__proto__ ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.2.4.js b/tests/auto/declarative/parserstress/tests/ecma/extensions/15.2.4.js deleted file mode 100644 index df55e0894a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.2.4.js +++ /dev/null @@ -1,66 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.2.4.js'; - -/** - File Name: 15.2.4.js - ECMA Section: 15.2.4 Properties of the Object prototype object - - Description: The value of the internal [[Prototype]] property of - the Object prototype object is null - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ - -var SECTION = "15.2.4"; -var VERSION = "ECMA_2"; -startTest(); -var TITLE = "Properties of the Object.prototype object"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "Object.prototype.__proto__", - null, - Object.prototype.__proto__ ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.3.1.1-1.js b/tests/auto/declarative/parserstress/tests/ecma/extensions/15.3.1.1-1.js deleted file mode 100644 index 169cf50851..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.3.1.1-1.js +++ /dev/null @@ -1,82 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.3.1.1-1.js'; - -/** - File Name: 15.3.1.1.js - ECMA Section: 15.3.1.1 The Function Constructor Called as a Function - - Description: - When the Function function is called with some arguments p1, p2, . . . , pn, body - (where n might be 0, that is, there are no "p" arguments, and where body might - also not be provided), the following steps are taken: - - 1. Create and return a new Function object exactly if the function constructor had - been called with the same arguments (15.3.2.1). - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ -var SECTION = "15.3.1.1-1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The Function Constructor Called as a Function"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var MyObject = Function( "value", "this.value = value; this.valueOf = Function( 'return this.value' ); this.toString = Function( 'return String(this.value);' )" ); - - -var myfunc = Function(); -myfunc.toString = Object.prototype.toString; - -// not going to test toString here since it is implementation dependent. -// new TestCase( SECTION, "myfunc.toString()", "function anonymous() { }", myfunc.toString() ); - -myfunc.toString = Object.prototype.toString; - -new TestCase( SECTION, - "MyObject.__proto__ == Function.prototype", - true, - MyObject.__proto__ == Function.prototype ); - -test(); - - diff --git a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.3.1.1-2.js b/tests/auto/declarative/parserstress/tests/ecma/extensions/15.3.1.1-2.js deleted file mode 100644 index 42165465bc..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.3.1.1-2.js +++ /dev/null @@ -1,82 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.3.1.1-2.js'; - -/** - File Name: 15.3.1.1-2.js - ECMA Section: 15.3.1.1 The Function Constructor Called as a Function - Function(p1, p2, ..., pn, body ) - - Description: - When the Function function is called with some arguments p1, p2, . . . , pn, - body (where n might be 0, that is, there are no "p" arguments, and where body - might also not be provided), the following steps are taken: - - 1. Create and return a new Function object exactly if the function constructor - had been called with the same arguments (15.3.2.1). - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ -var SECTION = "15.3.1.1-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The Function Constructor Called as a Function"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var myfunc2 = Function("a, b, c", "return a+b+c" ); -var myfunc3 = Function("a,b", "c", "return a+b+c" ); - -myfunc2.toString = Object.prototype.toString; -myfunc3.toString = Object.prototype.toString; - - -new TestCase( SECTION, - "myfunc2.__proto__", - Function.prototype, - myfunc2.__proto__ ); - -new TestCase( SECTION, - "myfunc3.__proto__", - Function.prototype, - myfunc3.__proto__ ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.3.2.1-1.js b/tests/auto/declarative/parserstress/tests/ecma/extensions/15.3.2.1-1.js deleted file mode 100644 index fab359211f..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.3.2.1-1.js +++ /dev/null @@ -1,72 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.3.2.1-1.js'; - -/** - File Name: 15.3.2.1.js - ECMA Section: 15.3.2.1 The Function Constructor - new Function(p1, p2, ..., pn, body ) - - Description: The last argument specifies the body (executable code) - of a function; any preceeding arguments sepcify formal - parameters. - - See the text for description of this section. - - This test examples from the specification. - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ -var SECTION = "15.3.2.1"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The Function Constructor"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -var MyObject = new Function( "value", "this.value = value; this.valueOf = new Function( 'return this.value' ); this.toString = new Function( 'return String(this.value);' )" ); - -new TestCase( SECTION, - "MyObject.__proto__ == Function.prototype", - true, - MyObject.__proto__ == Function.prototype ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.3.2.1-2.js b/tests/auto/declarative/parserstress/tests/ecma/extensions/15.3.2.1-2.js deleted file mode 100644 index 0b37e21028..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.3.2.1-2.js +++ /dev/null @@ -1,72 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.3.2.1-2.js'; - -/** - File Name: 15.3.2.1.js - ECMA Section: 15.3.2.1 The Function Constructor - new Function(p1, p2, ..., pn, body ) - - Description: - Author: christine@netscape.com - Date: 28 october 1997 - -*/ -var SECTION = "15.3.2.1-2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "The Function Constructor"; - -writeHeaderToLog( SECTION + " "+ TITLE); - - -var myfunc1 = new Function("a","b","c", "return a+b+c" ); -var myfunc2 = new Function("a, b, c", "return a+b+c" ); -var myfunc3 = new Function("a,b", "c", "return a+b+c" ); - -myfunc1.toString = Object.prototype.toString; -myfunc2.toString = Object.prototype.toString; -myfunc3.toString = Object.prototype.toString; - - -new TestCase( SECTION, "myfunc2.__proto__", Function.prototype, myfunc2.__proto__ ); - -new TestCase( SECTION, "myfunc3.__proto__", Function.prototype, myfunc3.__proto__ ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.3.3.1-1.js b/tests/auto/declarative/parserstress/tests/ecma/extensions/15.3.3.1-1.js deleted file mode 100644 index d4f22ff257..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.3.3.1-1.js +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.3.3.1-1.js'; - -/** - File Name: 15.3.3.1-1.js - ECMA Section: 15.3.3.1 Properties of the Function Constructor - Function.prototype - - Description: The initial value of Function.prototype is the built-in - Function prototype object. - - This property shall have the attributes [DontEnum | - DontDelete | ReadOnly] - - This test the value of Function.prototype. - - Author: christine@netscape.com - Date: 28 october 1997 - -*/ -var SECTION = "15.3.3.1-1"; -var VERSION = "ECMA_2"; -startTest(); -var TITLE = "Function.prototype"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "Function.prototype == Function.__proto__", true, Function.__proto__ == Function.prototype ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.4.3.js b/tests/auto/declarative/parserstress/tests/ecma/extensions/15.4.3.js deleted file mode 100644 index 8cbf949855..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.4.3.js +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.4.3.js'; - -/** - 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); - -new TestCase( SECTION, - "Array.__proto__", - Function.prototype, - Array.__proto__ ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.5.3.js b/tests/auto/declarative/parserstress/tests/ecma/extensions/15.5.3.js deleted file mode 100644 index c25398c4f4..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.5.3.js +++ /dev/null @@ -1,66 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.3.js'; - -/** - File Name: 15.5.3.1.js - ECMA Section: 15.5.3 Properties of the String Constructor - - Description: The value of the internal [[Prototype]] property of - the String constructor is the Function prototype - object. - - In addition to the internal [[Call]] and [[Construct]] - properties, the String constructor also has the length - property, as well as properties described in 15.5.3.1 - and 15.5.3.2. - - Author: christine@netscape.com - Date: 1 october 1997 -*/ - -var SECTION = "15.5.3"; -var VERSION = "ECMA_2"; -startTest(); -var passed = true; -writeHeaderToLog( SECTION + " Properties of the String Constructor" ); - -new TestCase( SECTION, "String.prototype", Function.prototype, String.__proto__ ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.5.4.2.js b/tests/auto/declarative/parserstress/tests/ecma/extensions/15.5.4.2.js deleted file mode 100644 index ebf4d03781..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.5.4.2.js +++ /dev/null @@ -1,59 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.2.js'; - -/** - File Name: 15.5.4.2.js - ECMA Section: 15.5.4.2 String.prototype.toString - - Description: - Author: christine@netscape.com - Date: 28 october 1997 - -*/ -var SECTION = "15.5.4.2"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "String.prototype.tostring"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, "String.prototype.toString.__proto__", Function.prototype, String.prototype.toString.__proto__ ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.5.4.4-4.js b/tests/auto/declarative/parserstress/tests/ecma/extensions/15.5.4.4-4.js deleted file mode 100644 index c2e115e0c6..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.5.4.4-4.js +++ /dev/null @@ -1,107 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.4-4.js'; - -/** - File Name: 15.5.4.4-4.js - ECMA Section: 15.5.4.4 String.prototype.charAt(pos) - Description: Returns a string containing the character at position - pos in the string. If there is no character at that - string, the result is the empty string. The result is - a string value, not a String object. - - When the charAt method is called with one argument, - pos, the following steps are taken: - 1. Call ToString, with this value as its argument - 2. Call ToInteger pos - 3. Compute the number of characters in Result(1) - 4. If Result(2) is less than 0 is or not less than - Result(3), return the empty string - 5. Return a string of length 1 containing one character - from result (1), the character at position Result(2). - - Note that the charAt function is intentionally generic; - it does not require that its this value be a String - object. Therefore it can be transferred to other kinds - of objects for use as a method. - - This tests assiging charAt to primitive types.. - - Author: christine@netscape.com - Date: 2 october 1997 -*/ -var SECTION = "15.5.4.4-4"; -var VERSION = "ECMA_2"; -startTest(); -var TITLE = "String.prototype.charAt"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -/* - new TestCase( SECTION, "x = null; x.__proto.charAt = String.prototype.charAt; x.charAt(0)", "n", eval("x=null; x.__proto__.charAt = String.prototype.charAt; x.charAt(0)") ); - new TestCase( SECTION, "x = null; x.__proto.charAt = String.prototype.charAt; x.charAt(1)", "u", eval("x=null; x.__proto__.charAt = String.prototype.charAt; x.charAt(1)") ); - new TestCase( SECTION, "x = null; x.__proto.charAt = String.prototype.charAt; x.charAt(2)", "l", eval("x=null; x.__proto__.charAt = String.prototype.charAt; x.charAt(2)") ); - new TestCase( SECTION, "x = null; x.__proto.charAt = String.prototype.charAt; x.charAt(3)", "l", eval("x=null; x.__proto__.charAt = String.prototype.charAt; x.charAt(3)") ); - - new TestCase( SECTION, "x = undefined; x.__proto.charAt = String.prototype.charAt; x.charAt(0)", "u", eval("x=undefined; x.__proto__.charAt = String.prototype.charAt; x.charAt(0)") ); - new TestCase( SECTION, "x = undefined; x.__proto.charAt = String.prototype.charAt; x.charAt(1)", "n", eval("x=undefined; x.__proto__.charAt = String.prototype.charAt; x.charAt(1)") ); - new TestCase( SECTION, "x = undefined; x.__proto.charAt = String.prototype.charAt; x.charAt(2)", "d", eval("x=undefined; x.__proto__.charAt = String.prototype.charAt; x.charAt(2)") ); - new TestCase( SECTION, "x = undefined; x.__proto.charAt = String.prototype.charAt; x.charAt(3)", "e", eval("x=undefined; x.__proto__.charAt = String.prototype.charAt; x.charAt(3)") ); -*/ -new TestCase( SECTION, "x = false; x.__proto.charAt = String.prototype.charAt; x.charAt(0)", "f", eval("x=false; x.__proto__.charAt = String.prototype.charAt; x.charAt(0)") ); -new TestCase( SECTION, "x = false; x.__proto.charAt = String.prototype.charAt; x.charAt(1)", "a", eval("x=false; x.__proto__.charAt = String.prototype.charAt; x.charAt(1)") ); -new TestCase( SECTION, "x = false; x.__proto.charAt = String.prototype.charAt; x.charAt(2)", "l", eval("x=false; x.__proto__.charAt = String.prototype.charAt; x.charAt(2)") ); -new TestCase( SECTION, "x = false; x.__proto.charAt = String.prototype.charAt; x.charAt(3)", "s", eval("x=false; x.__proto__.charAt = String.prototype.charAt; x.charAt(3)") ); -new TestCase( SECTION, "x = false; x.__proto.charAt = String.prototype.charAt; x.charAt(4)", "e", eval("x=false; x.__proto__.charAt = String.prototype.charAt; x.charAt(4)") ); - -new TestCase( SECTION, "x = true; x.__proto.charAt = String.prototype.charAt; x.charAt(0)", "t", eval("x=true; x.__proto__.charAt = String.prototype.charAt; x.charAt(0)") ); -new TestCase( SECTION, "x = true; x.__proto.charAt = String.prototype.charAt; x.charAt(1)", "r", eval("x=true; x.__proto__.charAt = String.prototype.charAt; x.charAt(1)") ); -new TestCase( SECTION, "x = true; x.__proto.charAt = String.prototype.charAt; x.charAt(2)", "u", eval("x=true; x.__proto__.charAt = String.prototype.charAt; x.charAt(2)") ); -new TestCase( SECTION, "x = true; x.__proto.charAt = String.prototype.charAt; x.charAt(3)", "e", eval("x=true; x.__proto__.charAt = String.prototype.charAt; x.charAt(3)") ); - -new TestCase( SECTION, "x = NaN; x.__proto.charAt = String.prototype.charAt; x.charAt(0)", "N", eval("x=NaN; x.__proto__.charAt = String.prototype.charAt; x.charAt(0)") ); -new TestCase( SECTION, "x = NaN; x.__proto.charAt = String.prototype.charAt; x.charAt(1)", "a", eval("x=NaN; x.__proto__.charAt = String.prototype.charAt; x.charAt(1)") ); -new TestCase( SECTION, "x = NaN; x.__proto.charAt = String.prototype.charAt; x.charAt(2)", "N", eval("x=NaN; x.__proto__.charAt = String.prototype.charAt; x.charAt(2)") ); - -new TestCase( SECTION, "x = 123; x.__proto.charAt = String.prototype.charAt; x.charAt(0)", "1", eval("x=123; x.__proto__.charAt = String.prototype.charAt; x.charAt(0)") ); -new TestCase( SECTION, "x = 123; x.__proto.charAt = String.prototype.charAt; x.charAt(1)", "2", eval("x=123; x.__proto__.charAt = String.prototype.charAt; x.charAt(1)") ); -new TestCase( SECTION, "x = 123; x.__proto.charAt = String.prototype.charAt; x.charAt(2)", "3", eval("x=123; x.__proto__.charAt = String.prototype.charAt; x.charAt(2)") ); - - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.5.4.5-6.js b/tests/auto/declarative/parserstress/tests/ecma/extensions/15.5.4.5-6.js deleted file mode 100644 index 4eadc66c04..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.5.4.5-6.js +++ /dev/null @@ -1,94 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.5-6.js'; - -/** - File Name: 15.5.4.5-6.js - ECMA Section: 15.5.4.5 String.prototype.charCodeAt(pos) - Description: Returns a number (a nonnegative integer less than 2^16) - representing the Unicode encoding of the character at - position pos in this string. If there is no character - at that position, the number is NaN. - - When the charCodeAt method is called with one argument - pos, the following steps are taken: - 1. Call ToString, giving it the theis value as its - argument - 2. Call ToInteger(pos) - 3. Compute the number of characters in result(1). - 4. If Result(2) is less than 0 or is not less than - Result(3), return NaN. - 5. Return a value of Number type, of positive sign, whose - magnitude is the Unicode encoding of one character - from result 1, namely the characer at position Result - (2), where the first character in Result(1) is - considered to be at position 0. - - Note that the charCodeAt funciton is intentionally - generic; it does not require that its this value be a - String object. Therefore it can be transferred to other - kinds of objects for use as a method. - - Author: christine@netscape.com - Date: 2 october 1997 -*/ -var SECTION = "15.5.4.5-6"; -var VERSION = "ECMA_2"; -startTest(); -var TITLE = "String.prototype.charCodeAt"; - -writeHeaderToLog( SECTION + " "+ TITLE); - - -new TestCase( SECTION, - "var obj = true; obj.__proto__.charCodeAt = String.prototype.charCodeAt; var s = ''; for ( var i = 0; i < 4; i++ ) s+= String.fromCharCode( obj.charCodeAt(i) ); s", - "true", - eval("var obj = true; obj.__proto__.charCodeAt = String.prototype.charCodeAt; var s = ''; for ( var i = 0; i < 4; i++ ) s+= String.fromCharCode( obj.charCodeAt(i) ); s") ); - -new TestCase( SECTION, - "var obj = 1234; obj.__proto__.charCodeAt = String.prototype.charCodeAt; var s = ''; for ( var i = 0; i < 4; i++ ) s+= String.fromCharCode( obj.charCodeAt(i) ); s", - "1234", - eval("var obj = 1234; obj.__proto__.charCodeAt = String.prototype.charCodeAt; var s = ''; for ( var i = 0; i < 4; i++ ) s+= String.fromCharCode( obj.charCodeAt(i) ); s") ); - -new TestCase( SECTION, - "var obj = 'hello'; obj.__proto__.charCodeAt = String.prototype.charCodeAt; var s = ''; for ( var i = 0; i < 5; i++ ) s+= String.fromCharCode( obj.charCodeAt(i) ); s", - "hello", - eval("var obj = 'hello'; obj.__proto__.charCodeAt = String.prototype.charCodeAt; var s = ''; for ( var i = 0; i < 5; i++ ) s+= String.fromCharCode( obj.charCodeAt(i) ); s") ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.5.4.7-3.js b/tests/auto/declarative/parserstress/tests/ecma/extensions/15.5.4.7-3.js deleted file mode 100644 index c5832fd477..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.5.4.7-3.js +++ /dev/null @@ -1,161 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.5.4.7-3.js'; - -/** - File Name: 15.5.4.7-3.js - ECMA Section: 15.5.4.7 String.prototype.lastIndexOf( searchString, pos) - Description: - - If the given searchString appears as a substring of the result of - converting this object to a string, at one or more positions that are - at or to the left of the specified position, then the index of the - rightmost such position is returned; otherwise -1 is returned. If position - is undefined or not supplied, the length of this string value is assumed, - so as to search all of the string. - - When the lastIndexOf method is called with two arguments searchString and - position, the following steps are taken: - - 1.Call ToString, giving it the this value as its argument. - 2.Call ToString(searchString). - 3.Call ToNumber(position). (If position is undefined or not supplied, this step produces the value NaN). - 4.If Result(3) is NaN, use +; otherwise, call ToInteger(Result(3)). - 5.Compute the number of characters in Result(1). - 6.Compute min(max(Result(4), 0), Result(5)). - 7.Compute the number of characters in the string that is Result(2). - 8.Compute the largest possible integer k not larger than Result(6) such that k+Result(7) is not greater - than Result(5), and for all nonnegative integers j less than Result(7), the character at position k+j of - Result(1) is the same as the character at position j of Result(2); but if there is no such integer k, then - compute the value -1. - - 1.Return Result(8). - - Note that the lastIndexOf function is intentionally generic; it does not require that its this value be a - String object. Therefore it can be transferred to other kinds of objects for use as a method. - - Author: christine@netscape.com - Date: 2 october 1997 -*/ -var SECTION = "15.5.4.7-3"; -var VERSION = "ECMA_2"; -startTest(); -var TITLE = "String.protoype.lastIndexOf"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "var b = true; b.__proto__.lastIndexOf = String.prototype.lastIndexOf; b.lastIndexOf('r', 0 )", - -1, - eval("var b = true; b.__proto__.lastIndexOf = String.prototype.lastIndexOf; b.lastIndexOf('r', 0 )") ); - -new TestCase( SECTION, - "var b = true; b.__proto__.lastIndexOf = String.prototype.lastIndexOf; b.lastIndexOf('r', 1 )", - 1, - eval("var b = true; b.__proto__.lastIndexOf = String.prototype.lastIndexOf; b.lastIndexOf('r', 1 )") ); - -new TestCase( SECTION, - "var b = true; b.__proto__.lastIndexOf = String.prototype.lastIndexOf; b.lastIndexOf('r', 2 )", - 1, - eval("var b = true; b.__proto__.lastIndexOf = String.prototype.lastIndexOf; b.lastIndexOf('r', 2 )") ); - -new TestCase( SECTION, - "var b = true; b.__proto__.lastIndexOf = String.prototype.lastIndexOf; b.lastIndexOf('r', 10 )", - 1, - eval("var b = true; b.__proto__.lastIndexOf = String.prototype.lastIndexOf; b.lastIndexOf('r', 10 )") ); - -new TestCase( SECTION, - "var b = true; b.__proto__.lastIndexOf = String.prototype.lastIndexOf; b.lastIndexOf('r' )", - 1, - eval("var b = true; b.__proto__.lastIndexOf = String.prototype.lastIndexOf; b.lastIndexOf('r' )") ); - -test(); - -function LastIndexOf( string, search, position ) { - string = String( string ); - search = String( search ); - - position = Number( position ) - - if ( isNaN( position ) ) { - position = Infinity; - } else { - position = ToInteger( position ); - } - - result5= string.length; - result6 = Math.min(Math.max(position, 0), result5); - result7 = search.length; - - if (result7 == 0) { - return Math.min(position, result5); - } - - result8 = -1; - - for ( k = 0; k <= result6; k++ ) { - if ( k+ result7 > result5 ) { - break; - } - for ( j = 0; j < result7; j++ ) { - if ( string.charAt(k+j) != search.charAt(j) ){ - break; - } else { - if ( j == result7 -1 ) { - result8 = k; - } - } - } - } - - return result8; -} -function ToInteger( n ) { - n = Number( n ); - if ( isNaN(n) ) { - return 0; - } - if ( Math.abs(n) == 0 || Math.abs(n) == Infinity ) { - return n; - } - - var sign = ( n < 0 ) ? -1 : 1; - - return ( sign * Math.floor(Math.abs(n)) ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.6.3.1-5.js b/tests/auto/declarative/parserstress/tests/ecma/extensions/15.6.3.1-5.js deleted file mode 100644 index b9f35b8225..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.6.3.1-5.js +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.6.3.1-5.js'; - -/** - 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 ); - -new TestCase( SECTION, "Function.prototype == Boolean.__proto__", true, Function.prototype == Boolean.__proto__ ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.6.3.js b/tests/auto/declarative/parserstress/tests/ecma/extensions/15.6.3.js deleted file mode 100644 index 0ae48c59f2..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.6.3.js +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.6.3.js'; - -/** - 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 ); - - -new TestCase( SECTION, "Boolean.__proto__ == Function.prototype", true, Boolean.__proto__ == Function.prototype ); -new TestCase( SECTION, "Boolean.length", 1, Boolean.length ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.6.4-2.js b/tests/auto/declarative/parserstress/tests/ecma/extensions/15.6.4-2.js deleted file mode 100644 index 7ca222235f..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.6.4-2.js +++ /dev/null @@ -1,66 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.6.4-2.js'; - -/** - 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"); - -new TestCase( SECTION, "Boolean.prototype.__proto__", Object.prototype, Boolean.prototype.__proto__ ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.7.3.js b/tests/auto/declarative/parserstress/tests/ecma/extensions/15.7.3.js deleted file mode 100644 index 84e362c2db..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.7.3.js +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.7.3.js'; - -/** - File Name: 15.7.3.js - 15.7.3 Properties of the Number Constructor - - Description: The value of the internal [[Prototype]] property - of the Number constructor is the Function prototype - object. The Number constructor also has the internal - [[Call]] and [[Construct]] properties, and the length - property. - - Other properties are in subsequent tests. - - Author: christine@netscape.com - Date: 29 september 1997 -*/ - -var SECTION = "15.7.3"; -var VERSION = "ECMA_2"; -startTest(); -var TITLE = "Properties of the Number Constructor"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase(SECTION, - "Number.__proto__", - Function.prototype, - Number.__proto__ ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.7.4.js b/tests/auto/declarative/parserstress/tests/ecma/extensions/15.7.4.js deleted file mode 100644 index 733b937e55..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.7.4.js +++ /dev/null @@ -1,90 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.7.4.js'; - -/** - File Name: 15.7.4.js - ECMA Section: 15.7.4 - - Description: - - The Number prototype object is itself a Number object (its [[Class]] is - "Number") whose value is +0. - - The value of the internal [[Prototype]] property of the Number prototype - object is the Object prototype object (15.2.3.1). - - In following descriptions of functions that are properties of the Number - prototype object, the phrase "this Number 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 "Number". Also, the phrase "this number value" refers - to the number value represented by this Number object, that is, the value - of the internal [[Value]] property of this Number object. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "15.7.4"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Properties of the Number Prototype Object"; - -writeHeaderToLog( SECTION + " "+TITLE); - -new TestCase( SECTION, - "Number.prototype.toString=Object.prototype.toString;Number.prototype.toString()", - "[object Number]", - eval("Number.prototype.toString=Object.prototype.toString;Number.prototype.toString()") ); - -new TestCase( SECTION, - "typeof Number.prototype", - "object", - typeof Number.prototype ); - -new TestCase( SECTION, - "Number.prototype.valueOf()", - 0, - Number.prototype.valueOf() ); - -// The __proto__ property cannot be used in ECMA_1 tests. -// new TestCase( SECTION, "Number.prototype.__proto__", Object.prototype, Number.prototype.__proto__ ); -// new TestCase( SECTION, "Number.prototype.__proto__ == Object.prototype", true, Number.prototype.__proto__ == Object.prototype ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.8-1.js b/tests/auto/declarative/parserstress/tests/ecma/extensions/15.8-1.js deleted file mode 100644 index 0f51cf5e61..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.8-1.js +++ /dev/null @@ -1,84 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.8-1.js'; - -/** - File Name: 15.8-1.js - ECMA Section: 15.8 The Math Object - - Description: - - The Math object is merely a single object that has some named properties, - some of which are functions. - - The value of the internal [[Prototype]] property of the Math object is the - Object prototype object (15.2.3.1). - - The Math object does not have a [[Construct]] property; it is not possible - to use the Math object as a constructor with the new operator. - - The Math object does not have a [[Call]] property; it is not possible to - invoke the Math object as a function. - - Recall that, in this specification, the phrase "the number value for x" has - a technical meaning defined in section 8.5. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ - -var SECTION = "15.8-1"; -var VERSION = "ECMA_2"; -startTest(); -var TITLE = "The Math Object"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "Math.__proto__ == Object.prototype", - true, - Math.__proto__ == Object.prototype ); - -new TestCase( SECTION, - "Math.__proto__", - Object.prototype, - Math.__proto__ ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.9.5.js b/tests/auto/declarative/parserstress/tests/ecma/extensions/15.9.5.js deleted file mode 100644 index 54e6bb6f0f..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/extensions/15.9.5.js +++ /dev/null @@ -1,76 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '15.9.5.js'; - -/** - File Name: 15.9.5.js - ECMA Section: 15.9.5 Properties of the Date prototype object - Description: - - The Date prototype object is itself a Date object (its [[Class]] is - "Date") whose value is NaN. - - The value of the internal [[Prototype]] property of the Date prototype - object is the Object prototype object (15.2.3.1). - - In following descriptions of functions that are properties of the Date - prototype object, the phrase "this Date 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 "Date". Also, the phrase "this time value" refers - to the number value for the time represented by this Date object, that is, - the value of the internal [[Value]] property of this Date object. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "15.9.5"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "Properties of the Date Prototype Object"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "Date.prototype.__proto__ == Object.prototype", - true, - Date.prototype.__proto__ == Object.prototype ); -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma/extensions/8.6.2.1-1.js b/tests/auto/declarative/parserstress/tests/ecma/extensions/8.6.2.1-1.js deleted file mode 100644 index a99bb01ee6..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/extensions/8.6.2.1-1.js +++ /dev/null @@ -1,98 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '8.6.2.1-1.js'; - -/** - File Name: 8.6.2.1-1.js - ECMA Section: 8.6.2.1 Get (Value) - Description: - - When the [[Get]] method of O is called with property name P, the following - steps are taken: - - 1. If O doesn't have a property with name P, go to step 4. - 2. Get the value of the property. - 3. Return Result(2). - 4. If the [[Prototype]] of O is null, return undefined. - 5. Call the [[Get]] method of [[Prototype]] with property name P. - 6. Return Result(5). - - This tests [[Get]] (Value). - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "8.6.2.1-1"; -var VERSION = "ECMA_1"; -startTest(); - -writeHeaderToLog( SECTION + " [[Get]] (Value)"); - -new TestCase( SECTION, "var OBJ = new MyValuelessObject(true); OBJ.valueOf()", true, eval("var OBJ = new MyValuelessObject(true); OBJ.valueOf()") ); -// new TestCase( SECTION, "var OBJ = new MyProtoValuelessObject(true); OBJ + ''", "undefined", eval("var OBJ = new MyProtoValuelessObject(); OBJ + ''") ); -new TestCase( SECTION, "var OBJ = new MyProtolessObject(true); OBJ.valueOf()", true, eval("var OBJ = new MyProtolessObject(true); OBJ.valueOf()") ); - -new TestCase( SECTION, "var OBJ = new MyValuelessObject(Number.POSITIVE_INFINITY); OBJ.valueOf()", Number.POSITIVE_INFINITY, eval("var OBJ = new MyValuelessObject(Number.POSITIVE_INFINITY); OBJ.valueOf()") ); -// new TestCase( SECTION, "var OBJ = new MyProtoValuelessObject(Number.POSITIVE_INFINITY); OBJ + ''", "undefined", eval("var OBJ = new MyProtoValuelessObject(); OBJ + ''") ); -new TestCase( SECTION, "var OBJ = new MyProtolessObject(Number.POSITIVE_INFINITY); OBJ.valueOf()", Number.POSITIVE_INFINITY, eval("var OBJ = new MyProtolessObject(Number.POSITIVE_INFINITY); OBJ.valueOf()") ); - -new TestCase( SECTION, "var OBJ = new MyValuelessObject('string'); OBJ.valueOf()", 'string', eval("var OBJ = new MyValuelessObject('string'); OBJ.valueOf()") ); -// new TestCase( SECTION, "var OBJ = new MyProtoValuelessObject('string'); OJ + ''", "undefined", eval("var OBJ = new MyProtoValuelessObject(); OBJ + ''") ); -new TestCase( SECTION, "var OBJ = new MyProtolessObject('string'); OBJ.valueOf()", 'string', eval("var OBJ = new MyProtolessObject('string'); OBJ.valueOf()") ); - -test(); - -function MyProtoValuelessObject(value) { - this.valueOf = new Function ( "" ); - this.__proto__ = null; -} - -function MyProtolessObject( value ) { - this.valueOf = new Function( "return this.value" ); - this.__proto__ = null; - this.value = value; -} -function MyValuelessObject(value) { - this.__proto__ = new MyPrototypeObject(value); -} -function MyPrototypeObject(value) { - this.valueOf = new Function( "return this.value;" ); - this.toString = new Function( "return (this.value + '');" ); - this.value = value; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/extensions/9.9-1.js b/tests/auto/declarative/parserstress/tests/ecma/extensions/9.9-1.js deleted file mode 100644 index 0df44013cd..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/extensions/9.9-1.js +++ /dev/null @@ -1,102 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = '9.9-1.js'; - -/** - File Name: 9.9-1.js - ECMA Section: 9.9 Type Conversion: ToObject - Description: - - undefined generate a runtime error - null generate a runtime error - boolean create a new Boolean object whose default - value is the value of the boolean. - number Create a new Number object whose default - value is the value of the number. - string Create a new String object whose default - value is the value of the string. - object Return the input argument (no conversion). - Author: christine@netscape.com - Date: 17 july 1997 -*/ - -var VERSION = "ECMA_1"; -startTest(); -var SECTION = "9.9-1"; - -writeHeaderToLog( SECTION + " Type Conversion: ToObject" ); - -new TestCase( SECTION, "(Object(true)).__proto__", Boolean.prototype, (Object(true)).__proto__ ); - -new TestCase( SECTION, "(Object(true)).__proto__", Boolean.prototype, (Object(true)).__proto__ ); - -new TestCase( SECTION, "(Object(0)).__proto__", Number.prototype, (Object(0)).__proto__ ); - -new TestCase( SECTION, "(Object(-0)).__proto__", Number.prototype, (Object(-0)).__proto__ ); - -new TestCase( SECTION, "(Object(1)).__proto__", Number.prototype, (Object(1)).__proto__ ); - -new TestCase( SECTION, "(Object(-1)).__proto__", Number.prototype, (Object(-1)).__proto__ ); - -new TestCase( SECTION, "(Object(Number.MAX_VALUE)).__proto__", Number.prototype, (Object(Number.MAX_VALUE)).__proto__ ); - -new TestCase( SECTION, "(Object(Number.MIN_VALUE)).__proto__", Number.prototype, (Object(Number.MIN_VALUE)).__proto__ ); - -new TestCase( SECTION, "(Object(Number.POSITIVE_INFINITY)).__proto__", Number.prototype, (Object(Number.POSITIVE_INFINITY)).__proto__ ); - -new TestCase( SECTION, "(Object(Number.NEGATIVE_INFINITY)).__proto__", Number.prototype, (Object(Number.NEGATIVE_INFINITY)).__proto__ ); - -new TestCase( SECTION, "(Object(Number.NaN)).__proto__", Number.prototype, (Object(Number.NaN)).__proto__ ); - -new TestCase( SECTION, "(Object('a string')).__proto__", String.prototype, (Object("a string")).__proto__ ); - -new TestCase( SECTION, "(Object('')).__proto__", String.prototype, (Object("")).__proto__ ); - -new TestCase( SECTION, "(Object('\\r\\t\\b\\n\\v\\f')).__proto__", String.prototype, (Object("\\r\\t\\b\\n\\v\\f")).__proto__ ); - -new TestCase( SECTION, "Object( '\\\'\\\"\\' ).__proto__", String.prototype, (Object("\'\"\\")).__proto__ ); - -new TestCase( SECTION, "(Object( new MyObject(true) )).toString()", "[object Object]", eval("(Object( new MyObject(true) )).toString()") ); - -test(); - -function MyObject( value ) { - this.value = value; - this.valueOf = new Function ( "return this.value" ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/extensions/browser.js b/tests/auto/declarative/parserstress/tests/ecma/extensions/browser.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/auto/declarative/parserstress/tests/ecma/extensions/shell.js b/tests/auto/declarative/parserstress/tests/ecma/extensions/shell.js deleted file mode 100644 index 3f52cffbc0..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/extensions/shell.js +++ /dev/null @@ -1 +0,0 @@ -gTestsubsuite = 'extensions'; diff --git a/tests/auto/declarative/parserstress/tests/ecma/jsref.js b/tests/auto/declarative/parserstress/tests/ecma/jsref.js deleted file mode 100644 index 1416643e1e..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/jsref.js +++ /dev/null @@ -1,634 +0,0 @@ -var completed = false; -var testcases; -var tc = 0; - -SECTION = ""; -VERSION = ""; -BUGNUMBER = ""; -TITLE = ""; - -/* - * constant strings - */ -var GLOBAL = "[object global]"; -var PASSED = " PASSED!" -var FAILED = " FAILED! expected: "; -var DEBUG = false; - -TZ_DIFF = -8; - -var TT = ""; -var TT_ = ""; -var BR = ""; -var NBSP = " "; -var CR = "\n"; -var FONT = ""; -var FONT_ = ""; -var FONT_RED = ""; -var FONT_GREEN = ""; -var B = ""; -var B_ = "" -var H2 = ""; -var H2_ = ""; -var HR = ""; -var DEBUG = false; - -var PASSED = " PASSED!" -var FAILED = " FAILED! expected: "; - -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 ); -} -/* wrapper for test cas constructor that doesn't require the SECTION - * argument. - */ - -function AddTestCase( description, expect, actual ) { - testcases[tc++] = new TestCase( SECTION, description, expect, actual ); -} - -function TestCase( n, d, e, a ) { - this.name = n; - this.description = d; - this.expect = e; - this.actual = a; - this.passed = true; - this.reason = ""; - this.bugnumber = BUGNUMBER; - - this.passed = getTestCaseResult( this.expect, this.actual ); - if ( DEBUG ) { - print( "added " + this.description ); - } - - testcases[tc++] = this; -} - -/* - * Set up test environment. - * - */ -function startTest() { - if ( version ) { - // JavaScript 1.3 is supposed to be compliant ecma version 1.0 - if ( VERSION == "ECMA_1" ) { - version ( "130" ); - } - if ( VERSION == "JS_1.3" ) { - version ( "130" ); - } - if ( VERSION == "JS_1.2" ) { - version ( "120" ); - } - if ( VERSION == "JS_1.1" ) { - version ( "110" ); - } - // for ecma version 2.0, we will leave the javascript version to - // the default ( for now ). - } - - // print out bugnumber - - if ( BUGNUMBER ) { - print ("BUGNUMBER: " + BUGNUMBER ); - } - - testcases = new Array(); - tc = 0; -} - - -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 getTestCaseResult( expect, actual ) { - // because ( NaN == NaN ) always returns false, need to do - // a special compare to see if we got the right result. - if ( actual != actual ) { - if ( typeof actual == "object" ) { - actual = "NaN object"; - } else { - actual = "NaN number"; - } - } - if ( expect != expect ) { - if ( typeof expect == "object" ) { - expect = "NaN object"; - } else { - expect = "NaN number"; - } - } - - var passed = ( expect == actual ) ? true : false; - - // if both objects are numbers - // need to replace w/ IEEE standard for rounding - if ( !passed - && typeof(actual) == "number" - && typeof(expect) == "number" - ) { - if ( Math.abs(actual-expect) < 0.0000001 ) { - passed = true; - } - } - - // verify type is the same - if ( typeof(expect) != typeof(actual) ) { - passed = false; - } - - return passed; -} -function writeTestCaseResult( expect, actual, string ) { - var passed = getTestCaseResult( expect, actual ); - writeFormattedResult( expect, actual, string, passed ); - return passed; -} -function writeFormattedResult( expect, actual, string, passed ) { - var s = TT + string ; - - for ( k = 0; - k < (60 - string.length >= 0 ? 60 - string.length : 5) ; - k++ ) { - } - - s += B ; - s += ( passed ) ? FONT_GREEN + NBSP + PASSED : FONT_RED + NBSP + FAILED + expect + TT_ ; - - print( s + FONT_ + B_ + TT_ ); - - return passed; -} - -function writeHeaderToLog( string ) { - print( H2 + string + H2_ ); -} -function stopTest() -{ - var sizeTag = "<#TEST CASES SIZE>"; - var doneTag = "<#TEST CASES DONE>"; - var beginTag = "<#TEST CASE "; - var endTag = ">"; - - print(sizeTag); - print(testcases.length); - for (tc = 0; tc < testcases.length; tc++) - { - print(beginTag + 'PASSED' + endTag); - print(testcases[tc].passed); - print(beginTag + 'NAME' + endTag); - print(testcases[tc].name); - print(beginTag + 'EXPECTED' + endTag); - print(testcases[tc].expect); - print(beginTag + 'ACTUAL' + endTag); - print(testcases[tc].actual); - print(beginTag + 'DESCRIPTION' + endTag); - print(testcases[tc].description); - print(beginTag + 'REASON' + endTag); - print(( testcases[tc].passed ) ? "" : "wrong value "); - print(beginTag + 'BUGNUMBER' + endTag); - print( BUGNUMBER ); - } - print(doneTag); - print( HR ); - gc(); -} -function getFailedCases() { - for ( var i = 0; i < testcases.length; i++ ) { - if ( ! testcases[i].passed ) { - print( testcases[i].description +" = " +testcases[i].actual +" expected: "+ testcases[i].expect ); - } - } -} -function err( msg, page, line ) { - testcases[tc].actual = "error"; - testcases[tc].reason = msg; - writeTestCaseResult( testcases[tc].expect, - testcases[tc].actual, - testcases[tc].description +" = "+ testcases[tc].actual + - ": " + testcases[tc].reason ); - stopTest(); - return true; -} - -/** - * Type Conversion functions used by Type Conversion - * - */ - - - - /* - * Date functions used by tests in Date suite - * - */ -var msPerDay = 86400000; -var HoursPerDay = 24; -var MinutesPerHour = 60; -var SecondsPerMinute = 60; -var msPerSecond = 1000; -var msPerMinute = 60000; // msPerSecond * SecondsPerMinute -var msPerHour = 3600000; // msPerMinute * MinutesPerHour - -var TIME_1970 = 0; -var TIME_2000 = 946684800000; -var TIME_1900 = -2208988800000; - -function Day( t ) { - return ( Math.floor(t/msPerDay ) ); -} -function DaysInYear( y ) { - if ( y % 4 != 0 ) { - return 365; - } - if ( (y % 4 == 0) && (y % 100 != 0) ) { - return 366; - } - if ( (y % 100 == 0) && (y % 400 != 0) ) { - return 365; - } - if ( (y % 400 == 0) ){ - return 366; - } else { - return "ERROR: DaysInYear(" + y + ") case not covered"; - } -} -function TimeInYear( y ) { - return ( DaysInYear(y) * msPerDay ); -} -function DayNumber( t ) { - return ( Math.floor( t / msPerDay ) ); -} -function TimeWithinDay( t ) { - if ( t < 0 ) { - return ( (t % msPerDay) + msPerDay ); - } else { - return ( t % msPerDay ); - } -} -function YearNumber( t ) { -} -function TimeFromYear( y ) { - return ( msPerDay * DayFromYear(y) ); -} -function DayFromYear( y ) { - return ( 365*(y-1970) + - Math.floor((y-1969)/4) - - Math.floor((y-1901)/100) + - Math.floor((y-1601)/400) ); -} -function InLeapYear( t ) { - if ( DaysInYear(YearFromTime(t)) == 365 ) { - return 0; - } - if ( DaysInYear(YearFromTime(t)) == 366 ) { - return 1; - } else { - return "ERROR: InLeapYear("+t+") case not covered"; - } -} -function YearFromTime( t ) { - t = Number( t ); - var sign = ( t < 0 ) ? -1 : 1; - var year = ( sign < 0 ) ? 1969 : 1970; - for ( var timeToTimeZero = t; ; ) { - // subtract the current year's time from the time that's left. - timeToTimeZero -= sign * TimeInYear(year) - - // if there's less than the current year's worth of time left, then break. - if ( sign < 0 ) { - if ( sign * timeToTimeZero <= 0 ) { - break; - } else { - year += sign; - } - } else { - if ( sign * timeToTimeZero < 0 ) { - break; - } else { - year += sign; - } - } - } - return ( year ); -} -function MonthFromTime( t ) { - // i know i could use switch but i'd rather not until it's part of ECMA - var day = DayWithinYear( t ); - var leap = InLeapYear(t); - - if ( (0 <= day) && (day < 31) ) { - return 0; - } - if ( (31 <= day) && (day < (59+leap)) ) { - return 1; - } - if ( ((59+leap) <= day) && (day < (90+leap)) ) { - return 2; - } - if ( ((90+leap) <= day) && (day < (120+leap)) ) { - return 3; - } - if ( ((120+leap) <= day) && (day < (151+leap)) ) { - return 4; - } - if ( ((151+leap) <= day) && (day < (181+leap)) ) { - return 5; - } - if ( ((181+leap) <= day) && (day < (212+leap)) ) { - return 6; - } - if ( ((212+leap) <= day) && (day < (243+leap)) ) { - return 7; - } - if ( ((243+leap) <= day) && (day < (273+leap)) ) { - return 8; - } - if ( ((273+leap) <= day) && (day < (304+leap)) ) { - return 9; - } - if ( ((304+leap) <= day) && (day < (334+leap)) ) { - return 10; - } - if ( ((334+leap) <= day) && (day < (365+leap)) ) { - return 11; - } else { - return "ERROR: MonthFromTime("+t+") not known"; - } -} -function DayWithinYear( t ) { - return( Day(t) - DayFromYear(YearFromTime(t))); -} -function DateFromTime( t ) { - var day = DayWithinYear(t); - var month = MonthFromTime(t); - - if ( month == 0 ) { - return ( day + 1 ); - } - if ( month == 1 ) { - return ( day - 30 ); - } - if ( month == 2 ) { - return ( day - 58 - InLeapYear(t) ); - } - if ( month == 3 ) { - return ( day - 89 - InLeapYear(t)); - } - if ( month == 4 ) { - return ( day - 119 - InLeapYear(t)); - } - if ( month == 5 ) { - return ( day - 150- InLeapYear(t)); - } - if ( month == 6 ) { - return ( day - 180- InLeapYear(t)); - } - if ( month == 7 ) { - return ( day - 211- InLeapYear(t)); - } - if ( month == 8 ) { - return ( day - 242- InLeapYear(t)); - } - if ( month == 9 ) { - return ( day - 272- InLeapYear(t)); - } - if ( month == 10 ) { - return ( day - 303- InLeapYear(t)); - } - if ( month == 11 ) { - return ( day - 333- InLeapYear(t)); - } - - return ("ERROR: DateFromTime("+t+") not known" ); -} -function WeekDay( t ) { - var weekday = (Day(t)+4) % 7; - return( weekday < 0 ? 7 + weekday : weekday ); -} - -// missing daylight savins time adjustment - -function HourFromTime( t ) { - var h = Math.floor( t / msPerHour ) % HoursPerDay; - return ( (h<0) ? HoursPerDay + h : h ); -} -function MinFromTime( t ) { - var min = Math.floor( t / msPerMinute ) % MinutesPerHour; - return( ( min < 0 ) ? MinutesPerHour + min : min ); -} -function SecFromTime( t ) { - var sec = Math.floor( t / msPerSecond ) % SecondsPerMinute; - return ( (sec < 0 ) ? SecondsPerMinute + sec : sec ); -} -function msFromTime( t ) { - var ms = t % msPerSecond; - return ( (ms < 0 ) ? msPerSecond + ms : ms ); -} -function LocalTZA() { - return ( TZ_DIFF * msPerHour ); -} -function UTC( t ) { - return ( t - LocalTZA() - DaylightSavingTA(t - LocalTZA()) ); -} -function DaylightSavingTA( t ) { - t = t - LocalTZA(); - - var dst_start = GetFirstSundayInApril(t) + 2*msPerHour; - var dst_end = GetLastSundayInOctober(t)+ 2*msPerHour; - - if ( t >= dst_start && t < dst_end ) { - return msPerHour; - } else { - return 0; - } - - // Daylight Savings Time starts on the first Sunday in April at 2:00AM in - // PST. Other time zones will need to override this function. - - print( new Date( UTC(dst_start + LocalTZA())) ); - - return UTC(dst_start + LocalTZA()); -} -function GetFirstSundayInApril( t ) { - var year = YearFromTime(t); - var leap = InLeapYear(t); - - var april = TimeFromYear(year) + TimeInMonth(0, leap) + TimeInMonth(1,leap) + - TimeInMonth(2,leap); - - for ( var first_sunday = april; WeekDay(first_sunday) > 0; - first_sunday += msPerDay ) - { - ; - } - - return first_sunday; -} -function GetLastSundayInOctober( t ) { - var year = YearFromTime(t); - var leap = InLeapYear(t); - - for ( var oct = TimeFromYear(year), m = 0; m < 9; m++ ) { - oct += TimeInMonth(m, leap); - } - for ( var last_sunday = oct + 30*msPerDay; WeekDay(last_sunday) > 0; - last_sunday -= msPerDay ) - { - ; - } - return last_sunday; -} -function LocalTime( t ) { - return ( t + LocalTZA() + DaylightSavingTA(t) ); -} -function MakeTime( hour, min, sec, ms ) { - if ( isNaN( hour ) || isNaN( min ) || isNaN( sec ) || isNaN( ms ) ) { - return Number.NaN; - } - - hour = ToInteger(hour); - min = ToInteger( min); - sec = ToInteger( sec); - ms = ToInteger( ms ); - - return( (hour*msPerHour) + (min*msPerMinute) + - (sec*msPerSecond) + ms ); -} -function MakeDay( year, month, date ) { - if ( isNaN(year) || isNaN(month) || isNaN(date) ) { - return Number.NaN; - } - year = ToInteger(year); - month = ToInteger(month); - date = ToInteger(date ); - - var sign = ( year < 1970 ) ? -1 : 1; - var t = ( year < 1970 ) ? 1 : 0; - var y = ( year < 1970 ) ? 1969 : 1970; - - var result5 = year + Math.floor( month/12 ); - var result6 = month % 12; - - if ( year < 1970 ) { - for ( y = 1969; y >= year; y += sign ) { - t += sign * TimeInYear(y); - } - } else { - for ( y = 1970 ; y < year; y += sign ) { - t += sign * TimeInYear(y); - } - } - - var leap = InLeapYear( t ); - - for ( var m = 0; m < month; m++ ) { - t += TimeInMonth( m, leap ); - } - - if ( YearFromTime(t) != result5 ) { - return Number.NaN; - } - if ( MonthFromTime(t) != result6 ) { - return Number.NaN; - } - if ( DateFromTime(t) != 1 ) { - return Number.NaN; - } - - return ( (Day(t)) + date - 1 ); -} -function TimeInMonth( month, leap ) { - // september april june november - // jan 0 feb 1 mar 2 apr 3 may 4 june 5 jul 6 - // aug 7 sep 8 oct 9 nov 10 dec 11 - - if ( month == 3 || month == 5 || month == 8 || month == 10 ) { - return ( 30*msPerDay ); - } - - // all the rest - if ( month == 0 || month == 2 || month == 4 || month == 6 || - month == 7 || month == 9 || month == 11 ) { - return ( 31*msPerDay ); - } - - // save february - return ( (leap == 0) ? 28*msPerDay : 29*msPerDay ); -} -function MakeDate( day, time ) { - if ( day == Number.POSITIVE_INFINITY || - day == Number.NEGATIVE_INFINITY || - day == Number.NaN ) { - return Number.NaN; - } - if ( time == Number.POSITIVE_INFINITY || - time == Number.POSITIVE_INFINITY || - day == Number.NaN) { - return Number.NaN; - } - return ( day * msPerDay ) + time; -} -function TimeClip( t ) { - if ( isNaN( t ) ) { - return ( Number.NaN ); - } - if ( Math.abs( t ) > 8.64e15 ) { - return ( Number.NaN ); - } - - return ( ToInteger( t ) ); -} -function ToInteger( t ) { - t = Number( t ); - - if ( isNaN( t ) ){ - return ( Number.NaN ); - } - if ( t == 0 || t == -0 || - t == Number.POSITIVE_INFINITY || t == Number.NEGATIVE_INFINITY ) { - return 0; - } - - var sign = ( t < 0 ) ? -1 : 1; - - return ( sign * Math.floor( Math.abs( t ) ) ); -} -function Enumerate ( o ) { - var properties = new Array(); - for ( p in o ) { - properties[ properties.length ] = new Array( p, o[p] ); - } - return properties; -} -function AddTestCase( description, expect, actual ) { - testcases[tc++] = new TestCase( SECTION, description, expect, actual ); -} - -function getFailedCases() { - for ( var i = 0; i < testcases.length; i++ ) { - if ( ! testcases[i].passed ) { - print( testcases[i].description +" = " +testcases[i].actual +" expected: "+ testcases[i].expect ); - } - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma/shell.js b/tests/auto/declarative/parserstress/tests/ecma/shell.js deleted file mode 100644 index 1c012601e6..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/shell.js +++ /dev/null @@ -1,577 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestsuite = 'ecma'; - -/* - * Date functions used by tests in Date suite - * - */ -var msPerDay = 86400000; -var HoursPerDay = 24; -var MinutesPerHour = 60; -var SecondsPerMinute = 60; -var msPerSecond = 1000; -var msPerMinute = 60000; // msPerSecond * SecondsPerMinute -var msPerHour = 3600000; // msPerMinute * MinutesPerHour -var TZ_DIFF = getTimeZoneDiff(); // offset of tester's timezone from UTC -var TZ_ADJUST = TZ_DIFF * msPerHour; -var TZ_PST = -8; // offset of Pacific Standard Time from UTC -var PST_DIFF = TZ_DIFF - TZ_PST; // offset of tester's timezone from PST -var PST_ADJUST = TZ_PST * msPerHour; -var TIME_0000 = (function () - { // calculate time for year 0 - for ( var time = 0, year = 1969; year >= 0; year-- ) { - time -= TimeInYear(year); - } - return time; - })(); -var TIME_1970 = 0; -var TIME_2000 = 946684800000; -var TIME_1900 = -2208988800000; -var UTC_FEB_29_2000 = TIME_2000 + 31*msPerDay + 28*msPerDay; -var UTC_JAN_1_2005 = TIME_2000 + TimeInYear(2000) + TimeInYear(2001) + - TimeInYear(2002) + TimeInYear(2003) + TimeInYear(2004); -var now = new Date(); -var TIME_NOW = now.valueOf(); //valueOf() is to accurate to the millisecond - //Date.parse() is accurate only to the second - -/* - * Originally, the test suite used a hard-coded value TZ_DIFF = -8. - * But that was only valid for testers in the Pacific Standard Time Zone! - * We calculate the proper number dynamically for any tester. We just - * have to be careful not to use a date subject to Daylight Savings Time... - */ -function getTimeZoneDiff() -{ - return -((new Date(2000, 1, 1)).getTimezoneOffset())/60; -} - -/* - * Date test "ResultArrays" are hard-coded for Pacific Standard Time. - * We must adjust them for the tester's own timezone - - */ -function adjustResultArray(ResultArray, msMode) -{ - // If the tester's system clock is in PST, no need to continue - -// if (!PST_DIFF) {return;} - - /* The date gTestcases instantiate Date objects in two different ways: - * - * millisecond mode: e.g. dt = new Date(10000000); - * year-month-day mode: dt = new Date(2000, 5, 1, ...); - * - * In the first case, the date is measured from Time 0 in Greenwich (i.e. UTC). - * In the second case, it is measured with reference to the tester's local timezone. - * - * In the first case we must correct those values expected for local measurements, - * like dt.getHours() etc. No correction is necessary for dt.getUTCHours() etc. - * - * In the second case, it is exactly the other way around - - */ - if (msMode) - { - // The hard-coded UTC milliseconds from Time 0 derives from a UTC date. - // Shift to the right by the offset between UTC and the tester. - var t = ResultArray[TIME] + TZ_DIFF*msPerHour; - - // Use our date arithmetic functions to determine the local hour, day, etc. - ResultArray[HOURS] = HourFromTime(t); - ResultArray[DAY] = WeekDay(t); - ResultArray[DATE] = DateFromTime(t); - ResultArray[MONTH] = MonthFromTime(t); - ResultArray[YEAR] = YearFromTime(t); - } - else - { - // The hard-coded UTC milliseconds from Time 0 derives from a PST date. - // Shift to the left by the offset between PST and the tester. - var t = ResultArray[TIME] - PST_DIFF*msPerHour; - - // Use our date arithmetic functions to determine the UTC hour, day, etc. - ResultArray[TIME] = t; - ResultArray[UTC_HOURS] = HourFromTime(t); - ResultArray[UTC_DAY] = WeekDay(t); - ResultArray[UTC_DATE] = DateFromTime(t); - ResultArray[UTC_MONTH] = MonthFromTime(t); - ResultArray[UTC_YEAR] = YearFromTime(t); - } -} - -function Day( t ) { - return ( Math.floor(t/msPerDay ) ); -} -function DaysInYear( y ) { - if ( y % 4 != 0 ) { - return 365; - } - if ( (y % 4 == 0) && (y % 100 != 0) ) { - return 366; - } - if ( (y % 100 == 0) && (y % 400 != 0) ) { - return 365; - } - if ( (y % 400 == 0) ){ - return 366; - } else { - return "ERROR: DaysInYear(" + y + ") case not covered"; - } -} -function TimeInYear( y ) { - return ( DaysInYear(y) * msPerDay ); -} -function DayNumber( t ) { - return ( Math.floor( t / msPerDay ) ); -} -function TimeWithinDay( t ) { - if ( t < 0 ) { - return ( (t % msPerDay) + msPerDay ); - } else { - return ( t % msPerDay ); - } -} -function YearNumber( t ) { -} -function TimeFromYear( y ) { - return ( msPerDay * DayFromYear(y) ); -} -function DayFromYear( y ) { - return ( 365*(y-1970) + - Math.floor((y-1969)/4) - - Math.floor((y-1901)/100) + - Math.floor((y-1601)/400) ); -} -function InLeapYear( t ) { - if ( DaysInYear(YearFromTime(t)) == 365 ) { - return 0; - } - if ( DaysInYear(YearFromTime(t)) == 366 ) { - return 1; - } else { - return "ERROR: InLeapYear("+ t + ") case not covered"; - } -} -function YearFromTime( t ) { - t = Number( t ); - var sign = ( t < 0 ) ? -1 : 1; - var year = ( sign < 0 ) ? 1969 : 1970; - for ( var timeToTimeZero = t; ; ) { - // subtract the current year's time from the time that's left. - timeToTimeZero -= sign * TimeInYear(year) - - // if there's less than the current year's worth of time left, then break. - if ( sign < 0 ) { - if ( sign * timeToTimeZero <= 0 ) { - break; - } else { - year += sign; - } - } else { - if ( sign * timeToTimeZero < 0 ) { - break; - } else { - year += sign; - } - } - } - return ( year ); -} -function MonthFromTime( t ) { - // i know i could use switch but i'd rather not until it's part of ECMA - var day = DayWithinYear( t ); - var leap = InLeapYear(t); - - if ( (0 <= day) && (day < 31) ) { - return 0; - } - if ( (31 <= day) && (day < (59+leap)) ) { - return 1; - } - if ( ((59+leap) <= day) && (day < (90+leap)) ) { - return 2; - } - if ( ((90+leap) <= day) && (day < (120+leap)) ) { - return 3; - } - if ( ((120+leap) <= day) && (day < (151+leap)) ) { - return 4; - } - if ( ((151+leap) <= day) && (day < (181+leap)) ) { - return 5; - } - if ( ((181+leap) <= day) && (day < (212+leap)) ) { - return 6; - } - if ( ((212+leap) <= day) && (day < (243+leap)) ) { - return 7; - } - if ( ((243+leap) <= day) && (day < (273+leap)) ) { - return 8; - } - if ( ((273+leap) <= day) && (day < (304+leap)) ) { - return 9; - } - if ( ((304+leap) <= day) && (day < (334+leap)) ) { - return 10; - } - if ( ((334+leap) <= day) && (day < (365+leap)) ) { - return 11; - } else { - return "ERROR: MonthFromTime("+t+") not known"; - } -} -function DayWithinYear( t ) { - return( Day(t) - DayFromYear(YearFromTime(t))); -} -function DateFromTime( t ) { - var day = DayWithinYear(t); - var month = MonthFromTime(t); - - if ( month == 0 ) { - return ( day + 1 ); - } - if ( month == 1 ) { - return ( day - 30 ); - } - if ( month == 2 ) { - return ( day - 58 - InLeapYear(t) ); - } - if ( month == 3 ) { - return ( day - 89 - InLeapYear(t)); - } - if ( month == 4 ) { - return ( day - 119 - InLeapYear(t)); - } - if ( month == 5 ) { - return ( day - 150- InLeapYear(t)); - } - if ( month == 6 ) { - return ( day - 180- InLeapYear(t)); - } - if ( month == 7 ) { - return ( day - 211- InLeapYear(t)); - } - if ( month == 8 ) { - return ( day - 242- InLeapYear(t)); - } - if ( month == 9 ) { - return ( day - 272- InLeapYear(t)); - } - if ( month == 10 ) { - return ( day - 303- InLeapYear(t)); - } - if ( month == 11 ) { - return ( day - 333- InLeapYear(t)); - } - - return ("ERROR: DateFromTime("+t+") not known" ); -} -function WeekDay( t ) { - var weekday = (Day(t)+4) % 7; - return( weekday < 0 ? 7 + weekday : weekday ); -} - -// missing daylight savings time adjustment - -function HourFromTime( t ) { - var h = Math.floor( t / msPerHour ) % HoursPerDay; - return ( (h<0) ? HoursPerDay + h : h ); -} -function MinFromTime( t ) { - var min = Math.floor( t / msPerMinute ) % MinutesPerHour; - return( ( min < 0 ) ? MinutesPerHour + min : min ); -} -function SecFromTime( t ) { - var sec = Math.floor( t / msPerSecond ) % SecondsPerMinute; - return ( (sec < 0 ) ? SecondsPerMinute + sec : sec ); -} -function msFromTime( t ) { - var ms = t % msPerSecond; - return ( (ms < 0 ) ? msPerSecond + ms : ms ); -} -function LocalTZA() { - return ( TZ_DIFF * msPerHour ); -} -function UTC( t ) { - return ( t - LocalTZA() - DaylightSavingTA(t - LocalTZA()) ); -} -function LocalTime( t ) { - return ( t + LocalTZA() + DaylightSavingTA(t) ); -} -function DaylightSavingTA( t ) { - t = t - LocalTZA(); - - var dst_start = GetDSTStart(t); - var dst_end = GetDSTEnd(t); - - if ( t >= dst_start && t < dst_end ) - return msPerHour; - - return 0; -} - -function GetFirstSundayInMonth( t, m ) { - var year = YearFromTime(t); - var leap = InLeapYear(t); - -// month m 0..11 -// april == 3 -// march == 2 - - // set time to first day of month m - var time = TimeFromYear(year); - for (var i = 0; i < m; ++i) - { - time += TimeInMonth(i, leap); - } - - for ( var first_sunday = time; WeekDay(first_sunday) > 0; - first_sunday += msPerDay ) - { - ; - } - - return first_sunday; -} - -function GetLastSundayInMonth( t, m ) { - var year = YearFromTime(t); - var leap = InLeapYear(t); - -// month m 0..11 -// april == 3 -// march == 2 - - // first day of following month - var time = TimeFromYear(year); - for (var i = 0; i <= m; ++i) - { - time += TimeInMonth(i, leap); - } - // prev day == last day of month - time -= msPerDay; - - for ( var last_sunday = time; WeekDay(last_sunday) > 0; - last_sunday -= msPerDay ) - { - ; - } - return last_sunday; -} - -/* - 15.9.1.9 Daylight Saving Time Adjustment - - The implementation of ECMAScript should not try to determine whether - the exact time was subject to daylight saving time, but just whether - daylight saving time would have been in effect if the current - daylight saving time algorithm had been used at the time. This avoids - complications such as taking into account the years that the locale - observed daylight saving time year round. -*/ - -/* - US DST algorithm - - Before 2007, DST starts first Sunday in April at 2 AM and ends last - Sunday in October at 2 AM - - Starting in 2007, DST starts second Sunday in March at 2 AM and ends - first Sunday in November at 2 AM - - Note that different operating systems behave differently. - - Fully patched Windows XP uses the 2007 algorithm for all dates while - fully patched Fedora Core 6 and RHEL 4 Linux use the algorithm in - effect at the time. - - Since pre-2007 DST is a subset of 2007 DST rules, this only affects - tests that occur in the period Mar-Apr and Oct-Nov where the two - algorithms do not agree. - -*/ - -function GetDSTStart( t ) -{ - return (GetFirstSundayInMonth(t, 2) + 7*msPerDay + 2*msPerHour - LocalTZA()); -} - -function GetDSTEnd( t ) -{ - return (GetFirstSundayInMonth(t, 10) + 2*msPerHour - LocalTZA()); -} - -function GetOldDSTStart( t ) -{ - return (GetFirstSundayInMonth(t, 3) + 2*msPerHour - LocalTZA()); -} - -function GetOldDSTEnd( t ) -{ - return (GetLastSundayInMonth(t, 9) + 2*msPerHour - LocalTZA()); -} - -function MakeTime( hour, min, sec, ms ) { - if ( isNaN( hour ) || isNaN( min ) || isNaN( sec ) || isNaN( ms ) ) { - return Number.NaN; - } - - hour = ToInteger(hour); - min = ToInteger( min); - sec = ToInteger( sec); - ms = ToInteger( ms ); - - return( (hour*msPerHour) + (min*msPerMinute) + - (sec*msPerSecond) + ms ); -} -function MakeDay( year, month, date ) { - if ( isNaN(year) || isNaN(month) || isNaN(date) ) { - return Number.NaN; - } - year = ToInteger(year); - month = ToInteger(month); - date = ToInteger(date ); - - var sign = ( year < 1970 ) ? -1 : 1; - var t = ( year < 1970 ) ? 1 : 0; - var y = ( year < 1970 ) ? 1969 : 1970; - - var result5 = year + Math.floor( month/12 ); - var result6 = month % 12; - - if ( year < 1970 ) { - for ( y = 1969; y >= year; y += sign ) { - t += sign * TimeInYear(y); - } - } else { - for ( y = 1970 ; y < year; y += sign ) { - t += sign * TimeInYear(y); - } - } - - var leap = InLeapYear( t ); - - for ( var m = 0; m < month; m++ ) { - t += TimeInMonth( m, leap ); - } - - if ( YearFromTime(t) != result5 ) { - return Number.NaN; - } - if ( MonthFromTime(t) != result6 ) { - return Number.NaN; - } - if ( DateFromTime(t) != 1 ) { - return Number.NaN; - } - - return ( (Day(t)) + date - 1 ); -} -function TimeInMonth( month, leap ) { - // september april june november - // jan 0 feb 1 mar 2 apr 3 may 4 june 5 jul 6 - // aug 7 sep 8 oct 9 nov 10 dec 11 - - if ( month == 3 || month == 5 || month == 8 || month == 10 ) { - return ( 30*msPerDay ); - } - - // all the rest - if ( month == 0 || month == 2 || month == 4 || month == 6 || - month == 7 || month == 9 || month == 11 ) { - return ( 31*msPerDay ); - } - - // save february - return ( (leap == 0) ? 28*msPerDay : 29*msPerDay ); -} -function MakeDate( day, time ) { - if ( day == Number.POSITIVE_INFINITY || - day == Number.NEGATIVE_INFINITY ) { - return Number.NaN; - } - if ( time == Number.POSITIVE_INFINITY || - time == Number.NEGATIVE_INFINITY ) { - return Number.NaN; - } - return ( day * msPerDay ) + time; -} -function TimeClip( t ) { - if ( isNaN( t ) ) { - return ( Number.NaN ); - } - if ( Math.abs( t ) > 8.64e15 ) { - return ( Number.NaN ); - } - - return ( ToInteger( t ) ); -} -function ToInteger( t ) { - t = Number( t ); - - if ( isNaN( t ) ){ - return ( Number.NaN ); - } - if ( t == 0 || t == -0 || - t == Number.POSITIVE_INFINITY || t == Number.NEGATIVE_INFINITY ) { - return 0; - } - - var sign = ( t < 0 ) ? -1 : 1; - - return ( sign * Math.floor( Math.abs( t ) ) ); -} -function Enumerate ( o ) { - var p; - for ( p in o ) { - print( p +": " + o[p] ); - } -} - -/* these functions are useful for running tests manually in Rhino */ - -function GetContext() { - return Packages.com.netscape.javascript.Context.getCurrentContext(); -} -function OptLevel( i ) { - i = Number(i); - var cx = GetContext(); - cx.setOptimizationLevel(i); -} -/* end of Rhino functions */ - diff --git a/tests/auto/declarative/parserstress/tests/ecma/template.js b/tests/auto/declarative/parserstress/tests/ecma/template.js deleted file mode 100644 index 8f11686890..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma/template.js +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Mozilla Foundation. - * Portions created by the Initial Developer are Copyright (C) 2007 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'template.js'; - -/** - * File Name: template.js - * Reference: ** replace with bugzilla URL or document reference ** - * Description: ** replace with description of test ** - * Author: ** replace with your e-mail address ** - */ - -var SECTION = ""; // provide a document reference (ie, ECMA section) -var VERSION = "ECMA"; // Version of JavaScript or ECMA -var TITLE = ""; // Provide ECMA section title or a description -var BUGNUMBER = ""; // Provide URL to bugsplat or bugzilla report - -startTest(); // leave this alone - -/* - * Calls to AddTestCase here. AddTestCase is a function that is defined - * in shell.js and takes three arguments: - * - a string representation of what is being tested - * - the expected result - * - the actual result - * - * For example, a test might look like this: - * - * AddTestCase("** description", - * "** expected value", - * "** actual value"); - */ - -// leave this alone. this executes the test cases and -// displays results. -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/boolean-001.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/boolean-001.js deleted file mode 100644 index 7462df2f98..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/boolean-001.js +++ /dev/null @@ -1,80 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'boolean-001.js'; - -/** - File Name: boolean-001.js - Description: Corresponds to ecma/Boolean/15.6.4.2-4-n.js - - 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 = "boolean-001.js"; -var VERSION = "JS1_4"; -var TITLE = "Boolean.prototype.toString()"; -startTest(); -writeHeaderToLog( SECTION +" "+ TITLE ); - -var exception = "No exception thrown"; -var result = "Failed"; - -var TO_STRING = Boolean.prototype.toString; - -try { - var s = new String("Not a Boolean"); - s.toString = TO_STRING; - s.toString(); -} catch ( e ) { - result = "Passed!"; - exception = e.toString(); -} - -new TestCase( - SECTION, - "Assigning Boolean.prototype.toString to a String object "+ - "(threw " +exception +")", - "Passed!", - result ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/boolean-002.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/boolean-002.js deleted file mode 100644 index 813e11cd39..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/boolean-002.js +++ /dev/null @@ -1,84 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'boolean-002.js'; - -/** - File Name: boolean-001.js - Description: Corresponds to ecma/Boolean/15.6.4.3-4-n.js - - 15.6.4.3 Boolean.prototype.valueOf() - 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: 09 september 1998 -*/ -var SECTION = "boolean-002.js"; -var VERSION = "JS1_4"; -var TITLE = "Boolean.prototype.valueOf()"; -startTest(); -writeHeaderToLog( SECTION +" "+ TITLE ); - - -var exception = "No exception thrown"; -var result = "Failed"; - -var VALUE_OF = Boolean.prototype.valueOf; - -try { - var s = new String("Not a Boolean"); - s.valueOf = VALUE_0F; - s.valueOf(); -} catch ( e ) { - result = "Passed!"; - exception = e.toString(); -} - -new TestCase( - SECTION, - "Assigning Boolean.prototype.valueOf to a String object "+ - "(threw " +exception +")", - "Passed!", - result ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/browser.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/browser.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/date-001.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/date-001.js deleted file mode 100644 index 041bbb523c..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/date-001.js +++ /dev/null @@ -1,93 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'date-001.js'; - -/** - File Name: date-001.js - Corresponds To: 15.9.5.2-2.js - ECMA Section: 15.9.5.2 Date.prototype.toString - Description: - This function returns a string value. The contents of the string are - implementation dependent, but are intended to represent the Date in a - convenient, human-readable form in the current time zone. - - The toString function is not generic; it generates a runtime error if its - this value is not a Date object. Therefore it cannot be transferred to - other kinds of objects for use as a method. - - - This verifies that calling toString on an object that is not a string - generates a runtime error. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "date-001"; -var VERSION = "JS1_4"; -var TITLE = "Date.prototype.toString"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - var OBJ = new MyObject( new Date(0) ); - result = OBJ.toString(); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "OBJECT = new MyObject( new Date(0)) ; result = OBJ.toString()" + - " (threw " + exception +")", - expect, - result ); - -test(); - -function MyObject( value ) { - this.value = value; - this.valueOf = new Function( "return this.value" ); - this.toString = Date.prototype.toString; - return this; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/date-002.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/date-002.js deleted file mode 100644 index 4fb11b38d9..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/date-002.js +++ /dev/null @@ -1,87 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'date-002.js'; - -/** - File Name: date-002.js - Corresponds To: 15.9.5.23-3-n.js - ECMA Section: 15.9.5.23 - Description: Date.prototype.setTime - - 1. If the this value is not a Date object, generate a runtime error. - 2. Call ToNumber(time). - 3. Call TimeClip(Result(1)). - 4. Set the [[Value]] property of the this value to Result(2). - 5. Return the value of the [[Value]] property of the this value. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "date-002"; -var VERSION = "JS1_4"; -var TITLE = "Date.prototype.setTime()"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - var MYDATE = new MyDate(); - result = MYDATE.setTime(0); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "MYDATE = new MyDate(); MYDATE.setTime(0)" + - " (threw " + exception +")", - expect, - result ); - -test(); - -function MyDate(value) { - this.value = value; - this.setTime = Date.prototype.setTime; - return this; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/date-003.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/date-003.js deleted file mode 100644 index 95129177c7..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/date-003.js +++ /dev/null @@ -1,89 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'date-003.js'; - -/** - File Name: date-003.js - Corresponds To 15.9.5.3-1.js - ECMA Section: 15.9.5.3-1 Date.prototype.valueOf - Description: - - The valueOf function returns a number, which is this time value. - - The valueOf function is not generic; it generates a runtime error if - its this value is not a Date object. Therefore it cannot be transferred - to other kinds of objects for use as a method. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "date-003"; -var VERSION = "JS1_4"; -var TITLE = "Date.prototype.valueOf"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - var OBJ = new MyObject( new Date(0) ); - result = OBJ.valueOf(); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "OBJ = new MyObject( new Date(0)); OBJ.valueOf()" + - " (threw " + exception +")", - expect, - result ); - -test(); - -function MyObject( value ) { - this.value = value; - this.valueOf = Date.prototype.valueOf; -// The following line causes an infinte loop -// this.toString = new Function( "return this+\"\";"); - return this; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/date-004.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/date-004.js deleted file mode 100644 index d77bd1c272..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/date-004.js +++ /dev/null @@ -1,83 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'date-004.js'; - -/** - File Name: date-004.js - Corresponds To: 15.9.5.4-2-n.js - ECMA Section: 15.9.5.4-1 Date.prototype.getTime - Description: - - 1. If the this value is not an object whose [[Class]] property is "Date", - generate a runtime error. - 2. Return this time value. - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "date-004"; -var VERSION = "JS1_4"; -var TITLE = "Date.prototype.getTime"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - var MYDATE = new MyDate(); - result = MYDATE.getTime(); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "MYDATE = new MyDate(); MYDATE.getTime()" + - " (threw " + exception +")", - expect, - result ); - -test(); - -function MyDate( value ) { - this.value = value; - this.getTime = Date.prototype.getTime; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-001.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-001.js deleted file mode 100644 index 3762c5b3c4..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-001.js +++ /dev/null @@ -1,78 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'exception-001.js'; - -/** - * File Name: exception-001 - * ECMA Section: - * Description: Tests for JavaScript Standard Exceptions - * - * Call error. - * - * Author: christine@netscape.com - * Date: 31 August 1998 - */ -var SECTION = "exception-001"; -var VERSION = "js1_4"; -var TITLE = "Tests for JavaScript Standard Exceptions: CallError"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -Call_1(); - -test(); - -function Call_1() { - result = "failed: no exception thrown"; - exception = null; - - try { - Math(); - } catch ( e ) { - result = "passed: threw exception", - exception = e.toString(); - } finally { - new TestCase( - SECTION, - "Math() [ exception is " + exception +" ]", - "passed: threw exception", - result ); - } -} - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-002.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-002.js deleted file mode 100644 index e5328b8b81..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-002.js +++ /dev/null @@ -1,78 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'exception-002.js'; - -/** - * File Name: exception-002 - * ECMA Section: - * Description: Tests for JavaScript Standard Exceptions - * - * Construct error. - * - * Author: christine@netscape.com - * Date: 31 August 1998 - */ -var SECTION = "exception-002"; -var VERSION = "js1_4"; -var TITLE = "Tests for JavaScript Standard Exceptions: ConstructError"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -Construct_1(); - -test(); - -function Construct_1() { - result = "failed: no exception thrown"; - exception = null; - - try { - result = new Math(); - } catch ( e ) { - result = "passed: threw exception", - exception = e.toString(); - } finally { - new TestCase( - SECTION, - "new Math() [ exception is " + exception +" ]", - "passed: threw exception", - result ); - } -} - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-003.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-003.js deleted file mode 100644 index c5956ffc95..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-003.js +++ /dev/null @@ -1,82 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'exception-003.js'; - -/** - * File Name: exception-003 - * ECMA Section: - * Description: Tests for JavaScript Standard Exceptions - * - * Target error. - * - * Author: christine@netscape.com - * Date: 31 August 1998 - */ -var SECTION = "exception-003"; -var VERSION = "js1_4"; -var TITLE = "Tests for JavaScript Standard Exceptions: TargetError"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -Target_1(); - -test(); - -function Target_1() { - result = "failed: no exception thrown"; - exception = null; - - try { - string = new String("hi"); - string.toString = Boolean.prototype.toString; - string.toString(); - } catch ( e ) { - result = "passed: threw exception", - exception = e.toString(); - } finally { - new TestCase( - SECTION, - "string = new String(\"hi\");"+ - "string.toString = Boolean.prototype.toString" + - "string.toString() [ exception is " + exception +" ]", - "passed: threw exception", - result ); - } -} - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-004.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-004.js deleted file mode 100644 index 15a07a806f..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-004.js +++ /dev/null @@ -1,78 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'exception-004.js'; - -/** - * File Name: exception-004 - * ECMA Section: - * Description: Tests for JavaScript Standard Exceptions - * - * ToObject error. - * - * Author: christine@netscape.com - * Date: 31 August 1998 - */ -var SECTION = "exception-004"; -var VERSION = "js1_4"; -var TITLE = "Tests for JavaScript Standard Exceptions: ToObjectError"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -ToObject_1(); - -test(); - -function ToObject_1() { - result = "failed: no exception thrown"; - exception = null; - - try { - result = foo["bar"]; - } catch ( e ) { - result = "passed: threw exception", - exception = e.toString(); - } finally { - new TestCase( - SECTION, - "foo[\"bar\"] [ exception is " + exception +" ]", - "passed: threw exception", - result ); - } -} - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-005.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-005.js deleted file mode 100644 index e5532ff40c..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-005.js +++ /dev/null @@ -1,78 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'exception-005.js'; - -/** - * File Name: exception-005 - * ECMA Section: - * Description: Tests for JavaScript Standard Exceptions - * - * ToObject error. - * - * Author: christine@netscape.com - * Date: 31 August 1998 - */ -var SECTION = "exception-005"; -var VERSION = "js1_4"; -var TITLE = "Tests for JavaScript Standard Exceptions: ToObjectError"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -ToObject_1(); - -test(); - -function ToObject_1() { - result = "failed: no exception thrown"; - exception = null; - - try { - result = foo["bar"]; - } catch ( e ) { - result = "passed: threw exception", - exception = e.toString(); - } finally { - new TestCase( - SECTION, - "foo[\"bar\"] [ exception is " + exception +" ]", - "passed: threw exception", - result ); - } -} - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-006.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-006.js deleted file mode 100644 index b37b52becb..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-006.js +++ /dev/null @@ -1,89 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'exception-006.js'; - -/** - * File Name: exception-006 - * ECMA Section: - * Description: Tests for JavaScript Standard Exceptions - * - * ToPrimitive error. - * - * Author: christine@netscape.com - * Date: 31 August 1998 - */ -var SECTION = "exception-006"; -var VERSION = "js1_4"; -var TITLE = "Tests for JavaScript Standard Exceptions: TypeError"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -ToPrimitive_1(); - -test(); - - -/** - * Getting the [[DefaultValue]] of any instances of MyObject - * should result in a runtime error in ToPrimitive. - */ - -function MyObject() { - this.toString = void 0; - this.valueOf = void 0; -} - -function ToPrimitive_1() { - result = "failed: no exception thrown"; - exception = null; - - try { - result = new MyObject() + new MyObject(); - } catch ( e ) { - result = "passed: threw exception", - exception = e.toString(); - } finally { - new TestCase( - SECTION, - "new MyObject() + new MyObject() [ exception is " + exception +" ]", - "passed: threw exception", - result ); - } -} - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-007.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-007.js deleted file mode 100644 index a63ed0e3f8..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-007.js +++ /dev/null @@ -1,90 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'exception-007.js'; - -/** - * File Name: exception-007 - * ECMA Section: - * Description: Tests for JavaScript Standard Exceptions - * - * DefaultValue error. - * - * Author: christine@netscape.com - * Date: 31 August 1998 - */ -var SECTION = "exception-007"; -var VERSION = "js1_4"; -var TITLE = "Tests for JavaScript Standard Exceptions: TypeError"; -var BUGNUMBER="318250"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -DefaultValue_1(); - -test(); - - -/** - * Getting the [[DefaultValue]] of any instances of MyObject - * should result in a runtime error in ToPrimitive. - */ - -function MyObject() { - this.toString = void 0; - this.valueOf = new Object(); -} - -function DefaultValue_1() { - result = "failed: no exception thrown"; - exception = null; - - try { - result = new MyObject() + new MyObject(); - } catch ( e ) { - result = "passed: threw exception", - exception = e.toString(); - } finally { - new TestCase( - SECTION, - "new MyObject() + new MyObject() [ exception is " + exception +" ]", - "passed: threw exception", - result ); - } -} - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-008.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-008.js deleted file mode 100644 index 39326183a4..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-008.js +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'exception-008.js'; - -/** - * File Name: exception-008 - * ECMA Section: - * Description: Tests for JavaScript Standard Exceptions - * - * SyntaxError. - * - * Author: christine@netscape.com - * Date: 31 August 1998 - */ -var SECTION = "exception-008"; -var VERSION = "js1_4"; -var TITLE = "Tests for JavaScript Standard Exceptions: SyntaxError"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -Syntax_1(); - -test(); - -function Syntax_1() { - result = "failed: no exception thrown"; - exception = null; - - try { - result = eval("continue;"); - } catch ( e ) { - result = "passed: threw exception", - exception = e.toString(); - } finally { - new TestCase( - SECTION, - "eval(\"continue\") [ exception is " + exception +" ]", - "passed: threw exception", - result ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-009.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-009.js deleted file mode 100644 index bd5cbe7f40..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-009.js +++ /dev/null @@ -1,86 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'exception-009.js'; - -/** - * File Name: exception-009 - * ECMA Section: - * Description: Tests for JavaScript Standard Exceptions - * - * Regression test for nested try blocks. - * - * http://scopus.mcom.com/bugsplat/show_bug.cgi?id=312964 - * - * Author: christine@netscape.com - * Date: 31 August 1998 - */ -var SECTION = "exception-009"; -var VERSION = "JS1_4"; -var TITLE = "Tests for JavaScript Standard Exceptions: SyntaxError"; -var BUGNUMBER= "312964"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -try { - expect = "passed: no exception thrown"; - result = expect; - Nested_1(); -} catch ( e ) { - result = "failed: threw " + e; -} finally { - new TestCase( - SECTION, - "nested try", - expect, - result ); -} - - -test(); - -function Nested_1() { - try { - try { - } catch (a) { - } finally { - } - } catch (b) { - } finally { - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-010-n.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-010-n.js deleted file mode 100644 index cb28d635a6..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-010-n.js +++ /dev/null @@ -1,61 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Rob Ginda rginda@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'exception-010-n.js'; - -var SECTION = "exception-010"; -var VERSION = "ECMA_2"; -startTest(); -var TITLE = "Don't Crash throwing null"; - -writeHeaderToLog( SECTION + " "+ TITLE); -print("Null throw test."); -print("BUGNUMBER: 21799"); - -DESCRIPTION = "throw null"; -EXPECTED = "error"; - -new TestCase( SECTION, "throw null", "error", eval("throw null" )); - -test(); - -print("FAILED!: Should have exited with uncaught exception."); - - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-011-n.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-011-n.js deleted file mode 100644 index ec5302c247..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/exception-011-n.js +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Rob Ginda rginda@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'exception-011-n.js'; - -var SECTION = "exception-011"; -var VERSION = "ECMA_2"; -startTest(); -var TITLE = "Don't Crash throwing undefined"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -print("Undefined throw test."); - -DESCRIPTION = "throw undefined"; -EXPECTED = "error"; - -new TestCase( SECTION, "throw undefined", "error", eval("throw (void 0)") ); - -test(); - -print("FAILED!: Should have exited with uncaught exception."); - - - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-001.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-001.js deleted file mode 100644 index c3ae4f21e6..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-001.js +++ /dev/null @@ -1,83 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'expression-001.js'; - -/** - File Name: expression-001.js - Corresponds to: ecma/Expressions/11.12-2-n.js - ECMA Section: 11.12 - Description: - - The grammar for a ConditionalExpression in ECMAScript is a little bit - different from that in C and Java, which each allow the second - subexpression to be an Expression but restrict the third expression to - be a ConditionalExpression. The motivation for this difference in - ECMAScript is to allow an assignment expression to be governed by either - arm of a conditional and to eliminate the confusing and fairly useless - case of a comma expression as the center expression. - - Author: christine@netscape.com - Date: 09 september 1998 -*/ -var SECTION = "expression-001"; -var VERSION = "JS1_4"; -var TITLE = "Conditional operator ( ? : )" - startTest(); -writeHeaderToLog( SECTION + " " + TITLE ); - -// the following expression should be an error in JS. - -var result = "Failed" - var exception = "No exception was thrown"; - -try { - eval("var MY_VAR = true ? \"EXPR1\", \"EXPR2\" : \"EXPR3\""); -} catch ( e ) { - result = "Passed"; - exception = e.toString(); -} - -new TestCase( - SECTION, - "comma expression in a conditional statement "+ - "(threw "+ exception +")", - "Passed", - result ); - - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-002.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-002.js deleted file mode 100644 index 2f060936ae..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-002.js +++ /dev/null @@ -1,93 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'expression-002.js'; - -/** - File Name: expressions-002.js - Corresponds to: ecma/Expressions/11.2.1-3-n.js - ECMA Section: 11.2.1 Property Accessors - Description: - - Try to access properties of an object whose value is undefined. - - Author: christine@netscape.com - Date: 09 september 1998 -*/ -var SECTION = "expressions-002.js"; -var VERSION = "JS1_4"; -var TITLE = "Property Accessors"; -writeHeaderToLog( SECTION + " "+TITLE ); - -startTest(); - -// go through all Native Function objects, methods, and properties and get their typeof. - -var PROPERTY = new Array(); -var p = 0; - -// try to access properties of primitive types - -OBJECT = new Property( "undefined", void 0, "undefined", NaN ); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - result = OBJECT.value.valueOf(); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - - -new TestCase( - SECTION, - "Get the value of an object whose value is undefined "+ - "(threw " + exception +")", - expect, - result ); - -test(); - -function Property( object, value, string, number ) { - this.object = object; - this.string = String(value); - this.number = Number(value); - this.valueOf = value; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-003.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-003.js deleted file mode 100644 index 5007b83adf..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-003.js +++ /dev/null @@ -1,88 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'expression-003.js'; - -/** - File Name: expressions-003.js - Corresponds to: ecma/Expressions/11.2.1-3-n.js - ECMA Section: 11.2.1 Property Accessors - Description: - - Try to access properties of an object whose value is undefined. - - Author: christine@netscape.com - Date: 09 september 1998 -*/ -var SECTION = "expressions-003.js"; -var VERSION = "JS1_4"; -var TITLE = "Property Accessors"; -writeHeaderToLog( SECTION + " "+TITLE ); - -startTest(); - -// try to access properties of primitive types - -OBJECT = new Property( "undefined", void 0, "undefined", NaN ); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - result = OBJECT.value.toString(); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - - -new TestCase( - SECTION, - "Get the toString value of an object whose value is undefined "+ - "(threw " + exception +")", - expect, - result ); - -test(); - -function Property( object, value, string, number ) { - this.object = object; - this.string = String(value); - this.number = Number(value); - this.value = value; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-004.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-004.js deleted file mode 100644 index 2befdd10f3..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-004.js +++ /dev/null @@ -1,82 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'expression-004.js'; - -/** - File Name: expression-004.js - Corresponds To: 11.2.1-4-n.js - ECMA Section: 11.2.1 Property Accessors - Description: - - Author: christine@netscape.com - Date: 09 september 1998 -*/ -var SECTION = "expression-004"; -var VERSION = "JS1_4"; -var TITLE = "Property Accessors"; -writeHeaderToLog( SECTION + " "+TITLE ); -startTest(); - -var OBJECT = new Property( "null", null, "null", 0 ); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - result = OBJECT.value.toString(); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "Get the toString value of an object whose value is null "+ - "(threw " + exception +")", - expect, - result ); - -test(); - -function Property( object, value, string, number ) { - this.object = object; - this.string = String(value); - this.number = Number(value); - this.value = value; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-005.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-005.js deleted file mode 100644 index 2d76593ea2..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-005.js +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'expression-005.js'; - -/** - File Name: expression-005.js - Corresponds To: 11.2.2-10-n.js - ECMA Section: 11.2.2. The new operator - Description: - - Author: christine@netscape.com - Date: 12 november 1997 -*/ - -var SECTION = "expression-005"; -var VERSION = "JS1_4"; -var TITLE = "The new operator"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var expect = "Passed"; -var exception = "No exception thrown"; - -try { - result = new Math(); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "result= new Math() (threw " + exception + ")", - expect, - result ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-006.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-006.js deleted file mode 100644 index eb21e0308c..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-006.js +++ /dev/null @@ -1,79 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'expression-006.js'; - -/** - File Name: expression-006.js - Corresponds to: 11.2.2-1-n.js - ECMA Section: 11.2.2. The new operator - Description: - - http://scopus/bugsplat/show_bug.cgi?id=327765 - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "expression-006.js"; -var VERSION = "JS1_4"; -var TITLE = "The new operator"; -var BUGNUMBER="327765"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - var OBJECT = new Object(); - result = new OBJECT(); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "OBJECT = new Object; result = new OBJECT()" + - " (threw " + exception +")", - expect, - result ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-007.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-007.js deleted file mode 100644 index a2305be16d..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-007.js +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'expression-007.js'; - -/** - File Name: expression-007.js - Corresponds To: 11.2.2-2-n.js - ECMA Section: 11.2.2. The new operator - Description: - - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "expression-007"; -var VERSION = "JS1_4"; -var TITLE = "The new operator"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - UNDEFINED = void 0; - result = new UNDEFINED(); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "UNDEFINED = void 0; result = new UNDEFINED()" + - " (threw " + exception +")", - expect, - result ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-008.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-008.js deleted file mode 100644 index c85310f957..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-008.js +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'expression-008.js'; - -/** - File Name: expression-008 - Corresponds To: 11.2.2-3-n.js - ECMA Section: 11.2.2. The new operator - Description: - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "expression-008"; -var VERSION = "JS1_4"; -var TITLE = "The new operator"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var NULL = null; -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - result = new NULL(); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "NULL = null; result = new NULL()" + - " (threw " + exception +")", - expect, - result ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-009.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-009.js deleted file mode 100644 index feec2cd052..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-009.js +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'expression-009.js'; - -/** - File Name: expression-009 - Corresponds to: ecma/Expressions/11.2.2-4-n.js - ECMA Section: 11.2.2. The new operator - Description: - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "expression-009"; -var VERSION = "JS1_4"; -var TITLE = "The new operator"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var STRING = ""; - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - result = new STRING(); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "STRING = ''; result = new STRING()" + - " (threw " + exception +")", - expect, - result ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-010.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-010.js deleted file mode 100644 index e0b38a4838..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-010.js +++ /dev/null @@ -1,76 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'expression-010.js'; - -/** - File Name: expression-010.js - Corresponds To: 11.2.2-5-n.js - ECMA Section: 11.2.2. The new operator - Description: - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "expression-010"; -var VERSION = "JS1_4"; -var TITLE = "The new operator"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var NUMBER = 0; - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - result = new NUMBER(); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "NUMBER=0, result = new NUMBER()" + - " (threw " + exception +")", - expect, - result ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-011.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-011.js deleted file mode 100644 index 75f872480d..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-011.js +++ /dev/null @@ -1,76 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'expression-011.js'; - -/** - File Name: expression-011.js - Corresponds To: ecma/Expressions/11.2.2-6-n.js - ECMA Section: 11.2.2. The new operator - Description: - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "expression-011"; -var VERSION = "JS1_4"; -var TITLE = "The new operator"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var BOOLEAN = true; - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - var OBJECT = new BOOLEAN(); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "BOOLEAN = true; result = new BOOLEAN()" + - " (threw " + exception +")", - expect, - result ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-012.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-012.js deleted file mode 100644 index 5223abd480..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-012.js +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'expression-012.js'; - -/** - File Name: expression-012.js - Corresponds To: ecma/Expressions/11.2.2-6-n.js - ECMA Section: 11.2.2. The new operator - Description: - http://scopus/bugsplat/show_bug.cgi?id=327765 - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "expression-012"; -var VERSION = "JS1_4"; -var TITLE = "The new operator"; -var BUGNUMBER= "327765"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var STRING = new String("hi"); -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - result = new STRING(); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "STRING = new String(\"hi\"); result = new STRING()" + - " (threw " + exception +")", - expect, - result ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-013.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-013.js deleted file mode 100644 index 10ad726653..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-013.js +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'expression-013.js'; - -/** - File Name: expression-013.js - Corresponds To: ecma/Expressions/11.2.2-8-n.js - ECMA Section: 11.2.2. The new operator - Description: - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "expression-013"; -var VERSION = "JS1_4"; -var TITLE = "The new operator"; -var BUGNUMBER= "327765"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var NUMBER = new Number(1); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - result = new NUMBER(); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "NUMBER = new Number(1); result = new NUMBER()" + - " (threw " + exception +")", - expect, - result ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-014.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-014.js deleted file mode 100644 index fadca81c7a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-014.js +++ /dev/null @@ -1,79 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'expression-014.js'; - -/** - File Name: expression-014.js - Corresponds To: ecma/Expressions/11.2.2-9-n.js - ECMA Section: 11.2.2. The new operator - Description: - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "expression-014.js"; -var VERSION = "ECMA_1"; -var TITLE = "The new operator"; -var BUGNUMBER= "327765"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var BOOLEAN = new Boolean(); - - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - result = new BOOLEAN(); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "BOOLEAN = new Boolean(); result = new BOOLEAN()" + - " (threw " + exception +")", - expect, - result ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-015.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-015.js deleted file mode 100644 index 2bd2b8d094..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-015.js +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'expression-015.js'; - -/** - File Name: expression-015.js - Corresponds To: ecma/Expressions/11.2.3-2-n.js - ECMA Section: 11.2.3. Function Calls - Description: - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "expression-015"; -var VERSION = "JS1_4"; -var TITLE = "Function Calls"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("result = 3.valueOf();"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "3.valueOf()" + - " (threw " + exception +")", - expect, - result ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-016.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-016.js deleted file mode 100644 index 3c91495f3c..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-016.js +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'expression-016.js'; - -/** - File Name: expression-016.js - Corresponds To: ecma/Expressions/11.2.3-3-n.js - ECMA Section: 11.2.3. Function Calls - Description: - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "expression-016"; -var VERSION = "JS1_4"; -var TITLE = "Function Calls"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - result = (void 0).valueOf(); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "(void 0).valueOf()" + - " (threw " + exception +")", - expect, - result ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-017.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-017.js deleted file mode 100644 index 4e762a54a9..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-017.js +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'expression-017.js'; - -/** - File Name: expression-07.js - Corresponds To: ecma/Expressions/11.2.3-4-n.js - ECMA Section: 11.2.3. Function Calls - Description: - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "expression-017"; -var VERSION = "JS1_4"; -var TITLE = "Function Calls"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - result = nullvalueOf(); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "null.valueOf()" + - " (threw " + exception +")", - expect, - result ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-019.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-019.js deleted file mode 100644 index 11ee3a0063..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/expression-019.js +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'expression-019.js'; - -/** - File Name: expression-019.js - Corresponds To: 11.2.2-7-n.js - ECMA Section: 11.2.2. The new operator - Description: - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "expression-019"; -var VERSION = "JS1_4"; -var TITLE = "The new operator"; -var BUGNUMBER= "327765"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - var STRING = new String("hi"); - result = new STRING(); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "var STRING = new String(\"hi\"); result = new STRING();" + - " (threw " + exception + ")", - expect, - result ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/function-001.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/function-001.js deleted file mode 100644 index d5f7b452e2..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/function-001.js +++ /dev/null @@ -1,86 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'function-001.js'; - -/** - * File Name: boolean-001.js - * Description: - * - * http://scopus.mcom.com/bugsplat/show_bug.cgi?id=99232 - * - * eval("function f(){}function g(){}") at top level is an error for JS1.2 - * and above (missing ; between named function expressions), but declares f - * and g as functions below 1.2. - * - * Fails to produce error regardless of version: - * js> version(100) - * 120 - * js> eval("function f(){}function g(){}") - * js> version(120); - * 100 - * js> eval("function f(){}function g(){}") - * js> - * Author: christine@netscape.com - * Date: 11 August 1998 - */ -var SECTION = "function-001.js"; -var VERSION = "JS_12"; -var TITLE = "functions not separated by semicolons are errors in version 120 and higher"; -var BUGNUMBER="10278"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "pass"; -var exception = "no exception thrown"; - -try { - eval("function f(){}function g(){}"); -} catch ( e ) { - result = "fail"; - exception = e.toString(); -} - -new TestCase( - SECTION, - "eval(\"function f(){}function g(){}\") (threw "+exception, - "pass", - result ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/global-001.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/global-001.js deleted file mode 100644 index a186a51e64..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/global-001.js +++ /dev/null @@ -1,78 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'global-001.js'; - -/** - File Name: global-001 - Corresponds To: ecma/GlobalObject/15.1-1-n.js - ECMA Section: The global object - Description: - - The global object does not have a [[Construct]] property; it is not - possible to use the global object as a constructor with the new operator. - - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "global-001"; -var VERSION = "ECMA_1"; -var TITLE = "The Global Object"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - result = new this(); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "result = new this()" + - " (threw " + exception +")", - expect, - result ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/global-002.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/global-002.js deleted file mode 100644 index c4ef143529..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/global-002.js +++ /dev/null @@ -1,78 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'global-002.js'; - -/** - File Name: global-002 - Corresponds To: ecma/GlobalObject/15.1-2-n.js - ECMA Section: The global object - Description: - - The global object does not have a [[Construct]] property; it is not - possible to use the global object as a constructor with the new operator. - - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "global-002"; -var VERSION = "JS1_4"; -var TITLE = "The Global Object"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - result = this(); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "result = this()" + - " (threw " + exception +")", - expect, - result ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-001.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-001.js deleted file mode 100644 index cc2e3a46aa..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-001.js +++ /dev/null @@ -1,85 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-001.js'; - -/** - File Name: lexical-001.js - CorrespondsTo: ecma/LexicalConventions/7.2.js - ECMA Section: 7.2 Line Terminators - Description: - readability - - separate tokens - - may occur between any two tokens - - cannot occur within any token, not even a string - - affect the process of automatic semicolon insertion. - - white space characters are: - unicode name formal name string representation - \u000A line feed \n - \u000D carriage return \r - - this test uses onerror to capture line numbers. because - we use on error, we can only have one test case per file. - - Author: christine@netscape.com - Date: 11 september 1997 -*/ -var SECTION = "lexical-001"; -var VERSION = "JS1_4"; -var TITLE = "Line Terminators"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - result = eval("\r\n\expect"); -} catch ( e ) { - exception = e.toString(); -} - -new TestCase( - SECTION, - "OBJECT = new Object; result = new OBJECT()" + - " (threw " + exception +")", - expect, - result ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-002.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-002.js deleted file mode 100644 index f7f691a049..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-002.js +++ /dev/null @@ -1,85 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-002.js'; - -/** - File Name: lexical-002.js - Corresponds To: ecma/LexicalConventions/7.2-3-n.js - ECMA Section: 7.2 Line Terminators - Description: - readability - - separate tokens - - may occur between any two tokens - - cannot occur within any token, not even a string - - affect the process of automatic semicolon insertion. - - white space characters are: - unicode name formal name string representation - \u000A line feed \n - \u000D carriage return \r - - this test uses onerror to capture line numbers. because - we use on error, we can only have one test case per file. - - Author: christine@netscape.com - Date: 11 september 1997 -*/ -var SECTION = "lexical-002"; -var VERSION = "JS1_4"; -var TITLE = "Line Terminators"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - result = eval("\r\n\expect"); -} catch ( e ) { - exception = e.toString(); -} - -new TestCase( - SECTION, - "result=eval(\"\r\nexpect\")" + - " (threw " + exception +")", - expect, - result ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-003.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-003.js deleted file mode 100644 index 482382eeed..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-003.js +++ /dev/null @@ -1,76 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-003.js'; - -/** - File Name: lexical-003.js - Corresponds To: 7.3-13-n.js - ECMA Section: 7.3 Comments - Description: - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "lexical-003.js"; -var VERSION = "JS1_4"; -var TITLE = "Comments"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("/*\n/* nested comment */\n*/\n"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "/*/*nested comment*/ */" + - " (threw " + exception +")", - expect, - result ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-004.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-004.js deleted file mode 100644 index ccf6124109..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-004.js +++ /dev/null @@ -1,85 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-004.js'; - -/** - File Name: lexical-004.js - Corresponds To: ecma/LexicalExpressions/7.4.1-1-n.js - ECMA Section: 7.4.1 - - Description: - - Reserved words cannot be used as identifiers. - - ReservedWord :: - Keyword - FutureReservedWord - NullLiteral - BooleanLiteral - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "lexical-004"; -var VERSION = "JS1_4"; -var TITLE = "Keywords"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("var null = true;"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "var null = true" + - " (threw " + exception +")", - expect, - result ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-005.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-005.js deleted file mode 100644 index 44b2ea9c87..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-005.js +++ /dev/null @@ -1,85 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-005.js'; - -/** - File Name: lexical-005.js - Corresponds To: 7.4.1-2.js - ECMA Section: 7.4.1 - - Description: - - Reserved words cannot be used as identifiers. - - ReservedWord :: - Keyword - FutureReservedWord - NullLiteral - BooleanLiteral - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "lexical-005"; -var VERSION = "JS1_4"; -var TITLE = "Keywords"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("true = false;"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "true = false" + - " (threw " + exception +")", - expect, - result ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-006.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-006.js deleted file mode 100644 index 6f693d8ad2..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-006.js +++ /dev/null @@ -1,91 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-006.js'; - -/** - File Name: lexical-006.js - Corresponds To: 7.4.2-1.js - ECMA Section: 7.4.2 - - Description: - The following tokens are ECMAScript keywords and may not be used as - identifiers in ECMAScript programs. - - Syntax - - Keyword :: one of - break for new var - continue function return void - delete if this while - else in typeof with - - This test verifies that the keyword cannot be used as an identifier. - Functioinal tests of the keyword may be found in the section corresponding - to the function of the keyword. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "lexical-006"; -var VERSION = "JS1_4"; -var TITLE = "Keywords"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("break = new Object();"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "break = new Object()" + - " (threw " + exception +")", - expect, - result ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-007.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-007.js deleted file mode 100644 index b6d5152ea0..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-007.js +++ /dev/null @@ -1,84 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-007.js'; - -/** - File Name: lexical-005.js - Corresponds To: 7.4.1-3-n.js - ECMA Section: 7.4.1 - - Description: - - Reserved words cannot be used as identifiers. - - ReservedWord :: - Keyword - FutureReservedWord - NullLiteral - BooleanLiteral - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "lexical-005"; -var VERSION = "JS1_4"; -var TITLE = "Keywords"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("false = true;"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "false = true" + - " (threw " + exception +")", - expect, - result ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-008.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-008.js deleted file mode 100644 index eed455c243..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-008.js +++ /dev/null @@ -1,86 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-008.js'; - -/** - File Name: lexical-008.js - Corresponds To: 7.4.3-1-n.js - ECMA Section: 7.4.3 - - Description: - The following words are used as keywords in proposed extensions and are - therefore reserved to allow for the possibility of future adoption of - those extensions. - - FutureReservedWord :: one of - case debugger export super - catch default extends switch - class do finally throw - const enum import try - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "lexical-008.js"; -var VERSION = "JS1_4"; -var TITLE = "Future Reserved Words"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("case = true;"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "case = true" + - " (threw " + exception +")", - expect, - result ); - -test(); - - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-009.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-009.js deleted file mode 100644 index d796574809..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-009.js +++ /dev/null @@ -1,86 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-009.js'; - -/** - File Name: lexical-009 - Corresponds To: 7.4.3-2-n.js - ECMA Section: 7.4.3 - - Description: - The following words are used as keywords in proposed extensions and are - therefore reserved to allow for the possibility of future adoption of - those extensions. - - FutureReservedWord :: one of - case debugger export super - catch default extends switch - class do finally throw - const enum import try - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "lexical-009"; -var VERSION = "ECMA_1"; -var TITLE = "Future Reserved Words"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("debugger = true;"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "debugger = true" + - " (threw " + exception +")", - expect, - result ); - -test(); - - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-010.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-010.js deleted file mode 100644 index 059b5a06be..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-010.js +++ /dev/null @@ -1,84 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-010.js'; - -/** - File Name: lexical-010.js - Corresponds To: 7.4.3-3-n.js - ECMA Section: 7.4.3 - - Description: - The following words are used as keywords in proposed extensions and are - therefore reserved to allow for the possibility of future adoption of - those extensions. - - FutureReservedWord :: one of - case debugger export super - catch default extends switch - class do finally throw - const enum import try - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "lexical-010"; -var VERSION = "ECMA_1"; -var TITLE = "Future Reserved Words"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("export = true;"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "export = true" + - " (threw " + exception +")", - expect, - result ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-011.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-011.js deleted file mode 100644 index 7f01041c41..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-011.js +++ /dev/null @@ -1,95 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-011.js'; - -/** - File Name: lexical-011.js - Corresponds To: 7.4.3-4-n.js - ECMA Section: 7.4.3 - - Description: - The following words are used as keywords in proposed extensions and are - therefore reserved to allow for the possibility of future adoption of - those extensions. - - FutureReservedWord :: one of - case debugger export super - catch default extends switch - class do finally throw - const enum import try - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "lexical-011"; -var VERSION = "JS1_4"; -var TITLE = "Future Reserved Words"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -print("This test requires option javascript.options.strict enabled"); - -if (!options().match(/strict/)) -{ - options('strict'); -} -if (!options().match(/werror/)) -{ - options('werror'); -} - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("super = true;"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "super = true" + - " (threw " + exception +")", - expect, - result ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-012.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-012.js deleted file mode 100644 index e55b6eb30f..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-012.js +++ /dev/null @@ -1,86 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-012.js'; - -/** - File Name: lexical-012.js - Corresponds To: 7.4.3-5-n.js - ECMA Section: 7.4.3 - - Description: - The following words are used as keywords in proposed extensions and are - therefore reserved to allow for the possibility of future adoption of - those extensions. - - FutureReservedWord :: one of - case debugger export super - catch default extends switch - class do finally throw - const enum import try - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "lexical-012"; -var VERSION = "JS1_4"; -var TITLE = "Future Reserved Words"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("catch = true;"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "catch = true" + - " (threw " + exception +")", - expect, - result ); - -test(); - - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-013.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-013.js deleted file mode 100644 index fbbf20b263..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-013.js +++ /dev/null @@ -1,86 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-013.js'; - -/** - File Name: lexical-013.js - Corresponds To: 7.4.3-6-n.js - ECMA Section: 7.4.3 - - Description: - The following words are used as keywords in proposed extensions and are - therefore reserved to allow for the possibility of future adoption of - those extensions. - - FutureReservedWord :: one of - case debugger export super - catch default extends switch - class do finally throw - const enum import try - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "lexical-013"; -var VERSION = "JS1_4"; -var TITLE = "Future Reserved Words"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("default = true;"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "default = true" + - " (threw " + exception +")", - expect, - result ); - -test(); - - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-014.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-014.js deleted file mode 100644 index 880d2800e5..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-014.js +++ /dev/null @@ -1,95 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-014.js'; - -/** - File Name: lexical-014.js - Corresponds To: 7.4.3-7-n.js - ECMA Section: 7.4.3 - - Description: - The following words are used as keywords in proposed extensions and are - therefore reserved to allow for the possibility of future adoption of - those extensions. - - FutureReservedWord :: one of - case debugger export super - catch default extends switch - class do finally throw - const enum import try - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "lexical-014.js"; -var VERSION = "JS1_4"; -var TITLE = "Future Reserved Words"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -print("This test requires option javascript.options.strict enabled"); - -if (!options().match(/strict/)) -{ - options('strict'); -} -if (!options().match(/werror/)) -{ - options('werror'); -} - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("extends = true;"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "extends = true" + - " (threw " + exception +")", - expect, - result ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-015.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-015.js deleted file mode 100644 index a15a2be544..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-015.js +++ /dev/null @@ -1,86 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-015.js'; - -/** - File Name: lexical-015.js - Corresponds To: 7.4.3-8-n.js - ECMA Section: 7.4.3 - - Description: - The following words are used as keywords in proposed extensions and are - therefore reserved to allow for the possibility of future adoption of - those extensions. - - FutureReservedWord :: one of - case debugger export super - catch default extends switch - class do finally throw - const enum import try - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "lexical-015"; -var VERSION = "JS1_4"; -var TITLE = "Future Reserved Words"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("switch = true;"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "switch = true" + - " (threw " + exception +")", - expect, - result ); - -test(); - - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-016.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-016.js deleted file mode 100644 index 021594d052..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-016.js +++ /dev/null @@ -1,95 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-016.js'; - -/** - File Name: lexical-016 - Corresponds To: 7.4.3-9-n.js - ECMA Section: 7.4.3 - - Description: - The following words are used as keywords in proposed extensions and are - therefore reserved to allow for the possibility of future adoption of - those extensions. - - FutureReservedWord :: one of - case debugger export super - catch default extends switch - class do finally throw - const enum import try - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "lexical-016"; -var VERSION = "JS1_4"; -var TITLE = "Future Reserved Words"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -print("This test requires option javascript.options.strict enabled"); - -if (!options().match(/strict/)) -{ - options('strict'); -} -if (!options().match(/werror/)) -{ - options('werror'); -} - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("class = true;"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "class = true" + - " (threw " + exception +")", - expect, - result ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-017.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-017.js deleted file mode 100644 index b89a526229..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-017.js +++ /dev/null @@ -1,87 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-017.js'; - -/** - File Name: lexical-017.js - Corresponds To: 7.4.3-10-n.js - ECMA Section: 7.4.3 - - Description: - The following words are used as keywords in proposed extensions and are - therefore reserved to allow for the possibility of future adoption of - those extensions. - - FutureReservedWord :: one of - case debugger export super - catch default extends switch - class do finally throw - const enum import try - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "lexical-017"; -var VERSION = "JS1_4"; -var TITLE = "Future Reserved Words"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("do = true;"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "do = true" + - " (threw " + exception +")", - expect, - result ); - -test(); - - - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-018.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-018.js deleted file mode 100644 index 18773dafe6..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-018.js +++ /dev/null @@ -1,86 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-018.js'; - -/** - File Name: lexical-018 - Corresponds To: 7.4.3-11-n.js - ECMA Section: 7.4.3 - - Description: - The following words are used as keywords in proposed extensions and are - therefore reserved to allow for the possibility of future adoption of - those extensions. - - FutureReservedWord :: one of - case debugger export super - catch default extends switch - class do finally throw - const enum import try - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "lexical-018"; -var VERSION = "JS1_4"; -var TITLE = "Future Reserved Words"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("finally = true;"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "finally = true" + - " (threw " + exception +")", - expect, - result ); - -test(); - - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-019.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-019.js deleted file mode 100644 index c1c34a93c1..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-019.js +++ /dev/null @@ -1,86 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-019.js'; - -/** - File Name: lexical-019.js - Corresponds To: 7.4.3-12-n.js - ECMA Section: 7.4.3 - - Description: - The following words are used as keywords in proposed extensions and are - therefore reserved to allow for the possibility of future adoption of - those extensions. - - FutureReservedWord :: one of - case debugger export super - catch default extends switch - class do finally throw - const enum import try - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "lexical-019"; -var VERSION = "JS1_4"; -var TITLE = "Future Reserved Words"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("throw = true;"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "throw = true" + - " (threw " + exception +")", - expect, - result ); - -test(); - - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-020.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-020.js deleted file mode 100644 index e82e1e50b9..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-020.js +++ /dev/null @@ -1,86 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-020.js'; - -/** - File Name: lexical-020.js - Corresponds To 7.4.3-13-n.js - ECMA Section: 7.4.3 - - Description: - The following words are used as keywords in proposed extensions and are - therefore reserved to allow for the possibility of future adoption of - those extensions. - - FutureReservedWord :: one of - case debugger export super - catch default extends switch - class do finally throw - const enum import try - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "lexical-020"; -var VERSION = "JS1_4"; -var TITLE = "Future Reserved Words"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("const = true;"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "const = true" + - " (threw " + exception +")", - expect, - result ); - -test(); - - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-021.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-021.js deleted file mode 100644 index 47a0725a09..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-021.js +++ /dev/null @@ -1,95 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-021.js'; - -/** - File Name: lexical-021.js - Corresponds To: 7.4.3-14-n.js - ECMA Section: 7.4.3 - - Description: - The following words are used as keywords in proposed extensions and are - therefore reserved to allow for the possibility of future adoption of - those extensions. - - FutureReservedWord :: one of - case debugger export super - catch default extends switch - class do finally throw - const enum import try - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "lexical-021.js"; -var VERSION = "ECMA_1"; -var TITLE = "Future Reserved Words"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -print("This test requires option javascript.options.strict enabled"); - -if (!options().match(/strict/)) -{ - options('strict'); -} -if (!options().match(/werror/)) -{ - options('werror'); -} - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("enum = true;"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "enum = true" + - " (threw " + exception +")", - expect, - result ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-022.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-022.js deleted file mode 100644 index 75d72aa5b6..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-022.js +++ /dev/null @@ -1,86 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-022.js'; - -/** - File Name: lexical-022 - Corresponds To 7.4.3-15-n.js - ECMA Section: 7.4.3 - - Description: - The following words are used as keywords in proposed extensions and are - therefore reserved to allow for the possibility of future adoption of - those extensions. - - FutureReservedWord :: one of - case debugger export super - catch default extends switch - class do finally throw - const enum import try - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "lexical-022.js"; -var VERSION = "ECMA_1"; -var TITLE = "Future Reserved Words"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("import = true;"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "import = true" + - " (threw " + exception +")", - expect, - result ); - -test(); - - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-023.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-023.js deleted file mode 100644 index aa89c04782..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-023.js +++ /dev/null @@ -1,85 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-023.js'; - -/** - File Name: lexical-023.js - Corresponds To: 7.4.3-16-n.js - ECMA Section: 7.4.3 - Description: - The following words are used as keywords in proposed extensions and are - therefore reserved to allow for the possibility of future adoption of - those extensions. - - FutureReservedWord :: one of - case debugger export super - catch default extends switch - class do finally throw - const enum import try - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "lexical-023.js"; -var VERSION = "ECMA_1"; -var TITLE = "Future Reserved Words"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("try = true;"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "try = true" + - " (threw " + exception +")", - expect, - result ); - -test(); - - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-024.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-024.js deleted file mode 100644 index 7c1f22f745..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-024.js +++ /dev/null @@ -1,92 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-024.js'; - -/** - File Name: lexical-024 - Corresponds To: 7.4.2-1-n.js - ECMA Section: 7.4.2 - - Description: - The following tokens are ECMAScript keywords and may not be used as - identifiers in ECMAScript programs. - - Syntax - - Keyword :: one of - break for new var - continue function return void - delete if this while - else in typeof with - - This test verifies that the keyword cannot be used as an identifier. - Functioinal tests of the keyword may be found in the section corresponding - to the function of the keyword. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "lexical-024"; -var VERSION = "JS1_4"; -var TITLE = "Keywords"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("var break;"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "var break" + - " (threw " + exception +")", - expect, - result ); - -test(); - - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-025.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-025.js deleted file mode 100644 index f1c7b93daf..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-025.js +++ /dev/null @@ -1,92 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-025.js'; - -/** - File Name: lexical-025.js - Corresponds To 7.4.2-2-n.js - ECMA Section: 7.4.2 - - Description: - The following tokens are ECMAScript keywords and may not be used as - identifiers in ECMAScript programs. - - Syntax - - Keyword :: one of - break for new var - continue function return void - delete if this while - else in typeof with - - This test verifies that the keyword cannot be used as an identifier. - Functioinal tests of the keyword may be found in the section corresponding - to the function of the keyword. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "lexical-025"; -var VERSION = "JS1_4"; -var TITLE = "Keywords"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("var for;"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "var for" + - " (threw " + exception +")", - expect, - result ); - -test(); - - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-026.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-026.js deleted file mode 100644 index 31b5aaaf61..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-026.js +++ /dev/null @@ -1,92 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-026.js'; - -/** - File Name: lexical-026.js - Corresponds To: 7.4.2-3-n.js - ECMA Section: 7.4.2 - - Description: - The following tokens are ECMAScript keywords and may not be used as - identifiers in ECMAScript programs. - - Syntax - - Keyword :: one of - break for new var - continue function return void - delete if this while - else in typeof with - - This test verifies that the keyword cannot be used as an identifier. - Functioinal tests of the keyword may be found in the section corresponding - to the function of the keyword. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "lexical-026"; -var VERSION = "JS1_4"; -var TITLE = "Keywords"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("var new;"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "var new" + - " (threw " + exception +")", - expect, - result ); - -test(); - - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-027.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-027.js deleted file mode 100644 index 573025b591..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-027.js +++ /dev/null @@ -1,94 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-027.js'; - -/** - File Name: lexical-027.js - Corresponds To: 7.4.2-4-n.js - ECMA Section: 7.4.2 - - Description: - The following tokens are ECMAScript keywords and may not be used as - identifiers in ECMAScript programs. - - Syntax - - var - - Keyword :: one of - break for new var - continue function return void - delete if this while - else in typeof with - - This test verifies that the keyword cannot be used as an identifier. - Functioinal tests of the keyword may be found in the section corresponding - to the function of the keyword. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "lexical-027"; -var VERSION = "JS1_4"; -var TITLE = "Keywords"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("var var;"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "var var" + - " (threw " + exception +")", - expect, - result ); - -test(); - - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-028.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-028.js deleted file mode 100644 index 1b76a22169..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-028.js +++ /dev/null @@ -1,92 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-028.js'; - -/** - File Name: lexical-028.js - Corresponds To: 7.4.2-5-n.js - ECMA Section: 7.4.2 - - Description: - The following tokens are ECMAScript keywords and may not be used as - identifiers in ECMAScript programs. - - Syntax - - Keyword :: one of - break for new var - continue function return void - delete if this while - else in typeof with - - This test verifies that the keyword cannot be used as an identifier. - Functioinal tests of the keyword may be found in the section corresponding - to the function of the keyword. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "lexical-028"; -var VERSION = "JS1_4"; -var TITLE = "Keywords"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("var continue=true;"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "var continue=true" + - " (threw " + exception +")", - expect, - result ); - -test(); - - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-029.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-029.js deleted file mode 100644 index f978b8ef89..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-029.js +++ /dev/null @@ -1,92 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-029.js'; - -/** - File Name: lexical-029.js - Corresponds To: 7.4.2-6.js - ECMA Section: 7.4.2 - - Description: - The following tokens are ECMAScript keywords and may not be used as - identifiers in ECMAScript programs. - - Syntax - - Keyword :: one of - break for new var - continue function return void - delete if this while - else in typeof with - - This test verifies that the keyword cannot be used as an identifier. - Functioinal tests of the keyword may be found in the section corresponding - to the function of the keyword. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "lexical-029"; -var VERSION = "JS1_4"; -var TITLE = "Keywords"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("var function = true;"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "var function = true" + - " (threw " + exception +")", - expect, - result ); - -test(); - - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-030.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-030.js deleted file mode 100644 index 3796551698..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-030.js +++ /dev/null @@ -1,92 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-030.js'; - -/** - File Name: lexical-030.js - Corresponds To: 7.4.2-7-n.js - ECMA Section: 7.4.2 - - Description: - The following tokens are ECMAScript keywords and may not be used as - identifiers in ECMAScript programs. - - Syntax - - Keyword :: one of - break for new var - continue function return void - delete if this while - else in typeof with - - This test verifies that the keyword cannot be used as an identifier. - Functioinal tests of the keyword may be found in the section corresponding - to the function of the keyword. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "lexical-030"; -var VERSION = "JS1_4"; -var TITLE = "Keywords"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("var return = true;"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "var return = true" + - " (threw " + exception +")", - expect, - result ); - -test(); - - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-031.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-031.js deleted file mode 100644 index 13379fed01..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-031.js +++ /dev/null @@ -1,92 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-031.js'; - -/** - File Name: lexical-031.js - Corresponds To: 7.4.2-8-n.js - ECMA Section: 7.4.2 - - Description: - The following tokens are ECMAScript keywords and may not be used as - identifiers in ECMAScript programs. - - Syntax - - Keyword :: one of - break for new var - continue function return void - delete if this while - else in typeof with - - This test verifies that the keyword cannot be used as an identifier. - Functioinal tests of the keyword may be found in the section corresponding - to the function of the keyword. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "lexical-031"; -var VERSION = "JS1_4"; -var TITLE = "Keywords"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("var return;"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "var return" + - " (threw " + exception +")", - expect, - result ); - -test(); - - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-032.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-032.js deleted file mode 100644 index 48e6e9aac5..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-032.js +++ /dev/null @@ -1,92 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-032.js'; - -/** - File Name: lexical-032.js - Corresponds To: 7.4.2-9-n.js - ECMA Section: 7.4.2 - - Description: - The following tokens are ECMAScript keywords and may not be used as - identifiers in ECMAScript programs. - - Syntax - - Keyword :: one of - break for new var - continue function return void - delete if this while - else in typeof with - - This test verifies that the keyword cannot be used as an identifier. - Functioinal tests of the keyword may be found in the section corresponding - to the function of the keyword. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "lexical-032"; -var VERSION = "JS1_4"; -var TITLE = "Keywords"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("delete = true;"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "delete = true" + - " (threw " + exception +")", - expect, - result ); - -test(); - - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-033.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-033.js deleted file mode 100644 index cc223c2282..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-033.js +++ /dev/null @@ -1,92 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-033.js'; - -/** - File Name: lexical-033.js - Corresponds To: 7.4.2-10.js - ECMA Section: 7.4.2 - - Description: - The following tokens are ECMAScript keywords and may not be used as - identifiers in ECMAScript programs. - - Syntax - - Keyword :: one of - break for new var - continue function return void - delete if this while - else in typeof with - - This test verifies that the keyword cannot be used as an identifier. - Functioinal tests of the keyword may be found in the section corresponding - to the function of the keyword. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "lexical-033"; -var VERSION = "JS1_4"; -var TITLE = "Keywords"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("if = true;"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "if = true" + - " (threw " + exception +")", - expect, - result ); - -test(); - - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-034.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-034.js deleted file mode 100644 index 4d3c7d5fc0..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-034.js +++ /dev/null @@ -1,91 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-034.js'; - -/** - File Name: 7.4.2-11-n.js - ECMA Section: 7.4.2 - - Description: - The following tokens are ECMAScript keywords and may not be used as - identifiers in ECMAScript programs. - - Syntax - - Keyword :: one of - break for new var - continue function return void - delete if this while - else in typeof with - - This test verifies that the keyword cannot be used as an identifier. - Functioinal tests of the keyword may be found in the section corresponding - to the function of the keyword. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "lexical-034"; -var VERSION = "JS1_4"; -var TITLE = "Keywords"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("this = true"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "this = true" + - " (threw " + exception +")", - expect, - result ); - -test(); - - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-035.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-035.js deleted file mode 100644 index 2a61b437ba..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-035.js +++ /dev/null @@ -1,92 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-035.js'; - -/** - File Name: lexical-035.js - Correpsonds To: 7.4.2-12-n.js - ECMA Section: 7.4.2 - - Description: - The following tokens are ECMAScript keywords and may not be used as - identifiers in ECMAScript programs. - - Syntax - - Keyword :: one of - break for new var - continue function return void - delete if this while - else in typeof with - - This test verifies that the keyword cannot be used as an identifier. - Functioinal tests of the keyword may be found in the section corresponding - to the function of the keyword. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "lexical-035"; -var VERSION = "JS1_4"; -var TITLE = "Keywords"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("var while"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "var while" + - " (threw " + exception +")", - expect, - result ); - -test(); - - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-036.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-036.js deleted file mode 100644 index a1923b7303..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-036.js +++ /dev/null @@ -1,92 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-036.js'; - -/** - File Name: lexical-036.js - Corresponds To: 7.4.2-13-n.js - ECMA Section: 7.4.2 - - Description: - The following tokens are ECMAScript keywords and may not be used as - identifiers in ECMAScript programs. - - Syntax - - Keyword :: one of - break for new var - continue function return void - delete if this while - else in typeof with - - This test verifies that the keyword cannot be used as an identifier. - Functioinal tests of the keyword may be found in the section corresponding - to the function of the keyword. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "lexical-036"; -var VERSION = "JS1_4"; -var TITLE = "Keywords"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("else = true;"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "else = true" + - " (threw " + exception +")", - expect, - result ); - -test(); - - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-037.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-037.js deleted file mode 100644 index e3cd75bd60..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-037.js +++ /dev/null @@ -1,92 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-037.js'; - -/** - File Name: lexical-037.js - Corresponds To: 7.4.2-14-n.js - ECMA Section: 7.4.2 - - Description: - The following tokens are ECMAScript keywords and may not be used as - identifiers in ECMAScript programs. - - Syntax - - Keyword :: one of - break for new var - continue function return void - delete if this while - else in typeof with - - This test verifies that the keyword cannot be used as an identifier. - Functioinal tests of the keyword may be found in the section corresponding - to the function of the keyword. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "lexical-028"; -var VERSION = "JS1_4"; -var TITLE = "Keywords"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("var in;"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "var in" + - " (threw " + exception +")", - expect, - result ); - -test(); - - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-038.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-038.js deleted file mode 100644 index 1bf8c6c4e4..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-038.js +++ /dev/null @@ -1,92 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-038.js'; - -/** - File Name: lexical-038.js - Corresponds To: 7.4.2-15-n.js - ECMA Section: 7.4.2 - - Description: - The following tokens are ECMAScript keywords and may not be used as - identifiers in ECMAScript programs. - - Syntax - - Keyword :: one of - break for new var - continue function return void - delete if this while - else in typeof with - - This test verifies that the keyword cannot be used as an identifier. - Functioinal tests of the keyword may be found in the section corresponding - to the function of the keyword. - - Author: christine@netscape.com - Date: 12 november 1997 - -*/ -var SECTION = "lexical-038"; -var VERSION = "JS1_4"; -var TITLE = "Keywords"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("typeof = true;"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "typeof = true" + - " (threw " + exception +")", - expect, - result ); - -test(); - - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-039.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-039.js deleted file mode 100644 index 2f193af89a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-039.js +++ /dev/null @@ -1,79 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-039.js'; - -/** - File Name: lexical-039 - Corresponds To: 7.5-2-n.js - ECMA Section: 7.5 Identifiers - Description: Identifiers are of unlimited length - - can contain letters, a decimal digit, _, or $ - - the first character cannot be a decimal digit - - identifiers are case sensitive - - Author: christine@netscape.com - Date: 11 september 1997 -*/ -var SECTION = "lexical-039"; -var VERSION = "JS1_4"; -var TITLE = "Identifiers"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("var 0abc;"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "var 0abc" + - " (threw " + exception +")", - expect, - result ); - -test(); - - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-040.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-040.js deleted file mode 100644 index f5ba3533dd..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-040.js +++ /dev/null @@ -1,79 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-040.js'; - -/** - File Name: lexical-040.js - Corresponds To: 7.5-2.js - ECMA Section: 7.5 Identifiers - Description: Identifiers are of unlimited length - - can contain letters, a decimal digit, _, or $ - - the first character cannot be a decimal digit - - identifiers are case sensitive - - Author: christine@netscape.com - Date: 11 september 1997 -*/ -var SECTION = "lexical-040"; -var VERSION = "JS1_4"; -var TITLE = "Identifiers"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("var 1abc;"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "var 1abc" + - " (threw " + exception +")", - expect, - result ); - -test(); - - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-041.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-041.js deleted file mode 100644 index 06d63bddb3..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-041.js +++ /dev/null @@ -1,81 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-041.js'; - -/** - File Name: lexical-041.js - Corresponds To: 7.5-8-n.js - ECMA Section: 7.5 Identifiers - Description: Identifiers are of unlimited length - - can contain letters, a decimal digit, _, or $ - - the first character cannot be a decimal digit - - identifiers are case sensitive - - Author: christine@netscape.com - Date: 11 september 1997 -*/ -var SECTION = "lexical-041"; -var VERSION = "ECMA_1"; -var TITLE = "Identifiers"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("var @abc;"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "var @abc" + - " (threw " + exception +")", - expect, - result ); - -test(); - - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-042.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-042.js deleted file mode 100644 index c2cedb0b81..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-042.js +++ /dev/null @@ -1,82 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-042.js'; - -/** - File Name: lexical-042.js - Corresponds To: 7.5-9-n.js - ECMA Section: 7.5 Identifiers - Description: Identifiers are of unlimited length - - can contain letters, a decimal digit, _, or $ - - the first character cannot be a decimal digit - - identifiers are case sensitive - - Author: christine@netscape.com - Date: 11 september 1997 -*/ -var SECTION = "lexical-042"; -var VERSION = "JS1_4"; -var TITLE = "Identifiers"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("var 123;"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "var 123" + - " (threw " + exception +")", - expect, - result ); - -test(); - - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-047.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-047.js deleted file mode 100644 index e809c24149..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-047.js +++ /dev/null @@ -1,83 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-047.js'; - -/** - File Name: lexical-047.js - Corresponds To: 7.8.1-7-n.js - ECMA Section: 7.8.1 - Description: - Author: christine@netscape.com - Date: 15 september 1997 -*/ - -var SECTION = "lexical-047"; -var VERSION = "JS1_4"; -var TITLE = "for loops"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - var counter = 0; - eval("for ( counter = 0\n" - + "counter <= 1\n" - + "counter++ )\n" - + "{\n" - + "result += \": got to inner loop\";\n" - + "}\n"); - -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "line breaks within a for expression" + - " (threw " + exception +")", - expect, - result ); - -test(); - - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-048.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-048.js deleted file mode 100644 index 18054d4328..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-048.js +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-048.js'; - -/** - File Name: lexical-048.js - Corresponds To: 7.8.1-1.js - ECMA Section: 7.8.1 Rules of Automatic Semicolon Insertion - Description: - Author: christine@netscape.com - Date: 15 september 1997 -*/ - -var SECTION = "lexical-048"; -var VERSION = "JS1_4"; -var TITLE = "The Rules of Automatic Semicolon Insertion"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - var counter = 0; - eval( "for ( counter = 0;\ncounter <= 1\ncounter++ ) {\nresult += \": got inside for loop\")"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "line breaks within a for expression" + - " (threw " + exception +")", - expect, - result ); - -test(); - - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-049.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-049.js deleted file mode 100644 index e4ce840829..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-049.js +++ /dev/null @@ -1,82 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-049.js'; - -/** - File Name: lexical-049 - Corresponds To: 7.8.1-1.js - ECMA Section: 7.8.1 Rules of Automatic Semicolon Insertioin - Description: - Author: christine@netscape.com - Date: 15 september 1997 -*/ -var SECTION = "lexical-049"; -var VERSION = "JS1_4"; -var TITLE = "The Rules of Automatic Semicolon Insertion"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - var counter = 0; - eval("for ( counter = 0\n" - + "counter <= 1;\n" - + "counter++ )\n" - + "{\n" - + "result += \": got inside for loop\";\n" - + "}\n"); - -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "line breaks within a for expression" + - " (threw " + exception +")", - expect, - result ); - -test(); - - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-050.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-050.js deleted file mode 100644 index d9161c4b8f..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-050.js +++ /dev/null @@ -1,78 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-050.js'; - -/** - File Name: lexical-050.js - Corresponds to: 7.8.2-1-n.js - ECMA Section: 7.8.2 Examples of Automatic Semicolon Insertion - Description: compare some specific examples of the automatic - insertion rules in the EMCA specification. - Author: christine@netscape.com - Date: 15 september 1997 -*/ - -var SECTION = "lexical-050"; -var VERSION = "JS1_4"; -var TITLE = "Examples of Automatic Semicolon Insertion"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("{ 1 2 } 3"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "{ 1 2 } 3" + - " (threw " + exception +")", - expect, - result ); - -test(); - - - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-051.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-051.js deleted file mode 100644 index 97ccbc6b43..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-051.js +++ /dev/null @@ -1,78 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-051.js'; - -/** - File Name: lexical-051.js - Corresponds to: 7.8.2-3-n.js - ECMA Section: 7.8.2 Examples of Automatic Semicolon Insertion - Description: compare some specific examples of the automatic - insertion rules in the EMCA specification. - Author: christine@netscape.com - Date: 15 september 1997 -*/ - -var SECTION = "lexical-051"; -var VERSION = "JS1_4"; -var TITLE = "Examples of Automatic Semicolon Insertion"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("for (a; b\n) result += \": got to inner loop\";") - } catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "for (a; b\n)" + - " (threw " + exception +")", - expect, - result ); - -test(); - - - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-052.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-052.js deleted file mode 100644 index 20d2d3c254..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-052.js +++ /dev/null @@ -1,80 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-052.js'; - -/** - File Name: lexical-052.js - Corresponds to: 7.8.2-4-n.js - ECMA Section: 7.8.2 Examples of Automatic Semicolon Insertion - Description: compare some specific examples of the automatic - insertion rules in the EMCA specification. - Author: christine@netscape.com - Date: 15 september 1997 -*/ - -var SECTION = "lexical-052"; -var VERSION = "JS1_4"; -var TITLE = "Examples of Automatic Semicolon Insertion"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - MyFunction(); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "calling return indirectly" + - " (threw " + exception +")", - expect, - result ); - -test(); - -function MyFunction() { - var s = "return"; - eval(s); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-053.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-053.js deleted file mode 100644 index 4e64fa1322..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-053.js +++ /dev/null @@ -1,78 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-053.js'; - -/** - File Name: lexical-053.js - Corresponds to: 7.8.2-7-n.js - ECMA Section: 7.8.2 Examples of Automatic Semicolon Insertion - Description: compare some specific examples of the automatic - insertion rules in the EMCA specification. - Author: christine@netscape.com - Date: 15 september 1997 -*/ - -var SECTION = "lexical-053"; -var VERSION = "JS1_4"; -var TITLE = "Examples of Automatic Semicolon Insertion"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - a = true - b = false - - eval('if (a > b)\nelse result += ": got to else statement"'); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "calling return indirectly" + - " (threw " + exception +")", - expect, - result ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-054.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-054.js deleted file mode 100644 index 3e25c36ef8..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/lexical-054.js +++ /dev/null @@ -1,79 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'lexical-054.js'; - -/** - File Name: lexical-054.js - Corresponds to: 7.8.2-7-n.js - ECMA Section: 7.8.2 Examples of Automatic Semicolon Insertion - Description: compare some specific examples of the automatic - insertion rules in the EMCA specification. - Author: christine@netscape.com - Date: 15 september 1997 -*/ - -var SECTION = "lexical-054"; -var VERSION = "JS1_4"; -var TITLE = "Examples of Automatic Semicolon Insertion"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - a=0; - b=1; - c=2; - d=3; - eval("if (a > b)\nelse c = d"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "if (a > b)\nelse c = d" + - " (threw " + exception +")", - expect, - result ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/number-001.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/number-001.js deleted file mode 100644 index eb49a5b9bd..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/number-001.js +++ /dev/null @@ -1,86 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'number-001.js'; - -/** - File Name: number-001 - Corresponds To: 15.7.4.2-2-n.js - ECMA Section: 15.7.4.2.2 Number.prototype.toString() - Description: - If the radix is the number 10 or not supplied, then this number value is - given as an argument to the ToString operator; the resulting string value - is returned. - - If the radix is supplied and is an integer from 2 to 36, but not 10, the - result is a string, the choice of which is implementation dependent. - - The toString function is not generic; it generates a runtime error if its - this value is not a Number object. Therefore it cannot be transferred to - other kinds of objects for use as a method. - - Author: christine@netscape.com - Date: 16 september 1997 -*/ -var SECTION = "number-001"; -var VERSION = "JS1_4"; -var TITLE = "Exceptions for Number.toString()"; - -startTest(); -writeHeaderToLog( SECTION + " Number.prototype.toString()"); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - object= new Object(); - object.toString = Number.prototype.toString; - result = object.toString(); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "object = new Object(); object.toString = Number.prototype.toString; object.toString()" + - " (threw " + exception +")", - expect, - result ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/number-002.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/number-002.js deleted file mode 100644 index fef61fd527..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/number-002.js +++ /dev/null @@ -1,81 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'number-002.js'; - -/** - File Name: number-002.js - Corresponds To: ecma/Number/15.7.4.3-2-n.js - ECMA Section: 15.7.4.3.1 Number.prototype.valueOf() - Description: - Returns this number value. - - The valueOf function is not generic; it generates a runtime error if its - this value is not a Number object. Therefore it cannot be transferred to - other kinds of objects for use as a method. - - Author: christine@netscape.com - Date: 16 september 1997 -*/ -var SECTION = "number-002"; -var VERSION = "JS1_4"; -var TITLE = "Exceptions for Number.valueOf()"; - -startTest(); -writeHeaderToLog( SECTION + " Number.prototype.valueOf()"); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - object= new Object(); - object.toString = Number.prototype.valueOf; - result = object.toString(); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "object = new Object(); object.valueOf = Number.prototype.valueOf; object.valueOf()" + - " (threw " + exception +")", - expect, - result ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/number-003.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/number-003.js deleted file mode 100644 index 46920b7072..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/number-003.js +++ /dev/null @@ -1,83 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'number-003.js'; - -/** - File Name: number-003.js - Corresponds To: 15.7.4.3-3.js - ECMA Section: 15.7.4.3.1 Number.prototype.valueOf() - Description: - Returns this number value. - - The valueOf function is not generic; it generates a runtime error if its - this value is not a Number object. Therefore it cannot be transferred to - other kinds of objects for use as a method. - - Author: christine@netscape.com - Date: 16 september 1997 -*/ -var SECTION = "number-003"; -var VERSION = "JS1_4"; -var TITLE = "Exceptions for Number.valueOf()"; - -startTest(); -writeHeaderToLog( SECTION + " Number.prototype.valueOf()"); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - VALUE_OF = Number.prototype.valueOf; - OBJECT = new String("Infinity"); - OBJECT.valueOf = VALUE_OF; - result = OBJECT.valueOf(); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "Assigning Number.prototype.valueOf as the valueOf of a String object " + - " (threw " + exception +")", - expect, - result ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/shell.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/shell.js deleted file mode 100644 index 6c671f1eea..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/shell.js +++ /dev/null @@ -1 +0,0 @@ -gTestsubsuite = 'Exceptions'; diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/statement-001.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/statement-001.js deleted file mode 100644 index 98e3d61a0c..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/statement-001.js +++ /dev/null @@ -1,80 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'statement-001.js'; - -/** - File Name: statement-001.js - Corresponds To: 12.6.2-9-n.js - ECMA Section: 12.6.2 The for Statement - - 1. first expression is not present. - 2. second expression is not present - 3. third expression is not present - - - Author: christine@netscape.com - Date: 15 september 1997 -*/ - -var SECTION = "statement-001.js"; -// var SECTION = "12.6.2-9-n"; -var VERSION = "ECMA_1"; -var TITLE = "The for statement"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("for (i) {\n}"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "for(i) {}" + - " (threw " + exception +")", - expect, - result ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/statement-002.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/statement-002.js deleted file mode 100644 index da9931e9ab..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/statement-002.js +++ /dev/null @@ -1,102 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'statement-002.js'; - -/** - File Name: statement-002.js - Corresponds To: 12.6.3-1.js - ECMA Section: 12.6.3 The for...in Statement - Description: - The production IterationStatement : for ( LeftHandSideExpression in Expression ) - Statement is evaluated as follows: - - 1. Evaluate the Expression. - 2. Call GetValue(Result(1)). - 3. Call ToObject(Result(2)). - 4. Let C be "normal completion". - 5. Get the name of the next property of Result(3) that doesn't have the - DontEnum attribute. If there is no such property, go to step 14. - 6. Evaluate the LeftHandSideExpression ( it may be evaluated repeatedly). - 7. Call PutValue(Result(6), Result(5)). PutValue( V, W ): - 1. If Type(V) is not Reference, generate a runtime error. - 2. Call GetBase(V). - 3. If Result(2) is null, go to step 6. - 4. Call the [[Put]] method of Result(2), passing GetPropertyName(V) - for the property name and W for the value. - 5. Return. - 6. Call the [[Put]] method for the global object, passing - GetPropertyName(V) for the property name and W for the value. - 7. Return. - 8. Evaluate Statement. - 9. If Result(8) is a value completion, change C to be "normal completion - after value V" where V is the value carried by Result(8). - 10. If Result(8) is a break completion, go to step 14. - 11. If Result(8) is a continue completion, go to step 5. - 12. If Result(8) is a return completion, return Result(8). - 13. Go to step 5. - 14. Return C. - - Author: christine@netscape.com - Date: 11 september 1997 -*/ -var SECTION = "statement-002"; -var VERSION = "JS1_4"; -var TITLE = "The for..in statement"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval(" for ( var i, p in this) { result += this[p]; }"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "more than one member expression" + - " (threw " + exception +")", - expect, - result ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/statement-003.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/statement-003.js deleted file mode 100644 index d51083c4cf..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/statement-003.js +++ /dev/null @@ -1,113 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'statement-003.js'; - -/** - File Name: statement-003 - Corresponds To: 12.6.3-7-n.js - ECMA Section: 12.6.3 The for...in Statement - Description: - The production IterationStatement : for ( LeftHandSideExpression in Expression ) - Statement is evaluated as follows: - - 1. Evaluate the Expression. - 2. Call GetValue(Result(1)). - 3. Call ToObject(Result(2)). - 4. Let C be "normal completion". - 5. Get the name of the next property of Result(3) that doesn't have the - DontEnum attribute. If there is no such property, go to step 14. - 6. Evaluate the LeftHandSideExpression ( it may be evaluated repeatedly). - 7. Call PutValue(Result(6), Result(5)). PutValue( V, W ): - 1. If Type(V) is not Reference, generate a runtime error. - 2. Call GetBase(V). - 3. If Result(2) is null, go to step 6. - 4. Call the [[Put]] method of Result(2), passing GetPropertyName(V) - for the property name and W for the value. - 5. Return. - 6. Call the [[Put]] method for the global object, passing - GetPropertyName(V) for the property name and W for the value. - 7. Return. - 8. Evaluate Statement. - 9. If Result(8) is a value completion, change C to be "normal completion - after value V" where V is the value carried by Result(8). - 10. If Result(8) is a break completion, go to step 14. - 11. If Result(8) is a continue completion, go to step 5. - 12. If Result(8) is a return completion, return Result(8). - 13. Go to step 5. - 14. Return C. - - Author: christine@netscape.com - Date: 11 september 1997 -*/ -var SECTION = "statement-003"; -var VERSION = "JS1_4"; -var TITLE = "The for..in statement"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - var o = new MyObject(); - var result = 0; - - eval("for ( this in o) {\n" - + "result += this[p];\n" - + "}\n"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "bad left-hand side expression" + - " (threw " + exception +")", - expect, - result ); - -test(); - -function MyObject() { - this.value = 2; - this[0] = 4; - return this; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/statement-004.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/statement-004.js deleted file mode 100644 index 8b9789a929..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/statement-004.js +++ /dev/null @@ -1,85 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'statement-004.js'; - -/** - File Name: statement-004.js - Corresponds To: 12.6.3-1.js - ECMA Section: 12.6.3 The for...in Statement - Description: - Author: christine@netscape.com - Date: 11 september 1997 -*/ -var SECTION = "statement-004"; -var VERSION = "JS1_4"; -var TITLE = "The for..in statement"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - var o = new MyObject(); - - eval("for ( \"a\" in o) {\n" - + "result += this[p];\n" - + "}"); - -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "bad left-hand side expression" + - " (threw " + exception +")", - expect, - result ); - -test(); - - -function MyObject() { - this.value = 2; - this[0] = 4; - return this; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/statement-005.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/statement-005.js deleted file mode 100644 index 62a8c45d92..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/statement-005.js +++ /dev/null @@ -1,84 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'statement-005.js'; - -/** - File Name: statement-005.js - Corresponds To: 12.6.3-8-n.js - ECMA Section: 12.6.3 The for...in Statement - Description: - Author: christine@netscape.com - Date: 11 september 1997 -*/ -var SECTION = "statement-005"; -var VERSION = "JS1_4"; -var TITLE = "The for..in statement"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - var o = new MyObject(); - result = 0; - - eval("for (1 in o) {\n" - + "result += this[p];" - + "}\n"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "bad left-hand side expression" + - " (threw " + exception +")", - expect, - result ); - -test(); - -function MyObject() { - this.value = 2; - this[0] = 4; - return this; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/statement-006.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/statement-006.js deleted file mode 100644 index ec5ba97576..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/statement-006.js +++ /dev/null @@ -1,84 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'statement-006.js'; - -/** - File Name: statement-006.js - Corresponds To: 12.6.3-9-n.js - ECMA Section: 12.6.3 The for...in Statement - Description: - - Author: christine@netscape.com - Date: 11 september 1997 -*/ -var SECTION = "statement-006"; -var VERSION = "JS1_4"; -var TITLE = "The for..in statement"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - var o = new MyObject(); - var result = 0; - for ( var o in foo) { - result += this[o]; - } -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "object is not defined" + - " (threw " + exception +")", - expect, - result ); - -test(); - -function MyObject() { - this.value = 2; - this[0] = 4; - return this; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/statement-007.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/statement-007.js deleted file mode 100644 index bb367c9924..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/statement-007.js +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'statement-007.js'; - -/** - File Name: statement-007.js - Corresponds To: 12.7-1-n.js - ECMA Section: 12.7 The continue statement - Description: - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "statement-007"; -var VERSION = "JS1_4"; -var TITLE = "The continue statement"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("continue;"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "continue outside of an iteration statement" + - " (threw " + exception +")", - expect, - result ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/statement-008.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/statement-008.js deleted file mode 100644 index 54ab39a9c9..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/statement-008.js +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'statement-008.js'; - -/** - File Name: statement-008.js - Corresponds To: 12.8-1-n.js - ECMA Section: 12.8 The break statement - Description: - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "statement-008"; -var VERSION = "JS1_4"; -var TITLE = "The break in statement"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("break;"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "break outside of an iteration statement" + - " (threw " + exception +")", - expect, - result ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/statement-009.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/statement-009.js deleted file mode 100644 index a63bd84e8e..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/statement-009.js +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'statement-009.js'; - -/** - File Name: 12.9-1-n.js - ECMA Section: 12.9 The return statement - Description: - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "12.9-1-n"; -var VERSION = "ECMA_1"; -var TITLE = "The return statement"; - -startTest(); -writeHeaderToLog( SECTION + " The return statement"); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - eval("return;"); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "return outside of a function" + - " (threw " + exception +")", - expect, - result ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/string-001.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/string-001.js deleted file mode 100644 index 551030db33..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/string-001.js +++ /dev/null @@ -1,86 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'string-001.js'; - -/** - File Name: string-001.js - Corresponds To: 15.5.4.2-2-n.js - ECMA Section: 15.5.4.2 String.prototype.toString() - - Description: Returns this string value. Note that, for a String - object, the toString() method happens to return the same - thing as the valueOf() method. - - The toString function is not generic; it generates a - runtime error if its this value is not a String object. - Therefore it connot be transferred to the other kinds of - objects for use as a method. - - Author: christine@netscape.com - Date: 1 october 1997 -*/ -var SECTION = "string-001"; -var VERSION = "JS1_4"; -var TITLE = "String.prototype.toString"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - OBJECT = new Object(); - OBJECT.toString = String.prototype.toString(); - result = OBJECT.toString(); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "OBJECT = new Object; "+ - " OBJECT.toString = String.prototype.toString; OBJECT.toString()" + - " (threw " + exception +")", - expect, - result ); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/string-002.js b/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/string-002.js deleted file mode 100644 index 785e339080..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Exceptions/string-002.js +++ /dev/null @@ -1,85 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'string-002.js'; - -/** - File Name: string-002.js - Corresponds To: 15.5.4.3-3-n.js - ECMA Section: 15.5.4.3 String.prototype.valueOf() - - Description: Returns this string value. - - The valueOf function is not generic; it generates a - runtime error if its this value is not a String object. - Therefore it connot be transferred to the other kinds of - objects for use as a method. - - Author: christine@netscape.com - Date: 1 october 1997 -*/ -var SECTION = "string-002"; -var VERSION = "JS1_4"; -var TITLE = "String.prototype.valueOf"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var result = "Failed"; -var exception = "No exception thrown"; -var expect = "Passed"; - -try { - var OBJECT =new Object(); - OBJECT.valueOf = String.prototype.valueOf; - result = OBJECT.valueOf(); -} catch ( e ) { - result = expect; - exception = e.toString(); -} - -new TestCase( - SECTION, - "OBJECT = new Object; OBJECT.valueOf = String.prototype.valueOf;"+ - "result = OBJECT.valueOf();" + - " (threw " + exception +")", - expect, - result ); - -test(); - - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Expressions/StrictEquality-001.js b/tests/auto/declarative/parserstress/tests/ecma_2/Expressions/StrictEquality-001.js deleted file mode 100644 index db5c403d3d..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Expressions/StrictEquality-001.js +++ /dev/null @@ -1,106 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'StrictEquality-001.js'; - -/** - * File Name: StrictEquality-001.js - * ECMA Section: 11.9.6.js - * Description: - * - * Author: christine@netscape.com - * Date: 4 september 1998 - */ -var SECTION = "StrictEquality-001 - 11.9.6"; -var VERSION = "ECMA_2"; -var TITLE = "The strict equality operator ( === )"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - - -// 1. If Type(x) is different from Type(y) return false - -StrictEquality( true, new Boolean(true), false ); -StrictEquality( new Boolean(), false, false ); -StrictEquality( "", new String(), false ); -StrictEquality( new String("hi"), "hi", false ); - -// 2. If Type(x) is not Number go to step 9. - -// 3. If x is NaN, return false -StrictEquality( NaN, NaN, false ); -StrictEquality( NaN, 0, false ); - -// 4. If y is NaN, return false. -StrictEquality( 0, NaN, false ); - -// 5. if x is the same number value as y, return true - -// 6. If x is +0 and y is -0, return true - -// 7. If x is -0 and y is +0, return true - -// 8. Return false. - - -// 9. If Type(x) is String, then return true if x and y are exactly -// the same sequence of characters ( same length and same characters -// in corresponding positions.) Otherwise return false. - -// 10. If Type(x) is Boolean, return true if x and y are both true or -// both false. otherwise return false. - - -// Return true if x and y refer to the same object. Otherwise return -// false. - -// Return false. - - -test(); - -function StrictEquality( x, y, expect ) { - result = ( x === y ); - - new TestCase( - SECTION, - x +" === " + y, - expect, - result ); -} - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Expressions/browser.js b/tests/auto/declarative/parserstress/tests/ecma_2/Expressions/browser.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Expressions/shell.js b/tests/auto/declarative/parserstress/tests/ecma_2/Expressions/shell.js deleted file mode 100644 index 8f5d1129d5..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Expressions/shell.js +++ /dev/null @@ -1 +0,0 @@ -gTestsubsuite = 'Expressions'; diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/FunctionObjects/apply-001-n.js b/tests/auto/declarative/parserstress/tests/ecma_2/FunctionObjects/apply-001-n.js deleted file mode 100644 index e58d087121..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/FunctionObjects/apply-001-n.js +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Rob Ginda rginda@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'apply-001-n.js'; - -print("STATUS: f.apply crash test."); - -print("BUGNUMBER: 21836"); - -function f () -{ -} - -var SECTION = "apply-001-n"; -var VERSION = "ECMA_1"; -startTest(); -var TITLE = "f.apply(2,2) doesn't crash"; - -writeHeaderToLog( SECTION + " "+ TITLE); - -DESCRIPTION = "f.apply(2,2) doesn't crash"; -EXPECTED = "error"; - -new TestCase( SECTION, "f.apply(2,2) doesn't crash", "error", eval("f.apply(2,2)") ); - -test(); - - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/FunctionObjects/browser.js b/tests/auto/declarative/parserstress/tests/ecma_2/FunctionObjects/browser.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/FunctionObjects/call-1.js b/tests/auto/declarative/parserstress/tests/ecma_2/FunctionObjects/call-1.js deleted file mode 100644 index 283e323797..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/FunctionObjects/call-1.js +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'call-1.js'; - -/** - File Name: call-1.js - Section: Function.prototype.call - Description: - - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = "call-1"; -var VERSION = "ECMA_2"; -var TITLE = "Function.prototype.call"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -new TestCase( SECTION, - "ToString.call( this, this )", - GLOBAL, - ToString.call( this, this ) ); - -new TestCase( SECTION, - "ToString.call( Boolean, Boolean.prototype )", - "false", - ToString.call( Boolean, Boolean.prototype ) ); - -new TestCase( SECTION, - "ToString.call( Boolean, Boolean.prototype.valueOf() )", - "false", - ToString.call( Boolean, Boolean.prototype.valueOf() ) ); - -test(); - -function ToString( obj ) { - return obj +""; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/FunctionObjects/shell.js b/tests/auto/declarative/parserstress/tests/ecma_2/FunctionObjects/shell.js deleted file mode 100644 index 27aa7b1318..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/FunctionObjects/shell.js +++ /dev/null @@ -1 +0,0 @@ -gTestsubsuite = 'FunctionObjects'; diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/LexicalConventions/browser.js b/tests/auto/declarative/parserstress/tests/ecma_2/LexicalConventions/browser.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/LexicalConventions/keywords-001.js b/tests/auto/declarative/parserstress/tests/ecma_2/LexicalConventions/keywords-001.js deleted file mode 100644 index 7362613783..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/LexicalConventions/keywords-001.js +++ /dev/null @@ -1,81 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'keywords-001.js'; - -/** - * File Name: - * ECMA Section: - * Description: - * - * - * Author: christine@netscape.com - * Date: 11 August 1998 - */ -var SECTION = ""; -var VERSION = "ECMA_2"; -var TITLE = "Keywords"; - -startTest(); - -print("This test requires option javascript.options.strict enabled"); - -if (!options().match(/strict/)) -{ - options('strict'); -} -if (!options().match(/werror/)) -{ - options('werror'); -} - -var result = "failed"; - -try { - eval("super;"); -} -catch (x) { - if (x instanceof SyntaxError) - result = x.name; -} - -AddTestCase( - "using the expression \"super\" shouldn't cause js to crash", - "SyntaxError", - result ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/LexicalConventions/regexp-literals-001.js b/tests/auto/declarative/parserstress/tests/ecma_2/LexicalConventions/regexp-literals-001.js deleted file mode 100644 index caa50fe363..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/LexicalConventions/regexp-literals-001.js +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'regexp-literals-001.js'; - -/** - * File Name: LexicalConventions/regexp-literals-001.js - * ECMA Section: 7.8.5 - * Description: - * - * - * Author: christine@netscape.com - * Date: 11 August 1998 - */ -var SECTION = "LexicalConventions/regexp-literals-001.js"; -var VERSION = "ECMA_2"; -var TITLE = "Regular Expression Literals"; - -startTest(); - -// Regular Expression Literals may not be empty; // should be regarded -// as a comment, not a RegExp literal. - -s = //; - - "passed"; - -AddTestCase( - "// should be a comment, not a regular expression literal", - "passed", - String(s)); - -AddTestCase( - "// typeof object should be type of object declared on following line", - "passed", - (typeof s) == "string" ? "passed" : "failed" ); - -AddTestCase( - "// should not return an object of the type RegExp", - "passed", - (typeof s == "object") ? "failed" : "passed" ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/LexicalConventions/regexp-literals-002.js b/tests/auto/declarative/parserstress/tests/ecma_2/LexicalConventions/regexp-literals-002.js deleted file mode 100644 index 911b5d117a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/LexicalConventions/regexp-literals-002.js +++ /dev/null @@ -1,61 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'regexp-literals-002.js'; - -/** - * File Name: LexicalConventions/regexp-literals-002.js - * ECMA Section: 7.8.5 - * Description: Based on ECMA 2 Draft 8 October 1999 - * - * Author: christine@netscape.com - * Date: 19 February 1999 - */ -var SECTION = "LexicalConventions/regexp-literals-002.js"; -var VERSION = "ECMA_2"; -var TITLE = "Regular Expression Literals"; - -startTest(); - -// A regular expression literal represents an object of type RegExp. - -AddTestCase( - "// A regular expression literal represents an object of type RegExp.", - "true", - (/x*/ instanceof RegExp).toString() ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/LexicalConventions/shell.js b/tests/auto/declarative/parserstress/tests/ecma_2/LexicalConventions/shell.js deleted file mode 100644 index 4e1d61d68a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/LexicalConventions/shell.js +++ /dev/null @@ -1 +0,0 @@ -gTestsubsuite = 'LexicalConventions'; diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/README b/tests/auto/declarative/parserstress/tests/ecma_2/README deleted file mode 100755 index 6da6cdd514..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/README +++ /dev/null @@ -1 +0,0 @@ -ECMA 262 Edition 2 diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/browser.js b/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/browser.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/constructor-001.js b/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/constructor-001.js deleted file mode 100644 index f1dba13b06..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/constructor-001.js +++ /dev/null @@ -1,99 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'constructor-001.js'; - -/** - * File Name: RegExp/constructor-001.js - * ECMA Section: 15.7.3.3 - * Description: Based on ECMA 2 Draft 7 February 1999 - * - * Author: christine@netscape.com - * Date: 19 February 1999 - */ -var SECTION = "RegExp/constructor-001"; -var VERSION = "ECMA_2"; -var TITLE = "new RegExp()"; - -startTest(); - -/* - * for each test case, verify: - * - verify that [[Class]] property is RegExp - * - prototype property should be set to RegExp.prototype - * - source is set to the empty string - * - global property is set to false - * - ignoreCase property is set to false - * - multiline property is set to false - * - lastIndex property is set to 0 - */ - -RegExp.prototype.getClassProperty = Object.prototype.toString; -var re = new RegExp(); - -AddTestCase( - "RegExp.prototype.getClassProperty = Object.prototype.toString; " + - "(new RegExp()).getClassProperty()", - "[object RegExp]", - re.getClassProperty() ); - -AddTestCase( - "(new RegExp()).source", - "", - re.source ); - -AddTestCase( - "(new RegExp()).global", - false, - re.global ); - -AddTestCase( - "(new RegExp()).ignoreCase", - false, - re.ignoreCase ); - -AddTestCase( - "(new RegExp()).multiline", - false, - re.multiline ); - -AddTestCase( - "(new RegExp()).lastIndex", - 0, - re.lastIndex ); - -test() diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/exec-001.js b/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/exec-001.js deleted file mode 100644 index 2d1bab472c..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/exec-001.js +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'exec-001.js'; - -/** - * File Name: RegExp/exec-001.js - * ECMA Section: 15.7.5.3 - * Description: Based on ECMA 2 Draft 7 February 1999 - * - * Author: christine@netscape.com - * Date: 19 February 1999 - */ -var SECTION = "RegExp/exec-001"; -var VERSION = "ECMA_2"; -var TITLE = "RegExp.prototype.exec(string)"; - -startTest(); - -/* - * for each test case, verify: - * - type of object returned - * - length of the returned array - * - value of lastIndex - * - value of index - * - value of input - * - value of the array indices - */ - -// test cases without subpatterns -// test cases with subpatterns -// global property is true -// global property is false -// test cases in which the exec returns null - -AddTestCase("NO TESTS EXIST", "PASSED", "Test not implemented"); - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/exec-002.js b/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/exec-002.js deleted file mode 100644 index 026f27d9d4..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/exec-002.js +++ /dev/null @@ -1,221 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'exec-002.js'; - -/** - * File Name: RegExp/exec-002.js - * ECMA Section: 15.7.5.3 - * Description: Based on ECMA 2 Draft 7 February 1999 - * - * Test cases provided by rogerl@netscape.com - * - * Author: christine@netscape.com - * Date: 19 February 1999 - */ -var SECTION = "RegExp/exec-002"; -var VERSION = "ECMA_2"; -var TITLE = "RegExp.prototype.exec(string)"; - -startTest(); - -/* - * for each test case, verify: - * - type of object returned - * - length of the returned array - * - value of lastIndex - * - value of index - * - value of input - * - value of the array indices - */ - -AddRegExpCases( - /(a|d|q|)x/i, - "bcaDxqy", - 3, - ["Dx", "D"] ); - -AddRegExpCases( - /(a|(e|q))(x|y)/, - "bcaddxqy", - 6, - ["qy","q","q","y"] ); - - -AddRegExpCases( - /a+b+d/, - "aabbeeaabbs", - 0, - null ); - -AddRegExpCases( - /a*b/, - "aaadaabaaa", - 4, - ["aab"] ); - -AddRegExpCases( - /a*b/, - "dddb", - 3, - ["b"] ); - -AddRegExpCases( - /a*b/, - "xxx", - 0, - null ); - -AddRegExpCases( - /x\d\dy/, - "abcx45ysss235", - 3, - ["x45y"] ); - -AddRegExpCases( - /[^abc]def[abc]+/, - "abxdefbb", - 2, - ["xdefbb"] ); - -AddRegExpCases( - /(a*)baa/, - "ccdaaabaxaabaa", - 9, - ["aabaa", "aa"] ); - -AddRegExpCases( - /(a*)baa/, - "aabaa", - 0, - ["aabaa", "aa"] ); - -AddRegExpCases( - /q(a|b)*q/, - "xxqababqyy", - 2, - ["qababq", "b"] ); - -AddRegExpCases( - /(a(.|[^d])c)*/, - "adcaxc", - 0, - ["adcaxc", "axc", "x"] ); - -AddRegExpCases( - /(a*)b\1/, - "abaaaxaabaayy", - 0, - ["aba", "a"] ); - -AddRegExpCases( - /(a*)b\1/, - "abaaaxaabaayy", - 0, - ["aba", "a"] ); - -AddRegExpCases( - /(a*)b\1/, - "cccdaaabaxaabaayy", - 6, - ["aba", "a"] ); - -AddRegExpCases( - /(a*)b\1/, - "cccdaaabqxaabaayy", - 7, - ["b", ""] ); - -AddRegExpCases( - /"(.|[^"\\\\])*"/, - 'xx\"makudonarudo\"yy', - 2, - ["\"makudonarudo\"", "o"] ); - - AddRegExpCases( - /"(.|[^"\\\\])*"/, - "xx\"ma\"yy", - 2, - ["\"ma\"", "a"] ); - - test(); - - function AddRegExpCases( - regexp, pattern, index, matches_array ) { - -// prevent a runtime error - - if ( regexp.exec(pattern) == null || matches_array == null ) { - AddTestCase( - regexp + ".exec(" + pattern +")", - matches_array, - regexp.exec(pattern) ); - - return; - } - AddTestCase( - regexp + ".exec(" + pattern +").length", - matches_array.length, - regexp.exec(pattern).length ); - - AddTestCase( - regexp + ".exec(" + pattern +").index", - index, - regexp.exec(pattern).index ); - - AddTestCase( - regexp + ".exec(" + pattern +").input", - pattern, - regexp.exec(pattern).input ); - - AddTestCase( - regexp + ".exec(" + pattern +").toString()", - matches_array.toString(), - regexp.exec(pattern).toString() ); -/* - var limit = matches_array.length > regexp.exec(pattern).length - ? matches_array.length - : regexp.exec(pattern).length; - - for ( var matches = 0; matches < limit; matches++ ) { - AddTestCase( - regexp + ".exec(" + pattern +")[" + matches +"]", - matches_array[matches], - regexp.exec(pattern)[matches] ); - } -*/ - } diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/function-001.js b/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/function-001.js deleted file mode 100644 index 8b219b935b..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/function-001.js +++ /dev/null @@ -1,99 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'function-001.js'; - -/** - * File Name: RegExp/function-001.js - * ECMA Section: 15.7.2.1 - * Description: Based on ECMA 2 Draft 7 February 1999 - * - * Author: christine@netscape.com - * Date: 19 February 1999 - */ -var SECTION = "RegExp/function-001"; -var VERSION = "ECMA_2"; -var TITLE = "RegExp( pattern, flags )"; - -startTest(); - -/* - * for each test case, verify: - * - verify that [[Class]] property is RegExp - * - prototype property should be set to RegExp.prototype - * - source is set to the empty string - * - global property is set to false - * - ignoreCase property is set to false - * - multiline property is set to false - * - lastIndex property is set to 0 - */ - -RegExp.prototype.getClassProperty = Object.prototype.toString; -var re = new RegExp(); - -AddTestCase( - "RegExp.prototype.getClassProperty = Object.prototype.toString; " + - "(new RegExp()).getClassProperty()", - "[object RegExp]", - re.getClassProperty() ); - -AddTestCase( - "(new RegExp()).source", - "", - re.source ); - -AddTestCase( - "(new RegExp()).global", - false, - re.global ); - -AddTestCase( - "(new RegExp()).ignoreCase", - false, - re.ignoreCase ); - -AddTestCase( - "(new RegExp()).multiline", - false, - re.multiline ); - -AddTestCase( - "(new RegExp()).lastIndex", - 0, - re.lastIndex ); - -test() diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/hex-001.js b/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/hex-001.js deleted file mode 100644 index 3e85ac7abf..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/hex-001.js +++ /dev/null @@ -1,102 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'hex-001.js'; - -/** - * File Name: RegExp/hex-001.js - * ECMA Section: 15.7.3.1 - * Description: Based on ECMA 2 Draft 7 February 1999 - * Positive test cases for constructing a RegExp object - * Author: christine@netscape.com - * Date: 19 February 1999 - */ -var SECTION = "RegExp/hex-001"; -var VERSION = "ECMA_2"; -var TITLE = "RegExp patterns that contain HexicdecimalEscapeSequences"; - -startTest(); - -// These examples come from 15.7.1, HexidecimalEscapeSequence - -AddRegExpCases( new RegExp("\x41"), "new RegExp('\\x41')", "A", "A", 1, 0, ["A"] ); -AddRegExpCases( new RegExp("\x412"),"new RegExp('\\x412')", "A2", "A2", 1, 0, ["A2"] ); -AddRegExpCases( new RegExp("\x1g"), "new RegExp('\\x1g')", "x1g","x1g", 1, 0, ["x1g"] ); - -AddRegExpCases( new RegExp("A"), "new RegExp('A')", "\x41", "\\x41", 1, 0, ["A"] ); -AddRegExpCases( new RegExp("A"), "new RegExp('A')", "\x412", "\\x412", 1, 0, ["A"] ); -AddRegExpCases( new RegExp("^x"), "new RegExp('^x')", "x412", "x412", 1, 0, ["x"]); -AddRegExpCases( new RegExp("A"), "new RegExp('A')", "A2", "A2", 1, 0, ["A"] ); - -test(); - -function AddRegExpCases( - regexp, str_regexp, pattern, str_pattern, length, index, matches_array ) { - - // prevent a runtime error - - if ( regexp.exec(pattern) == null || matches_array == null ) { - AddTestCase( - str_regexp + ".exec(" + pattern +")", - matches_array, - regexp.exec(pattern) ); - - return; - } - - AddTestCase( - str_regexp + ".exec(" + str_pattern +").length", - length, - regexp.exec(pattern).length ); - - AddTestCase( - str_regexp + ".exec(" + str_pattern +").index", - index, - regexp.exec(pattern).index ); - - AddTestCase( - str_regexp + ".exec(" + str_pattern +").input", - pattern, - regexp.exec(pattern).input ); - - for ( var matches = 0; matches < matches_array.length; matches++ ) { - AddTestCase( - str_regexp + ".exec(" + str_pattern +")[" + matches +"]", - matches_array[matches], - regexp.exec(pattern)[matches] ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/multiline-001.js b/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/multiline-001.js deleted file mode 100644 index 102f91fcd4..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/multiline-001.js +++ /dev/null @@ -1,101 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'multiline-001.js'; - -/** - * File Name: RegExp/multiline-001.js - * ECMA Section: - * Description: Based on ECMA 2 Draft 7 February 1999 - * - * Date: 19 February 1999 - */ - -var SECTION = "RegExp/multiline-001"; -var VERSION = "ECMA_2"; -var TITLE = "RegExp: multiline flag"; -var BUGNUMBER="343901"; - -startTest(); - -var woodpeckers = "ivory-billed\ndowny\nhairy\nacorn\nyellow-bellied sapsucker\n" + - "northern flicker\npileated\n"; - -AddRegExpCases( /.*[y]$/m, woodpeckers, woodpeckers.indexOf("downy"), ["downy"] ); - -AddRegExpCases( /.*[d]$/m, woodpeckers, woodpeckers.indexOf("ivory-billed"), ["ivory-billed"] ); - -test(); - - -function AddRegExpCases -( regexp, pattern, index, matches_array ) { - - // prevent a runtime error - - if ( regexp.exec(pattern) == null || matches_array == null ) { - AddTestCase( - regexp + ".exec(" + pattern +")", - matches_array, - regexp.exec(pattern) ); - - return; - } - - AddTestCase( - regexp.toString() + ".exec(" + pattern +").length", - matches_array.length, - regexp.exec(pattern).length ); - - AddTestCase( - regexp.toString() + ".exec(" + pattern +").index", - index, - regexp.exec(pattern).index ); - - AddTestCase( - regexp + ".exec(" + pattern +").input", - pattern, - regexp.exec(pattern).input ); - - - for ( var matches = 0; matches < matches_array.length; matches++ ) { - AddTestCase( - regexp + ".exec(" + pattern +")[" + matches +"]", - matches_array[matches], - regexp.exec(pattern)[matches] ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/octal-001.js b/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/octal-001.js deleted file mode 100644 index 1c520750ce..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/octal-001.js +++ /dev/null @@ -1,111 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'octal-001.js'; - -/** - * File Name: RegExp/octal-001.js - * ECMA Section: 15.7.1 - * Description: Based on ECMA 2 Draft 7 February 1999 - * Simple test cases for matching OctalEscapeSequences. - * Author: christine@netscape.com - * Date: 19 February 1999 - */ -var SECTION = "RegExp/octal-001.js"; -var VERSION = "ECMA_2"; -var TITLE = "RegExp patterns that contain OctalEscapeSequences"; -var BUGNUMBER="http://scopus/bugsplat/show_bug.cgi?id=346196"; - -startTest(); - - -// backreference -AddRegExpCases( - /(.)\1/, - "/(.)\\1/", - "HI!!", - "HI!", - 2, - ["!!", "!"] ); - -test(); - -function AddRegExpCases( - regexp, str_regexp, pattern, str_pattern, index, matches_array ) { - - // prevent a runtime error - - if ( regexp.exec(pattern) == null || matches_array == null ) { - AddTestCase( - regexp + ".exec(" + str_pattern +")", - matches_array, - regexp.exec(pattern) ); - - return; - } - AddTestCase( - str_regexp + ".exec(" + str_pattern +").length", - matches_array.length, - regexp.exec(pattern).length ); - - AddTestCase( - str_regexp + ".exec(" + str_pattern +").index", - index, - regexp.exec(pattern).index ); - - AddTestCase( - str_regexp + ".exec(" + str_pattern +").input", - pattern, - regexp.exec(pattern).input ); - - AddTestCase( - str_regexp + ".exec(" + str_pattern +").toString()", - matches_array.toString(), - regexp.exec(pattern).toString() ); -/* - var limit = matches_array.length > regexp.exec(pattern).length - ? matches_array.length - : regexp.exec(pattern).length; - - for ( var matches = 0; matches < limit; matches++ ) { - AddTestCase( - str_regexp + ".exec(" + str_pattern +")[" + matches +"]", - matches_array[matches], - regexp.exec(pattern)[matches] ); - } -*/ -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/octal-002.js b/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/octal-002.js deleted file mode 100644 index b654e5e68a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/octal-002.js +++ /dev/null @@ -1,126 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'octal-002.js'; - -/** - * File Name: RegExp/octal-002.js - * ECMA Section: 15.7.1 - * Description: Based on ECMA 2 Draft 7 February 1999 - * Simple test cases for matching OctalEscapeSequences. - * Author: christine@netscape.com - * Date: 19 February 1999 - */ -var SECTION = "RegExp/octal-002.js"; -var VERSION = "ECMA_2"; -var TITLE = "RegExp patterns that contain OctalEscapeSequences"; -var BUGNUMBER="http://scopus/bugsplat/show_bug.cgi?id=346189"; - -startTest(); - -// backreference -AddRegExpCases( - /(.)(.)(.)(.)(.)(.)(.)(.)\8/, - "/(.)(.)(.)(.)(.)(.)(.)(.)\\8", - "aabbccaaabbbccc", - "aabbccaaabbbccc", - 0, - ["aabbccaaa", "a", "a", "b", "b", "c", "c", "a", "a"] ); - -AddRegExpCases( - /(.)(.)(.)(.)(.)(.)(.)(.)(.)\9/, - "/(.)(.)(.)(.)(.)(.)(.)(.)\\9", - "aabbccaabbcc", - "aabbccaabbcc", - 0, - ["aabbccaabb", "a", "a", "b", "b", "c", "c", "a", "a", "b"] ); - -AddRegExpCases( - /(.)(.)(.)(.)(.)(.)(.)(.)(.)\8/, - "/(.)(.)(.)(.)(.)(.)(.)(.)(.)\\8", - "aabbccaababcc", - "aabbccaababcc", - 0, - ["aabbccaaba", "a", "a", "b", "b", "c", "c", "a", "a", "b"] ); - -test(); - -function AddRegExpCases( - regexp, str_regexp, pattern, str_pattern, index, matches_array ) { - - // prevent a runtime error - - if ( regexp.exec(pattern) == null || matches_array == null ) { - AddTestCase( - regexp + ".exec(" + str_pattern +")", - matches_array, - regexp.exec(pattern) ); - - return; - } - AddTestCase( - str_regexp + ".exec(" + str_pattern +").length", - matches_array.length, - regexp.exec(pattern).length ); - - AddTestCase( - str_regexp + ".exec(" + str_pattern +").index", - index, - regexp.exec(pattern).index ); - - AddTestCase( - str_regexp + ".exec(" + str_pattern +").input", - pattern, - regexp.exec(pattern).input ); - - AddTestCase( - str_regexp + ".exec(" + str_pattern +").toString()", - matches_array.toString(), - regexp.exec(pattern).toString() ); -/* - var limit = matches_array.length > regexp.exec(pattern).length - ? matches_array.length - : regexp.exec(pattern).length; - - for ( var matches = 0; matches < limit; matches++ ) { - AddTestCase( - str_regexp + ".exec(" + str_pattern +")[" + matches +"]", - matches_array[matches], - regexp.exec(pattern)[matches] ); - } -*/ -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/octal-003.js b/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/octal-003.js deleted file mode 100644 index ee07ca602b..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/octal-003.js +++ /dev/null @@ -1,120 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'octal-003.js'; - -/** - * File Name: RegExp/octal-003.js - * ECMA Section: 15.7.1 - * Description: Based on ECMA 2 Draft 7 February 1999 - * Simple test cases for matching OctalEscapeSequences. - * Author: christine@netscape.com - * Date: 19 February 1999 - * - * Revised: 02 August 2002 - * Author: pschwartau@netscape.com - * - * WHY: the original test expected the regexp /.\011/ - * to match 'a' + String.fromCharCode(0) + '11' - * - * This is incorrect: the string is a 4-character string consisting of - * the characters <'a'>, , <'1'>, <'1'>. By contrast, the \011 in the - * regexp should be parsed as a single token: it is the octal escape sequence - * for the horizontal tab character '\t' === '\u0009' === '\x09' === '\011'. - * - * So the regexp consists of 2 characters: , <'\t'>. - * There is no match between the regexp and the string. - * - * See the testcase ecma_3/RegExp/octal-002.js for an elaboration. - * - */ -var SECTION = "RegExp/octal-003.js"; -var VERSION = "ECMA_2"; -var TITLE = "RegExp patterns that contain OctalEscapeSequences"; -var BUGNUMBER="http://scopus/bugsplat/show_bug.cgi?id=346132"; - -startTest(); - -AddRegExpCases( /.\011/, "/\\011/", "a" + String.fromCharCode(0) + "11", "a\\011", 0, null ); - -test(); - -function AddRegExpCases( - regexp, str_regexp, pattern, str_pattern, index, matches_array ) { - - // prevent a runtime error - - if ( regexp.exec(pattern) == null || matches_array == null ) { - AddTestCase( - regexp + ".exec(" + str_pattern +")", - matches_array, - regexp.exec(pattern) ); - - return; - } - AddTestCase( - str_regexp + ".exec(" + str_pattern +").length", - matches_array.length, - regexp.exec(pattern).length ); - - AddTestCase( - str_regexp + ".exec(" + str_pattern +").index", - index, - regexp.exec(pattern).index ); - - AddTestCase( - str_regexp + ".exec(" + str_pattern +").input", - escape(pattern), - escape(regexp.exec(pattern).input) ); - - AddTestCase( - str_regexp + ".exec(" + str_pattern +").toString()", - matches_array.toString(), - escape(regexp.exec(pattern).toString()) ); - - var limit = matches_array.length > regexp.exec(pattern).length - ? matches_array.length - : regexp.exec(pattern).length; - - for ( var matches = 0; matches < limit; matches++ ) { - AddTestCase( - str_regexp + ".exec(" + str_pattern +")[" + matches +"]", - matches_array[matches], - escape(regexp.exec(pattern)[matches]) ); - } - -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/properties-001.js b/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/properties-001.js deleted file mode 100644 index 7d2913cc53..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/properties-001.js +++ /dev/null @@ -1,124 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'properties-001.js'; - -/** - * File Name: RegExp/properties-001.js - * ECMA Section: 15.7.6.js - * Description: Based on ECMA 2 Draft 7 February 1999 - * - * Author: christine@netscape.com - * Date: 19 February 1999 - */ -var SECTION = "RegExp/properties-001.js"; -var VERSION = "ECMA_2"; -var TITLE = "Properties of RegExp Instances"; -var BUGNUMBER =""; - -startTest(); - -AddRegExpCases( new RegExp, "", false, false, false, 0 ); -AddRegExpCases( /.*/, ".*", false, false, false, 0 ); -AddRegExpCases( /[\d]{5}/g, "[\\d]{5}", true, false, false, 0 ); -AddRegExpCases( /[\S]?$/i, "[\\S]?$", false, true, false, 0 ); -AddRegExpCases( /^([a-z]*)[^\w\s\f\n\r]+/m, "^([a-z]*)[^\\w\\s\\f\\n\\r]+", false, false, true, 0 ); -AddRegExpCases( /[\D]{1,5}[\ -][\d]/gi, "[\\D]{1,5}[\\ -][\\d]", true, true, false, 0 ); -AddRegExpCases( /[a-zA-Z0-9]*/gm, "[a-zA-Z0-9]*", true, false, true, 0 ); -AddRegExpCases( /x|y|z/gim, "x|y|z", true, true, true, 0 ); - -AddRegExpCases( /\u0051/im, "\\u0051", false, true, true, 0 ); -AddRegExpCases( /\x45/gm, "\\x45", true, false, true, 0 ); -AddRegExpCases( /\097/gi, "\\097", true, true, false, 0 ); - -test(); - -function AddRegExpCases( re, s, g, i, m, l ) { - - AddTestCase( re + ".test == RegExp.prototype.test", - true, - re.test == RegExp.prototype.test ); - - AddTestCase( re + ".toString == RegExp.prototype.toString", - true, - re.toString == RegExp.prototype.toString ); - - AddTestCase( re + ".contructor == RegExp.prototype.constructor", - true, - re.constructor == RegExp.prototype.constructor ); - - AddTestCase( re + ".compile == RegExp.prototype.compile", - true, - re.compile == RegExp.prototype.compile ); - - AddTestCase( re + ".exec == RegExp.prototype.exec", - true, - re.exec == RegExp.prototype.exec ); - - // properties - - AddTestCase( re + ".source", - s, - re.source ); - -/* - * http://bugzilla.mozilla.org/show_bug.cgi?id=225550 changed - * the behavior of toString() and toSource() on empty regexps. - * So branch if |s| is the empty string - - */ - var S = s? s : '(?:)'; - - AddTestCase( re + ".toString()", - "/" + S +"/" + (g?"g":"") + (i?"i":"") +(m?"m":""), - re.toString() ); - - AddTestCase( re + ".global", - g, - re.global ); - - AddTestCase( re + ".ignoreCase", - i, - re.ignoreCase ); - - AddTestCase( re + ".multiline", - m, - re.multiline); - - AddTestCase( re + ".lastIndex", - l, - re.lastIndex ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/properties-002.js b/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/properties-002.js deleted file mode 100644 index 1fcfd8d219..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/properties-002.js +++ /dev/null @@ -1,162 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'properties-002.js'; - -/** - * File Name: RegExp/properties-002.js - * ECMA Section: 15.7.6.js - * Description: Based on ECMA 2 Draft 7 February 1999 - * - * Author: christine@netscape.com - * Date: 19 February 1999 - */ -//----------------------------------------------------------------------------- -var SECTION = "RegExp/properties-002.js"; -var VERSION = "ECMA_2"; -var TITLE = "Properties of RegExp Instances"; -var BUGNUMBER ="124339"; - -startTest(); - -re_1 = /\cA?/g; -re_1.lastIndex = Math.pow(2,31); -AddRegExpCases( re_1, "\\cA?", true, false, false, Math.pow(2,31) ); - -re_2 = /\w*/i; -re_2.lastIndex = Math.pow(2,32) -1; -AddRegExpCases( re_2, "\\w*", false, true, false, Math.pow(2,32)-1 ); - -re_3 = /\*{0,80}/m; -re_3.lastIndex = Math.pow(2,31) -1; -AddRegExpCases( re_3, "\\*{0,80}", false, false, true, Math.pow(2,31) -1 ); - -re_4 = /^./gim; -re_4.lastIndex = Math.pow(2,30) -1; -AddRegExpCases( re_4, "^.", true, true, true, Math.pow(2,30) -1 ); - -re_5 = /\B/; -re_5.lastIndex = Math.pow(2,30); -AddRegExpCases( re_5, "\\B", false, false, false, Math.pow(2,30) ); - -/* - * Brendan: "need to test cases Math.pow(2,32) and greater to see - * whether they round-trip." Reason: thanks to the work done in - * http://bugzilla.mozilla.org/show_bug.cgi?id=124339, lastIndex - * is now stored as a double instead of a uint32 (unsigned integer). - * - * Note 2^32 -1 is the upper bound for uint32's, but doubles can go - * all the way up to Number.MAX_VALUE. So that's why we need cases - * between those two numbers. - * - */ -re_6 = /\B/; -re_6.lastIndex = Math.pow(2,32); -AddRegExpCases( re_6, "\\B", false, false, false, Math.pow(2,32) ); - -re_7 = /\B/; -re_7.lastIndex = Math.pow(2,32) + 1; -AddRegExpCases( re_7, "\\B", false, false, false, Math.pow(2,32) + 1 ); - -re_8 = /\B/; -re_8.lastIndex = Math.pow(2,32) * 2; -AddRegExpCases( re_8, "\\B", false, false, false, Math.pow(2,32) * 2 ); - -re_9 = /\B/; -re_9.lastIndex = Math.pow(2,40); -AddRegExpCases( re_9, "\\B", false, false, false, Math.pow(2,40) ); - -re_10 = /\B/; -re_10.lastIndex = Number.MAX_VALUE; -AddRegExpCases( re_10, "\\B", false, false, false, Number.MAX_VALUE ); - - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - - - -function AddRegExpCases( re, s, g, i, m, l ){ - - AddTestCase( re + ".test == RegExp.prototype.test", - true, - re.test == RegExp.prototype.test ); - - AddTestCase( re + ".toString == RegExp.prototype.toString", - true, - re.toString == RegExp.prototype.toString ); - - AddTestCase( re + ".contructor == RegExp.prototype.constructor", - true, - re.constructor == RegExp.prototype.constructor ); - - AddTestCase( re + ".compile == RegExp.prototype.compile", - true, - re.compile == RegExp.prototype.compile ); - - AddTestCase( re + ".exec == RegExp.prototype.exec", - true, - re.exec == RegExp.prototype.exec ); - - // properties - - AddTestCase( re + ".source", - s, - re.source ); - - AddTestCase( re + ".toString()", - "/" + s +"/" + (g?"g":"") + (i?"i":"") +(m?"m":""), - re.toString() ); - - AddTestCase( re + ".global", - g, - re.global ); - - AddTestCase( re + ".ignoreCase", - i, - re.ignoreCase ); - - AddTestCase( re + ".multiline", - m, - re.multiline); - - AddTestCase( re + ".lastIndex", - l, - re.lastIndex ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/regexp-enumerate-001.js b/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/regexp-enumerate-001.js deleted file mode 100644 index c26a1216ea..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/regexp-enumerate-001.js +++ /dev/null @@ -1,121 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'regexp-enumerate-001.js'; - -/** - File Name: regexp-enumerate-001.js - ECMA V2 Section: - Description: Regression Test. - - If instance Native Object have properties that are enumerable, - JavaScript enumerated through the properties twice. This only - happened if objects had been instantiated, but their properties - had not been enumerated. ie, the object inherited properties - from its prototype that are enumerated. - - In the core JavaScript, this is only a problem with RegExp - objects, since the inherited properties of most core JavaScript - objects are not enumerated. - - Author: christine@netscape.com, pschwartau@netscape.com - Date: 12 November 1997 - Modified: 14 July 2002 - Reason: See http://bugzilla.mozilla.org/show_bug.cgi?id=155291 - ECMA-262 Ed.3 Sections 15.10.7.1 through 15.10.7.5 - RegExp properties should be DontEnum - * - */ -// onerror = err; - -var SECTION = "regexp-enumerate-001"; -var VERSION = "ECMA_2"; -var TITLE = "Regression Test for Enumerating Properties"; - -var BUGNUMBER="339403"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -/* - * This test expects RegExp instances to have four enumerated properties: - * source, global, ignoreCase, and lastIndex - * - * 99.01.25: now they also have a multiLine instance property. - * - */ - - -var r = new RegExp(); - -var e = new Array(); - -var t = new TestRegExp(); - -for ( p in r ) { e[e.length] = { property:p, value:r[p] }; t.addProperty( p, r[p]) }; - -new TestCase( SECTION, - "r = new RegExp(); e = new Array(); "+ - "for ( p in r ) { e[e.length] = { property:p, value:r[p] }; e.length", - 0, - e.length ); - -test(); - -function TestRegExp() { - this.addProperty = addProperty; -} -function addProperty(name, value) { - var pass = false; - - if ( eval("this."+name) != void 0 ) { - pass = true; - } else { - eval( "this."+ name+" = "+ false ); - } - - new TestCase( SECTION, - "Property: " + name +" already enumerated?", - false, - pass ); - - if ( gTestcases[ gTestcases.length-1].passed == false ) { - gTestcases[gTestcases.length-1].reason = "property already enumerated"; - - } - -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/regress-001.js b/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/regress-001.js deleted file mode 100644 index 219ce245ee..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/regress-001.js +++ /dev/null @@ -1,78 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'regress-001.js'; - -/** - * File Name: RegExp/regress-001.js - * ECMA Section: N/A - * Description: Regression test case: - * JS regexp anchoring on empty match bug - * http://bugzilla.mozilla.org/show_bug.cgi?id=2157 - * - * Author: christine@netscape.com - * Date: 19 February 1999 - */ -var SECTION = "RegExp/hex-001.js"; -var VERSION = "ECMA_2"; -var TITLE = "JS regexp anchoring on empty match bug"; -var BUGNUMBER = "2157"; - -startTest(); - -AddRegExpCases( /a||b/(''), - "//a||b/('')", - 1, - [''] ); - -test(); - -function AddRegExpCases( regexp, str_regexp, length, matches_array ) { - - AddTestCase( - "( " + str_regexp + " ).length", - regexp.length, - regexp.length ); - - - for ( var matches = 0; matches < matches_array.length; matches++ ) { - AddTestCase( - "( " + str_regexp + " )[" + matches +"]", - matches_array[matches], - regexp[matches] ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/shell.js b/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/shell.js deleted file mode 100644 index 9b4657d963..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/shell.js +++ /dev/null @@ -1 +0,0 @@ -gTestsubsuite = 'RegExp'; diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/unicode-001.js b/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/unicode-001.js deleted file mode 100644 index 79a3212a2e..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/RegExp/unicode-001.js +++ /dev/null @@ -1,92 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'unicode-001.js'; - -/** - * File Name: RegExp/unicode-001.js - * ECMA Section: 15.7.3.1 - * Description: Based on ECMA 2 Draft 7 February 1999 - * Positive test cases for constructing a RegExp object - * Author: christine@netscape.com - * Date: 19 February 1999 - */ -var SECTION = "RegExp/unicode-001.js"; -var VERSION = "ECMA_2"; -var TITLE = "new RegExp( pattern, flags )"; - -startTest(); - -// These examples come from 15.7.1, UnicodeEscapeSequence - -AddRegExpCases( /\u0041/, "/\\u0041/", "A", "A", 1, 0, ["A"] ); -AddRegExpCases( /\u00412/, "/\\u00412/", "A2", "A2", 1, 0, ["A2"] ); -AddRegExpCases( /\u00412/, "/\\u00412/", "A2", "A2", 1, 0, ["A2"] ); -AddRegExpCases( /\u001g/, "/\\u001g/", "u001g", "u001g", 1, 0, ["u001g"] ); - -AddRegExpCases( /A/, "/A/", "\u0041", "\\u0041", 1, 0, ["A"] ); -AddRegExpCases( /A/, "/A/", "\u00412", "\\u00412", 1, 0, ["A"] ); -AddRegExpCases( /A2/, "/A2/", "\u00412", "\\u00412", 1, 0, ["A2"]); -AddRegExpCases( /A/, "/A/", "A2", "A2", 1, 0, ["A"] ); - -test(); - -function AddRegExpCases( - regexp, str_regexp, pattern, str_pattern, length, index, matches_array ) { - - AddTestCase( - str_regexp + " .exec(" + str_pattern +").length", - length, - regexp.exec(pattern).length ); - - AddTestCase( - str_regexp + " .exec(" + str_pattern +").index", - index, - regexp.exec(pattern).index ); - - AddTestCase( - str_regexp + " .exec(" + str_pattern +").input", - pattern, - regexp.exec(pattern).input ); - - for ( var matches = 0; matches < matches_array.length; matches++ ) { - AddTestCase( - str_regexp + " .exec(" + str_pattern +")[" + matches +"]", - matches_array[matches], - regexp.exec(pattern)[matches] ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/browser.js b/tests/auto/declarative/parserstress/tests/ecma_2/Statements/browser.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/dowhile-001.js b/tests/auto/declarative/parserstress/tests/ecma_2/Statements/dowhile-001.js deleted file mode 100644 index 8cfdc25dd6..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/dowhile-001.js +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'dowhile-001.js'; - -/** - * File Name: dowhile-001 - * ECMA Section: - * Description: do...while statements - * - * - * - * Author: christine@netscape.com - * Date: 11 August 1998 - */ -var SECTION = "dowhile-002"; -var VERSION = "ECMA_2"; -var TITLE = "do...while with a labeled continue statement"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -LabeledContinue( 0, 1 ); -LabeledContinue( 1, 1 ); -LabeledContinue( -1, 1 ); -LabeledContinue( 5, 5 ); - -test(); - -function LabeledContinue( limit, expect ) { - i = 0; -woohoo: - do { - i++; - continue woohoo; - } while ( i < limit ); - - new TestCase( - SECTION, - "do while ( " + i +" < " + limit +" )", - expect, - i ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/dowhile-002.js b/tests/auto/declarative/parserstress/tests/ecma_2/Statements/dowhile-002.js deleted file mode 100644 index ca53dff899..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/dowhile-002.js +++ /dev/null @@ -1,104 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'dowhile-002.js'; - -/** - * File Name: dowhile-002 - * ECMA Section: - * Description: do...while statements - * - * Verify that code after a labeled break is not executed. Verify that - * a labeled break breaks you out of the whole labeled block, and not - * just the current iteration statement. - * - * Author: christine@netscape.com - * Date: 11 August 1998 - */ -var SECTION = "dowhile-002"; -var VERSION = "ECMA_2"; -var TITLE = "do...while with a labeled continue statement"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -LabeledContinue( 0, 1 ); -LabeledContinue( 1, 1 ); -LabeledContinue( -1, 1 ); -LabeledContinue( 5, 5 ); - -test(); - -// The labeled statement contains statements after the labeled break. -// Verify that the statements after the break are not executed. - -function LabeledContinue( limit, expect ) { - i = 0; - result1 = "pass"; - result2 = "pass"; - -woohoo: { - do { - i++; - if ( ! (i < limit) ) { - break woohoo; - result1 = "fail: evaluated statement after a labeled break"; - } - } while ( true ); - - result2 = "failed: broke out of loop, but not out of labeled block"; - } - - new TestCase( - SECTION, - "do while ( " + i +" < " + limit +" )", - expect, - i ); - - new TestCase( - SECTION, - "breaking out of a do... while loop", - "pass", - result1 ); - - - new TestCase( - SECTION, - "breaking out of a labeled do...while loop", - "pass", - result2 ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/dowhile-003.js b/tests/auto/declarative/parserstress/tests/ecma_2/Statements/dowhile-003.js deleted file mode 100644 index 598f655f8d..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/dowhile-003.js +++ /dev/null @@ -1,96 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'dowhile-003.js'; - -/** - * File Name: dowhile-003 - * ECMA Section: - * Description: do...while statements - * - * Test do while, when the while expression is a JavaScript Number object. - * - * - * Author: christine@netscape.com - * Date: 11 August 1998 - */ -var SECTION = "dowhile-003"; -var VERSION = "ECMA_2"; -var TITLE = "do...while with a labeled continue statement"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -DoWhile( new DoWhileObject( 1, 1, 0 )); -DoWhile( new DoWhileObject( 1000, 1000, 0 )); -DoWhile( new DoWhileObject( 1001, 1001, 0 )); -DoWhile( new DoWhileObject( 1002, 1001, 1 )); -DoWhile( new DoWhileObject( -1, 1001, -1002 )); - -test(); - -function DoWhileObject( value, iterations, endvalue ) { - this.value = value; - this.iterations = iterations; - this.endvalue = endvalue; -} - -function DoWhile( object ) { - var i = 0; - - do { - object.value = --object.value; - i++; - if ( i > 1000 ) - break; - } while( object.value ); - - new TestCase( - SECTION, - "loop iterations", - object.iterations, - i - ); - - new TestCase( - SECTION, - "object.value", - object.endvalue, - Number( object.value ) - ); - -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/dowhile-004.js b/tests/auto/declarative/parserstress/tests/ecma_2/Statements/dowhile-004.js deleted file mode 100644 index eb8e0c1b72..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/dowhile-004.js +++ /dev/null @@ -1,100 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'dowhile-004.js'; - -/** - * File Name: dowhile-004 - * ECMA Section: - * Description: do...while statements - * - * Test a labeled do...while. Break out of the loop with no label - * should break out of the loop, but not out of the label. - * - * Author: christine@netscape.com - * Date: 11 August 1998 - */ -var SECTION = "dowhile-004"; -var VERSION = "ECMA_2"; -var TITLE = "do...while with a labeled continue statement"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -DoWhile( 0, 1 ); -DoWhile( 1, 1 ); -DoWhile( -1, 1 ); -DoWhile( 5, 5 ); - -test(); - -function DoWhile( limit, expect ) { - i = 0; - result1 = "pass"; - result2 = "failed: broke out of labeled statement unexpectedly"; - -foo: { - do { - i++; - if ( ! (i < limit) ) { - break; - result1 = "fail: evaluated statement after a labeled break"; - } - } while ( true ); - - result2 = "pass"; - } - - new TestCase( - SECTION, - "do while ( " + i +" < " + limit +" )", - expect, - i ); - - new TestCase( - SECTION, - "breaking out of a do... while loop", - "pass", - result1 ); - - - new TestCase( - SECTION, - "breaking out of a labeled do...while loop", - "pass", - result2 ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/dowhile-005.js b/tests/auto/declarative/parserstress/tests/ecma_2/Statements/dowhile-005.js deleted file mode 100644 index e4096f0d25..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/dowhile-005.js +++ /dev/null @@ -1,106 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'dowhile-005.js'; - -/** - * File Name: dowhile-005 - * ECMA Section: - * Description: do...while statements - * - * Test a labeled do...while. Break out of the loop with no label - * should break out of the loop, but not out of the label. - * - * Currently causes an infinite loop in the monkey. Uncomment the - * print statement below and it works OK. - * - * Author: christine@netscape.com - * Date: 26 August 1998 - */ -var SECTION = "dowhile-005"; -var VERSION = "ECMA_2"; -var TITLE = "do...while with a labeled continue statement"; -var BUGNUMBER = "316293"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -NestedLabel(); - - -test(); - -function NestedLabel() { - i = 0; - result1 = "pass"; - result2 = "fail: did not hit code after inner loop"; - result3 = "pass"; - -outer: { - do { - inner: { -// print( i ); - break inner; - result1 = "fail: did break out of inner label"; - } - result2 = "pass"; - break outer; - print(i); - } while ( i++ < 100 ); - - } - - result3 = "fail: did not break out of outer label"; - - new TestCase( - SECTION, - "number of loop iterations", - 0, - i ); - - new TestCase( - SECTION, - "break out of inner loop", - "pass", - result1 ); - - new TestCase( - SECTION, - "break out of outer loop", - "pass", - result2 ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/dowhile-006.js b/tests/auto/declarative/parserstress/tests/ecma_2/Statements/dowhile-006.js deleted file mode 100644 index c8ad46f629..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/dowhile-006.js +++ /dev/null @@ -1,122 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'dowhile-006.js'; - -/** - * File Name: dowhile-006 - * ECMA Section: - * Description: do...while statements - * - * A general do...while test. - * - * Author: christine@netscape.com - * Date: 26 August 1998 - */ -var SECTION = "dowhile-006"; -var VERSION = "ECMA_2"; -var TITLE = "do...while"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -DoWhile( new DoWhileObject( false, false, 10 ) ); -DoWhile( new DoWhileObject( true, false, 2 ) ); -DoWhile( new DoWhileObject( false, true, 3 ) ); -DoWhile( new DoWhileObject( true, true, 4 ) ); - -test(); - -function looping( object ) { - object.iterations--; - - if ( object.iterations <= 0 ) { - return false; - } else { - return true; - } -} -function DoWhileObject( breakOut, breakIn, iterations, loops ) { - this.iterations = iterations; - this.loops = loops; - this.breakOut = breakOut; - this.breakIn = breakIn; - this.looping = looping; -} -function DoWhile( object ) { - var result1 = false; - var result2 = false; - -outie: { - innie: { - do { - if ( object.breakOut ) - break outie; - - if ( object.breakIn ) - break innie; - - } while ( looping(object) ); - - // statements should be executed if: - // do...while exits normally - // do...while exits abruptly with no label - - result1 = true; - - } - -// statements should be executed if: -// do...while breaks out with label "innie" -// do...while exits normally -// do...while does not break out with "outie" - - result2 = true; - } - - new TestCase( - SECTION, - "hit code after loop in inner loop", - ( object.breakIn || object.breakOut ) ? false : true , - result1 ); - - new TestCase( - SECTION, - "hit code after loop in outer loop", - ( object.breakOut ) ? false : true, - result2 ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/dowhile-007.js b/tests/auto/declarative/parserstress/tests/ecma_2/Statements/dowhile-007.js deleted file mode 100644 index 5d148095d1..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/dowhile-007.js +++ /dev/null @@ -1,130 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'dowhile-007.js'; - -/** - * File Name: dowhile-007 - * ECMA Section: - * Description: do...while statements - * - * A general do...while test. - * - * Author: christine@netscape.com - * Date: 26 August 1998 - */ -var SECTION = "dowhile-007"; -var VERSION = "ECMA_2"; -var TITLE = "do...while"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -DoWhile( new DoWhileObject( false, false, false, false )); -DoWhile( new DoWhileObject( true, false, false, false )); -DoWhile( new DoWhileObject( true, true, false, false )); -DoWhile( new DoWhileObject( true, true, true, false )); -DoWhile( new DoWhileObject( true, true, true, true )); -DoWhile( new DoWhileObject( false, false, false, true )); -DoWhile( new DoWhileObject( false, false, true, true )); -DoWhile( new DoWhileObject( false, true, true, true )); -DoWhile( new DoWhileObject( false, false, true, false )); - -test(); - -function DoWhileObject( out1, out2, out3, in1 ) { - this.breakOutOne = out1; - this.breakOutTwo = out2; - this.breakOutThree = out3; - this.breakIn = in1; -} -function DoWhile( object ) { - result1 = false; - result2 = false; - result3 = false; - result4 = false; - -outie: - do { - if ( object.breakOutOne ) { - break outie; - } - result1 = true; - - innie: - do { - if ( object.breakOutTwo ) { - break outie; - } - result2 = true; - - if ( object.breakIn ) { - break innie; - } - result3 = true; - - } while ( false ); - if ( object.breakOutThree ) { - break outie; - } - result4 = true; - } while ( false ); - - new TestCase( - SECTION, - "break one: ", - (object.breakOutOne) ? false : true, - result1 ); - - new TestCase( - SECTION, - "break two: ", - (object.breakOutOne||object.breakOutTwo) ? false : true, - result2 ); - - new TestCase( - SECTION, - "break three: ", - (object.breakOutOne||object.breakOutTwo||object.breakIn) ? false : true, - result3 ); - - new TestCase( - SECTION, - "break four: ", - (object.breakOutOne||object.breakOutTwo||object.breakOutThree) ? false: true, - result4 ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/forin-001.js b/tests/auto/declarative/parserstress/tests/ecma_2/Statements/forin-001.js deleted file mode 100644 index 0f20f6e953..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/forin-001.js +++ /dev/null @@ -1,330 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'forin-001.js'; - -/** - * File Name: forin-001.js - * ECMA Section: - * Description: The forin-001 statement - * - * Verify that the property name is assigned to the property on the left - * hand side of the for...in expression. - * - * Author: christine@netscape.com - * Date: 28 August 1998 - */ -var SECTION = "forin-001"; -var VERSION = "ECMA_2"; -var TITLE = "The for...in statement"; -var BUGNUMBER="330890"; -var BUGNUMBER="http://scopus.mcom.com/bugsplat/show_bug.cgi?id=344855"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -ForIn_1( { length:4, company:"netscape", year:2000, 0:"zero" } ); -ForIn_2( { length:4, company:"netscape", year:2000, 0:"zero" } ); -ForIn_3( { length:4, company:"netscape", year:2000, 0:"zero" } ); - -// ForIn_6({ length:4, company:"netscape", year:2000, 0:"zero" }); -// ForIn_7({ length:4, company:"netscape", year:2000, 0:"zero" }); -ForIn_8({ length:4, company:"netscape", year:2000, 0:"zero" }); - -test(); - -/** - * Verify that the left side argument is evaluated with every iteration. - * Verify that the name of each property of the object is assigned to a - * a property. - * - */ -function ForIn_1( object ) { - PropertyArray = new Array(); - ValueArray = new Array(); - - for ( PropertyArray[PropertyArray.length] in object ) { - ValueArray[ValueArray.length] = - object[PropertyArray[PropertyArray.length-1]]; - } - - for ( var i = 0; i < PropertyArray.length; i++ ) { - new TestCase( - SECTION, - "object[" + PropertyArray[i] +"]", - object[PropertyArray[i]], - ValueArray[i] - ); - } - - new TestCase( - SECTION, - "object.length", - PropertyArray.length, - object.length ); -} - -/** - * Similar to ForIn_1, except it should increment the counter variable - * every time the left hand expression is evaluated. - */ -function ForIn_2( object ) { - PropertyArray = new Array(); - ValueArray = new Array(); - var i = 0; - - for ( PropertyArray[i++] in object ) { - ValueArray[ValueArray.length] = - object[PropertyArray[PropertyArray.length-1]]; - } - - for ( i = 0; i < PropertyArray.length; i++ ) { - new TestCase( - SECTION, - "object[" + PropertyArray[i] +"]", - object[PropertyArray[i]], - ValueArray[i] - ); - } - - new TestCase( - SECTION, - "object.length", - PropertyArray.length, - object.length ); -} - -/** - * Break out of a for...in loop - * - * - */ -function ForIn_3( object ) { - var checkBreak = "pass"; - var properties = new Array(); - var values = new Array(); - - for ( properties[properties.length] in object ) { - values[values.length] = object[properties[properties.length-1]]; - break; - checkBreak = "fail"; - } - - new TestCase( - SECTION, - "check break out of for...in", - "pass", - checkBreak ); - - new TestCase( - SECTION, - "properties.length", - 1, - properties.length ); - - new TestCase( - SECTION, - "object["+properties[0]+"]", - values[0], - object[properties[0]] ); -} - -/** - * Break out of a labeled for...in loop. - */ -function ForIn_4( object ) { - var result1 = 0; - var result2 = 0; - var result3 = 0; - var result4 = 0; - var i = 0; - var property = new Array(); - -butterbean: { - result1++; - - for ( property[i++] in object ) { - result2++; - break; - result4++; - } - result3++; - } - - new TestCase( - SECTION, - "verify labeled statement is only executed once", - true, - result1 == 1 ); - - new TestCase( - SECTION, - "verify statements in for loop are evaluated", - true, - result2 == i ); - - new TestCase( - SECTION, - "verify break out of labeled for...in loop", - true, - result4 == 0 ); - - new TestCase( - SECTION, - "verify break out of labeled block", - true, - result3 == 0 ); -} - -/** - * Labeled break out of a labeled for...in loop. - */ -function ForIn_5 (object) { - var result1 = 0; - var result2 = 0; - var result3 = 0; - var result4 = 0; - var i = 0; - var property = new Array(); - -bigredbird: { - result1++; - for ( property[i++] in object ) { - result2++; - break bigredbird; - result4++; - } - result3++; - } - - new TestCase( - SECTION, - "verify labeled statement is only executed once", - true, - result1 == 1 ); - - new TestCase( - SECTION, - "verify statements in for loop are evaluated", - true, - result2 == i ); - - new TestCase( - SECTION, - "verify break out of labeled for...in loop", - true, - result4 == 0 ); - - new TestCase( - SECTION, - "verify break out of labeled block", - true, - result3 == 0 ); -} - -/** - * Labeled continue from a labeled for...in loop - */ -function ForIn_7( object ) { - var result1 = 0; - var result2 = 0; - var result3 = 0; - var result4 = 0; - var i = 0; - var property = new Array(); - -bigredbird: - for ( property[i++] in object ) { - result2++; - continue bigredbird; - result4++; - } - - new TestCase( - SECTION, - "verify statements in for loop are evaluated", - true, - result2 == i ); - - new TestCase( - SECTION, - "verify break out of labeled for...in loop", - true, - result4 == 0 ); - - new TestCase( - SECTION, - "verify break out of labeled block", - true, - result3 == 1 ); -} - - -/** - * continue in a for...in loop - * - */ -function ForIn_8( object ) { - var checkBreak = "pass"; - var properties = new Array(); - var values = new Array(); - - for ( properties[properties.length] in object ) { - values[values.length] = object[properties[properties.length-1]]; - break; - checkBreak = "fail"; - } - - new TestCase( - SECTION, - "check break out of for...in", - "pass", - checkBreak ); - - new TestCase( - SECTION, - "properties.length", - 1, - properties.length ); - - new TestCase( - SECTION, - "object["+properties[0]+"]", - values[0], - object[properties[0]] ); -} - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/forin-002.js b/tests/auto/declarative/parserstress/tests/ecma_2/Statements/forin-002.js deleted file mode 100644 index 524bf38b9a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/forin-002.js +++ /dev/null @@ -1,109 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'forin-002.js'; - -/** - * File Name: forin-002.js - * ECMA Section: - * Description: The forin-001 statement - * - * Verify that the property name is assigned to the property on the left - * hand side of the for...in expression. - * - * Author: christine@netscape.com - * Date: 28 August 1998 - */ -var SECTION = "forin-002"; -var VERSION = "ECMA_2"; -var TITLE = "The for...in statement"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -function MyObject( value ) { - this.value = value; - this.valueOf = new Function ( "return this.value" ); - this.toString = new Function ( "return this.value + \"\"" ); - this.toNumber = new Function ( "return this.value + 0" ); - this.toBoolean = new Function ( "return Boolean( this.value )" ); -} - -ForIn_1(this); -ForIn_2(this); - -ForIn_1(new MyObject(true)); -ForIn_2(new MyObject(new Boolean(true))); - -ForIn_2(3); - -test(); - -/** - * For ... In in a With Block - * - */ -function ForIn_1( object) { - with ( object ) { - for ( property in object ) { - new TestCase( - SECTION, - "with loop in a for...in loop. ("+object+")["+property +"] == "+ - "eval ( " + property +" )", - true, - object[property] == eval(property) ); - } - } -} - -/** - * With block in a For...In loop - * - */ -function ForIn_2(object) { - for ( property in object ) { - with ( object ) { - new TestCase( - SECTION, - "with loop in a for...in loop. ("+object+")["+property +"] == "+ - "eval ( " + property +" )", - true, - object[property] == eval(property) ); - } - } -} - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/if-001.js b/tests/auto/declarative/parserstress/tests/ecma_2/Statements/if-001.js deleted file mode 100644 index 439410c9a6..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/if-001.js +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'if-001.js'; - -/** - * File Name: if-001.js - * ECMA Section: - * Description: The if statement - * - * Verify that assignment in the if expression is evaluated correctly. - * Verifies the fix for bug http://scopus/bugsplat/show_bug.cgi?id=148822. - * - * Author: christine@netscape.com - * Date: 28 August 1998 - */ -var SECTION = "for-001"; -var VERSION = "ECMA_2"; -var TITLE = "The if statement"; -var BUGNUMBER="148822"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var a = 0; -var b = 0; -var result = "passed"; - -if ( a = b ) { - result = "failed: a = b should return 0"; -} - -new TestCase( - SECTION, - "if ( a = b ), where a and b are both equal to 0", - "passed", - result ); - - -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/label-001.js b/tests/auto/declarative/parserstress/tests/ecma_2/Statements/label-001.js deleted file mode 100644 index 07bdeb6b81..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/label-001.js +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'label-001.js'; - -/** - * File Name: label-001.js - * ECMA Section: - * Description: Labeled statements - * - * Labeled break and continue within a for loop. - * - * - * Author: christine@netscape.com - * Date: 11 August 1998 - */ -var SECTION = "label-003"; -var VERSION = "ECMA_2"; -var TITLE = "Labeled statements"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -LabelTest(0, 0); -LabelTest(1, 1) - LabelTest(-1, 1000); -LabelTest(false, 0); -LabelTest(true, 1); - -test(); - -function LabelTest( limit, expect) { -woo: for ( var result = 0; result < 1000; result++ ) { if (result == limit) { break woo; } else { continue woo; } }; - - new TestCase( - SECTION, - "break out of a labeled for loop: "+ limit, - expect, - result ); -} - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/label-002.js b/tests/auto/declarative/parserstress/tests/ecma_2/Statements/label-002.js deleted file mode 100644 index 83b114d3f2..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/label-002.js +++ /dev/null @@ -1,89 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'label-002.js'; - -/** - * File Name: label-002.js - * ECMA Section: - * Description: Labeled statements - * - * Labeled break and continue within a for-in loop. - * - * - * Author: christine@netscape.com - * Date: 11 August 1998 - */ -var SECTION = "label-002"; -var VERSION = "ECMA_2"; -var TITLE = "Labeled statements"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -LabelTest( { p1:"hi,", p2:" norris" }, "hi, norris", " norrishi," ); -LabelTest( { 0:"zero", 1:"one" }, "zeroone", "onezero" ); - -LabelTest2( { p1:"hi,", p2:" norris" }, "hi,", " norris" ); -LabelTest2( { 0:"zero", 1:"one" }, "zero", "one" ); - -test(); - -function LabelTest( object, expect1, expect2 ) { - result = ""; - -yoohoo: { for ( property in object ) { result += object[property]; }; break yoohoo }; - - new TestCase( - SECTION, - "yoohoo: for ( property in object ) { result += object[property]; } break yoohoo }", - true, - result == expect1 || result == expect2 ); -} - -function LabelTest2( object, expect1, expect2 ) { - result = ""; - -yoohoo: { for ( property in object ) { result += object[property]; break yoohoo } }; ; - - new TestCase( - SECTION, - "yoohoo: for ( property in object ) { result += object[property]; break yoohoo }}", - true, - result == expect1 || result == expect2 ); -} - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/shell.js b/tests/auto/declarative/parserstress/tests/ecma_2/Statements/shell.js deleted file mode 100644 index 7346f697a5..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/shell.js +++ /dev/null @@ -1 +0,0 @@ -gTestsubsuite = 'Statements'; diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/switch-001.js b/tests/auto/declarative/parserstress/tests/ecma_2/Statements/switch-001.js deleted file mode 100644 index 22ab0a7b60..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/switch-001.js +++ /dev/null @@ -1,98 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'switch-001.js'; - -/** - * File Name: switch-001.js - * ECMA Section: - * Description: The switch Statement - * - * A simple switch test with no abrupt completions. - * - * Author: christine@netscape.com - * Date: 11 August 1998 - * - */ -var SECTION = "switch-001"; -var VERSION = "ECMA_2"; -var TITLE = "The switch statement"; - -var BUGNUMBER="315767"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -SwitchTest( 0, 126 ); -SwitchTest( 1, 124 ); -SwitchTest( 2, 120 ); -SwitchTest( 3, 112 ); -SwitchTest( 4, 64 ); -SwitchTest( 5, 96 ); -SwitchTest( true, 96 ); -SwitchTest( false, 96 ); -SwitchTest( null, 96 ); -SwitchTest( void 0, 96 ); -SwitchTest( "0", 96 ); - -test(); - -function SwitchTest( input, expect ) { - var result = 0; - - switch ( input ) { - case 0: - result += 2; - case 1: - result += 4; - case 2: - result += 8; - case 3: - result += 16; - default: - result += 32; - case 4: - result +=64; - } - - new TestCase( - SECTION, - "switch with no breaks, case expressions are numbers. input is "+ - input, - expect, - result ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/switch-002.js b/tests/auto/declarative/parserstress/tests/ecma_2/Statements/switch-002.js deleted file mode 100644 index 6cb5491beb..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/switch-002.js +++ /dev/null @@ -1,96 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'switch-002.js'; - -/** - * File Name: switch-002.js - * ECMA Section: - * Description: The switch Statement - * - * A simple switch test with no abrupt completions. - * - * Author: christine@netscape.com - * Date: 11 August 1998 - * - */ -var SECTION = "switch-002"; -var VERSION = "ECMA_2"; -var TITLE = "The switch statement"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -SwitchTest( 0, 6 ); -SwitchTest( 1, 4 ); -SwitchTest( 2, 56 ); -SwitchTest( 3, 48 ); -SwitchTest( 4, 64 ); -SwitchTest( true, 32 ); -SwitchTest( false, 32 ); -SwitchTest( null, 32 ); -SwitchTest( void 0, 32 ); -SwitchTest( "0", 32 ); - -test(); - -function SwitchTest( input, expect ) { - var result = 0; - - switch ( input ) { - case 0: - result += 2; - case 1: - result += 4; - break; - case 2: - result += 8; - case 3: - result += 16; - default: - result += 32; - break; - case 4: - result += 64; - } - - new TestCase( - SECTION, - "switch with no breaks: input is " + input, - expect, - result ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/switch-003.js b/tests/auto/declarative/parserstress/tests/ecma_2/Statements/switch-003.js deleted file mode 100644 index 27ed593bfe..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/switch-003.js +++ /dev/null @@ -1,90 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'switch-003.js'; - -/** - * File Name: switch-003.js - * ECMA Section: - * Description: The switch Statement - * - * Attempt to verify that case statements are evaluated in source order - * - * Author: christine@netscape.com - * Date: 11 August 1998 - * - */ -var SECTION = "switch-003"; -var VERSION = "ECMA_2"; -var TITLE = "The switch statement"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -SwitchTest( "a", "abc" ); -SwitchTest( "b", "bc" ); -SwitchTest( "c", "c" ); -SwitchTest( "d", "*abc" ); -SwitchTest( "v", "*abc" ); -SwitchTest( "w", "w*abc" ); -SwitchTest( "x", "xw*abc" ); -SwitchTest( "y", "yxw*abc" ); -SwitchTest( "z", "zyxw*abc" ); -// SwitchTest( new java.lang.String("z"), "*abc" ); - -test(); - -function SwitchTest( input, expect ) { - var result = ""; - - switch ( input ) { - case "z": result += "z"; - case "y": result += "y"; - case "x": result += "x"; - case "w": result += "w"; - default: result += "*"; - case "a": result += "a"; - case "b": result += "b"; - case "c": result += "c"; - } - - new TestCase( - SECTION, - "switch with no breaks: input is " + input, - expect, - result ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/switch-004.js b/tests/auto/declarative/parserstress/tests/ecma_2/Statements/switch-004.js deleted file mode 100644 index e7605222d6..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/switch-004.js +++ /dev/null @@ -1,127 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'switch-004.js'; - -/** - * File Name: switch-003.js - * ECMA Section: - * Description: The switch Statement - * - * This uses variables and objects as case expressions in switch statements. - * This verifies a bunch of bugs: - * - * http://scopus.mcom.com/bugsplat/show_bug.cgi?id=315988 - * http://scopus.mcom.com/bugsplat/show_bug.cgi?id=315975 - * http://scopus.mcom.com/bugsplat/show_bug.cgi?id=315954 - * - * Author: christine@netscape.com - * Date: 11 August 1998 - * - */ -var SECTION = "switch-003"; -var VERSION = "ECMA_2"; -var TITLE = "The switch statement"; -var BUGNUMBER= "315988"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -ONE = new Number(1); -ZERO = new Number(0); -var A = new String("A"); -var B = new String("B"); -TRUE = new Boolean( true ); -FALSE = new Boolean( false ); -UNDEFINED = void 0; -NULL = null; - -SwitchTest( ZERO, "ZERO" ); -SwitchTest( NULL, "NULL" ); -SwitchTest( UNDEFINED, "UNDEFINED" ); -SwitchTest( FALSE, "FALSE" ); -SwitchTest( false, "false" ); -SwitchTest( 0, "0" ); - -SwitchTest ( TRUE, "TRUE" ); -SwitchTest( 1, "1" ); -SwitchTest( ONE, "ONE" ); -SwitchTest( true, "true" ); - -SwitchTest( "a", "a" ); -SwitchTest( A, "A" ); -SwitchTest( "b", "b" ); -SwitchTest( B, "B" ); - -SwitchTest( new Boolean( true ), "default" ); -SwitchTest( new Boolean(false ), "default" ); -SwitchTest( new String( "A" ), "default" ); -SwitchTest( new Number( 0 ), "default" ); - -test(); - -function SwitchTest( input, expect ) { - var result = ""; - - switch ( input ) { - default: result += "default"; break; - case "a": result += "a"; break; - case "b": result += "b"; break; - case A: result += "A"; break; - case B: result += "B"; break; - case new Boolean(true): result += "new TRUE"; break; - case new Boolean(false): result += "new FALSE"; break; - case NULL: result += "NULL"; break; - case UNDEFINED: result += "UNDEFINED"; break; - case true: result += "true"; break; - case false: result += "false"; break; - case TRUE: result += "TRUE"; break; - case FALSE: result += "FALSE"; break; - case 0: result += "0"; break; - case 1: result += "1"; break; - case new Number(0) : result += "new ZERO"; break; - case new Number(1) : result += "new ONE"; break; - case ONE: result += "ONE"; break; - case ZERO: result += "ZERO"; break; - } - - new TestCase( - SECTION, - "switch with no breaks: input is " + input, - expect, - result ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/try-001.js b/tests/auto/declarative/parserstress/tests/ecma_2/Statements/try-001.js deleted file mode 100644 index c7b430dabe..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/try-001.js +++ /dev/null @@ -1,118 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'try-001.js'; - -/** - * File Name: try-001.js - * ECMA Section: - * Description: The try statement - * - * This test contains try, catch, and finally blocks. An exception is - * sometimes thrown by a function called from within the try block. - * - * This test doesn't actually make any LiveConnect calls. - * - * - * Author: christine@netscape.com - * Date: 11 August 1998 - */ -var SECTION = ""; -var VERSION = "ECMA_2"; -var TITLE = "The try statement"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var INVALID_JAVA_INTEGER_VALUE = "Invalid value for java.lang.Integer constructor"; - -TryNewJavaInteger( "3.14159", INVALID_JAVA_INTEGER_VALUE ); -TryNewJavaInteger( NaN, INVALID_JAVA_INTEGER_VALUE ); -TryNewJavaInteger( 0, 0 ); -TryNewJavaInteger( -1, -1 ); -TryNewJavaInteger( 1, 1 ); -TryNewJavaInteger( Infinity, Infinity ); - -test(); - -/** - * Check to see if the input is valid for java.lang.Integer. If it is - * not valid, throw INVALID_JAVA_INTEGER_VALUE. If input is valid, - * return Number( v ) - * - */ - -function newJavaInteger( v ) { - value = Number( v ); - if ( Math.floor(value) != value || isNaN(value) ) { - throw ( INVALID_JAVA_INTEGER_VALUE ); - } else { - return value; - } -} - -/** - * Call newJavaInteger( value ) from within a try block. Catch any - * exception, and store it in result. Verify that we got the right - * return value from newJavaInteger in cases in which we do not expect - * exceptions, and that we got the exception in cases where an exception - * was expected. - */ -function TryNewJavaInteger( value, expect ) { - var finalTest = false; - - try { - result = newJavaInteger( value ); - } catch ( e ) { - result = String( e ); - } finally { - finalTest = true; - } - new TestCase( - SECTION, - "newJavaValue( " + value +" )", - expect, - result); - - new TestCase( - SECTION, - "newJavaValue( " + value +" ) hit finally block", - true, - finalTest); - -} - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/try-003.js b/tests/auto/declarative/parserstress/tests/ecma_2/Statements/try-003.js deleted file mode 100644 index 2c39aac243..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/try-003.js +++ /dev/null @@ -1,115 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'try-003.js'; - -/** - * File Name: try-003.js - * ECMA Section: - * Description: The try statement - * - * This test has a try with no catch, and a finally. - * - * Author: christine@netscape.com - * Date: 11 August 1998 - */ -var SECTION = "try-003"; -var VERSION = "ECMA_2"; -var TITLE = "The try statement"; -var BUGNUMBER="http://scopus.mcom.com/bugsplat/show_bug.cgi?id=313585"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -// Tests start here. - -TrySomething( "x = \"hi\"", false ); -TrySomething( "throw \"boo\"", true ); -TrySomething( "throw 3", true ); - -test(); - -/** - * This function contains a try block with no catch block, - * but it does have a finally block. Try to evaluate expressions - * that do and do not throw exceptions. - */ - -function TrySomething( expression, throwing ) { - innerFinally = "FAIL: DID NOT HIT INNER FINALLY BLOCK"; - if (throwing) { - outerCatch = "FAILED: NO EXCEPTION CAUGHT"; - } else { - outerCatch = "PASS"; - } - outerFinally = "FAIL: DID NOT HIT OUTER FINALLY BLOCK"; - - try { - try { - eval( expression ); - } finally { - innerFinally = "PASS"; - } - } catch ( e ) { - if (throwing) { - outerCatch = "PASS"; - } else { - outerCatch = "FAIL: HIT OUTER CATCH BLOCK"; - } - } finally { - outerFinally = "PASS"; - } - - - new TestCase( - SECTION, - "eval( " + expression +" )", - "PASS", - innerFinally ); - new TestCase( - SECTION, - "eval( " + expression +" )", - "PASS", - outerCatch ); - new TestCase( - SECTION, - "eval( " + expression +" )", - "PASS", - outerFinally ); - - -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/try-004.js b/tests/auto/declarative/parserstress/tests/ecma_2/Statements/try-004.js deleted file mode 100644 index d41903de18..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/try-004.js +++ /dev/null @@ -1,87 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'try-004.js'; - -/** - * File Name: try-004.js - * ECMA Section: - * Description: The try statement - * - * This test has a try with one catch block but no finally. - * - * Author: christine@netscape.com - * Date: 11 August 1998 - */ -var SECTION = "try-004"; -var VERSION = "ECMA_2"; -var TITLE = "The try statement"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -TryToCatch( "Math.PI", Math.PI ); -TryToCatch( "Thrower(5)", "Caught 5" ); -TryToCatch( "Thrower(\"some random exception\")", "Caught some random exception" ); - -test(); - -function Thrower( v ) { - throw "Caught " + v; -} - -/** - * Evaluate a string. Catch any exceptions thrown. If no exception is - * expected, verify the result of the evaluation. If an exception is - * expected, verify that we got the right exception. - */ - -function TryToCatch( value, expect ) { - try { - result = eval( value ); - } catch ( e ) { - result = e; - } - - new TestCase( - SECTION, - "eval( " + value +" )", - expect, - result ); -} - - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/try-005.js b/tests/auto/declarative/parserstress/tests/ecma_2/Statements/try-005.js deleted file mode 100644 index 0b9a055325..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/try-005.js +++ /dev/null @@ -1,90 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'try-005.js'; - -/** - * File Name: try-005.js - * ECMA Section: - * Description: The try statement - * - * This test has a try with one catch block but no finally. Same - * as try-004, but the eval statement is called from a function, not - * directly from within the try block. - * - * Author: christine@netscape.com - * Date: 11 August 1998 - */ -var SECTION = "try-005"; -var VERSION = "ECMA_2"; -var TITLE = "The try statement"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -TryToCatch( "Math.PI", Math.PI ); -TryToCatch( "Thrower(5)", "Caught 5" ); -TryToCatch( "Thrower(\"some random exception\")", "Caught some random exception" ); - -test(); - -function Thrower( v ) { - throw "Caught " + v; -} -function Eval( v ) { - return eval( v ); -} - -/** - * Evaluate a string. Catch any exceptions thrown. If no exception is - * expected, verify the result of the evaluation. If an exception is - * expected, verify that we got the right exception. - */ - -function TryToCatch( value, expect ) { - try { - result = Eval( value ); - } catch ( e ) { - result = e; - } - - new TestCase( - SECTION, - "eval( " + value +" )", - expect, - result ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/try-006.js b/tests/auto/declarative/parserstress/tests/ecma_2/Statements/try-006.js deleted file mode 100644 index 1cfbd28656..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/try-006.js +++ /dev/null @@ -1,120 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'try-006.js'; - -/** - * File Name: try-006.js - * ECMA Section: - * Description: The try statement - * - * Throw an exception from within a With block in a try block. Verify - * that any expected exceptions are caught. - * - * Author: christine@netscape.com - * Date: 11 August 1998 - */ -var SECTION = "try-006"; -var VERSION = "ECMA_2"; -var TITLE = "The try statement"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -/** - * This is the "check" function for test objects that will - * throw an exception. - */ -function throwException() { - throw EXCEPTION_STRING +": " + this.valueOf(); -} -var EXCEPTION_STRING = "Exception thrown:"; - -/** - * This is the "check" function for test objects that do not - * throw an exception - */ -function noException() { - return this.valueOf(); -} - -/** - * Add test cases here - */ -TryWith( new TryObject( "hello", throwException, true )); -TryWith( new TryObject( "hola", noException, false )); - -/** - * Run the test. - */ - -test(); - -/** - * This is the object that will be the "this" in a with block. - */ -function TryObject( value, fun, exception ) { - this.value = value; - this.exception = exception; - - this.valueOf = new Function ( "return this.value" ); - this.check = fun; -} - -/** - * This function has the try block that has a with block within it. - * Test cases are added in this function. Within the with block, the - * object's "check" function is called. If the test object's exception - * property is true, we expect the result to be the exception value. - * If exception is false, then we expect the result to be the value of - * the object. - */ -function TryWith( object ) { - try { - with ( object ) { - result = check(); - } - } catch ( e ) { - result = e; - } - - new TestCase( - SECTION, - "TryWith( " + object.value +" )", - (object.exception ? EXCEPTION_STRING +": " + object.valueOf() : object.valueOf()), - result ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/try-007.js b/tests/auto/declarative/parserstress/tests/ecma_2/Statements/try-007.js deleted file mode 100644 index 566166755c..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/try-007.js +++ /dev/null @@ -1,125 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'try-007.js'; - -/** - * File Name: try-007.js - * ECMA Section: - * Description: The try statement - * - * This test has a for-in statement within a try block. - * - * - * Author: christine@netscape.com - * Date: 11 August 1998 - */ -var SECTION = "try-007"; -var VERSION = "ECMA_2"; -var TITLE = "The try statement: for-in"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -/** - * This is the "check" function for test objects that will - * throw an exception. - */ -function throwException() { - throw EXCEPTION_STRING +": " + this.valueOf(); -} -var EXCEPTION_STRING = "Exception thrown:"; - -/** - * This is the "check" function for test objects that do not - * throw an exception - */ -function noException() { - return this.valueOf(); -} - -/** - * Add test cases here - */ -TryForIn( new TryObject( "hello", throwException, true )); -TryForIn( new TryObject( "hola", noException, false )); - -/** - * Run the test. - */ - -test(); - -/** - * This is the object that will be the "this" in a with block. - * The check function is either throwException() or noException(). - * See above. - * - */ -function TryObject( value, fun, exception ) { - this.value = value; - this.exception = exception; - - this.check = fun; - this.valueOf = function () { return this.value; } -} - -/** - * This function has a for-in statement within a try block. Test cases - * are added after the try-catch-finally statement. Within the for-in - * block, call a function that can throw an exception. Verify that any - * exceptions are properly caught. - */ - -function TryForIn( object ) { - try { - for ( p in object ) { - if ( typeof object[p] == "function" ) { - result = object[p](); - } - } - } catch ( e ) { - result = e; - } - - new TestCase( - SECTION, - "TryForIn( " + object+ " )", - (object.exception ? EXCEPTION_STRING +": " + object.value : object.value), - result ); - -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/try-008.js b/tests/auto/declarative/parserstress/tests/ecma_2/Statements/try-008.js deleted file mode 100644 index 016ab29a31..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/try-008.js +++ /dev/null @@ -1,92 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'try-008.js'; - -/** - * File Name: try-008.js - * ECMA Section: - * Description: The try statement - * - * This test has a try block in a constructor. - * - * - * Author: christine@netscape.com - * Date: 11 August 1998 - */ -var SECTION = "try-008"; -var VERSION = "ECMA_2"; -var TITLE = "The try statement: try in a constructor"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -function Integer( value, exception ) { - try { - this.value = checkValue( value ); - } catch ( e ) { - this.value = e.toString(); - } - - new TestCase( - SECTION, - "Integer( " + value +" )", - (exception ? INVALID_INTEGER_VALUE +": " + value : this.value), - this.value ); -} - -var INVALID_INTEGER_VALUE = "Invalid value for java.lang.Integer constructor"; - -function checkValue( value ) { - if ( Math.floor(value) != value || isNaN(value) ) { - throw ( INVALID_INTEGER_VALUE +": " + value ); - } else { - return value; - } -} - -// add test cases - -new Integer( 3, false ); -new Integer( NaN, true ); -new Integer( 0, false ); -new Integer( Infinity, false ); -new Integer( -2.12, true ); -new Integer( Math.LN2, true ); - - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/try-009.js b/tests/auto/declarative/parserstress/tests/ecma_2/Statements/try-009.js deleted file mode 100644 index d6ce368638..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/try-009.js +++ /dev/null @@ -1,99 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'try-009.js'; - -/** - * File Name: try-009.js - * ECMA Section: - * Description: The try statement - * - * This test has a try block within a while block. Verify that an exception - * breaks out of the while. I don't really know why this is an interesting - * test case but Mike Shaver had two of these so what the hey. - * - * Author: christine@netscape.com - * Date: 11 August 1998 - */ -var SECTION = "try-009"; -var VERSION = "ECMA_2"; -var TITLE = "The try statement: try in a while block"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var EXCEPTION_STRING = "Exception thrown: "; -var NO_EXCEPTION_STRING = "No exception thrown: "; - - -TryInWhile( new TryObject( "hello", ThrowException, true ) ); -TryInWhile( new TryObject( "aloha", NoException, false )); - -test(); - -function TryObject( value, throwFunction, result ) { - this.value = value; - this.thrower = throwFunction; - this.result = result; -} -function ThrowException() { - throw EXCEPTION_STRING + this.value; -} -function NoException() { - return NO_EXCEPTION_STRING + this.value; -} -function TryInWhile( object ) { - result = null; - while ( true ) { - try { - object.thrower(); - result = NO_EXCEPTION_STRING + object.value; - break; - } catch ( e ) { - result = e; - break; - } - } - - new TestCase( - SECTION, - "( "+ object +".thrower() )", - (object.result - ? EXCEPTION_STRING + object.value : - NO_EXCEPTION_STRING + object.value), - result ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/try-010.js b/tests/auto/declarative/parserstress/tests/ecma_2/Statements/try-010.js deleted file mode 100644 index 27e712c895..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/try-010.js +++ /dev/null @@ -1,106 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'try-010.js'; - -/** - * File Name: try-010.js - * ECMA Section: - * Description: The try statement - * - * This has a try block nested in the try block. Verify that the - * exception is caught by the right try block, and all finally blocks - * are executed. - * - * Author: christine@netscape.com - * Date: 11 August 1998 - */ -var SECTION = "try-010"; -var VERSION = "ECMA_2"; -var TITLE = "The try statement: try in a tryblock"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var EXCEPTION_STRING = "Exception thrown: "; -var NO_EXCEPTION_STRING = "No exception thrown: "; - - -NestedTry( new TryObject( "No Exceptions Thrown", NoException, NoException, 43 ) ); -NestedTry( new TryObject( "Throw Exception in Outer Try", ThrowException, NoException, 48 )); -NestedTry( new TryObject( "Throw Exception in Inner Try", NoException, ThrowException, 45 )); -NestedTry( new TryObject( "Throw Exception in Both Trys", ThrowException, ThrowException, 48 )); - -test(); - -function TryObject( description, tryOne, tryTwo, result ) { - this.description = description; - this.tryOne = tryOne; - this.tryTwo = tryTwo; - this.result = result; -} -function ThrowException() { - throw EXCEPTION_STRING + this.value; -} -function NoException() { - return NO_EXCEPTION_STRING + this.value; -} -function NestedTry( object ) { - result = 0; - try { - object.tryOne(); - result += 1; - try { - object.tryTwo(); - result += 2; - } catch ( e ) { - result +=4; - } finally { - result += 8; - } - } catch ( e ) { - result += 16; - } finally { - result += 32; - } - - new TestCase( - SECTION, - object.description, - object.result, - result ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/try-012.js b/tests/auto/declarative/parserstress/tests/ecma_2/Statements/try-012.js deleted file mode 100644 index 79dfca2f03..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/try-012.js +++ /dev/null @@ -1,128 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'try-012.js'; - -/** - * File Name: try-012.js - * ECMA Section: - * Description: The try statement - * - * This test has a try with no catch, and a finally. This is like try-003, - * but throws from a finally block, not the try block. - * - * Author: christine@netscape.com - * Date: 11 August 1998 - */ -var SECTION = "try-012"; -var VERSION = "ECMA_2"; -var TITLE = "The try statement"; -var BUGNUMBER="336872"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -// Tests start here. - -TrySomething( "x = \"hi\"", true ); -TrySomething( "throw \"boo\"", true ); -TrySomething( "throw 3", true ); - -test(); - -/** - * This function contains a try block with no catch block, - * but it does have a finally block. Try to evaluate expressions - * that do and do not throw exceptions. - * - * The productioni TryStatement Block Finally is evaluated as follows: - * 1. Evaluate Block - * 2. Evaluate Finally - * 3. If Result(2).type is normal return result 1 (in the test case, result 1 has - * the completion type throw) - * 4. return result 2 (does not get hit in this case) - * - */ - -function TrySomething( expression, throwing ) { - innerFinally = "FAIL: DID NOT HIT INNER FINALLY BLOCK"; - if (throwing) { - outerCatch = "FAILED: NO EXCEPTION CAUGHT"; - } else { - outerCatch = "PASS"; - } - outerFinally = "FAIL: DID NOT HIT OUTER FINALLY BLOCK"; - - - // If the inner finally does not throw an exception, the result - // of the try block should be returned. (Type of inner return - // value should be throw if finally executes correctly - - try { - try { - throw 0; - } finally { - innerFinally = "PASS"; - eval( expression ); - } - } catch ( e ) { - if (throwing) { - outerCatch = "PASS"; - } else { - outerCatch = "FAIL: HIT OUTER CATCH BLOCK"; - } - } finally { - outerFinally = "PASS"; - } - - - new TestCase( - SECTION, - "eval( " + expression +" ): evaluated inner finally block", - "PASS", - innerFinally ); - new TestCase( - SECTION, - "eval( " + expression +" ): evaluated outer catch block ", - "PASS", - outerCatch ); - new TestCase( - SECTION, - "eval( " + expression +" ): evaluated outer finally block", - "PASS", - outerFinally ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/while-001.js b/tests/auto/declarative/parserstress/tests/ecma_2/Statements/while-001.js deleted file mode 100644 index 467efe7f02..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/while-001.js +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'while-001.js'; - -/** - * File Name: while-001 - * ECMA Section: - * Description: while statement - * - * Verify that the while statement is not executed if the while expression is - * false - * - * Author: christine@netscape.com - * Date: 11 August 1998 - */ -var SECTION = "while-001"; -var VERSION = "ECMA_2"; -var TITLE = "while statement"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -DoWhile(); -test(); - -function DoWhile() { - result = "pass"; - - while (false) { - result = "fail"; - break; - } - - new TestCase( - SECTION, - "while statement: don't evaluate statement is expression is false", - "pass", - result ); - -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/while-002.js b/tests/auto/declarative/parserstress/tests/ecma_2/Statements/while-002.js deleted file mode 100644 index c89e195497..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/while-002.js +++ /dev/null @@ -1,119 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'while-002.js'; - -/** - * File Name: while-002 - * ECMA Section: - * Description: while statement - * - * Verify that the while statement is not executed if the while expression is - * false - * - * Author: christine@netscape.com - * Date: 11 August 1998 - */ -var SECTION = "while-002"; -var VERSION = "ECMA_2"; -var TITLE = "while statement"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -DoWhile( new DoWhileObject( - "while expression is null", - null, - "result = \"fail: should not have evaluated statements in while block;break" - ) ); - -DoWhile( new DoWhileObject( - "while expression is undefined", - void 0, - "result = \"fail: should not have evaluated statements in while block; break" - )); - -DoWhile( new DoWhileObject( - "while expression is 0", - 0, - "result = \"fail: should not have evaluated statements in while block; break;" - )); - -DoWhile( new DoWhileObject( - "while expression is eval(\"\")", - eval(""), - "result = \"fail: should not have evaluated statements in while block; break" - )); - -DoWhile( new DoWhileObject( - "while expression is NaN", - NaN, - "result = \"fail: should not have evaluated statements in while block; break" - )); - -test(); - -function DoWhileObject( d, e, s ) { - this.description = d; - this.whileExpression = e; - this.statements = s; -} - -function DoWhile( object ) { - result = "pass"; - - while ( expression = object.whileExpression ) { - eval( object.statements ); - } - - // verify that the while expression was evaluated - - new TestCase( - SECTION, - "verify that while expression was evaluated (should be "+ - object.whileExpression +")", - "pass", - (object.whileExpression == expression || - ( isNaN(object.whileExpression) && isNaN(expression) ) - ) ? "pass" : "fail" ); - - new TestCase( - SECTION, - object.description, - "pass", - result ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/while-003.js b/tests/auto/declarative/parserstress/tests/ecma_2/Statements/while-003.js deleted file mode 100644 index 5fb734cce6..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/while-003.js +++ /dev/null @@ -1,120 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'while-003.js'; - -/** - * File Name: while-003 - * ECMA Section: - * Description: while statement - * - * The while expression evaluates to true, Statement returns abrupt completion. - * - * Author: christine@netscape.com - * Date: 11 August 1998 - */ -var SECTION = "while-003"; -var VERSION = "ECMA_2"; -var TITLE = "while statement"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -DoWhile( new DoWhileObject( - "while expression is true", - true, - "result = \"pass\";" )); - -DoWhile( new DoWhileObject( - "while expression is 1", - 1, - "result = \"pass\";" )); - -DoWhile( new DoWhileObject( - "while expression is new Boolean(false)", - new Boolean(false), - "result = \"pass\";" )); - -DoWhile( new DoWhileObject( - "while expression is new Object()", - new Object(), - "result = \"pass\";" )); - -DoWhile( new DoWhileObject( - "while expression is \"hi\"", - "hi", - "result = \"pass\";" )); -/* - DoWhile( new DoWhileObject( - "while expression has a continue in it", - "true", - "if ( i == void 0 ) i = 0; result=\"pass\"; if ( ++i == 1 ) {continue;} else {break;} result=\"fail\";" - )); -*/ -test(); - -function DoWhileObject( d, e, s ) { - this.description = d; - this.whileExpression = e; - this.statements = s; -} - -function DoWhile( object ) { - result = "fail: statements in while block were not evaluated"; - - while ( expression = object.whileExpression ) { - eval( object.statements ); - break; - } - - // verify that the while expression was evaluated - - new TestCase( - SECTION, - "verify that while expression was evaluated (should be "+ - object.whileExpression +")", - "pass", - (object.whileExpression == expression || - ( isNaN(object.whileExpression) && isNaN(expression) ) - ) ? "pass" : "fail" ); - - new TestCase( - SECTION, - object.description, - "pass", - result ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/while-004.js b/tests/auto/declarative/parserstress/tests/ecma_2/Statements/while-004.js deleted file mode 100644 index c5e2472816..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/Statements/while-004.js +++ /dev/null @@ -1,250 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'while-004.js'; - -/** - * File Name: while-004 - * ECMA Section: - * Description: while statement - * - * Author: christine@netscape.com - * Date: 11 August 1998 - */ -var SECTION = "while-004"; -var VERSION = "ECMA_2"; -var TITLE = "while statement"; -var BUGNUMBER="316725"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -DoWhile_1(); -DoWhile_2(); -DoWhile_3(); -DoWhile_4(); -DoWhile_5(); - -test(); - -/** - * Break out of a while by calling return. - * - * Tests: 12.6.2 step 6. - */ -function dowhile() { - result = "pass"; - - while (true) { - return result; - result = "fail: hit code after return statement"; - break; - } -} - -function DoWhile_1() { - description = "return statement in a while block"; - - result = dowhile(); - - new TestCase( - SECTION, - "DoWhile_1" + description, - "pass", - result ); -} - -/** - * While with a labeled continue statement. Verify that statements - * after the continue statement are not evaluated. - * - * Tests: 12.6.2 step 8. - * - */ -function DoWhile_2() { - var description = "while with a labeled continue statement"; - var result1 = "pass"; - var result2 = "fail: did not execute code after loop, but inside label"; - var i = 0; - var j = 0; - -theloop: - while( i++ < 10 ) { - j++; - continue theloop; - result1 = "failed: hit code after continue statement"; - } - result2 = "pass"; - - new TestCase( - SECTION, - "DoWhile_2: " +description + " - code inside the loop, before the continue should be executed ("+j+")", - true, - j == 10 ); - - new TestCase( - SECTION, - "DoWhile_2: " +description +" - code after labeled continue should not be executed", - "pass", - result1 ); - - new TestCase( - SECTION, - "DoWhile_2: " +description +" - code after loop but inside label should be executed", - "pass", - result2 ); -} - -/** - * While with a labeled break. - * - */ -function DoWhile_3() { - var description = "while with a labeled break statement"; - var result1 = "pass"; - var result2 = "pass"; - var result3 = "fail: did not get to code after label"; - -woohoo: { - while( true ) { - break woohoo; - result1 = "fail: got to code after a break"; - } - result2 = "fail: got to code outside of loop but inside label"; - } - - result3 = "pass"; - - new TestCase( - SECTION, - "DoWhile_3: " +description +" - verify break out of loop", - "pass", - result1 ); - - - new TestCase( - SECTION, - "DoWhile_3: " +description +" - verify break out of label", - "pass", - result2 ); - - new TestCase( - SECTION, - "DoWhile_3: " +description + " - verify correct exit from label", - "pass", - result3 ); -} - - -/** - * Labled while with an unlabeled break - * - */ -function DoWhile_4() { - var description = "labeled while with an unlabeled break"; - var result1 = "pass"; - var result2 = "pass"; - var result3 = "fail: did not evaluate statement after label"; - -woohooboy: { - while( true ) { - break woohooboy; - result1 = "fail: got to code after the break"; - } - result2 = "fail: broke out of while, but not out of label"; - } - result3 = "pass"; - - new TestCase( - SECTION, - "DoWhile_4: " +description +" - verify break out of while loop", - "pass", - result1 ); - - new TestCase( - SECTION, - "DoWhile_4: " +description + " - verify break out of label", - "pass", - result2 ); - - new TestCase( - SECTION, - "DoWhile_4: " +description +" - verify that statements after label are evaluated", - "pass", - result3 ); -} - -/** - * in this case, should behave the same way as - * - * - */ -function DoWhile_5() { - var description = "while with a labeled continue statement"; - var result1 = "pass"; - var result2 = "fail: did not execute code after loop, but inside label"; - var i = 0; - var j = 0; - -theloop: { - j++; - while( i++ < 10 ) { - continue; - result1 = "failed: hit code after continue statement"; - } - result2 = "pass"; - } - - new TestCase( - SECTION, - "DoWhile_5: " +description + " - continue should not execute statements above the loop", - true, - ( j == 1 ) ); - - new TestCase( - SECTION, - "DoWhile_5: " +description +" - code after labeled continue should not be executed", - "pass", - result1 ); - - new TestCase( - SECTION, - "DoWhile_5: " +description +" - code after loop but inside label should be executed", - "pass", - result2 ); -} - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/String/browser.js b/tests/auto/declarative/parserstress/tests/ecma_2/String/browser.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/String/match-001.js b/tests/auto/declarative/parserstress/tests/ecma_2/String/match-001.js deleted file mode 100644 index de2275b5d6..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/String/match-001.js +++ /dev/null @@ -1,139 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'match-001.js'; - -/** - * File Name: String/match-001.js - * ECMA Section: 15.6.4.9 - * Description: Based on ECMA 2 Draft 7 February 1999 - * - * Author: christine@netscape.com - * Date: 19 February 1999 - */ - -/* - * String.match( regexp ) - * - * If regexp is not an object of type RegExp, it is replaced with result - * of the expression new RegExp(regexp). Let string denote the result of - * converting the this value to a string. If regexp.global is false, - * return the result obtained by invoking RegExp.prototype.exec (see - * section 15.7.5.3) on regexp with string as parameter. - * - * Otherwise, set the regexp.lastIndex property to 0 and invoke - * RegExp.prototype.exec repeatedly until there is no match. If there is a - * match with an empty string (in other words, if the value of - * regexp.lastIndex is left unchanged) increment regexp.lastIndex by 1. - * The value returned is an array with the properties 0 through n-1 - * corresponding to the first element of the result of each matching - * invocation of RegExp.prototype.exec. - * - * Note that the match function is intentionally generic; it does not - * require that its this value be a string object. Therefore, it can be - * transferred to other kinds of objects for use as a method. - */ - -var SECTION = "String/match-001.js"; -var VERSION = "ECMA_2"; -var TITLE = "String.prototype.match( regexp )"; - -startTest(); - -// the regexp argument is not a RegExp object -// this is not a string object - -// cases in which the regexp global property is false - -AddRegExpCases( 3, "3", "1234567890", 1, 2, ["3"] ); - -// cases in which the regexp object global property is true - -AddGlobalRegExpCases( /34/g, "/34/g", "343443444", 3, ["34", "34", "34"] ); -AddGlobalRegExpCases( /\d{1}/g, "/d{1}/g", "123456abcde7890", 10, - ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"] ); - -AddGlobalRegExpCases( /\d{2}/g, "/d{2}/g", "123456abcde7890", 5, - ["12", "34", "56", "78", "90"] ); - -AddGlobalRegExpCases( /\D{2}/g, "/d{2}/g", "123456abcde7890", 2, - ["ab", "cd"] ); - -test(); - - -function AddRegExpCases( - regexp, str_regexp, string, length, index, matches_array ) { - - AddTestCase( - "( " + string + " ).match(" + str_regexp +").length", - length, - string.match(regexp).length ); - - AddTestCase( - "( " + string + " ).match(" + str_regexp +").index", - index, - string.match(regexp).index ); - - AddTestCase( - "( " + string + " ).match(" + str_regexp +").input", - string, - string.match(regexp).input ); - - for ( var matches = 0; matches < matches_array.length; matches++ ) { - AddTestCase( - "( " + string + " ).match(" + str_regexp +")[" + matches +"]", - matches_array[matches], - string.match(regexp)[matches] ); - } -} - -function AddGlobalRegExpCases( - regexp, str_regexp, string, length, matches_array ) { - - AddTestCase( - "( " + string + " ).match(" + str_regexp +").length", - length, - string.match(regexp).length ); - - for ( var matches = 0; matches < matches_array.length; matches++ ) { - AddTestCase( - "( " + string + " ).match(" + str_regexp +")[" + matches +"]", - matches_array[matches], - string.match(regexp)[matches] ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/String/match-002.js b/tests/auto/declarative/parserstress/tests/ecma_2/String/match-002.js deleted file mode 100644 index a57da2f77f..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/String/match-002.js +++ /dev/null @@ -1,207 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'match-002.js'; - -/** - * File Name: String/match-002.js - * ECMA Section: 15.6.4.9 - * Description: Based on ECMA 2 Draft 7 February 1999 - * - * Author: christine@netscape.com - * Date: 19 February 1999 - */ - -/* - * String.match( regexp ) - * - * If regexp is not an object of type RegExp, it is replaced with result - * of the expression new RegExp(regexp). Let string denote the result of - * converting the this value to a string. If regexp.global is false, - * return the result obtained by invoking RegExp.prototype.exec (see - * section 15.7.5.3) on regexp with string as parameter. - * - * Otherwise, set the regexp.lastIndex property to 0 and invoke - * RegExp.prototype.exec repeatedly until there is no match. If there is a - * match with an empty string (in other words, if the value of - * regexp.lastIndex is left unchanged) increment regexp.lastIndex by 1. - * The value returned is an array with the properties 0 through n-1 - * corresponding to the first element of the result of each matching - * invocation of RegExp.prototype.exec. - * - * Note that the match function is intentionally generic; it does not - * require that its this value be a string object. Therefore, it can be - * transferred to other kinds of objects for use as a method. - * - * This file tests cases in which regexp.global is false. Therefore, - * results should behave as regexp.exec with string passed as a parameter. - * - */ - -var SECTION = "String/match-002.js"; -var VERSION = "ECMA_2"; -var TITLE = "String.prototype.match( regexp )"; - -startTest(); - -// the regexp argument is not a RegExp object -// this is not a string object - -AddRegExpCases( /([\d]{5})([-\ ]?[\d]{4})?$/, - "/([\d]{5})([-\ ]?[\d]{4})?$/", - "Boston, Mass. 02134", - 14, - ["02134", "02134", undefined]); - -AddGlobalRegExpCases( /([\d]{5})([-\ ]?[\d]{4})?$/g, - "/([\d]{5})([-\ ]?[\d]{4})?$/g", - "Boston, Mass. 02134", - ["02134"]); - -// set the value of lastIndex -re = /([\d]{5})([-\ ]?[\d]{4})?$/; -re.lastIndex = 0; - -s = "Boston, MA 02134"; - -AddRegExpCases( re, - "re = /([\d]{5})([-\ ]?[\d]{4})?$/; re.lastIndex =0", - s, - s.lastIndexOf("0"), - ["02134", "02134", undefined]); - - -re.lastIndex = s.length; - -AddRegExpCases( re, - "re = /([\d]{5})([-\ ]?[\d]{4})?$/; re.lastIndex = " + - s.length, - s, - s.lastIndexOf("0"), - ["02134", "02134", undefined] ); - -re.lastIndex = s.lastIndexOf("0"); - -AddRegExpCases( re, - "re = /([\d]{5})([-\ ]?[\d]{4})?$/; re.lastIndex = " + - s.lastIndexOf("0"), - s, - s.lastIndexOf("0"), - ["02134", "02134", undefined]); - -re.lastIndex = s.lastIndexOf("0") + 1; - -AddRegExpCases( re, - "re = /([\d]{5})([-\ ]?[\d]{4})?$/; re.lastIndex = " + - s.lastIndexOf("0") +1, - s, - s.lastIndexOf("0"), - ["02134", "02134", undefined]); - -test(); - -function AddRegExpCases( - regexp, str_regexp, string, index, matches_array ) { - - // prevent a runtime error - - if ( regexp.exec(string) == null || matches_array == null ) { - AddTestCase( - string + ".match(" + regexp +")", - matches_array, - string.match(regexp) ); - - return; - } - - AddTestCase( - "( " + string + " ).match(" + str_regexp +").length", - matches_array.length, - string.match(regexp).length ); - - AddTestCase( - "( " + string + " ).match(" + str_regexp +").index", - index, - string.match(regexp).index ); - - AddTestCase( - "( " + string + " ).match(" + str_regexp +").input", - string, - string.match(regexp).input ); - - var limit = matches_array.length > string.match(regexp).length ? - matches_array.length : - string.match(regexp).length; - - for ( var matches = 0; matches < limit; matches++ ) { - AddTestCase( - "( " + string + " ).match(" + str_regexp +")[" + matches +"]", - matches_array[matches], - string.match(regexp)[matches] ); - } -} - -function AddGlobalRegExpCases( - regexp, str_regexp, string, matches_array ) { - - // prevent a runtime error - - if ( regexp.exec(string) == null || matches_array == null ) { - AddTestCase( - regexp + ".exec(" + string +")", - matches_array, - regexp.exec(string) ); - - return; - } - - AddTestCase( - "( " + string + " ).match(" + str_regexp +").length", - matches_array.length, - string.match(regexp).length ); - - var limit = matches_array.length > string.match(regexp).length ? - matches_array.length : - string.match(regexp).length; - - for ( var matches = 0; matches < limit; matches++ ) { - AddTestCase( - "( " + string + " ).match(" + str_regexp +")[" + matches +"]", - matches_array[matches], - string.match(regexp)[matches] ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/String/match-003.js b/tests/auto/declarative/parserstress/tests/ecma_2/String/match-003.js deleted file mode 100644 index cd3d80c919..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/String/match-003.js +++ /dev/null @@ -1,165 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'match-003.js'; - -/** - * File Name: String/match-003.js - * ECMA Section: 15.6.4.9 - * Description: Based on ECMA 2 Draft 7 February 1999 - * - * Author: christine@netscape.com - * Date: 19 February 1999 - */ - -/* - * String.match( regexp ) - * - * If regexp is not an object of type RegExp, it is replaced with result - * of the expression new RegExp(regexp). Let string denote the result of - * converting the this value to a string. If regexp.global is false, - * return the result obtained by invoking RegExp.prototype.exec (see - * section 15.7.5.3) on regexp with string as parameter. - * - * Otherwise, set the regexp.lastIndex property to 0 and invoke - * RegExp.prototype.exec repeatedly until there is no match. If there is a - * match with an empty string (in other words, if the value of - * regexp.lastIndex is left unchanged) increment regexp.lastIndex by 1. - * The value returned is an array with the properties 0 through n-1 - * corresponding to the first element of the result of each matching - * invocation of RegExp.prototype.exec. - * - * Note that the match function is intentionally generic; it does not - * require that its this value be a string object. Therefore, it can be - * transferred to other kinds of objects for use as a method. - */ - -var SECTION = "String/match-003.js"; -var VERSION = "ECMA_2"; -var TITLE = "String.prototype.match( regexp )"; - -startTest(); - -// the regexp argument is not a RegExp object -// this is not a string object - - -// [if regexp.global is true] set the regexp.lastIndex property to 0 and -// invoke RegExp.prototype.exec repeatedly until there is no match. If -// there is a match with an empty string (in other words, if the value of -// regexp.lastIndex is left unchanged) increment regexp.lastIndex by 1. -// The value returned is an array with the properties 0 through n-1 -// corresponding to the first element of the result of each matching invocation -// of RegExp.prototype.exec. - - -// set the value of lastIndex -re = /([\d]{5})([-\ ]?[\d]{4})?$/g; - - -s = "Boston, MA 02134"; - -AddGlobalRegExpCases( re, - "re = " + re, - s, - ["02134" ]); - -re.lastIndex = 0; - -AddGlobalRegExpCases( - re, - "re = " + re + "; re.lastIndex = 0 ", - s, - ["02134"]); - - -re.lastIndex = s.length; - -AddGlobalRegExpCases( - re, - "re = " + re + "; re.lastIndex = " + s.length, - s, - ["02134"] ); - -re.lastIndex = s.lastIndexOf("0"); - -AddGlobalRegExpCases( - re, - "re = "+ re +"; re.lastIndex = " + s.lastIndexOf("0"), - s, - ["02134"]); - -re.lastIndex = s.lastIndexOf("0") + 1; - -AddGlobalRegExpCases( - re, - "re = " +re+ "; re.lastIndex = " + (s.lastIndexOf("0") +1), - s, - ["02134"]); - -test(); - -function AddGlobalRegExpCases( - regexp, str_regexp, string, matches_array ) { - - // prevent a runtime error - - if ( string.match(regexp) == null || matches_array == null ) { - AddTestCase( - string + ".match(" + str_regexp +")", - matches_array, - string.match(regexp) ); - - return; - } - - AddTestCase( - "( " + string + " ).match(" + str_regexp +").length", - matches_array.length, - string.match(regexp).length ); - - var limit = matches_array.length > string.match(regexp).length ? - matches_array.length : - string.match(regexp).length; - - for ( var matches = 0; matches < limit; matches++ ) { - AddTestCase( - "( " + string + " ).match(" + str_regexp +")[" + matches +"]", - matches_array[matches], - string.match(regexp)[matches] ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/String/match-004.js b/tests/auto/declarative/parserstress/tests/ecma_2/String/match-004.js deleted file mode 100644 index 5c26de8b61..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/String/match-004.js +++ /dev/null @@ -1,206 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'match-004.js'; - -/** - * File Name: String/match-004.js - * ECMA Section: 15.6.4.9 - * Description: Based on ECMA 2 Draft 7 February 1999 - * - * Author: christine@netscape.com - * Date: 19 February 1999 - */ - -/* - * String.match( regexp ) - * - * If regexp is not an object of type RegExp, it is replaced with result - * of the expression new RegExp(regexp). Let string denote the result of - * converting the this value to a string. If regexp.global is false, - * return the result obtained by invoking RegExp.prototype.exec (see - * section 15.7.5.3) on regexp with string as parameter. - * - * Otherwise, set the regexp.lastIndex property to 0 and invoke - * RegExp.prototype.exec repeatedly until there is no match. If there is a - * match with an empty string (in other words, if the value of - * regexp.lastIndex is left unchanged) increment regexp.lastIndex by 1. - * The value returned is an array with the properties 0 through n-1 - * corresponding to the first element of the result of each matching - * invocation of RegExp.prototype.exec. - * - * Note that the match function is intentionally generic; it does not - * require that its this value be a string object. Therefore, it can be - * transferred to other kinds of objects for use as a method. - * - * - * The match function should be intentionally generic, and not require - * this to be a string. - * - */ - -var SECTION = "String/match-004.js"; -var VERSION = "ECMA_2"; -var TITLE = "String.prototype.match( regexp )"; - -var BUGNUMBER="http://scopus/bugsplat/show_bug.cgi?id=345818"; - -startTest(); - -// set the value of lastIndex -re = /0./; -s = 10203040506070809000; - -Number.prototype.match = String.prototype.match; - -AddRegExpCases( re, - "re = " + re , - s, - String(s), - 1, - ["02"]); - - -re.lastIndex = 0; -AddRegExpCases( re, - "re = " + re +" [lastIndex is " + re.lastIndex+"]", - s, - String(s), - 1, - ["02"]); -/* - -re.lastIndex = s.length; - -AddRegExpCases( re, -"re = /([\d]{5})([-\ ]?[\d]{4})?$/; re.lastIndex = " + -s.length, -s, -s.lastIndexOf("0"), -null ); - -re.lastIndex = s.lastIndexOf("0"); - -AddRegExpCases( re, -"re = /([\d]{5})([-\ ]?[\d]{4})?$/; re.lastIndex = " + -s.lastIndexOf("0"), -s, -s.lastIndexOf("0"), -["02134"]); - -re.lastIndex = s.lastIndexOf("0") + 1; - -AddRegExpCases( re, -"re = /([\d]{5})([-\ ]?[\d]{4})?$/; re.lastIndex = " + -s.lastIndexOf("0") +1, -s, -0, -null); -*/ -test(); - -function AddRegExpCases( - regexp, str_regexp, string, str_string, index, matches_array ) { - - // prevent a runtime error - - if ( regexp.exec(string) == null || matches_array == null ) { - AddTestCase( - string + ".match(" + regexp +")", - matches_array, - string.match(regexp) ); - - return; - } - - AddTestCase( - "( " + string + " ).match(" + str_regexp +").length", - matches_array.length, - string.match(regexp).length ); - - AddTestCase( - "( " + string + " ).match(" + str_regexp +").index", - index, - string.match(regexp).index ); - - AddTestCase( - "( " + string + " ).match(" + str_regexp +").input", - str_string, - string.match(regexp).input ); - - var limit = matches_array.length > string.match(regexp).length ? - matches_array.length : - string.match(regexp).length; - - for ( var matches = 0; matches < limit; matches++ ) { - AddTestCase( - "( " + string + " ).match(" + str_regexp +")[" + matches +"]", - matches_array[matches], - string.match(regexp)[matches] ); - } -} - -function AddGlobalRegExpCases( - regexp, str_regexp, string, matches_array ) { - - // prevent a runtime error - - if ( regexp.exec(string) == null || matches_array == null ) { - AddTestCase( - regexp + ".exec(" + string +")", - matches_array, - regexp.exec(string) ); - - return; - } - - AddTestCase( - "( " + string + " ).match(" + str_regexp +").length", - matches_array.length, - string.match(regexp).length ); - - var limit = matches_array.length > string.match(regexp).length ? - matches_array.length : - string.match(regexp).length; - - for ( var matches = 0; matches < limit; matches++ ) { - AddTestCase( - "( " + string + " ).match(" + str_regexp +")[" + matches +"]", - matches_array[matches], - string.match(regexp)[matches] ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/String/replace-001.js b/tests/auto/declarative/parserstress/tests/ecma_2/String/replace-001.js deleted file mode 100644 index f0ae3cdbfa..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/String/replace-001.js +++ /dev/null @@ -1,99 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'replace-001.js'; - -/** - * File Name: String/replace-001.js - * ECMA Section: 15.6.4.10 - * Description: Based on ECMA 2 Draft 7 February 1999 - * - * Author: christine@netscape.com - * Date: 19 February 1999 - */ - -var SECTION = "String/replace-001.js"; -var VERSION = "ECMA_2"; -var TITLE = "String.prototype.replace( regexp, replaceValue )"; - -startTest(); - -/* - * If regexp is not an object of type RegExp, it is replaced with the - * result of the expression new RegExp(regexp). Let string denote the - * result of converting the this value to a string. String is searched - * for the first occurrence of the regular expression pattern regexp if - * regexp.global is false, or all occurrences if regexp.global is true. - * - * The match is performed as in String.prototype.match, including the - * update of regexp.lastIndex. Let m be the number of matched - * parenthesized subexpressions as specified in section 15.7.5.3. - * - * If replaceValue is a function, then for each matched substring, call - * the function with the following m + 3 arguments. Argument 1 is the - * substring that matched. The next m arguments are all of the matched - * subexpressions. Argument m + 2 is the length of the left context, and - * argument m + 3 is string. - * - * The result is a string value derived from the original input by - * replacing each matched substring with the corresponding return value - * of the function call, converted to a string if need be. - * - * Otherwise, let newstring denote the result of converting replaceValue - * to a string. The result is a string value derived from the original - * input string by replacing each matched substring with a string derived - * from newstring by replacing characters in newstring by replacement text - * as specified in the following table: - * - * $& The matched substring. - * $‘ The portion of string that precedes the matched substring. - * $’ The portion of string that follows the matched substring. - * $+ The substring matched by the last parenthesized subexpressions in - * the regular expression. - * $n The corresponding matched parenthesized subexpression n, where n - * is a single digit 0-9. If there are fewer than n subexpressions, “$n - * is left unchanged. - * - * Note that the replace function is intentionally generic; it does not - * require that its this value be a string object. Therefore, it can be - * transferred to other kinds of objects for use as a method. - */ - - -AddTestCase( "NO TESTS EXIST", "PASSED", "Test not implemented"); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/String/shell.js b/tests/auto/declarative/parserstress/tests/ecma_2/String/shell.js deleted file mode 100644 index 7d850446cc..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/String/shell.js +++ /dev/null @@ -1 +0,0 @@ -gTestsubsuite = 'String'; diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/String/split-001.js b/tests/auto/declarative/parserstress/tests/ecma_2/String/split-001.js deleted file mode 100644 index bbab3b0428..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/String/split-001.js +++ /dev/null @@ -1,145 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'split-001.js'; - -/** - * File Name: String/split-001.js - * ECMA Section: 15.6.4.9 - * Description: Based on ECMA 2 Draft 7 February 1999 - * - * Author: christine@netscape.com - * Date: 19 February 1999 - */ - -/* - * Since regular expressions have been part of JavaScript since 1.2, there - * are already tests for regular expressions in the js1_2/regexp folder. - * - * These new tests try to supplement the existing tests, and verify that - * our implementation of RegExp conforms to the ECMA specification, but - * does not try to be as exhaustive as in previous tests. - * - * The [,limit] argument to String.split is new, and not covered in any - * existing tests. - * - * String.split cases are covered in ecma/String/15.5.4.8-*.js. - * String.split where separator is a RegExp are in - * js1_2/regexp/string_split.js - * - */ - -var SECTION = "ecma_2/String/split-001.js"; -var VERSION = "ECMA_2"; -var TITLE = "String.prototype.split( regexp, [,limit] )"; - -startTest(); - -// the separator is not supplied -// separator is undefined -// separator is an empty string - -AddSplitCases( "splitme", "", "''", ["s", "p", "l", "i", "t", "m", "e"] ); -AddSplitCases( "splitme", new RegExp(), "new RegExp()", ["s", "p", "l", "i", "t", "m", "e"] ); - -// separartor is a regexp -// separator regexp value global setting is set -// string is an empty string -// if separator is an empty string, split each by character - -// this is not a String object - -// limit is not a number -// limit is undefined -// limit is larger than 2^32-1 -// limit is a negative number - -test(); - -function AddSplitCases( string, separator, str_sep, split_array ) { - - // verify that the result of split is an object of type Array - AddTestCase( - "( " + string + " ).split(" + str_sep +").constructor == Array", - true, - string.split(separator).constructor == Array ); - - // check the number of items in the array - AddTestCase( - "( " + string + " ).split(" + str_sep +").length", - split_array.length, - string.split(separator).length ); - - // check the value of each array item - var limit = (split_array.length > string.split(separator).length ) - ? split_array.length : string.split(separator).length; - - for ( var matches = 0; matches < split_array.length; matches++ ) { - AddTestCase( - "( " + string + " ).split(" + str_sep +")[" + matches +"]", - split_array[matches], - string.split( separator )[matches] ); - } -} - -function AddLimitedSplitCases( - string, separator, str_sep, limit, str_limit, split_array ) { - - // verify that the result of split is an object of type Array - - AddTestCase( - "( " + string + " ).split(" + str_sep +", " + str_limit + - " ).constructor == Array", - true, - string.split(separator, limit).constructor == Array ); - - // check the length of the array - - AddTestCase( - "( " + string + " ).split(" + str_sep +", " + str_limit + " ).length", - length, - string.split(separator).length ); - - // check the value of each array item - - for ( var matches = 0; matches < split_array.length; matches++ ) { - AddTestCase( - "( " + string + " ).split(" + str_sep +", " + str_limit + " )[" + matches +"]", - split_array[matches], - string.split( separator )[matches] ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/String/split-002.js b/tests/auto/declarative/parserstress/tests/ecma_2/String/split-002.js deleted file mode 100644 index 9ae000790e..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/String/split-002.js +++ /dev/null @@ -1,303 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'split-002.js'; - -/** - * File Name: String/split-002.js - * ECMA Section: 15.6.4.9 - * Description: Based on ECMA 2 Draft 7 February 1999 - * - * Author: christine@netscape.com - * Date: 19 February 1999 - */ - -/* - * Since regular expressions have been part of JavaScript since 1.2, there - * are already tests for regular expressions in the js1_2/regexp folder. - * - * These new tests try to supplement the existing tests, and verify that - * our implementation of RegExp conforms to the ECMA specification, but - * does not try to be as exhaustive as in previous tests. - * - * The [,limit] argument to String.split is new, and not covered in any - * existing tests. - * - * String.split cases are covered in ecma/String/15.5.4.8-*.js. - * String.split where separator is a RegExp are in - * js1_2/regexp/string_split.js - * - */ - -var SECTION = "ecma_2/String/split-002.js"; -var VERSION = "ECMA_2"; -var TITLE = "String.prototype.split( regexp, [,limit] )"; - -startTest(); - -// the separator is not supplied -// separator is undefined -// separator is an empty string - -// AddSplitCases( "splitme", "", "''", ["s", "p", "l", "i", "t", "m", "e"] ); -// AddSplitCases( "splitme", new RegExp(), "new RegExp()", ["s", "p", "l", "i", "t", "m", "e"] ); - -// separator is an empty regexp -// separator is not supplied - -CompareSplit( "hello", "ll" ); - -CompareSplit( "hello", "l" ); -CompareSplit( "hello", "x" ); -CompareSplit( "hello", "h" ); -CompareSplit( "hello", "o" ); -CompareSplit( "hello", "hello" ); -CompareSplit( "hello", undefined ); - -CompareSplit( "hello", ""); -CompareSplit( "hello", "hellothere" ); - -CompareSplit( new String("hello" ) ); - - -Number.prototype.split = String.prototype.split; - -CompareSplit( new Number(100111122133144155), 1 ); -CompareSplitWithLimit(new Number(100111122133144155), 1, 1 ); - -CompareSplitWithLimit(new Number(100111122133144155), 1, 2 ); -CompareSplitWithLimit(new Number(100111122133144155), 1, 0 ); -CompareSplitWithLimit(new Number(100111122133144155), 1, 100 ); -CompareSplitWithLimit(new Number(100111122133144155), 1, void 0 ); -CompareSplitWithLimit(new Number(100111122133144155), 1, Math.pow(2,32)-1 ); -CompareSplitWithLimit(new Number(100111122133144155), 1, "boo" ); -CompareSplitWithLimit(new Number(100111122133144155), 1, -(Math.pow(2,32)-1) ); -CompareSplitWithLimit( "hello", "l", NaN ); -CompareSplitWithLimit( "hello", "l", 0 ); -CompareSplitWithLimit( "hello", "l", 1 ); -CompareSplitWithLimit( "hello", "l", 2 ); -CompareSplitWithLimit( "hello", "l", 3 ); -CompareSplitWithLimit( "hello", "l", 4 ); - - -/* - CompareSplitWithLimit( "hello", "ll", 0 ); - CompareSplitWithLimit( "hello", "ll", 1 ); - CompareSplitWithLimit( "hello", "ll", 2 ); - CompareSplit( "", " " ); - CompareSplit( "" ); -*/ - -// separartor is a regexp -// separator regexp value global setting is set -// string is an empty string -// if separator is an empty string, split each by character - -// this is not a String object - -// limit is not a number -// limit is undefined -// limit is larger than 2^32-1 -// limit is a negative number - -test(); - -function CompareSplit( string, separator ) { - split_1 = string.split( separator ); - split_2 = string_split( string, separator ); - - AddTestCase( - "( " + string +".split(" + separator + ") ).length" , - split_2.length, - split_1.length ); - - var limit = split_1.length > split_2.length ? - split_1.length : split_2.length; - - for ( var split_item = 0; split_item < limit; split_item++ ) { - AddTestCase( - string + ".split(" + separator + ")["+split_item+"]", - split_2[split_item], - split_1[split_item] ); - } -} - -function CompareSplitWithLimit( string, separator, splitlimit ) { - split_1 = string.split( separator, splitlimit ); - split_2 = string_split( string, separator, splitlimit ); - - AddTestCase( - "( " + string +".split(" + separator + ", " + splitlimit+") ).length" , - split_2.length, - split_1.length ); - - var limit = split_1.length > split_2.length ? - split_1.length : split_2.length; - - for ( var split_item = 0; split_item < limit; split_item++ ) { - AddTestCase( - string + ".split(" + separator + ", " + splitlimit+")["+split_item+"]", - split_2[split_item], - split_1[split_item] ); - } -} - -function string_split ( __this, separator, limit ) { - var S = String(__this ); // 1 - - var A = new Array(); // 2 - - if ( limit == undefined ) { // 3 - lim = Math.pow(2, 31 ) -1; - } else { - lim = ToUint32( limit ); - } - - var s = S.length; // 4 - var p = 0; // 5 - - if ( separator == undefined ) { // 8 - A[0] = S; - return A; - } - - if ( separator.constructor == RegExp ) // 6 - R = separator; - else - R = separator.toString(); - - if (lim == 0) return A; // 7 - - if ( separator == undefined ) { // 8 - A[0] = S; - return A; - } - - if (s == 0) { // 9 - z = SplitMatch(R, S, 0); - if (z != false) return A; - A[0] = S; - return A; - } - - var q = p; // 10 -loop: - while (true ) { - - if ( q == s ) break; // 11 - - z = SplitMatch(R, S, q); // 12 - -//print("Returned ", z); - - if (z != false) { // 13 - e = z.endIndex; // 14 - cap = z.captures; // 14 - if (e != p) { // 15 -//print("S = ", S, ", p = ", p, ", q = ", q); - T = S.slice(p, q); // 16 -//print("T = ", T); - A[A.length] = T; // 17 - if (A.length == lim) return A; // 18 - p = e; // 19 - i = 0; // 20 - while (true) { // 25 - if (i == cap.length) { // 21 - q = p; // 10 - continue loop; - } - i = i + 1; // 22 - A[A.length] = cap[i] // 23 - if (A.length == lim) return A; // 24 - } - } - } - - q = q + 1; // 26 - } - - T = S.slice(p, q); - A[A.length] = T; - return A; -} - -function SplitMatch(R, S, q) -{ - if (R.constructor == RegExp) { // 1 - var reResult = R.match(S, q); // 8 - if (reResult == undefined) - return false; - else { - a = new Array(reResult.length - 1); - for (var i = 1; i < reResult.length; i++) - a[a.length] = reResult[i]; - return { endIndex : reResult.index + reResult[0].length, captures : cap }; - } - } - else { - var r = R.length; // 2 - s = S.length; // 3 - if ((q + r) > s) return false; // 4 - for (var i = 0; i < r; i++) { -//print("S.charAt(", q + i, ") = ", S.charAt(q + i), ", R.charAt(", i, ") = ", R.charAt(i)); - if (S.charAt(q + i) != R.charAt(i)) // 5 - return false; - } - cap = new Array(); // 6 - return { endIndex : q + r, captures : cap }; // 7 - } -} - -function ToUint32( n ) { - n = Number( n ); - var sign = ( n < 0 ) ? -1 : 1; - - if ( Math.abs( n ) == 0 - || Math.abs( n ) == Number.POSITIVE_INFINITY - || n != n) { - 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 ); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/String/split-003.js b/tests/auto/declarative/parserstress/tests/ecma_2/String/split-003.js deleted file mode 100644 index 5029fc98f9..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/String/split-003.js +++ /dev/null @@ -1,156 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'split-003.js'; - -/** - * File Name: String/split-003.js - * ECMA Section: 15.6.4.9 - * Description: Based on ECMA 2 Draft 7 February 1999 - * - * Author: christine@netscape.com - * Date: 19 February 1999 - */ - -/* - * Since regular expressions have been part of JavaScript since 1.2, there - * are already tests for regular expressions in the js1_2/regexp folder. - * - * These new tests try to supplement the existing tests, and verify that - * our implementation of RegExp conforms to the ECMA specification, but - * does not try to be as exhaustive as in previous tests. - * - * The [,limit] argument to String.split is new, and not covered in any - * existing tests. - * - * String.split cases are covered in ecma/String/15.5.4.8-*.js. - * String.split where separator is a RegExp are in - * js1_2/regexp/string_split.js - * - */ - -var SECTION = "ecma_2/String/split-003.js"; -var VERSION = "ECMA_2"; -var TITLE = "String.prototype.split( regexp, [,limit] )"; - -startTest(); - -// separator is a regexp -// separator regexp value global setting is set -// string is an empty string -// if separator is an empty string, split each by character - - -AddSplitCases( "hello", new RegExp, "new RegExp", ["h","e","l","l","o"] ); - -AddSplitCases( "hello", /l/, "/l/", ["he","","o"] ); -AddLimitedSplitCases( "hello", /l/, "/l/", 0, [] ); -AddLimitedSplitCases( "hello", /l/, "/l/", 1, ["he"] ); -AddLimitedSplitCases( "hello", /l/, "/l/", 2, ["he",""] ); -AddLimitedSplitCases( "hello", /l/, "/l/", 3, ["he","","o"] ); -AddLimitedSplitCases( "hello", /l/, "/l/", 4, ["he","","o"] ); -AddLimitedSplitCases( "hello", /l/, "/l/", void 0, ["he","","o"] ); -AddLimitedSplitCases( "hello", /l/, "/l/", "hi", [] ); -AddLimitedSplitCases( "hello", /l/, "/l/", undefined, ["he","","o"] ); - -AddSplitCases( "hello", new RegExp, "new RegExp", ["h","e","l","l","o"] ); -AddLimitedSplitCases( "hello", new RegExp, "new RegExp", 0, [] ); -AddLimitedSplitCases( "hello", new RegExp, "new RegExp", 1, ["h"] ); -AddLimitedSplitCases( "hello", new RegExp, "new RegExp", 2, ["h","e"] ); -AddLimitedSplitCases( "hello", new RegExp, "new RegExp", 3, ["h","e","l"] ); -AddLimitedSplitCases( "hello", new RegExp, "new RegExp", 4, ["h","e","l","l"] ); -AddLimitedSplitCases( "hello", new RegExp, "new RegExp", void 0, ["h","e","l","l","o"] ); -AddLimitedSplitCases( "hello", new RegExp, "new RegExp", "hi", [] ); -AddLimitedSplitCases( "hello", new RegExp, "new RegExp", undefined, ["h","e","l","l","o"] ); - -test(); - -function AddSplitCases( string, separator, str_sep, split_array ) { - // verify that the result of split is an object of type Array - AddTestCase( - "( " + string + " ).split(" + str_sep +").constructor == Array", - true, - string.split(separator).constructor == Array ); - - // check the number of items in the array - AddTestCase( - "( " + string + " ).split(" + str_sep +").length", - split_array.length, - string.split(separator).length ); - - // check the value of each array item - var limit = (split_array.length > string.split(separator).length ) - ? split_array.length : string.split(separator).length; - - for ( var matches = 0; matches < split_array.length; matches++ ) { - AddTestCase( - "( " + string + " ).split(" + str_sep +")[" + matches +"]", - split_array[matches], - string.split( separator )[matches] ); - } -} - -function AddLimitedSplitCases( - string, separator, str_sep, limit, split_array ) { - - // verify that the result of split is an object of type Array - - AddTestCase( - "( " + string + " ).split(" + str_sep +", " + limit + - " ).constructor == Array", - true, - string.split(separator, limit).constructor == Array ); - - // check the length of the array - - AddTestCase( - "( " + string + " ).split(" + str_sep +", " + limit + " ).length", - split_array.length, - string.split(separator, limit).length ); - - // check the value of each array item - - var slimit = (split_array.length > string.split(separator).length ) - ? split_array.length : string.split(separator, limit).length; - - for ( var matches = 0; matches < slimit; matches++ ) { - AddTestCase( - "( " + string + " ).split(" + str_sep +", " + limit + " )[" + matches +"]", - split_array[matches], - string.split( separator, limit )[matches] ); - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/browser.js b/tests/auto/declarative/parserstress/tests/ecma_2/browser.js deleted file mode 100644 index 4cde9b0629..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/browser.js +++ /dev/null @@ -1,37 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/extensions/browser.js b/tests/auto/declarative/parserstress/tests/ecma_2/extensions/browser.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/extensions/constructor-001.js b/tests/auto/declarative/parserstress/tests/ecma_2/extensions/constructor-001.js deleted file mode 100755 index cc7907d006..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/extensions/constructor-001.js +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'constructor-001.js'; - -/** - * File Name: RegExp/constructor-001.js - * ECMA Section: 15.7.3.3 - * Description: Based on ECMA 2 Draft 7 February 1999 - * - * Author: christine@netscape.com - * Date: 19 February 1999 - */ -var SECTION = "RegExp/constructor-001"; -var VERSION = "ECMA_2"; -var TITLE = "new RegExp()"; - -startTest(); - -/* - * for each test case, verify: - * - verify that [[Class]] property is RegExp - * - prototype property should be set to RegExp.prototype - * - source is set to the empty string - * - global property is set to false - * - ignoreCase property is set to false - * - multiline property is set to false - * - lastIndex property is set to 0 - */ - -RegExp.prototype.getClassProperty = Object.prototype.toString; -var re = new RegExp(); - -AddTestCase( - "new RegExp().__proto__", - RegExp.prototype, - re.__proto__ - ); - -test() diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/extensions/function-001.js b/tests/auto/declarative/parserstress/tests/ecma_2/extensions/function-001.js deleted file mode 100755 index 5153d25f9d..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/extensions/function-001.js +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'function-001.js'; - -/** - * File Name: RegExp/function-001.js - * ECMA Section: 15.7.2.1 - * Description: Based on ECMA 2 Draft 7 February 1999 - * - * Author: christine@netscape.com - * Date: 19 February 1999 - */ -var SECTION = "RegExp/function-001"; -var VERSION = "ECMA_2"; -var TITLE = "RegExp( pattern, flags )"; - -startTest(); - -/* - * for each test case, verify: - * - verify that [[Class]] property is RegExp - * - prototype property should be set to RegExp.prototype - * - source is set to the empty string - * - global property is set to false - * - ignoreCase property is set to false - * - multiline property is set to false - * - lastIndex property is set to 0 - */ - -RegExp.prototype.getClassProperty = Object.prototype.toString; -var re = new RegExp(); - -AddTestCase( - "new RegExp().__proto__", - RegExp.prototype, - re.__proto__ - ); - -test() diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/extensions/instanceof-001.js b/tests/auto/declarative/parserstress/tests/ecma_2/extensions/instanceof-001.js deleted file mode 100755 index 8ea446a248..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/extensions/instanceof-001.js +++ /dev/null @@ -1,144 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'instanceof-001.js'; - -/** - * File Name: instanceof-001.js - * ECMA Section: 11.8.6 - * Description: - * - * RelationalExpression instanceof Identifier - * - * Author: christine@netscape.com - * Date: 2 September 1998 - */ -var SECTION = "instanceof-001"; -var VERSION = "ECMA_2"; -var TITLE = "instanceof" - - startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -function InstanceOf( object_1, object_2, expect ) { - result = object_1 instanceof object_2; - - new TestCase( - SECTION, - "(" + object_1 + ") instanceof " + object_2, - expect, - result ); -} - -function Gen3(value) { - this.value = value; - this.generation = 3; - this.toString = new Function ( "return \"(Gen\"+this.generation+\" instance)\"" ); -} -Gen3.name = 3; -Gen3.__proto__.toString = new Function( "return \"(\"+this.name+\" object)\""); - -function Gen2(value) { - this.value = value; - this.generation = 2; -} -Gen2.name = 2; -Gen2.prototype = new Gen3(); - -function Gen1(value) { - this.value = value; - this.generation = 1; -} -Gen1.name = 1; -Gen1.prototype = new Gen2(); - -function Gen0(value) { - this.value = value; - this.generation = 0; -} -Gen0.name = 0; -Gen0.prototype = new Gen1(); - - -function GenA(value) { - this.value = value; - this.generation = "A"; - this.toString = new Function ( "return \"(instance of Gen\"+this.generation+\")\"" ); - -} -GenA.prototype = new Gen0(); -GenA.name = "A"; - -function GenB(value) { - this.value = value; - this.generation = "B"; - this.toString = new Function ( "return \"(instance of Gen\"+this.generation+\")\"" ); -} -GenB.name = "B" - GenB.prototype = void 0; - -// RelationalExpression is not an object. - -InstanceOf( true, Boolean, false ); -InstanceOf( new Boolean(false), Boolean, true ); - -// __proto__ of RelationalExpression is null. should return false -genA = new GenA(); -genA.__proto__ = null; - -InstanceOf( genA, GenA, false ); - -// RelationalExpression.__proto__ == (but not ===) Identifier.prototype - -InstanceOf( new Gen2(), Gen0, false ); -InstanceOf( new Gen2(), Gen1, false ); -InstanceOf( new Gen2(), Gen2, true ); -InstanceOf( new Gen2(), Gen3, true ); - -// RelationalExpression.__proto__.__proto__ === Identifier.prototype -InstanceOf( new Gen0(), Gen0, true ); -InstanceOf( new Gen0(), Gen1, true ); -InstanceOf( new Gen0(), Gen2, true ); -InstanceOf( new Gen0(), Gen3, true ); - -InstanceOf( new Gen0(), Object, true ); -InstanceOf( new Gen0(), Function, false ); - -InstanceOf( Gen0, Function, true ); -InstanceOf( Gen0, Object, true ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/extensions/instanceof-002.js b/tests/auto/declarative/parserstress/tests/ecma_2/extensions/instanceof-002.js deleted file mode 100755 index 9cc837d8ef..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/extensions/instanceof-002.js +++ /dev/null @@ -1,160 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'instanceof-002.js'; - -/** - File Name: instanceof-002.js - Section: - Description: Determining Instance Relationships - - This test is the same as js1_3/inherit/proto-002, except that it uses - the builtin instanceof operator rather than a user-defined function - called InstanceOf. - - This tests Object Hierarchy and Inheritance, as described in the document - Object Hierarchy and Inheritance in JavaScript, last modified on 12/18/97 - 15:19:34 on http://devedge.netscape.com/. Current URL: - http://devedge.netscape.com/docs/manuals/communicator/jsobj/contents.htm - - This tests the syntax ObjectName.prototype = new PrototypeObject using the - Employee example in the document referenced above. - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -// onerror = err; - -var SECTION = "instanceof-002"; -var VERSION = "ECMA_2"; -var TITLE = "Determining Instance Relationships"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -function InstanceOf( object, constructor ) { - while ( object != null ) { - if ( object == constructor.prototype ) { - return true; - } - object = object.__proto__; - } - return false; -} - -function Employee ( name, dept ) { - this.name = name || ""; - this.dept = dept || "general"; -} - -function Manager () { - this.reports = []; -} -Manager.prototype = new Employee(); - -function WorkerBee ( name, dept, projs ) { - this.base = Employee; - this.base( name, dept) - this.projects = projs || new Array(); -} -WorkerBee.prototype = new Employee(); - -function SalesPerson () { - this.dept = "sales"; - this.quota = 100; -} -SalesPerson.prototype = new WorkerBee(); - -function Engineer ( name, projs, machine ) { - this.base = WorkerBee; - this.base( name, "engineering", projs ) - this.machine = machine || ""; -} -Engineer.prototype = new WorkerBee(); - -var pat = new Engineer(); - -new TestCase( SECTION, - "pat.__proto__ == Engineer.prototype", - true, - pat.__proto__ == Engineer.prototype ); - -new TestCase( SECTION, - "pat.__proto__.__proto__ == WorkerBee.prototype", - true, - pat.__proto__.__proto__ == WorkerBee.prototype ); - -new TestCase( SECTION, - "pat.__proto__.__proto__.__proto__ == Employee.prototype", - true, - pat.__proto__.__proto__.__proto__ == Employee.prototype ); - -new TestCase( SECTION, - "pat.__proto__.__proto__.__proto__.__proto__ == Object.prototype", - true, - pat.__proto__.__proto__.__proto__.__proto__ == Object.prototype ); - -new TestCase( SECTION, - "pat.__proto__.__proto__.__proto__.__proto__.__proto__ == null", - true, - pat.__proto__.__proto__.__proto__.__proto__.__proto__ == null ); - -new TestCase( SECTION, - "pat instanceof Engineer", - true, - pat instanceof Engineer ); - -new TestCase( SECTION, - "pat instanceof WorkerBee )", - true, - pat instanceof WorkerBee ); - -new TestCase( SECTION, - "pat instanceof Employee )", - true, - pat instanceof Employee ); - -new TestCase( SECTION, - "pat instanceof Object )", - true, - pat instanceof Object ); - -new TestCase( SECTION, - "pat instanceof SalesPerson )", - false, - pat instanceof SalesPerson ); -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/extensions/instanceof-003-n.js b/tests/auto/declarative/parserstress/tests/ecma_2/extensions/instanceof-003-n.js deleted file mode 100755 index 7a763a895c..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/extensions/instanceof-003-n.js +++ /dev/null @@ -1,121 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'instanceof-003-n.js'; - -/** - * File Name: instanceof-001.js - * ECMA Section: 11.8.6 - * Description: - * - * RelationalExpression instanceof Identifier - * - * Author: christine@netscape.com - * Date: 2 September 1998 - */ -var SECTION = "instanceof-003-n"; -var VERSION = "ECMA_2"; -var TITLE = "instanceof" - - startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -function InstanceOf( object_1, object_2, expect ) { - - result = object_1 instanceof object_2; - - new TestCase( - SECTION, - "(" + object_1 + ") instanceof " + object_2, - expect, - result ); -} - -function Gen3(value) { - this.value = value; - this.generation = 3; - this.toString = new Function ( "return \"(Gen\"+this.generation+\" instance)\"" ); -} -Gen3.name = 3; -Gen3.__proto__.toString = new Function( "return \"(\"+this.name+\" object)\""); - -function Gen2(value) { - this.value = value; - this.generation = 2; -} -Gen2.name = 2; -Gen2.prototype = new Gen3(); - -function Gen1(value) { - this.value = value; - this.generation = 1; -} -Gen1.name = 1; -Gen1.prototype = new Gen2(); - -function Gen0(value) { - this.value = value; - this.generation = 0; -} -Gen0.name = 0; -Gen0.prototype = new Gen1(); - - -function GenA(value) { - this.value = value; - this.generation = "A"; - this.toString = new Function ( "return \"(instance of Gen\"+this.generation+\")\"" ); - -} -GenA.prototype = new Gen0(); -GenA.name = "A"; - -function GenB(value) { - this.value = value; - this.generation = "B"; - this.toString = new Function ( "return \"(instance of Gen\"+this.generation+\")\"" ); -} -GenB.name = "B" - GenB.prototype = void 0; - -// Identifier is not a function -DESCRIPTION = "Identifier is not a function"; -EXPECTED = "error"; - -InstanceOf( true, true, "error" ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/extensions/instanceof-004-n.js b/tests/auto/declarative/parserstress/tests/ecma_2/extensions/instanceof-004-n.js deleted file mode 100755 index 1662ae566b..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/extensions/instanceof-004-n.js +++ /dev/null @@ -1,121 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'instanceof-004-n.js'; - -/** - * File Name: instanceof-001.js - * ECMA Section: 11.8.6 - * Description: - * - * RelationalExpression instanceof Identifier - * - * Author: christine@netscape.com - * Date: 2 September 1998 - */ -var SECTION = "instanceof-004-n"; -var VERSION = "ECMA_2"; -var TITLE = "instanceof" - - startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -function InstanceOf( object_1, object_2, expect ) { - result = object_1 instanceof object_2; - - new TestCase( - SECTION, - "(" + object_1 + ") instanceof " + object_2, - expect, - result ); -} - -function Gen3(value) { - this.value = value; - this.generation = 3; - this.toString = new Function ( "return \"(Gen\"+this.generation+\" instance)\"" ); -} -Gen3.name = 3; -Gen3.__proto__.toString = new Function( "return \"(\"+this.name+\" object)\""); - -function Gen2(value) { - this.value = value; - this.generation = 2; -} -Gen2.name = 2; -Gen2.prototype = new Gen3(); - -function Gen1(value) { - this.value = value; - this.generation = 1; -} -Gen1.name = 1; -Gen1.prototype = new Gen2(); - -function Gen0(value) { - this.value = value; - this.generation = 0; -} -Gen0.name = 0; -Gen0.prototype = new Gen1(); - - -function GenA(value) { - this.value = value; - this.generation = "A"; - this.toString = new Function ( "return \"(instance of Gen\"+this.generation+\")\"" ); - -} -GenA.prototype = new Gen0(); -GenA.name = "A"; - -function GenB(value) { - this.value = value; - this.generation = "B"; - this.toString = new Function ( "return \"(instance of Gen\"+this.generation+\")\"" ); -} -GenB.name = "B" - GenB.prototype = void 0; - -// Identifier is not a function - -DESCRIPTION = "Identifier is not a function"; -EXPECTED = "error"; - -InstanceOf( new Boolean(true), false, "error" ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/extensions/instanceof-005-n.js b/tests/auto/declarative/parserstress/tests/ecma_2/extensions/instanceof-005-n.js deleted file mode 100755 index 1a9b1b3437..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/extensions/instanceof-005-n.js +++ /dev/null @@ -1,122 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'instanceof-005-n.js'; - -/** - * File Name: instanceof-001.js - * ECMA Section: 11.8.6 - * Description: - * - * RelationalExpression instanceof Identifier - * - * Author: christine@netscape.com - * Date: 2 September 1998 - */ -var SECTION = "instanceof-005-n"; -var VERSION = "ECMA_2"; -var TITLE = "instanceof" - - startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -function InstanceOf( object_1, object_2, expect ) { - result = object_1 instanceof object_2; - - new TestCase( - SECTION, - "(" + object_1 + ") instanceof " + object_2, - expect, - result ); -} - -function Gen3(value) { - this.value = value; - this.generation = 3; - this.toString = new Function ( "return \"(Gen\"+this.generation+\" instance)\"" ); -} -Gen3.name = 3; -Gen3.__proto__.toString = new Function( "return \"(\"+this.name+\" object)\""); - -function Gen2(value) { - this.value = value; - this.generation = 2; -} -Gen2.name = 2; -Gen2.prototype = new Gen3(); - -function Gen1(value) { - this.value = value; - this.generation = 1; -} -Gen1.name = 1; -Gen1.prototype = new Gen2(); - -function Gen0(value) { - this.value = value; - this.generation = 0; -} -Gen0.name = 0; -Gen0.prototype = new Gen1(); - - -function GenA(value) { - this.value = value; - this.generation = "A"; - this.toString = new Function ( "return \"(instance of Gen\"+this.generation+\")\"" ); - -} -GenA.prototype = new Gen0(); -GenA.name = "A"; - -function GenB(value) { - this.value = value; - this.generation = "B"; - this.toString = new Function ( "return \"(instance of Gen\"+this.generation+\")\"" ); -} -GenB.name = "B" - GenB.prototype = void 0; - - -// Identifier is a function, prototype of Identifier is not an object - -DESCRIPTION = "Identifier is a function, prototype of Identifier is not an object"; -EXPECTED = "error"; - -InstanceOf( new GenB(), GenB, "error" ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/extensions/instanceof-006.js b/tests/auto/declarative/parserstress/tests/ecma_2/extensions/instanceof-006.js deleted file mode 100755 index 03c0f16fb9..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/extensions/instanceof-006.js +++ /dev/null @@ -1,119 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'instanceof-006.js'; - -/** - * File Name: instanceof-001.js - * ECMA Section: 11.8.6 - * Description: - * - * RelationalExpression instanceof Identifier - * - * Author: christine@netscape.com - * Date: 2 September 1998 - */ -var SECTION = "instanceof-001"; -var VERSION = "ECMA_2"; -var TITLE = "instanceof" - - startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -function InstanceOf( object_1, object_2, expect ) { - result = object_1 instanceof object_2; - - new TestCase( - SECTION, - "(" + object_1 + ") instanceof " + object_2, - expect, - result ); -} - -function Gen3(value) { - this.value = value; - this.generation = 3; - this.toString = new Function ( "return \"(Gen\"+this.generation+\" instance)\"" ); -} -Gen3.name = 3; -Gen3.__proto__.toString = new Function( "return \"(\"+this.name+\" object)\""); - -function Gen2(value) { - this.value = value; - this.generation = 2; -} -Gen2.name = 2; -Gen2.prototype = new Gen3(); - -function Gen1(value) { - this.value = value; - this.generation = 1; -} -Gen1.name = 1; -Gen1.prototype = new Gen2(); - -function Gen0(value) { - this.value = value; - this.generation = 0; -} -Gen0.name = 0; -Gen0.prototype = new Gen1(); - - -function GenA(value) { - this.value = value; - this.generation = "A"; - this.toString = new Function ( "return \"(instance of Gen\"+this.generation+\")\"" ); - -} -GenA.prototype = new Gen0(); -GenA.name = "A"; - -function GenB(value) { - this.value = value; - this.generation = "B"; - this.toString = new Function ( "return \"(instance of Gen\"+this.generation+\")\"" ); -} -GenB.name = "B" - GenB.prototype = void 0; - -// RelationalExpression is not an object. - -// InstanceOf( true, Boolean, false ); -InstanceOf( new Boolean(false), Boolean, true ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/extensions/shell.js b/tests/auto/declarative/parserstress/tests/ecma_2/extensions/shell.js deleted file mode 100644 index 3f52cffbc0..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/extensions/shell.js +++ /dev/null @@ -1 +0,0 @@ -gTestsubsuite = 'extensions'; diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/instanceof/browser.js b/tests/auto/declarative/parserstress/tests/ecma_2/instanceof/browser.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/instanceof/instanceof-001.js b/tests/auto/declarative/parserstress/tests/ecma_2/instanceof/instanceof-001.js deleted file mode 100644 index 39ae96fa5b..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/instanceof/instanceof-001.js +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'instanceof-001.js'; - -/** - File Name: instanceof-1.js - ECMA Section: - Description: instanceof operator - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = ""; -var VERSION = "ECMA_2"; -var TITLE = "instanceof operator"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var b = new Boolean(); - -new TestCase( SECTION, - "var b = new Boolean(); b instanceof Boolean", - true, - b instanceof Boolean ); - -new TestCase( SECTION, - "b instanceof Object", - true, - b instanceof Object ); - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/instanceof/instanceof-002.js b/tests/auto/declarative/parserstress/tests/ecma_2/instanceof/instanceof-002.js deleted file mode 100644 index c35fcb0486..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/instanceof/instanceof-002.js +++ /dev/null @@ -1,84 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'instanceof-002.js'; - -/** - File Name: - ECMA Section: - Description: Call Objects - - - - Author: christine@netscape.com - Date: 12 november 1997 -*/ -var SECTION = ""; -var VERSION = "ECMA_2"; -var TITLE = "The Call Constructor"; - -startTest(); -writeHeaderToLog( SECTION + " "+ TITLE); - -var b = new Boolean(); - -new TestCase( SECTION, - "var b = new Boolean(); b instanceof Boolean", - true, - b instanceof Boolean ); - -new TestCase( SECTION, - "b instanceof Object", - true, - b instanceof Object ); - -new TestCase( SECTION, - "b instanceof Array", - false, - b instanceof Array ); - -new TestCase( SECTION, - "true instanceof Boolean", - false, - true instanceof Boolean ); - -new TestCase( SECTION, - "Boolean instanceof Object", - true, - Boolean instanceof Object ); -test(); - diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/instanceof/instanceof-003.js b/tests/auto/declarative/parserstress/tests/ecma_2/instanceof/instanceof-003.js deleted file mode 100644 index 6c1279f865..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/instanceof/instanceof-003.js +++ /dev/null @@ -1,98 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communication Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'instanceof-003.js'; - -/** - File Name: instanceof-003.js - ECMA Section: - Description: http://bugzilla.mozilla.org/show_bug.cgi?id=7635 - - js> function Foo() {} - js> theproto = {}; - [object Object] - js> Foo.prototype = theproto - [object Object] - js> theproto instanceof Foo - true - - I think this should be 'false' - - - Author: christine@netscape.com - Date: 12 november 1997 - - Modified to conform to ECMA3 - https://bugzilla.mozilla.org/show_bug.cgi?id=281606 -*/ -var SECTION = "instanceof-003"; -var VERSION = "ECMA_2"; -var TITLE = "instanceof operator"; -var BUGNUMBER ="7635"; - -startTest(); - -function Foo() {}; -theproto = {}; -Foo.prototype = theproto; - -AddTestCase( - "function Foo() = {}; theproto = {}; Foo.prototype = theproto; " + - "theproto instanceof Foo", - false, - theproto instanceof Foo ); - - -var o = {}; - -// https://bugzilla.mozilla.org/show_bug.cgi?id=281606 -try -{ - AddTestCase( - "o = {}; o instanceof o", - "error", - o instanceof o ); -} -catch(e) -{ - AddTestCase( - "o = {}; o instanceof o", - "error", - "error" ); -} - -test(); diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/instanceof/regress-7635.js b/tests/auto/declarative/parserstress/tests/ecma_2/instanceof/regress-7635.js deleted file mode 100644 index c643920b04..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/instanceof/regress-7635.js +++ /dev/null @@ -1,88 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'regress-7635.js'; - -/** - * File Name: regress-7635.js - * Reference: http://bugzilla.mozilla.org/show_bug.cgi?id=7635 - * Description: instanceof tweaks - * Author: - */ - -var SECTION = "instanceof"; // provide a document reference (ie, ECMA section) -var VERSION = "ECMA_2"; // Version of JavaScript or ECMA -var TITLE = "Regression test for Bugzilla #7635"; // Provide ECMA section title or a description -var BUGNUMBER = "7635"; // Provide URL to bugsplat or bugzilla report - -startTest(); // leave this alone - -/* - * Calls to AddTestCase here. AddTestCase is a function that is defined - * in shell.js and takes three arguments: - * - a string representation of what is being tested - * - the expected result - * - the actual result - * - * For example, a test might look like this: - * - * var zip = /[\d]{5}$/; - * - * AddTestCase( - * "zip = /[\d]{5}$/; \"PO Box 12345 Boston, MA 02134\".match(zip)", // description of the test - * "02134", // expected result - * "PO Box 12345 Boston, MA 02134".match(zip) ); // actual result - * - */ - -function Foo() {} -theproto = {}; -Foo.prototype = theproto - theproto instanceof Foo - - - AddTestCase( "function Foo() {}; theproto = {}; Foo.prototype = theproto; theproto instanceof Foo", - false, - theproto instanceof Foo ); - -var f = new Function(); - -AddTestCase( "var f = new Function(); f instanceof f", false, f instanceof f ); - - -test(); // leave this alone. this executes the test cases and -// displays results. diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/instanceof/shell.js b/tests/auto/declarative/parserstress/tests/ecma_2/instanceof/shell.js deleted file mode 100644 index b390356c38..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/instanceof/shell.js +++ /dev/null @@ -1 +0,0 @@ -gTestsubsuite = 'instanceof'; diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/jsref.js b/tests/auto/declarative/parserstress/tests/ecma_2/jsref.js deleted file mode 100644 index e5a3ddfeed..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/jsref.js +++ /dev/null @@ -1,591 +0,0 @@ -var completed = false; -var testcases; -var tc = 0; - -SECTION = ""; -VERSION = ""; -BUGNUMBER = ""; -EXCLUDE = ""; -BUGNUMBER = ""; - - -TZ_DIFF = -8; - -var TT = ""; -var TT_ = ""; -var BR = ""; -var NBSP = " "; -var CR = "\n"; -var FONT = ""; -var FONT_ = ""; -var FONT_RED = ""; -var FONT_GREEN = ""; -var B = ""; -var B_ = "" -var H2 = ""; -var H2_ = ""; -var HR = ""; -var DEBUG = false; - - -var PASSED = " PASSED!" -var FAILED = " FAILED! expected: "; -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 TestCase( n, d, e, a ) { - this.name = n; - this.description = d; - this.expect = e; - this.actual = a; - this.passed = true; - this.reason = ""; - this.bugnumber = BUGNUMBER; - - this.passed = getTestCaseResult( this.expect, this.actual ); - if ( DEBUG ) { - print( "added " + this.description ); - } -} -function startTest() { - // JavaScript 1.3 is supposed to be compliant ecma version 1.0 - if ( VERSION == "ECMA_1" ) { - version ( "130" ); - } - if ( VERSION == "JS_13" ) { - version ( "130" ); - } - if ( VERSION == "JS_12" ) { - version ( "120" ); - } - if ( VERSION == "JS_11" ) { - version ( "110" ); - } - // for ecma version 2.0, we will leave the javascript version to - // the default ( for now ). - writeHeaderToLog( SECTION + " "+ TITLE); - testcases = new Array(); - tc = 0; - -} -function getTestCaseResult( expect, actual ) { - // because ( NaN == NaN ) always returns false, need to do - // a special compare to see if we got the right result. - if ( actual != actual ) { - if ( typeof actual == "object" ) { - actual = "NaN object"; - } else { - actual = "NaN number"; - } - } - if ( expect != expect ) { - if ( typeof expect == "object" ) { - expect = "NaN object"; - } else { - expect = "NaN number"; - } - } - - var passed = ( expect == actual ) ? true : false; - - // if both objects are numbers - // need to replace w/ IEEE standard for rounding - if ( !passed - && typeof(actual) == "number" - && typeof(expect) == "number" - ) { - if ( Math.abs(actual-expect) < 0.0000001 ) { - passed = true; - } - } - - // verify type is the same - if ( typeof(expect) != typeof(actual) ) { - passed = false; - } - - return passed; -} -function writeTestCaseResult( expect, actual, string ) { - var passed = getTestCaseResult( expect, actual ); - writeFormattedResult( expect, actual, string, passed ); - return passed; -} -function writeFormattedResult( expect, actual, string, passed ) { - var s = TT + string ; - - for ( k = 0; - k < (60 - string.length >= 0 ? 60 - string.length : 5) ; - k++ ) { - } - - s += B ; - s += ( passed ) ? FONT_GREEN + NBSP + PASSED : FONT_RED + NBSP + FAILED + expect + TT_ ; - - print( s + FONT_ + B_ + TT_ ); - - return passed; -} - -function writeHeaderToLog( string ) { - print( H2 + string + H2_ ); -} -function stopTest() -{ - var sizeTag = "<#TEST CASES SIZE>"; - var doneTag = "<#TEST CASES DONE>"; - var beginTag = "<#TEST CASE "; - var endTag = ">"; - - print(sizeTag); - print(testcases.length); - for (tc = 0; tc < testcases.length; tc++) - { - print(beginTag + 'PASSED' + endTag); - print(testcases[tc].passed); - print(beginTag + 'NAME' + endTag); - print(testcases[tc].name); - print(beginTag + 'EXPECTED' + endTag); - print(testcases[tc].expect); - print(beginTag + 'ACTUAL' + endTag); - print(testcases[tc].actual); - print(beginTag + 'DESCRIPTION' + endTag); - print(testcases[tc].description); - print(beginTag + 'REASON' + endTag); - print(( testcases[tc].passed ) ? "" : "wrong value "); - print(beginTag + 'BUGNUMBER' + endTag); - print( BUGNUMBER ); - } - print(doneTag); - print( HR ); - gc(); -} -function getFailedCases() { - for ( var i = 0; i < testcases.length; i++ ) { - if ( ! testcases[i].passed ) { - print( testcases[i].description +" = " +testcases[i].actual +" expected: "+ testcases[i].expect ); - } - } -} -function err( msg, page, line ) { - testcases[tc].actual = "error"; - testcases[tc].reason = msg; - writeTestCaseResult( testcases[tc].expect, - testcases[tc].actual, - testcases[tc].description +" = "+ testcases[tc].actual + - ": " + testcases[tc].reason ); - stopTest(); - return true; -} - -/** - * Type Conversion functions used by Type Conversion - * - */ - - - - /* - * Date functions used by tests in Date suite - * - */ -var msPerDay = 86400000; -var HoursPerDay = 24; -var MinutesPerHour = 60; -var SecondsPerMinute = 60; -var msPerSecond = 1000; -var msPerMinute = 60000; // msPerSecond * SecondsPerMinute -var msPerHour = 3600000; // msPerMinute * MinutesPerHour - -var TIME_1970 = 0; -var TIME_2000 = 946684800000; -var TIME_1900 = -2208988800000; - -function Day( t ) { - return ( Math.floor(t/msPerDay ) ); -} -function DaysInYear( y ) { - if ( y % 4 != 0 ) { - return 365; - } - if ( (y % 4 == 0) && (y % 100 != 0) ) { - return 366; - } - if ( (y % 100 == 0) && (y % 400 != 0) ) { - return 365; - } - if ( (y % 400 == 0) ){ - return 366; - } else { - return "ERROR: DaysInYear(" + y + ") case not covered"; - } -} -function TimeInYear( y ) { - return ( DaysInYear(y) * msPerDay ); -} -function DayNumber( t ) { - return ( Math.floor( t / msPerDay ) ); -} -function TimeWithinDay( t ) { - if ( t < 0 ) { - return ( (t % msPerDay) + msPerDay ); - } else { - return ( t % msPerDay ); - } -} -function YearNumber( t ) { -} -function TimeFromYear( y ) { - return ( msPerDay * DayFromYear(y) ); -} -function DayFromYear( y ) { - return ( 365*(y-1970) + - Math.floor((y-1969)/4) - - Math.floor((y-1901)/100) + - Math.floor((y-1601)/400) ); -} -function InLeapYear( t ) { - if ( DaysInYear(YearFromTime(t)) == 365 ) { - return 0; - } - if ( DaysInYear(YearFromTime(t)) == 366 ) { - return 1; - } else { - return "ERROR: InLeapYear("+t+") case not covered"; - } -} -function YearFromTime( t ) { - t = Number( t ); - var sign = ( t < 0 ) ? -1 : 1; - var year = ( sign < 0 ) ? 1969 : 1970; - for ( var timeToTimeZero = t; ; ) { - // subtract the current year's time from the time that's left. - timeToTimeZero -= sign * TimeInYear(year) - - // if there's less than the current year's worth of time left, then break. - if ( sign < 0 ) { - if ( sign * timeToTimeZero <= 0 ) { - break; - } else { - year += sign; - } - } else { - if ( sign * timeToTimeZero < 0 ) { - break; - } else { - year += sign; - } - } - } - return ( year ); -} -function MonthFromTime( t ) { - // i know i could use switch but i'd rather not until it's part of ECMA - var day = DayWithinYear( t ); - var leap = InLeapYear(t); - - if ( (0 <= day) && (day < 31) ) { - return 0; - } - if ( (31 <= day) && (day < (59+leap)) ) { - return 1; - } - if ( ((59+leap) <= day) && (day < (90+leap)) ) { - return 2; - } - if ( ((90+leap) <= day) && (day < (120+leap)) ) { - return 3; - } - if ( ((120+leap) <= day) && (day < (151+leap)) ) { - return 4; - } - if ( ((151+leap) <= day) && (day < (181+leap)) ) { - return 5; - } - if ( ((181+leap) <= day) && (day < (212+leap)) ) { - return 6; - } - if ( ((212+leap) <= day) && (day < (243+leap)) ) { - return 7; - } - if ( ((243+leap) <= day) && (day < (273+leap)) ) { - return 8; - } - if ( ((273+leap) <= day) && (day < (304+leap)) ) { - return 9; - } - if ( ((304+leap) <= day) && (day < (334+leap)) ) { - return 10; - } - if ( ((334+leap) <= day) && (day < (365+leap)) ) { - return 11; - } else { - return "ERROR: MonthFromTime("+t+") not known"; - } -} -function DayWithinYear( t ) { - return( Day(t) - DayFromYear(YearFromTime(t))); -} -function DateFromTime( t ) { - var day = DayWithinYear(t); - var month = MonthFromTime(t); - - if ( month == 0 ) { - return ( day + 1 ); - } - if ( month == 1 ) { - return ( day - 30 ); - } - if ( month == 2 ) { - return ( day - 58 - InLeapYear(t) ); - } - if ( month == 3 ) { - return ( day - 89 - InLeapYear(t)); - } - if ( month == 4 ) { - return ( day - 119 - InLeapYear(t)); - } - if ( month == 5 ) { - return ( day - 150- InLeapYear(t)); - } - if ( month == 6 ) { - return ( day - 180- InLeapYear(t)); - } - if ( month == 7 ) { - return ( day - 211- InLeapYear(t)); - } - if ( month == 8 ) { - return ( day - 242- InLeapYear(t)); - } - if ( month == 9 ) { - return ( day - 272- InLeapYear(t)); - } - if ( month == 10 ) { - return ( day - 303- InLeapYear(t)); - } - if ( month == 11 ) { - return ( day - 333- InLeapYear(t)); - } - - return ("ERROR: DateFromTime("+t+") not known" ); -} -function WeekDay( t ) { - var weekday = (Day(t)+4) % 7; - return( weekday < 0 ? 7 + weekday : weekday ); -} - -// missing daylight savins time adjustment - -function HourFromTime( t ) { - var h = Math.floor( t / msPerHour ) % HoursPerDay; - return ( (h<0) ? HoursPerDay + h : h ); -} -function MinFromTime( t ) { - var min = Math.floor( t / msPerMinute ) % MinutesPerHour; - return( ( min < 0 ) ? MinutesPerHour + min : min ); -} -function SecFromTime( t ) { - var sec = Math.floor( t / msPerSecond ) % SecondsPerMinute; - return ( (sec < 0 ) ? SecondsPerMinute + sec : sec ); -} -function msFromTime( t ) { - var ms = t % msPerSecond; - return ( (ms < 0 ) ? msPerSecond + ms : ms ); -} -function LocalTZA() { - return ( TZ_DIFF * msPerHour ); -} -function UTC( t ) { - return ( t - LocalTZA() - DaylightSavingTA(t - LocalTZA()) ); -} -function DaylightSavingTA( t ) { - t = t - LocalTZA(); - - var dst_start = GetFirstSundayInApril(t) + 2*msPerHour; - var dst_end = GetLastSundayInOctober(t)+ 2*msPerHour; - - if ( t >= dst_start && t < dst_end ) { - return msPerHour; - } else { - return 0; - } - - // Daylight Savings Time starts on the first Sunday in April at 2:00AM in - // PST. Other time zones will need to override this function. - - print( new Date( UTC(dst_start + LocalTZA())) ); - - return UTC(dst_start + LocalTZA()); -} -function GetFirstSundayInApril( t ) { - var year = YearFromTime(t); - var leap = InLeapYear(t); - - var april = TimeFromYear(year) + TimeInMonth(0, leap) + TimeInMonth(1,leap) + - TimeInMonth(2,leap); - - for ( var first_sunday = april; WeekDay(first_sunday) > 0; - first_sunday += msPerDay ) - { - ; - } - - return first_sunday; -} -function GetLastSundayInOctober( t ) { - var year = YearFromTime(t); - var leap = InLeapYear(t); - - for ( var oct = TimeFromYear(year), m = 0; m < 9; m++ ) { - oct += TimeInMonth(m, leap); - } - for ( var last_sunday = oct + 30*msPerDay; WeekDay(last_sunday) > 0; - last_sunday -= msPerDay ) - { - ; - } - return last_sunday; -} -function LocalTime( t ) { - return ( t + LocalTZA() + DaylightSavingTA(t) ); -} -function MakeTime( hour, min, sec, ms ) { - if ( isNaN( hour ) || isNaN( min ) || isNaN( sec ) || isNaN( ms ) ) { - return Number.NaN; - } - - hour = ToInteger(hour); - min = ToInteger( min); - sec = ToInteger( sec); - ms = ToInteger( ms ); - - return( (hour*msPerHour) + (min*msPerMinute) + - (sec*msPerSecond) + ms ); -} -function MakeDay( year, month, date ) { - if ( isNaN(year) || isNaN(month) || isNaN(date) ) { - return Number.NaN; - } - year = ToInteger(year); - month = ToInteger(month); - date = ToInteger(date ); - - var sign = ( year < 1970 ) ? -1 : 1; - var t = ( year < 1970 ) ? 1 : 0; - var y = ( year < 1970 ) ? 1969 : 1970; - - var result5 = year + Math.floor( month/12 ); - var result6 = month % 12; - - if ( year < 1970 ) { - for ( y = 1969; y >= year; y += sign ) { - t += sign * TimeInYear(y); - } - } else { - for ( y = 1970 ; y < year; y += sign ) { - t += sign * TimeInYear(y); - } - } - - var leap = InLeapYear( t ); - - for ( var m = 0; m < month; m++ ) { - t += TimeInMonth( m, leap ); - } - - if ( YearFromTime(t) != result5 ) { - return Number.NaN; - } - if ( MonthFromTime(t) != result6 ) { - return Number.NaN; - } - if ( DateFromTime(t) != 1 ) { - return Number.NaN; - } - - return ( (Day(t)) + date - 1 ); -} -function TimeInMonth( month, leap ) { - // september april june november - // jan 0 feb 1 mar 2 apr 3 may 4 june 5 jul 6 - // aug 7 sep 8 oct 9 nov 10 dec 11 - - if ( month == 3 || month == 5 || month == 8 || month == 10 ) { - return ( 30*msPerDay ); - } - - // all the rest - if ( month == 0 || month == 2 || month == 4 || month == 6 || - month == 7 || month == 9 || month == 11 ) { - return ( 31*msPerDay ); - } - - // save february - return ( (leap == 0) ? 28*msPerDay : 29*msPerDay ); -} -function MakeDate( day, time ) { - if ( day == Number.POSITIVE_INFINITY || - day == Number.NEGATIVE_INFINITY || - day == Number.NaN ) { - return Number.NaN; - } - if ( time == Number.POSITIVE_INFINITY || - time == Number.POSITIVE_INFINITY || - day == Number.NaN) { - return Number.NaN; - } - return ( day * msPerDay ) + time; -} -function TimeClip( t ) { - if ( isNaN( t ) ) { - return ( Number.NaN ); - } - if ( Math.abs( t ) > 8.64e15 ) { - return ( Number.NaN ); - } - - return ( ToInteger( t ) ); -} -function ToInteger( t ) { - t = Number( t ); - - if ( isNaN( t ) ){ - return ( Number.NaN ); - } - if ( t == 0 || t == -0 || - t == Number.POSITIVE_INFINITY || t == Number.NEGATIVE_INFINITY ) { - return 0; - } - - var sign = ( t < 0 ) ? -1 : 1; - - return ( sign * Math.floor( Math.abs( t ) ) ); -} -function Enumerate ( o ) { - var properties = new Array(); - for ( p in o ) { - properties[ properties.length ] = new Array( p, o[p] ); - } - return properties; -} -function AddTestCase( description, expect, actual ) { - testcases[tc++] = new TestCase( SECTION, description, expect, actual ); -} -function getFailedCases() { - for ( var i = 0; i < testcases.length; i++ ) { - if ( ! testcases[i].passed ) { - print( testcases[i].description +" = " +testcases[i].actual +" expected: "+ testcases[i].expect ); - } - } -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/shell.js b/tests/auto/declarative/parserstress/tests/ecma_2/shell.js deleted file mode 100644 index a83dd68ec2..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/shell.js +++ /dev/null @@ -1,51 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestsuite = 'ecma_2'; - -var TZ_DIFF = getTimeZoneDiff(); - -/* - * Originally, the test suite used a hard-coded value TZ_DIFF = -8. - * But that was only valid for testers in the Pacific Standard Time Zone! - * We calculate the proper number dynamically for any tester. We just - * have to be careful to use a date not subject to Daylight Savings Time... - */ -function getTimeZoneDiff() -{ - return -((new Date(2000, 1, 1)).getTimezoneOffset())/60; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_2/template.js b/tests/auto/declarative/parserstress/tests/ecma_2/template.js deleted file mode 100644 index 83397ba7b3..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_2/template.js +++ /dev/null @@ -1,57 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Mozilla Foundation. - * Portions created by the Initial Developer are Copyright (C) 2008 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -gTestfile = 'template.js'; - -/** - * File Name: template.js - * Reference: ** replace with bugzilla URL or document reference ** - * Description: ** replace with description of test ** - * Author: ** replace with your e-mail address ** - */ - -var SECTION = ""; // if ECMA test, provide section number -var VERSION = "ECMA_2"; // Version of JavaScript or ECMA -var TITLE = ""; // Provide ECMA section title or description -var BUGNUMBER = ""; // Provide URL to bugsplat or bugzilla report - -startTest(); // leave this alone - - -/* Calls to AddTestCase here */ - -test(); // leave this alone diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/Array/15.4.4.11-01.js b/tests/auto/declarative/parserstress/tests/ecma_3/Array/15.4.4.11-01.js deleted file mode 100755 index 0436b8c1e0..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/Array/15.4.4.11-01.js +++ /dev/null @@ -1,61 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Mozilla Foundation. - * Portions created by the Initial Developer are Copyright (C) 2005 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Igor Bukanov - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -var gTestfile = '15.4.4.11-01.js'; -//----------------------------------------------------------------------------- -var BUGNUMBER = 312138; -var summary = 'Array.sort should not eat exceptions'; -var actual = ''; -var expect = ''; - -printBugNumber(BUGNUMBER); -printStatus (summary); - -expect = "e=1 N=1"; - -var N = 0; -var array = [4,3,2,1]; - -try { - array.sort(function() { - throw ++N; - }); -} catch (e) { - actual = ("e="+e+" N="+N); -} - -reportCompare(expect, actual, summary); diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/Array/15.4.4.3-1.js b/tests/auto/declarative/parserstress/tests/ecma_3/Array/15.4.4.3-1.js deleted file mode 100644 index e3de6fb116..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/Array/15.4.4.3-1.js +++ /dev/null @@ -1,88 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * pschwartau@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * Date: 12 Mar 2001 - * - * - * SUMMARY: Testing Array.prototype.toLocaleString() - * See http://bugzilla.mozilla.org/show_bug.cgi?id=56883 - * See http://bugzilla.mozilla.org/show_bug.cgi?id=58031 - * - * By ECMA3 15.4.4.3, myArray.toLocaleString() means that toLocaleString() - * should be applied to each element of the array, and the results should be - * concatenated with an implementation-specific delimiter. For example: - * - * myArray[0].toLocaleString() + ',' + myArray[1].toLocaleString() + etc. - * - * In this testcase toLocaleString is a user-defined property of each - * array element; therefore it is the function that should be - * invoked. This function increments a global variable. Therefore the - * end value of this variable should be myArray.length. - */ -//----------------------------------------------------------------------------- -var gTestfile = '15.4.4.3-1.js'; -var BUGNUMBER = 56883; -var summary = 'Testing Array.prototype.toLocaleString() -'; -var actual = ''; -var expect = ''; -var n = 0; -var obj = {toLocaleString: function() {n++}}; -var myArray = [obj, obj, obj]; - - -myArray.toLocaleString(); -actual = n; -expect = 3; // (see explanation above) - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - reportCompare(expect, actual, summary); - - exitFunc ('test'); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/Array/15.4.4.4-001.js b/tests/auto/declarative/parserstress/tests/ecma_3/Array/15.4.4.4-001.js deleted file mode 100644 index b87233ea97..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/Array/15.4.4.4-001.js +++ /dev/null @@ -1,153 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * george@vanous.com, igor@icesoft.no, pschwartau@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * - * Date: 19 September 2002 - * SUMMARY: Testing Array.prototype.concat() - * See http://bugzilla.mozilla.org/show_bug.cgi?id=169795 - * - */ -//----------------------------------------------------------------------------- -var gTestfile = '15.4.4.4-001.js'; -var UBound = 0; -var BUGNUMBER = 169795; -var summary = 'Testing Array.prototype.concat()'; -var status = ''; -var statusitems = []; -var actual = ''; -var actualvalues = []; -var expect= ''; -var expectedvalues = []; -var x; - - -status = inSection(1); -x = "Hello"; -actual = [].concat(x).toString(); -expect = x.toString(); -addThis(); - -status = inSection(2); -x = 999; -actual = [].concat(x).toString(); -expect = x.toString(); -addThis(); - -status = inSection(3); -x = /Hello/g; -actual = [].concat(x).toString(); -expect = x.toString(); -addThis(); - -status = inSection(4); -x = new Error("Hello"); -actual = [].concat(x).toString(); -expect = x.toString(); -addThis(); - -status = inSection(5); -x = function() {return "Hello";}; -actual = [].concat(x).toString(); -expect = x.toString(); -addThis(); - -status = inSection(6); -x = [function() {return "Hello";}]; -actual = [].concat(x).toString(); -expect = x.toString(); -addThis(); - -status = inSection(7); -x = [1,2,3].concat([4,5,6]); -actual = [].concat(x).toString(); -expect = x.toString(); -addThis(); - -status = inSection(8); -x = eval('this'); -actual = [].concat(x).toString(); -expect = x.toString(); -addThis(); - -/* - * The next two sections are by igor@icesoft.no; see - * http://bugzilla.mozilla.org/show_bug.cgi?id=169795#c3 - */ -status = inSection(9); -x={length:0}; -actual = [].concat(x).toString(); -expect = x.toString(); -addThis(); - -status = inSection(10); -x={length:2, 0:0, 1:1}; -actual = [].concat(x).toString(); -expect = x.toString(); -addThis(); - - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - - - -function addThis() -{ - statusitems[UBound] = status; - actualvalues[UBound] = actual; - expectedvalues[UBound] = expect; - UBound++; -} - - -function test() -{ - enterFunc('test'); - printBugNumber(BUGNUMBER); - printStatus(summary); - - for (var i=0; i - * See http://bugzilla.mozilla.org/show_bug.cgi?id=101488 - * - * Without the "new" keyword, assigning arr.length = Number(n) worked. - * But with it, Rhino was giving an error "Inappropriate array length" - * and SpiderMonkey was exiting without giving any error or return value - - * - * Comments on the Rhino code by igor@icesoft.no: - * - * jsSet_length requires that the new length value should be an instance - * of Number. But according to Ecma 15.4.5.1, item 12-13, an error should - * be thrown only if ToUint32(length_value) != ToNumber(length_value) - */ -//----------------------------------------------------------------------------- -var gTestfile = 'regress-101488.js'; -var UBound = 0; -var BUGNUMBER = 101488; -var summary = 'Try assigning arr.length = new Number(n)'; -var status = ''; -var statusitems = []; -var actual = ''; -var actualvalues = []; -var expect= ''; -var expectedvalues = []; -var arr = []; - - -status = inSection(1); -arr = Array(); -tryThis('arr.length = new Number(1);'); -actual = arr.length; -expect = 1; -addThis(); - -status = inSection(2); -arr = Array(5); -tryThis('arr.length = new Number(1);'); -actual = arr.length; -expect = 1; -addThis(); - -status = inSection(3); -arr = Array(); -tryThis('arr.length = new Number(17);'); -actual = arr.length; -expect = 17; -addThis(); - -status = inSection(4); -arr = Array(5); -tryThis('arr.length = new Number(17);'); -actual = arr.length; -expect = 17; -addThis(); - - -/* - * Also try the above with the "new" keyword before Array(). - * Array() and new Array() should be equivalent, by ECMA 15.4.1.1 - */ -status = inSection(5); -arr = new Array(); -tryThis('arr.length = new Number(1);'); -actual = arr.length; -expect = 1; -addThis(); - -status = inSection(6); -arr = new Array(5); -tryThis('arr.length = new Number(1);'); -actual = arr.length; -expect = 1; -addThis(); - -arr = new Array(); -tryThis('arr.length = new Number(17);'); -actual = arr.length; -expect = 17; -addThis(); - -status = inSection(7); -arr = new Array(5); -tryThis('arr.length = new Number(17);'); -actual = arr.length; -expect = 17; -addThis(); - - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - - - -function tryThis(s) -{ - try - { - eval(s); - } - catch(e) - { - // keep going - } -} - - -function addThis() -{ - statusitems[UBound] = status; - actualvalues[UBound] = actual; - expectedvalues[UBound] = expect; - UBound++; -} - - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - for (var i=0; i= dst_start && t < dst_end ) - return msPerHour; - - return 0; -} - -function GetFirstSundayInMonth( t, m ) { - var year = YearFromTime(t); - var leap = InLeapYear(t); - -// month m 0..11 -// april == 3 -// march == 2 - - // set time to first day of month m - var time = TimeFromYear(year); - for (var i = 0; i < m; ++i) - { - time += TimeInMonth(i, leap); - } - - for ( var first_sunday = time; WeekDay(first_sunday) > 0; - first_sunday += msPerDay ) - { - ; - } - - return first_sunday; -} - -function GetLastSundayInMonth( t, m ) { - var year = YearFromTime(t); - var leap = InLeapYear(t); - -// month m 0..11 -// april == 3 -// march == 2 - - // first day of following month - var time = TimeFromYear(year); - for (var i = 0; i <= m; ++i) - { - time += TimeInMonth(i, leap); - } - // prev day == last day of month - time -= msPerDay; - - for ( var last_sunday = time; WeekDay(last_sunday) > 0; - last_sunday -= msPerDay ) - { - ; - } - return last_sunday; -} - -/* - 15.9.1.9 Daylight Saving Time Adjustment - - The implementation of ECMAScript should not try to determine whether - the exact time was subject to daylight saving time, but just whether - daylight saving time would have been in effect if the current - daylight saving time algorithm had been used at the time. This avoids - complications such as taking into account the years that the locale - observed daylight saving time year round. -*/ - -/* - US DST algorithm - - Before 2007, DST starts first Sunday in April at 2 AM and ends last - Sunday in October at 2 AM - - Starting in 2007, DST starts second Sunday in March at 2 AM and ends - first Sunday in November at 2 AM - - Note that different operating systems behave differently. - - Fully patched Windows XP uses the 2007 algorithm for all dates while - fully patched Fedora Core 6 and RHEL 4 Linux use the algorithm in - effect at the time. - - Since pre-2007 DST is a subset of 2007 DST rules, this only affects - tests that occur in the period Mar-Apr and Oct-Nov where the two - algorithms do not agree. - -*/ - -function GetDSTStart( t ) -{ - return (GetFirstSundayInMonth(t, 2) + 7*msPerDay + 2*msPerHour - LocalTZA()); -} - -function GetDSTEnd( t ) -{ - return (GetFirstSundayInMonth(t, 10) + 2*msPerHour - LocalTZA()); -} - -function GetOldDSTStart( t ) -{ - return (GetFirstSundayInMonth(t, 3) + 2*msPerHour - LocalTZA()); -} - -function GetOldDSTEnd( t ) -{ - return (GetLastSundayInMonth(t, 9) + 2*msPerHour - LocalTZA()); -} - -function LocalTime( t ) { - return ( t + LocalTZA() + DaylightSavingTA(t) ); -} -function MakeTime( hour, min, sec, ms ) { - if ( isNaN( hour ) || isNaN( min ) || isNaN( sec ) || isNaN( ms ) ) { - return Number.NaN; - } - - hour = ToInteger(hour); - min = ToInteger( min); - sec = ToInteger( sec); - ms = ToInteger( ms ); - - return( (hour*msPerHour) + (min*msPerMinute) + - (sec*msPerSecond) + ms ); -} -function MakeDay( year, month, date ) { - if ( isNaN(year) || isNaN(month) || isNaN(date) ) { - return Number.NaN; - } - year = ToInteger(year); - month = ToInteger(month); - date = ToInteger(date ); - - var sign = ( year < 1970 ) ? -1 : 1; - var t = ( year < 1970 ) ? 1 : 0; - var y = ( year < 1970 ) ? 1969 : 1970; - - var result5 = year + Math.floor( month/12 ); - var result6 = month % 12; - - if ( year < 1970 ) { - for ( y = 1969; y >= year; y += sign ) { - t += sign * TimeInYear(y); - } - } else { - for ( y = 1970 ; y < year; y += sign ) { - t += sign * TimeInYear(y); - } - } - - var leap = InLeapYear( t ); - - for ( var m = 0; m < month; m++ ) { - t += TimeInMonth( m, leap ); - } - - if ( YearFromTime(t) != result5 ) { - return Number.NaN; - } - if ( MonthFromTime(t) != result6 ) { - return Number.NaN; - } - if ( DateFromTime(t) != 1 ) { - return Number.NaN; - } - - return ( (Day(t)) + date - 1 ); -} -function TimeInMonth( month, leap ) { - // september april june november - // jan 0 feb 1 mar 2 apr 3 may 4 june 5 jul 6 - // aug 7 sep 8 oct 9 nov 10 dec 11 - - if ( month == 3 || month == 5 || month == 8 || month == 10 ) { - return ( 30*msPerDay ); - } - - // all the rest - if ( month == 0 || month == 2 || month == 4 || month == 6 || - month == 7 || month == 9 || month == 11 ) { - return ( 31*msPerDay ); - } - - // save february - return ( (leap == 0) ? 28*msPerDay : 29*msPerDay ); -} -function MakeDate( day, time ) { - if ( day == Number.POSITIVE_INFINITY || - day == Number.NEGATIVE_INFINITY ) { - return Number.NaN; - } - if ( time == Number.POSITIVE_INFINITY || - time == Number.NEGATIVE_INFINITY ) { - return Number.NaN; - } - return ( day * msPerDay ) + time; -} -function TimeClip( t ) { - if ( isNaN( t ) ) { - return ( Number.NaN ); - } - if ( Math.abs( t ) > 8.64e15 ) { - return ( Number.NaN ); - } - - return ( ToInteger( t ) ); -} -function ToInteger( t ) { - t = Number( t ); - - if ( isNaN( t ) ){ - return ( Number.NaN ); - } - if ( t == 0 || t == -0 || - t == Number.POSITIVE_INFINITY || t == Number.NEGATIVE_INFINITY ) { - return 0; - } - - var sign = ( t < 0 ) ? -1 : 1; - - return ( sign * Math.floor( Math.abs( t ) ) ); -} -function Enumerate ( o ) { - var p; - for ( p in o ) { - print( p +": " + o[p] ); - } -} - diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/Exceptions/15.11.1.1.js b/tests/auto/declarative/parserstress/tests/ecma_3/Exceptions/15.11.1.1.js deleted file mode 100644 index 6910d76f15..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/Exceptions/15.11.1.1.js +++ /dev/null @@ -1,137 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * joerg.schaible@gmx.de - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * - * Date: 27 Nov 2002 - * SUMMARY: Ensuring normal function call of Error (ECMA-262 Ed.3 15.11.1.1). - */ -//----------------------------------------------------------------------------- -var gTestfile = '15.11.1.1.js'; -var UBound = 0; -var BUGNUMBER = ''; -var summary = 'Ensuring normal function call of Error (ECMA-262 Ed.3 15.11.1.1)'; -var status = ''; -var statusitems = []; -var actual = ''; -var actualvalues = []; -var expect= ''; -var expectedvalues = []; -var EMPTY_STRING = ''; -var EXPECTED_FORMAT = 0; - - -function otherScope(msg) -{ - return Error(msg); -} - - -status = inSection(1); -var err1 = Error('msg1'); -actual = examineThis(err1, 'msg1'); -expect = EXPECTED_FORMAT; -addThis(); - -status = inSection(2); -var err2 = otherScope('msg2'); -actual = examineThis(err2, 'msg2'); -expect = EXPECTED_FORMAT; -addThis(); - -status = inSection(3); -var err3 = otherScope(); -actual = examineThis(err3, EMPTY_STRING); -expect = EXPECTED_FORMAT; -addThis(); - -status = inSection(4); -var err4 = eval("Error('msg4')"); -actual = examineThis(err4, 'msg4'); -expect = EXPECTED_FORMAT; -addThis(); - - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - - - -/* - * Searches err.toString() for err.name + ':' + err.message, - * with possible whitespace on each side of the colon sign. - * - * We allow for no colon in case err.message was not provided by the user. - * In such a case, SpiderMonkey and Rhino currently set err.message = '', - * as allowed for by ECMA 15.11.4.3. This makes |pattern| work in this case. - * - * If this is ever changed to a non-empty string, e.g. 'undefined', - * you may have to modify |pattern| to take that into account - - * - */ -function examineThis(err, msg) -{ - var pattern = err.name + '\\s*:?\\s*' + msg; - return err.toString().search(RegExp(pattern)); -} - - -function addThis() -{ - statusitems[UBound] = status; - actualvalues[UBound] = actual; - expectedvalues[UBound] = expect; - UBound++; -} - - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - for (var i = 0; i < UBound; i++) - { - reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]); - } - - exitFunc ('test'); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/Exceptions/15.11.4.4-1.js b/tests/auto/declarative/parserstress/tests/ecma_3/Exceptions/15.11.4.4-1.js deleted file mode 100644 index 00f9503041..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/Exceptions/15.11.4.4-1.js +++ /dev/null @@ -1,174 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * d-russo@ti.com, pschwartau@netscape.com, joerg.schaible@gmx.de - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * - * Date: 22 Jan 2002 - * SUMMARY: Testing Error.prototype.toString() - * - * Revised: 25 Nov 2002 - * See http://bugzilla.mozilla.org/show_bug.cgi?id=181909 - * - * Note that ECMA-262 3rd Edition Final, Section 15.11.4.4 states that - * Error.prototype.toString() returns an implementation-dependent string. - * Therefore any testcase on this property is somewhat arbitrary. - * - * However, d-russo@ti.com pointed out that Rhino was returning this: - * - * js> err = new Error() - * undefined: undefined - * - * js> err = new Error("msg") - * undefined: msg - * - * - * We expect Rhino to return what SpiderMonkey currently does: - * - * js> err = new Error() - * Error - * - * js> err = new Error("msg") - * Error: msg - * - * - * i.e. we expect err.toString() === err.name if err.message is not defined; - * otherwise, we expect err.toString() === err.name + ': ' + err.message. - * - * See also ECMA 15.11.4.2, 15.11.4.3 - */ -//----------------------------------------------------------------------------- -var gTestfile = '15.11.4.4-1.js'; -var UBound = 0; -var BUGNUMBER = '(none)'; -var summary = 'Testing Error.prototype.toString()'; -var status = ''; -var statusitems = []; -var actual = ''; -var actualvalues = []; -var expect= ''; -var expectedvalues = []; -var EMPTY_STRING = ''; -var EXPECTED_FORMAT = 0; - - -status = inSection(1); -var err1 = new Error('msg1'); -actual = examineThis(err1, 'msg1'); -expect = EXPECTED_FORMAT; -addThis(); - -status = inSection(2); -var err2 = new Error(err1); -actual = examineThis(err2, err1); -expect = EXPECTED_FORMAT; -addThis(); - -status = inSection(3); -var err3 = new Error(); -actual = examineThis(err3, EMPTY_STRING); -expect = EXPECTED_FORMAT; -addThis(); - -status = inSection(4); -var err4 = new Error(EMPTY_STRING); -actual = examineThis(err4, EMPTY_STRING); -expect = EXPECTED_FORMAT; -addThis(); - -// now generate a run-time error - -status = inSection(5); -try -{ - eval('1=2'); -} -catch(err5) -{ - actual = examineThis(err5, '.*'); -} -expect = EXPECTED_FORMAT; -addThis(); - - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - - - -/* - * Searches err.toString() for err.name + ':' + err.message, - * with possible whitespace on each side of the colon sign. - * - * We allow for no colon in case err.message was not provided by the user. - * In such a case, SpiderMonkey and Rhino currently set err.message = '', - * as allowed for by ECMA 15.11.4.3. This makes |pattern| work in this case. - * - * If this is ever changed to a non-empty string, e.g. 'undefined', - * you may have to modify |pattern| to take that into account - - * - */ -function examineThis(err, msg) -{ - var pattern = err.name + '\\s*:?\\s*' + msg; - return err.toString().search(RegExp(pattern)); -} - - -function addThis() -{ - statusitems[UBound] = status; - actualvalues[UBound] = actual; - expectedvalues[UBound] = expect; - UBound++; -} - - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - for (var i = 0; i < UBound; i++) - { - reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]); - } - - exitFunc ('test'); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/Exceptions/15.11.7.6-001.js b/tests/auto/declarative/parserstress/tests/ecma_3/Exceptions/15.11.7.6-001.js deleted file mode 100644 index c6248cc7c1..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/Exceptions/15.11.7.6-001.js +++ /dev/null @@ -1,130 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2003 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * igor@fastmail.fm, pschwartau@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * - * Date: 14 April 2003 - * SUMMARY: Prototype of predefined error objects should be DontEnum - * See http://bugzilla.mozilla.org/show_bug.cgi?id=201989 - * - */ -//----------------------------------------------------------------------------- -var gTestfile = '15.11.7.6-001.js'; -var UBound = 0; -var BUGNUMBER = 201989; -var summary = 'Prototype of predefined error objects should be DontEnum'; -var status = ''; -var statusitems = []; -var actual = ''; -var actualvalues = []; -var expect= ''; -var expectedvalues = []; - - -/* - * Tests that |F.prototype| is not enumerable in |F| - */ -function testDontEnum(F) -{ - var proto = F.prototype; - - for (var prop in F) - { - if (F[prop] === proto) - return false; - } - return true; -} - - -var list = [ - "Error", - "ConversionError", - "EvalError", - "RangeError", - "ReferenceError", - "SyntaxError", - "TypeError", - "URIError" - ]; - - -for (i in list) -{ - var F = this[list[i]]; - - // Test for |F|; e.g. Rhino defines |ConversionError| while SM does not. - if (F) - { - status = 'Testing DontEnum attribute of |' + list[i] + '.prototype|'; - actual = testDontEnum(F); - expect = true; - addThis(); - } -} - - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - - - -function addThis() -{ - statusitems[UBound] = status; - actualvalues[UBound] = actual; - expectedvalues[UBound] = expect; - UBound++; -} - - -function test() -{ - enterFunc('test'); - printBugNumber(BUGNUMBER); - printStatus(summary); - - for (var i=0; i -1); - expect = true; - addThis(); -} - - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - - -function addThis() -{ - statusitems[UBound] = status; - actualvalues[UBound] = isReferenceError(actual); - expectedvalues[UBound] = isReferenceError(expect); - UBound++; -} - - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - for (var i = 0; i < UBound; i++) - { - reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]); - } - - exitFunc ('test'); -} - - -// converts a Boolean result into a textual result - -function isReferenceError(bResult) -{ - return bResult? ERR_REF_YES : ERR_REF_NO; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/Exceptions/browser.js b/tests/auto/declarative/parserstress/tests/ecma_3/Exceptions/browser.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/Exceptions/regress-181654.js b/tests/auto/declarative/parserstress/tests/ecma_3/Exceptions/regress-181654.js deleted file mode 100644 index 3fe80f15ac..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/Exceptions/regress-181654.js +++ /dev/null @@ -1,155 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * joerg.schaible@gmx.de - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * - * Date: 23 Nov 2002 - * SUMMARY: Calling toString for an object derived from the Error class - * results in an TypeError (Rhino only) - * See http://bugzilla.mozilla.org/show_bug.cgi?id=181654 - */ -//----------------------------------------------------------------------------- -var gTestfile = 'regress-181654.js'; -var UBound = 0; -var BUGNUMBER = '181654'; -var summary = 'Calling toString for an object derived from the Error class should be possible.'; -var status = ''; -var statusitems = []; -var actual = ''; -var actualvalues = []; -var expect= ''; -var expectedvalues = []; -var EMPTY_STRING = ''; -var EXPECTED_FORMAT = 0; - - -// derive MyError from Error -function MyError( msg ) -{ - this.message = msg; -} -MyError.prototype = new Error(); -MyError.prototype.name = "MyError"; - - -status = inSection(1); -var err1 = new MyError('msg1'); -actual = examineThis(err1, 'msg1'); -expect = EXPECTED_FORMAT; -addThis(); - -status = inSection(2); -var err2 = new MyError(String(err1)); -actual = examineThis(err2, err1); -expect = EXPECTED_FORMAT; -addThis(); - -status = inSection(3); -var err3 = new MyError(); -actual = examineThis(err3, EMPTY_STRING); -expect = EXPECTED_FORMAT; -addThis(); - -status = inSection(4); -var err4 = new MyError(EMPTY_STRING); -actual = examineThis(err4, EMPTY_STRING); -expect = EXPECTED_FORMAT; -addThis(); - -// now generate an error - -status = inSection(5); -try -{ - throw new MyError("thrown"); -} -catch(err5) -{ - actual = examineThis(err5, "thrown"); -} -expect = EXPECTED_FORMAT; -addThis(); - - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - - - -/* - * Searches err.toString() for err.name + ':' + err.message, - * with possible whitespace on each side of the colon sign. - * - * We allow for no colon in case err.message was not provided by the user. - * In such a case, SpiderMonkey and Rhino currently set err.message = '', - * as allowed for by ECMA 15.11.4.3. This makes |pattern| work in this case. - * - * If this is ever changed to a non-empty string, e.g. 'undefined', - * you may have to modify |pattern| to take that into account - - * - */ -function examineThis(err, msg) -{ - var pattern = err.name + '\\s*:?\\s*' + msg; - return err.toString().search(RegExp(pattern)); -} - - -function addThis() -{ - statusitems[UBound] = status; - actualvalues[UBound] = actual; - expectedvalues[UBound] = expect; - UBound++; -} - - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - for (var i = 0; i < UBound; i++) - { - reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]); - } - - exitFunc ('test'); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/Exceptions/regress-181914.js b/tests/auto/declarative/parserstress/tests/ecma_3/Exceptions/regress-181914.js deleted file mode 100644 index f4d1f224c8..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/Exceptions/regress-181914.js +++ /dev/null @@ -1,194 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * joerg.schaible@gmx.de, pschwartau@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * - * Date: 25 Nov 2002 - * SUMMARY: Calling a user-defined superconstructor - * See http://bugzilla.mozilla.org/show_bug.cgi?id=181914, esp. Comment 10. - * - */ -//----------------------------------------------------------------------------- -var gTestfile = 'regress-181914.js'; -var UBound = 0; -var BUGNUMBER = '181914'; -var summary = 'Calling a user-defined superconstructor'; -var status = ''; -var statusitems = []; -var actual = ''; -var actualvalues = []; -var expect= ''; -var expectedvalues = []; -var EMPTY_STRING = ''; -var EXPECTED_FORMAT = 0; - - -// make a user-defined version of the Error constructor -function _Error(msg) -{ - this.message = msg; -} -_Error.prototype = new Error(); -_Error.prototype.name = '_Error'; - - -// derive MyApplyError from _Error -function MyApplyError(msg) -{ - if(this instanceof MyApplyError) - _Error.apply(this, arguments); - else - return new MyApplyError(msg); -} -MyApplyError.prototype = new _Error(); -MyApplyError.prototype.name = "MyApplyError"; - - -// derive MyCallError from _Error -function MyCallError(msg) -{ - if(this instanceof MyCallError) - _Error.call(this, msg); - else - return new MyCallError(msg); -} -MyCallError.prototype = new _Error(); -MyCallError.prototype.name = "MyCallError"; - - -function otherScope(msg) -{ - return MyApplyError(msg); -} - - -status = inSection(1); -var err1 = new MyApplyError('msg1'); -actual = examineThis(err1, 'msg1'); -expect = EXPECTED_FORMAT; -addThis(); - -status = inSection(2); -var err2 = new MyCallError('msg2'); -actual = examineThis(err2, 'msg2'); -expect = EXPECTED_FORMAT; -addThis(); - -status = inSection(3); -var err3 = MyApplyError('msg3'); -actual = examineThis(err3, 'msg3'); -expect = EXPECTED_FORMAT; -addThis(); - -status = inSection(4); -var err4 = MyCallError('msg4'); -actual = examineThis(err4, 'msg4'); -expect = EXPECTED_FORMAT; -addThis(); - -status = inSection(5); -var err5 = otherScope('msg5'); -actual = examineThis(err5, 'msg5'); -expect = EXPECTED_FORMAT; -addThis(); - -status = inSection(6); -var err6 = otherScope(); -actual = examineThis(err6, EMPTY_STRING); -expect = EXPECTED_FORMAT; -addThis(); - -status = inSection(7); -var err7 = eval("MyApplyError('msg7')"); -actual = examineThis(err7, 'msg7'); -expect = EXPECTED_FORMAT; -addThis(); - -status = inSection(8); -var err8; -try -{ - throw MyApplyError('msg8'); -} -catch(e) -{ - if(e instanceof Error) - err8 = e; -} -actual = examineThis(err8, 'msg8'); -expect = EXPECTED_FORMAT; -addThis(); - - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - - - -// Searches |err.toString()| for |err.name + ':' + err.message| -function examineThis(err, msg) -{ - var pattern = err.name + '\\s*:?\\s*' + msg; - return err.toString().search(RegExp(pattern)); -} - - -function addThis() -{ - statusitems[UBound] = status; - actualvalues[UBound] = actual; - expectedvalues[UBound] = expect; - UBound++; -} - - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - for (var i = 0; i < UBound; i++) - { - reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]); - } - - exitFunc ('test'); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/Exceptions/regress-58946.js b/tests/auto/declarative/parserstress/tests/ecma_3/Exceptions/regress-58946.js deleted file mode 100644 index 97212c88a0..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/Exceptions/regress-58946.js +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * pschwartau@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -var gTestfile = 'regress-58946.js'; -//------------------------------------------------------------------------------------------------- -var BUGNUMBER = '58946'; -var stat = 'Testing a return statement inside a catch statement inside a function'; - -test(); - -function test() { - enterFunc ("test"); - printBugNumber(BUGNUMBER); - printStatus (stat); - - expect = 'PASS'; - - function f() - { - try - { - throw 'PASS'; - } - catch(e) - { - return e; - } - } - - actual = f(); - - reportCompare(expect, actual, stat); - - exitFunc ("test"); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/Exceptions/regress-95101.js b/tests/auto/declarative/parserstress/tests/ecma_3/Exceptions/regress-95101.js deleted file mode 100644 index b7ef074350..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/Exceptions/regress-95101.js +++ /dev/null @@ -1,118 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * pschwartau@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * Date: 13 August 2001 - * - * SUMMARY: Invoking an undefined function should produce a ReferenceError - * See http://bugzilla.mozilla.org/show_bug.cgi?id=95101 - */ -//----------------------------------------------------------------------------- -var gTestfile = 'regress-95101.js'; -var UBound = 0; -var BUGNUMBER = 95101; -var summary = 'Invoking an undefined function should produce a ReferenceError'; -var msgERR_REF_YES = 'ReferenceError'; -var msgERR_REF_NO = 'did NOT generate a ReferenceError'; -var status = ''; -var statusitems = []; -var actual = ''; -var actualvalues = []; -var expect= ''; -var expectedvalues = []; - - -try -{ - xxxyyyzzz(); -} -catch (e) -{ - status = 'Section 1 of test'; - actual = e instanceof ReferenceError; - expect = true; - addThis(); - - - /* - * This test is more literal, and may one day be invalid. - * Searching for literal string "ReferenceError" in e.toString() - */ - status = 'Section 2 of test'; - var match = e.toString().search(/ReferenceError/); - actual = (match > -1); - expect = true; - addThis(); -} - - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - - -function addThis() -{ - statusitems[UBound] = status; - actualvalues[UBound] = isReferenceError(actual); - expectedvalues[UBound] = isReferenceError(expect); - UBound++; -} - - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - for (var i = 0; i < UBound; i++) - { - reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]); - } - - exitFunc ('test'); -} - - -// converts a Boolean result into a textual result - -function isReferenceError(bResult) -{ - return bResult? msgERR_REF_YES : msgERR_REF_NO; -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/Exceptions/shell.js b/tests/auto/declarative/parserstress/tests/ecma_3/Exceptions/shell.js deleted file mode 100644 index 6c671f1eea..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/Exceptions/shell.js +++ /dev/null @@ -1 +0,0 @@ -gTestsubsuite = 'Exceptions'; diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/ExecutionContexts/10.1.3-1.js b/tests/auto/declarative/parserstress/tests/ecma_3/ExecutionContexts/10.1.3-1.js deleted file mode 100644 index 1e7e0254bf..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/ExecutionContexts/10.1.3-1.js +++ /dev/null @@ -1,201 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * pschwartau@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * - * Date: 11 Feb 2002 - * SUMMARY: Testing functions having duplicate formal parameter names - * - * Note: given function f(x,x,x,x) {return x;}; f(1,2,3,4) should return 4. - * See ECMA-262 3rd Edition Final Section 10.1.3: Variable Instantiation - * - * Also see http://bugzilla.mozilla.org/show_bug.cgi?id=124900 - */ -//----------------------------------------------------------------------------- -var gTestfile = '10.1.3-1.js'; -var UBound = 0; -var BUGNUMBER = 124900; -var summary = 'Testing functions having duplicate formal parameter names'; -var status = ''; -var statusitems = []; -var actual = ''; -var actualvalues = []; -var expect= ''; -var expectedvalues = []; - - -function f1(x,x) -{ - return x; -} -status = inSection(1); -actual = f1(1,2); -expect = 2; -addThis(); - - -function f2(x,x,x) -{ - return x*x*x; -} -status = inSection(2); -actual = f2(1,2,3); -expect = 27; -addThis(); - - -function f3(x,x,x,x) -{ - return 'a' + x + 'b' + x + 'c' + x ; -} -status = inSection(3); -actual = f3(1,2,3,4); -expect = 'a4b4c4'; -addThis(); - - -/* - * If the value of the last duplicate parameter is not provided by - * the function caller, the value of this parameter is undefined - */ -function f4(x,a,b,x,z) -{ - return x; -} -status = inSection(4); -actual = f4(1,2); -expect = undefined; -addThis(); - - -/* - * f.toString() should preserve any duplicate formal parameter names that exist - */ -function f5(x,x,x,x) -{ -} -status = inSection(5); -actual = f5.toString().match(/\((.*)\)/)[1]; -actual = actual.replace(/\s/g, ''); // for definiteness, remove any white space -expect = 'x,x,x,x'; -addThis(); - - -function f6(x,x,x,x) -{ - var ret = []; - - for (var i=0; i> p); - - reportCompare(expectval, actualval, summary + ': value'); - reportCompare(expect, actual, summary + ': order'); - - exitFunc ('test'); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/Expressions/11.7.3-01.js b/tests/auto/declarative/parserstress/tests/ecma_3/Expressions/11.7.3-01.js deleted file mode 100755 index d5af3b86d4..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/Expressions/11.7.3-01.js +++ /dev/null @@ -1,76 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Mozilla Foundation. - * Portions created by the Initial Developer are Copyright (C) 2007 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Brendan Eich - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -var gTestfile = '11.7.3-01.js'; -//----------------------------------------------------------------------------- -var BUGNUMBER = 396969; -var summary = '11.7.3 - >>> should evaluate operands in order'; -var actual = ''; -var expect = ''; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - expect = 'o.valueOf, p.valueOf'; - var actualval; - var expectval = 10; - - var o = { - valueOf: (function (){ actual += 'o.valueOf'; return this.value}), - value:42 - }; - - var p = { - valueOf: (function (){ actual += ', p.valueOf'; return this.value}), - value:2 - }; - - actualval = (o >>> p); - - reportCompare(expectval, actualval, summary + ': value'); - reportCompare(expect, actual, summary + ': order'); - - exitFunc ('test'); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/Expressions/11.9.6-1.js b/tests/auto/declarative/parserstress/tests/ecma_3/Expressions/11.9.6-1.js deleted file mode 100644 index 1e8f59e400..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/Expressions/11.9.6-1.js +++ /dev/null @@ -1,213 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * pschwartau@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * - * Date: 20 Feb 2002 - * SUMMARY: Testing the comparison |undefined === null| - * See http://bugzilla.mozilla.org/show_bug.cgi?id=126722 - * - */ -//----------------------------------------------------------------------------- -var gTestfile = '11.9.6-1.js'; -var UBound = 0; -var BUGNUMBER = 126722; -var summary = 'Testing the comparison |undefined === null|'; -var status = ''; -var statusitems = []; -var actual = ''; -var actualvalues = []; -var expect= ''; -var expectedvalues = []; - - -status = inSection(1); -if (undefined === null) - actual = true; -else - actual = false; -expect = false; -addThis(); - - - -status = inSection(2); -switch(true) -{ -case (undefined === null) : - actual = true; - break; - -default: - actual = false; -} -expect = false; -addThis(); - - - -status = inSection(3); -function f3(x) -{ - var res = false; - - switch(true) - { - case (x === null) : - res = true; - break; - - default: - // do nothing - } - - return res; -} - -actual = f3(undefined); -expect = false; -addThis(); - - - -status = inSection(4); -function f4(arr) -{ - var elt = ''; - var res = false; - - for (i=0; i function f\u02B1 () {} - * - * js> f\u02B1.toSource(); - * function f¦() {} - * - * js> f\u02B1.toSource().toSource(); - * (new String("function f\xB1() {}")) - * - * - * See how the high-byte information (the 02) has been lost? - * The same thing was happening with the toString() method: - * - * js> f\u02B1.toString(); - * - * function f¦() { - * } - * - * js> f\u02B1.toString().toSource(); - * (new String("\nfunction f\xB1() {\n}\n")) - * - */ -//----------------------------------------------------------------------------- -var gTestfile = 'regress-58274.js'; -var UBound = 0; -var BUGNUMBER = 58274; -var summary = 'Testing functions with double-byte names'; -var ERR = 'UNEXPECTED ERROR! \n'; -var ERR_MALFORMED_NAME = ERR + 'Could not find function name in: \n\n'; -var status = ''; -var statusitems = []; -var actual = ''; -var actualvalues = []; -var expect= ''; -var expectedvalues = []; -var sEval; -var sName; - - -sEval = "function f\u02B2() {return 42;}"; -eval(sEval); -sName = getFunctionName(f\u02B2); - -// Test function call - -status = inSection(1); -actual = f\u02B2(); -expect = 42; -addThis(); - -// Test both characters of function name - -status = inSection(2); -actual = sName[0]; -expect = sEval[9]; -addThis(); - -status = inSection(3); -actual = sName[1]; -expect = sEval[10]; -addThis(); - - - -sEval = "function f\u02B2\u0AAA () {return 84;}"; -eval(sEval); -sName = getFunctionName(f\u02B2\u0AAA); - -// Test function call - -status = inSection(4); -actual = f\u02B2\u0AAA(); -expect = 84; -addThis(); - -// Test all three characters of function name - -status = inSection(5); -actual = sName[0]; -expect = sEval[9]; -addThis(); - -status = inSection(6); -actual = sName[1]; -expect = sEval[10]; -addThis(); - -status = inSection(7); -actual = sName[2]; -expect = sEval[11]; -addThis(); - - - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - - - -/* - * Goal: test that f.toString() contains the proper function name. - * - * Note, however, f.toString() is implementation-independent. For example, - * it may begin with '\nfunction' instead of 'function'. Therefore we use - * a regexp to make sure we extract the name properly. - * - * Here we assume that f has been defined by means of a function statement, - * and not a function expression (where it wouldn't have to have a name). - * - * Rhino uses a Unicode representation for f.toString(); whereas - * SpiderMonkey uses an ASCII representation, putting escape sequences - * for non-ASCII characters. For example, if a function is called f\u02B1, - * then in Rhino the toString() method will present a 2-character Unicode - * string for its name, whereas SpiderMonkey will present a 7-character - * ASCII string for its name: the string literal 'f\u02B1'. - * - * So we force the lexer to condense the string before using it. - * This will give uniform results in Rhino and SpiderMonkey. - */ -function getFunctionName(f) -{ - var s = condenseStr(f.toString()); - var re = /\s*function\s+(\S+)\s*\(/; - var arr = s.match(re); - - if (!(arr && arr[1])) - return ERR_MALFORMED_NAME + s; - return arr[1]; -} - - -/* - * This function is the opposite of functions like escape(), which take - * Unicode characters and return escape sequences for them. Here, we force - * the lexer to turn escape sequences back into single characters. - * - * Note we can't simply do |eval(str)|, since in practice |str| will be an - * identifier somewhere in the program (e.g. a function name); thus |eval(str)| - * would return the object that the identifier represents: not what we want. - * - * So we surround |str| lexicographically with quotes to force the lexer to - * evaluate it as a string. Have to strip out any linefeeds first, however - - */ -function condenseStr(str) -{ - /* - * You won't be able to do the next step if |str| has - * any carriage returns or linefeeds in it. For example: - * - * js> eval("'" + '\nHello' + "'"); - * 1: SyntaxError: unterminated string literal: - * 1: ' - * 1: ^ - * - * So replace them with the empty string - - */ - str = str.replace(/[\r\n]/g, '') - return eval("'" + str + "'"); -} - - -function addThis() -{ - statusitems[UBound] = status; - actualvalues[UBound] = actual; - expectedvalues[UBound] = expect; - UBound++; -} - - -function test() -{ - enterFunc('test'); - printBugNumber(BUGNUMBER); - printStatus(summary); - - for (var i=0; i - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -var gTestfile = '8.6.1-01.js'; -//----------------------------------------------------------------------------- - -var BUGNUMBER = 315436; -var summary = 'In strict mode, setting a read-only property should generate a warning'; - -printBugNumber(BUGNUMBER); -printStatus (summary); - -enterFunc (String (BUGNUMBER)); - -// should throw an error in strict mode -var actual = ''; -var expect = 's.length is read-only'; -var status = summary + ': Throw if STRICT and WERROR is enabled'; - -if (!options().match(/strict/)) -{ - options('strict'); -} -if (!options().match(/werror/)) -{ - options('werror'); -} - -try -{ - var s = new String ('abc'); - s.length = 0; -} -catch (e) -{ - actual = e.message; -} - -reportCompare(expect, actual, status); - -// should not throw an error if in strict mode and WERROR is false - -actual = 'did not throw'; -expect = 'did not throw'; -var status = summary + ': Do not throw if STRICT is enabled and WERROR is disabled'; - -// toggle werror off -options('werror'); - -try -{ - s.length = 0; -} -catch (e) -{ - actual = e.message; -} - -reportCompare(expect, actual, status); - -// should not throw an error if not in strict mode - -actual = 'did not throw'; -expect = 'did not throw'; -var status = summary + ': Do not throw if not in strict mode'; - -// toggle strict off -options('strict'); - -try -{ - s.length = 0; -} -catch (e) -{ - actual = e.message; -} - -reportCompare(expect, actual, status); diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/Object/8.6.2.6-001.js b/tests/auto/declarative/parserstress/tests/ecma_3/Object/8.6.2.6-001.js deleted file mode 100644 index 8fe2b23f4a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/Object/8.6.2.6-001.js +++ /dev/null @@ -1,113 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * pschwartau@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * - * Date: 09 September 2002 - * SUMMARY: Test for TypeError on invalid default string value of object - * See ECMA reference at http://bugzilla.mozilla.org/show_bug.cgi?id=167325 - * - */ -//----------------------------------------------------------------------------- -var gTestfile = '8.6.2.6-001.js'; -var UBound = 0; -var BUGNUMBER = 167325; -var summary = "Test for TypeError on invalid default string value of object"; -var TEST_PASSED = 'TypeError'; -var TEST_FAILED = 'Generated an error, but NOT a TypeError!'; -var TEST_FAILED_BADLY = 'Did not generate ANY error!!!'; -var status = ''; -var statusitems = []; -var actual = ''; -var actualvalues = []; -var expect= ''; -var expectedvalues = []; - - -status = inSection(1); -expect = TEST_PASSED; -actual = TEST_FAILED_BADLY; -/* - * This should generate a TypeError. See ECMA reference - * at http://bugzilla.mozilla.org/show_bug.cgi?id=167325 - */ -try -{ - var obj = {toString: function() {return new Object();}} - obj == 'abc'; -} -catch(e) -{ - if (e instanceof TypeError) - actual = TEST_PASSED; - else - actual = TEST_FAILED; -} -addThis(); - - - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - - - -function addThis() -{ - statusitems[UBound] = status; - actualvalues[UBound] = actual; - expectedvalues[UBound] = expect; - UBound++; -} - - -function test() -{ - enterFunc('test'); - printBugNumber(BUGNUMBER); - printStatus(summary); - - for (var i=0; i>'}, - {section: '11.7.3', operator: '>>>'}, - {section: '11.8.1', operator: '<'}, - {section: '11.8.2', operator: '>'}, - {section: '11.8.3', operator: '<='}, - {section: '11.8.4', operator: '>='}, - {section: '11.10', operator: '&'}, - {section: '11.10', operator: '^'}, - {section: '11.10', operator: '|'}, - {section: '11.13.2', operator: '*='}, - {section: '11.13.2', operator: '/='}, - {section: '11.13.2', operator: '%='}, - {section: '11.13.2', operator: '+='}, - {section: '11.13.2', operator: '<<='}, - {section: '11.13.2', operator: '>>='}, - {section: '11.13.2', operator: '>>>='}, - {section: '11.13.2', operator: '&='}, - {section: '11.13.2', operator: '^='}, - {section: '11.13.2', operator: '|='}, - ]; - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - for (var i = 0; i < operators.length; i++) - { - expect = 'left valueOf, left toString, right valueOf, right toString, '; - actual = ''; - - var left = makeObject('left'); - var right = makeObject('right'); - - eval('left ' + operators[i].operator + ' right'); - - reportCompare(expect, actual, summary + ': ' + operators[i].section + ' ' + operators[i].operator); - } - - exitFunc ('test'); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/Operators/shell.js b/tests/auto/declarative/parserstress/tests/ecma_3/Operators/shell.js deleted file mode 100644 index 910515cfe4..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/Operators/shell.js +++ /dev/null @@ -1 +0,0 @@ -gTestsubsuite = 'Operators'; diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/README b/tests/auto/declarative/parserstress/tests/ecma_3/README deleted file mode 100755 index eebd421c2e..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/README +++ /dev/null @@ -1 +0,0 @@ -ECMA 262 Edition 3 diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.2-1.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.2-1.js deleted file mode 100644 index 9439a2ccd6..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.2-1.js +++ /dev/null @@ -1,181 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * rogerl@netscape.com, pschwartau@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * - * Date: 09 July 2002 - * SUMMARY: RegExp conformance test - * - * These gTestcases are derived from the examples in the ECMA-262 Ed.3 spec - * scattered through section 15.10.2. - * - */ -//----------------------------------------------------------------------------- -var gTestfile = '15.10.2-1.js'; -var i = 0; -var BUGNUMBER = '(none)'; -var summary = 'RegExp conformance test'; -var status = ''; -var statusmessages = new Array(); -var pattern = ''; -var patterns = new Array(); -var string = ''; -var strings = new Array(); -var actualmatch = ''; -var actualmatches = new Array(); -var expectedmatch = ''; -var expectedmatches = new Array(); - - -status = inSection(1); -pattern = /a|ab/; -string = 'abc'; -actualmatch = string.match(pattern); -expectedmatch = Array('a'); -addThis(); - -status = inSection(2); -pattern = /((a)|(ab))((c)|(bc))/; -string = 'abc'; -actualmatch = string.match(pattern); -expectedmatch = Array('abc', 'a', 'a', undefined, 'bc', undefined, 'bc'); -addThis(); - -status = inSection(3); -pattern = /a[a-z]{2,4}/; -string = 'abcdefghi'; -actualmatch = string.match(pattern); -expectedmatch = Array('abcde'); -addThis(); - -status = inSection(4); -pattern = /a[a-z]{2,4}?/; -string = 'abcdefghi'; -actualmatch = string.match(pattern); -expectedmatch = Array('abc'); -addThis(); - -status = inSection(5); -pattern = /(aa|aabaac|ba|b|c)*/; -string = 'aabaac'; -actualmatch = string.match(pattern); -expectedmatch = Array('aaba', 'ba'); -addThis(); - -status = inSection(6); -pattern = /^(a+)\1*,\1+$/; -string = 'aaaaaaaaaa,aaaaaaaaaaaaaaa'; -actualmatch = string.match(pattern); -expectedmatch = Array('aaaaaaaaaa,aaaaaaaaaaaaaaa', 'aaaaa'); -addThis(); - -status = inSection(7); -pattern = /(z)((a+)?(b+)?(c))*/; -string = 'zaacbbbcac'; -actualmatch = string.match(pattern); -expectedmatch = Array('zaacbbbcac', 'z', 'ac', 'a', undefined, 'c'); -addThis(); - -status = inSection(8); -pattern = /(a*)*/; -string = 'b'; -actualmatch = string.match(pattern); -expectedmatch = Array('', undefined); -addThis(); - -status = inSection(9); -pattern = /(a*)b\1+/; -string = 'baaaac'; -actualmatch = string.match(pattern); -expectedmatch = Array('b', ''); -addThis(); - -status = inSection(10); -pattern = /(?=(a+))/; -string = 'baaabac'; -actualmatch = string.match(pattern); -expectedmatch = Array('', 'aaa'); -addThis(); - -status = inSection(11); -pattern = /(?=(a+))a*b\1/; -string = 'baaabac'; -actualmatch = string.match(pattern); -expectedmatch = Array('aba', 'a'); -addThis(); - -status = inSection(12); -pattern = /(.*?)a(?!(a+)b\2c)\2(.*)/; -string = 'baaabaac'; -actualmatch = string.match(pattern); -expectedmatch = Array('baaabaac', 'ba', undefined, 'abaac'); -addThis(); - -status = inSection(13); -pattern = /(?=(a+))/; -string = 'baaabac'; -actualmatch = string.match(pattern); -expectedmatch = Array('', 'aaa'); -addThis(); - - - -//------------------------------------------------------------------------------------------------- -test(); -//------------------------------------------------------------------------------------------------- - - -function addThis() -{ - statusmessages[i] = status; - patterns[i] = pattern; - strings[i] = string; - actualmatches[i] = actualmatch; - expectedmatches[i] = expectedmatch; - i++; -} - - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - testRegExp(statusmessages, patterns, strings, actualmatches, expectedmatches); - exitFunc ('test'); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.2.12.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.2.12.js deleted file mode 100755 index d68b86c2ed..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.2.12.js +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Mozilla Foundation. - * Portions created by the Initial Developer are Copyright (C) 2007 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Igor Tandetnik - * Martin Honnen - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -var gTestfile = '15.10.2.12.js'; -//----------------------------------------------------------------------------- -var BUGNUMBER = 378738; -var summary = '15.10.2.12 - CharacterClassEscape \d'; -var actual = ''; -var expect = ''; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - expect = false; - actual = /\d/.test("\uFF11"); - - reportCompare(expect, actual, summary); - - exitFunc ('test'); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.3.1-1.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.3.1-1.js deleted file mode 100644 index 7286cea297..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.3.1-1.js +++ /dev/null @@ -1,136 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * pschwartau@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * Date: 26 November 2000 - * - * - * SUMMARY: Passing (RegExp object, flag) to RegExp() function. - * This test arose from Bugzilla bug 61266. The ECMA3 section is: - * - * 15.10.3 The RegExp Constructor Called as a Function - * - * 15.10.3.1 RegExp(pattern, flags) - * - * If pattern is an object R whose [[Class]] property is "RegExp" - * and flags is undefined, then return R unchanged. Otherwise - * call the RegExp constructor (section 15.10.4.1), passing it the - * pattern and flags arguments and return the object constructed - * by that constructor. - * - * - * The current test will check the first scenario outlined above: - * - * "pattern" is itself a RegExp object R - * "flags" is undefined - * - * The flags parameter will be undefined in the sense of not being - * provided. We check that RegExp(R) returns R - - */ -//----------------------------------------------------------------------------- -var gTestfile = '15.10.3.1-1.js'; -var BUGNUMBER = '61266'; -var summary = 'Passing (RegExp object,flag) to RegExp() function'; -var statprefix = 'RegExp(new RegExp('; -var comma = ', '; var singlequote = "'"; var closeparens = '))'; -var cnSUCCESS = 'RegExp() returned the supplied RegExp object'; -var cnFAILURE = 'RegExp() did NOT return the supplied RegExp object'; -var i = -1; var j = -1; var s = ''; var f = ''; -var obj = {}; -var status = ''; var actual = ''; var expect = ''; -var patterns = new Array(); -var flags = new Array(); - - -// various regular expressions to try - -patterns[0] = ''; -patterns[1] = 'abc'; -patterns[2] = '(.*)(3-1)\s\w'; -patterns[3] = '(.*)(...)\\s\\w'; -patterns[4] = '[^A-Za-z0-9_]'; -patterns[5] = '[^\f\n\r\t\v](123.5)([4 - 8]$)'; - -// various flags to try - -flags[0] = 'i'; -flags[1] = 'g'; -flags[2] = 'm'; -flags[3] = undefined; - - - -//------------------------------------------------------------------------------------------------- -test(); -//------------------------------------------------------------------------------------------------- - - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - for (i in patterns) - { - s = patterns[i]; - - for (j in flags) - { - f = flags[j]; - status = getStatus(s, f); - obj = new RegExp(s, f); - - actual = (obj == RegExp(obj))? cnSUCCESS : cnFAILURE; - expect = cnSUCCESS; - reportCompare (expect, actual, status); - } - } - - exitFunc ('test'); -} - - -function getStatus(regexp, flag) -{ - return (statprefix + quote(regexp) + comma + flag + closeparens); -} - - -function quote(text) -{ - return (singlequote + text + singlequote); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.3.1-2.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.3.1-2.js deleted file mode 100644 index d78be13c25..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.3.1-2.js +++ /dev/null @@ -1,144 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * pschwartau@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * Date: 26 November 2000 - * - * - * SUMMARY: Passing (RegExp object, flag) to RegExp() function. - * This test arose from Bugzilla bug 61266. The ECMA3 section is: - * - * 15.10.3 The RegExp Constructor Called as a Function - * - * 15.10.3.1 RegExp(pattern, flags) - * - * If pattern is an object R whose [[Class]] property is "RegExp" - * and flags is undefined, then return R unchanged. Otherwise - * call the RegExp constructor (section 15.10.4.1), passing it the - * pattern and flags arguments and return the object constructed - * by that constructor. - * - * - * The current test will check the first scenario outlined above: - * - * "pattern" is itself a RegExp object R - * "flags" is undefined - * - * This test is identical to test 15.10.3.1-1.js, except here we do: - * - * RegExp(R, undefined); - * - * instead of: - * - * RegExp(R); - * - * - * We check that RegExp(R, undefined) returns R - - */ -//----------------------------------------------------------------------------- -var gTestfile = '15.10.3.1-2.js'; -var BUGNUMBER = '61266'; -var summary = 'Passing (RegExp object,flag) to RegExp() function'; -var statprefix = 'RegExp(new RegExp('; -var comma = ', '; var singlequote = "'"; var closeparens = '))'; -var cnSUCCESS = 'RegExp() returned the supplied RegExp object'; -var cnFAILURE = 'RegExp() did NOT return the supplied RegExp object'; -var i = -1; var j = -1; var s = ''; var f = ''; -var obj = {}; -var status = ''; var actual = ''; var expect = ''; -var patterns = new Array(); -var flags = new Array(); - - -// various regular expressions to try - -patterns[0] = ''; -patterns[1] = 'abc'; -patterns[2] = '(.*)(3-1)\s\w'; -patterns[3] = '(.*)(...)\\s\\w'; -patterns[4] = '[^A-Za-z0-9_]'; -patterns[5] = '[^\f\n\r\t\v](123.5)([4 - 8]$)'; - -// various flags to try - -flags[0] = 'i'; -flags[1] = 'g'; -flags[2] = 'm'; -flags[3] = undefined; - - - -//------------------------------------------------------------------------------------------------- -test(); -//------------------------------------------------------------------------------------------------- - - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - for (i in patterns) - { - s = patterns[i]; - - for (j in flags) - { - f = flags[j]; - status = getStatus(s, f); - obj = new RegExp(s, f); - - actual = (obj == RegExp(obj, undefined))? cnSUCCESS : cnFAILURE ; - expect = cnSUCCESS; - reportCompare (expect, actual, status); - } - } - - exitFunc ('test'); -} - - -function getStatus(regexp, flag) -{ - return (statprefix + quote(regexp) + comma + flag + closeparens); -} - - -function quote(text) -{ - return (singlequote + text + singlequote); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.4.1-1.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.4.1-1.js deleted file mode 100644 index 47faf0051b..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.4.1-1.js +++ /dev/null @@ -1,127 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * pschwartau@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * Date: 26 November 2000 - * - * - *SUMMARY: Passing a RegExp object to a RegExp() constructor. - *This test arose from Bugzilla bug 61266. The ECMA3 section is: - * - * 15.10.4.1 new RegExp(pattern, flags) - * - * If pattern is an object R whose [[Class]] property is "RegExp" and - * flags is undefined, then let P be the pattern used to construct R - * and let F be the flags used to construct R. If pattern is an object R - * whose [[Class]] property is "RegExp" and flags is not undefined, - * then throw a TypeError exception. Otherwise, let P be the empty string - * if pattern is undefined and ToString(pattern) otherwise, and let F be - * the empty string if flags is undefined and ToString(flags) otherwise. - * - * - *The current test will check the first scenario outlined above: - * - * "pattern" is itself a RegExp object R - * "flags" is undefined - * - * We check that a new RegExp object obj2 defined from these parameters - * is morally the same as the original RegExp object obj1. Of course, they - * can't be equal as objects - so we check their enumerable properties... - * - * In this test, the initial RegExp object obj1 will not include a - * flag. The flags parameter for obj2 will be undefined in the sense - * of not being provided. - */ -//----------------------------------------------------------------------------- -var gTestfile = '15.10.4.1-1.js'; -var BUGNUMBER = '61266'; -var summary = 'Passing a RegExp object to a RegExp() constructor'; -var statprefix = 'Applying RegExp() twice to pattern '; -var statsuffix = '; testing property '; -var singlequote = "'"; -var i = -1; var s = ''; -var obj1 = {}; var obj2 = {}; -var status = ''; var actual = ''; var expect = ''; var msg = ''; -var patterns = new Array(); - - -// various regular expressions to try - -patterns[0] = ''; -patterns[1] = 'abc'; -patterns[2] = '(.*)(3-1)\s\w'; -patterns[3] = '(.*)(...)\\s\\w'; -patterns[4] = '[^A-Za-z0-9_]'; -patterns[5] = '[^\f\n\r\t\v](123.5)([4 - 8]$)'; - - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - for (i in patterns) - { - s = patterns[i]; - status =getStatus(s); - obj1 = new RegExp(s); - obj2 = new RegExp(obj1); - - reportCompare (obj1 + '', obj2 + '', status); - } - - exitFunc ('test'); -} - - -function getStatus(regexp) -{ - return (statprefix + quote(regexp) + statsuffix); -} - - -function quote(text) -{ - return (singlequote + text + singlequote); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.4.1-2.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.4.1-2.js deleted file mode 100644 index 1d67b8afe6..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.4.1-2.js +++ /dev/null @@ -1,133 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * pschwartau@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * Date: 26 November 2000 - * - * - *SUMMARY: Passing a RegExp object to a RegExp() constructor. - *This test arose from Bugzilla bug 61266. The ECMA3 section is: - * - * 15.10.4.1 new RegExp(pattern, flags) - * - * If pattern is an object R whose [[Class]] property is "RegExp" and - * flags is undefined, then let P be the pattern used to construct R - * and let F be the flags used to construct R. If pattern is an object R - * whose [[Class]] property is "RegExp" and flags is not undefined, - * then throw a TypeError exception. Otherwise, let P be the empty string - * if pattern is undefined and ToString(pattern) otherwise, and let F be - * the empty string if flags is undefined and ToString(flags) otherwise. - * - * - *The current test will check the first scenario outlined above: - * - * "pattern" is itself a RegExp object R - * "flags" is undefined - * - * We check that a new RegExp object obj2 defined from these parameters - * is morally the same as the original RegExp object obj1. Of course, they - * can't be equal as objects - so we check their enumerable properties... - * - * In this test, the initial RegExp object obj1 will not include a - * flag. This test is identical to test 15.10.4.1-1.js, except that - * here we use this syntax: - * - * obj2 = new RegExp(obj1, undefined); - * - * instead of: - * - * obj2 = new RegExp(obj1); - */ -//----------------------------------------------------------------------------- -var gTestfile = '15.10.4.1-2.js'; -var BUGNUMBER = '61266'; -var summary = 'Passing a RegExp object to a RegExp() constructor'; -var statprefix = 'Applying RegExp() twice to pattern '; -var statsuffix = '; testing property '; -var singlequote = "'"; -var i = -1; var s = ''; -var obj1 = {}; var obj2 = {}; -var status = ''; var actual = ''; var expect = ''; var msg = ''; -var patterns = new Array(); - - -// various regular expressions to try - -patterns[0] = ''; -patterns[1] = 'abc'; -patterns[2] = '(.*)(3-1)\s\w'; -patterns[3] = '(.*)(...)\\s\\w'; -patterns[4] = '[^A-Za-z0-9_]'; -patterns[5] = '[^\f\n\r\t\v](123.5)([4 - 8]$)'; - - - -//------------------------------------------------------------------------------------------------- -test(); -//------------------------------------------------------------------------------------------------- - - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - for (i in patterns) - { - s = patterns[i]; - status =getStatus(s); - obj1 = new RegExp(s); - obj2 = new RegExp(obj1, undefined); // see introduction to bug - - reportCompare (obj1 + '', obj2 + '', status); - } - - exitFunc ('test'); -} - - -function getStatus(regexp) -{ - return (statprefix + quote(regexp) + statsuffix); -} - - -function quote(text) -{ - return (singlequote + text + singlequote); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.4.1-3.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.4.1-3.js deleted file mode 100644 index 12ef46bde8..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.4.1-3.js +++ /dev/null @@ -1,139 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * pschwartau@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * Date: 26 November 2000 - * - * - *SUMMARY: Passing a RegExp object to a RegExp() constructor. - *This test arose from Bugzilla bug 61266. The ECMA3 section is: - * - * 15.10.4.1 new RegExp(pattern, flags) - * - * If pattern is an object R whose [[Class]] property is "RegExp" and - * flags is undefined, then let P be the pattern used to construct R - * and let F be the flags used to construct R. If pattern is an object R - * whose [[Class]] property is "RegExp" and flags is not undefined, - * then throw a TypeError exception. Otherwise, let P be the empty string - * if pattern is undefined and ToString(pattern) otherwise, and let F be - * the empty string if flags is undefined and ToString(flags) otherwise. - * - * - *The current test will check the first scenario outlined above: - * - * "pattern" is itself a RegExp object R - * "flags" is undefined - * - * We check that a new RegExp object obj2 defined from these parameters - * is morally the same as the original RegExp object obj1. Of course, they - * can't be equal as objects - so we check their enumerable properties... - * - * In this test, the initial RegExp obj1 will include a flag. The flags - * parameter for obj2 will be undefined in the sense of not being provided. - */ -//----------------------------------------------------------------------------- -var gTestfile = '15.10.4.1-3.js'; -var BUGNUMBER = '61266'; -var summary = 'Passing a RegExp object to a RegExp() constructor'; -var statprefix = 'Applying RegExp() twice to pattern '; -var statmiddle = ' and flag '; -var statsuffix = '; testing property '; -var singlequote = "'"; -var i = -1; var j = -1; var s = ''; -var obj1 = {}; var obj2 = {}; -var status = ''; var actual = ''; var expect = ''; var msg = ''; -var patterns = new Array(); -var flags = new Array(); - - -// various regular expressions to try - -patterns[0] = ''; -patterns[1] = 'abc'; -patterns[2] = '(.*)(3-1)\s\w'; -patterns[3] = '(.*)(...)\\s\\w'; -patterns[4] = '[^A-Za-z0-9_]'; -patterns[5] = '[^\f\n\r\t\v](123.5)([4 - 8]$)'; - -// various flags to try - -flags[0] = 'i'; -flags[1] = 'g'; -flags[2] = 'm'; -flags[3] = undefined; - - - -//------------------------------------------------------------------------------------------------- -test(); -//------------------------------------------------------------------------------------------------- - - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - for (i in patterns) - { - s = patterns[i]; - - for (j in flags) - { - f = flags[j]; - status = getStatus(s, f); - obj1 = new RegExp(s, f); - obj2 = new RegExp(obj1); - - reportCompare (obj1 + '', obj2 + '', status); - } - } - - exitFunc ('test'); -} - - -function getStatus(regexp, flag) -{ - return (statprefix + quote(regexp) + statmiddle + flag + statsuffix); -} - - -function quote(text) -{ - return (singlequote + text + singlequote); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.4.1-4.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.4.1-4.js deleted file mode 100644 index 3b4245851e..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.4.1-4.js +++ /dev/null @@ -1,146 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * pschwartau@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * Date: 26 November 2000 - * - * - *SUMMARY: Passing a RegExp object to a RegExp() constructor. - *This test arose from Bugzilla bug 61266. The ECMA3 section is: - * - * 15.10.4.1 new RegExp(pattern, flags) - * - * If pattern is an object R whose [[Class]] property is "RegExp" and - * flags is undefined, then let P be the pattern used to construct R - * and let F be the flags used to construct R. If pattern is an object R - * whose [[Class]] property is "RegExp" and flags is not undefined, - * then throw a TypeError exception. Otherwise, let P be the empty string - * if pattern is undefined and ToString(pattern) otherwise, and let F be - * the empty string if flags is undefined and ToString(flags) otherwise. - * - * - *The current test will check the first scenario outlined above: - * - * "pattern" is itself a RegExp object R - * "flags" is undefined - * - * We check that a new RegExp object obj2 defined from these parameters - * is morally the same as the original RegExp object obj1. Of course, they - * can't be equal as objects - so we check their enumerable properties... - * - * In this test, the initial RegExp object obj1 will include a - * flag. This test is identical to test 15.10.4.1-3.js, except that - * here we use this syntax: - * - * obj2 = new RegExp(obj1, undefined); - * - * instead of: - * - * obj2 = new RegExp(obj1); - */ -//----------------------------------------------------------------------------- -var gTestfile = '15.10.4.1-4.js'; -var BUGNUMBER = '61266'; -var summary = 'Passing a RegExp object to a RegExp() constructor'; -var statprefix = 'Applying RegExp() twice to pattern '; -var statmiddle = ' and flag '; -var statsuffix = '; testing property '; -var singlequote = "'"; -var i = -1; var j = -1; var s = ''; -var obj1 = {}; var obj2 = {}; -var status = ''; var actual = ''; var expect = ''; var msg = ''; -var patterns = new Array(); -var flags = new Array(); - - -// various regular expressions to try - -patterns[0] = ''; -patterns[1] = 'abc'; -patterns[2] = '(.*)(3-1)\s\w'; -patterns[3] = '(.*)(...)\\s\\w'; -patterns[4] = '[^A-Za-z0-9_]'; -patterns[5] = '[^\f\n\r\t\v](123.5)([4 - 8]$)'; - -// various flags to try - -flags[0] = 'i'; -flags[1] = 'g'; -flags[2] = 'm'; -flags[3] = undefined; - - - -//------------------------------------------------------------------------------------------------- -test(); -//------------------------------------------------------------------------------------------------- - - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - for (i in patterns) - { - s = patterns[i]; - - for (j in flags) - { - f = flags[j]; - status = getStatus(s, f); - obj1 = new RegExp(s, f); - obj2 = new RegExp(obj1, undefined); // see introduction to bug - - reportCompare (obj1 + '', obj2 + '', status); - } - } - - exitFunc ('test'); -} - - -function getStatus(regexp, flag) -{ - return (statprefix + quote(regexp) + statmiddle + flag + statsuffix); -} - - -function quote(text) -{ - return (singlequote + text + singlequote); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.4.1-5-n.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.4.1-5-n.js deleted file mode 100644 index 592fb03ac7..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.4.1-5-n.js +++ /dev/null @@ -1,139 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * pschwartau@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -var gTestfile = '15.10.4.1-5-n.js'; -/* - * - * Date: 26 November 2000 - * - * - *SUMMARY: Passing a RegExp object to a RegExp() constructor. - *This test arose from Bugzilla bug 61266. The ECMA3 section is: - * - * 15.10.4.1 new RegExp(pattern, flags) - * - * If pattern is an object R whose [[Class]] property is "RegExp" and - * flags is undefined, then let P be the pattern used to construct R - * and let F be the flags used to construct R. If pattern is an object R - * whose [[Class]] property is "RegExp" and flags is not undefined, - * then throw a TypeError exception. Otherwise, let P be the empty string - * if pattern is undefined and ToString(pattern) otherwise, and let F be - * the empty string if flags is undefined and ToString(flags) otherwise. - * - * - *The current test will check the second scenario outlined above: - * - * "pattern" is itself a RegExp object R - * "flags" is NOT undefined - * - * This should throw an exception ... we test for this. - * - */ - -//------------------------------------------------------------------------------------------------- -var BUGNUMBER = '61266'; -var summary = 'Negative test: Passing (RegExp object, flag) to RegExp() constructor'; -var statprefix = 'Passing RegExp object on pattern '; -var statsuffix = '; passing flag '; -var cnFAILURE = 'Expected an exception to be thrown, but none was -'; -var singlequote = "'"; -var i = -1; var j = -1; var s = ''; var f = ''; -var obj1 = {}; var obj2 = {}; -var patterns = new Array(); -var flags = new Array(); - - -// various regular expressions to try - -patterns[0] = ''; -patterns[1] = 'abc'; -patterns[2] = '(.*)(3-1)\s\w'; -patterns[3] = '(.*)(...)\\s\\w'; -patterns[4] = '[^A-Za-z0-9_]'; -patterns[5] = '[^\f\n\r\t\v](123.5)([4 - 8]$)'; - -// various flags to try - -flags[0] = 'i'; -flags[1] = 'g'; -flags[2] = 'm'; - - -DESCRIPTION = "Negative test: Passing (RegExp object, flag) to RegExp() constructor" - EXPECTED = "error"; - - -//------------------------------------------------------------------------------------------------- -test(); -//------------------------------------------------------------------------------------------------- - - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - for (i in patterns) - { - s = patterns[i]; - - for (j in flags) - { - f = flags[j]; - printStatus(getStatus(s, f)); - obj1 = new RegExp(s, f); - obj2 = new RegExp(obj1, f); // this should cause an exception - - // WE SHOULD NEVER REACH THIS POINT - - reportCompare('PASS', 'FAIL', cnFAILURE); - } - } - - exitFunc ('test'); -} - - -function getStatus(regexp, flag) -{ - return (statprefix + quote(regexp) + statsuffix + flag); -} - - -function quote(text) -{ - return (singlequote + text + singlequote); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.6.2-1.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.6.2-1.js deleted file mode 100644 index 8203da4967..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.6.2-1.js +++ /dev/null @@ -1,140 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * pschwartau@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * Date: 23 October 2001 - * - * SUMMARY: Testing regexps with the global flag set. - * NOT every substring fitting the given pattern will be matched. - * The parent string is CONSUMED as successive matches are found. - * - * From the ECMA-262 Final spec: - * - * 15.10.6.2 RegExp.prototype.exec(string) - * Performs a regular expression match of string against the regular - * expression and returns an Array object containing the results of - * the match, or null if the string did not match. - * - * The string ToString(string) is searched for an occurrence of the - * regular expression pattern as follows: - * - * 1. Let S be the value of ToString(string). - * 2. Let length be the length of S. - * 3. Let lastIndex be the value of the lastIndex property. - * 4. Let i be the value of ToInteger(lastIndex). - * 5. If the global property is false, let i = 0. - * 6. If i < 0 or i > length then set lastIndex to 0 and return null. - * 7. Call [[Match]], giving it the arguments S and i. - * If [[Match]] returned failure, go to step 8; - * otherwise let r be its State result and go to step 10. - * 8. Let i = i+1. - * 9. Go to step 6. - * 10. Let e be r's endIndex value. - * 11. If the global property is true, set lastIndex to e. - * - * etc. - * - * - * So when the global flag is set, |lastIndex| is incremented every time - * there is a match; not from i to i+1, but from i to "endIndex" e: - * - * e = (index of last input character matched so far by the pattern) + 1 - * - * Thus in the example below, the first endIndex e occurs after the - * first match 'a b'. The next match will begin AFTER this, and so - * will NOT be 'b c', but rather 'c d'. Similarly, 'd e' won't be matched. - */ -//----------------------------------------------------------------------------- -var gTestfile = '15.10.6.2-1.js'; -var i = 0; -var BUGNUMBER = '(none)'; -var summary = 'Testing regexps with the global flag set'; -var status = ''; -var statusmessages = new Array(); -var pattern = ''; -var patterns = new Array(); -var string = ''; -var strings = new Array(); -var actualmatch = ''; -var actualmatches = new Array(); -var expectedmatch = ''; -var expectedmatches = new Array(); - - -status = inSection(1); -string = 'a b c d e'; -pattern = /\w\s\w/g; -actualmatch = string.match(pattern); -expectedmatch = ['a b','c d']; // see above explanation - -addThis(); - - -status = inSection(2); -string = '12345678'; -pattern = /\d\d\d/g; -actualmatch = string.match(pattern); -expectedmatch = ['123','456']; -addThis(); - - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - - - -function addThis() -{ - statusmessages[i] = status; - patterns[i] = pattern; - strings[i] = string; - actualmatches[i] = actualmatch; - expectedmatches[i] = expectedmatch; - i++; -} - - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - testRegExp(statusmessages, patterns, strings, actualmatches, expectedmatches); - exitFunc ('test'); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.6.2-2.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.6.2-2.js deleted file mode 100644 index e6fd6c6311..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/15.10.6.2-2.js +++ /dev/null @@ -1,367 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * pschwartau@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * - * Date: 18 Feb 2002 - * SUMMARY: Testing re.exec(str) when re.lastIndex is < 0 or > str.length - * - * Case 1: If re has the global flag set, then re(str) should be null - * Case 2: If re doesn't have this set, then re(str) should be unaffected - * - * See http://bugzilla.mozilla.org/show_bug.cgi?id=76717 - * - * - * From the ECMA-262 Final spec: - * - * 15.10.6.2 RegExp.prototype.exec(string) - * Performs a regular expression match of string against the regular - * expression and returns an Array object containing the results of - * the match, or null if the string did not match. - * - * The string ToString(string) is searched for an occurrence of the - * regular expression pattern as follows: - * - * 1. Let S be the value of ToString(string). - * 2. Let length be the length of S. - * 3. Let lastIndex be the value of the lastIndex property. - * 4. Let i be the value of ToInteger(lastIndex). - * 5. If the global property is false, let i = 0. - * 6. If i < 0 or i > length then set lastIndex to 0 and return null. - * 7. Call [[Match]], giving it the arguments S and i. - * If [[Match]] returned failure, go to step 8; - * otherwise let r be its State result and go to step 10. - * 8. Let i = i+1. - * 9. Go to step 6. - * 10. Let e be r's endIndex value. - * 11. If the global property is true, set lastIndex to e. - * - * etc. - * - * - * So: - * - * A. If the global flag is not set, |lastIndex| is set to 0 - * before the match is attempted; thus the match is unaffected. - * - * B. If the global flag IS set and re.lastIndex is >= 0 and <= str.length, - * |lastIndex| is incremented every time there is a match; not from - * i to i+1, but from i to "endIndex" e: - * - * e = (index of last input character matched so far by the pattern) + 1 - * - * The match is then attempted from this position in the string (Step 7). - * - * C. When the global flag IS set and re.lastIndex is < 0 or > str.length, - * |lastIndex| is set to 0 and the match returns null. - * - * - * Note the |lastIndex| property is writeable, and may be set arbitrarily - * by the programmer - and we will do that below. - * - */ -//----------------------------------------------------------------------------- -var gTestfile = '15.10.6.2-2.js'; -var i = 0; -var BUGNUMBER = 76717; -var summary = 'Testing re.exec(str) when re.lastIndex is < 0 or > str.length'; -var status = ''; -var statusmessages = new Array(); -var pattern = ''; -var patterns = new Array(); -var string = ''; -var strings = new Array(); -var actualmatch = ''; -var actualmatches = new Array(); -var expectedmatch = ''; -var expectedmatches = new Array(); - - -/****************************************************************************** - * - * Case 1 : when the global flag is set - - * - *****************************************************************************/ -pattern = /abc/gi; -string = 'AbcaBcabC'; - -status = inSection(1); -actualmatch = pattern.exec(string); -expectedmatch = Array('Abc'); -addThis(); - -status = inSection(2); -actualmatch = pattern.exec(string); -expectedmatch = Array('aBc'); -addThis(); - -status = inSection(3); -actualmatch = pattern.exec(string); -expectedmatch = Array('abC'); -addThis(); - -/* - * At this point |lastIndex| is > string.length, so the match should be null - - */ -status = inSection(4); -actualmatch = pattern.exec(string); -expectedmatch = null; -addThis(); - -/* - * Now let's set |lastIndex| to -1, so the match should again be null - - */ -status = inSection(5); -pattern.lastIndex = -1; -actualmatch = pattern.exec(string); -expectedmatch = null; -addThis(); - -/* - * Now try some edge-case values. Thanks to the work done in - * http://bugzilla.mozilla.org/show_bug.cgi?id=124339, |lastIndex| - * is now stored as a double instead of a uint32 (unsigned integer). - * - * Note 2^32 -1 is the upper bound for uint32's, but doubles can go - * all the way up to Number.MAX_VALUE. So that's why we need cases - * between those two numbers. - */ -status = inSection(6); -pattern.lastIndex = Math.pow(2,32); -actualmatch = pattern.exec(string); -expectedmatch = null; -addThis(); - -status = inSection(7); -pattern.lastIndex = -Math.pow(2,32); -actualmatch = pattern.exec(string); -expectedmatch = null; -addThis(); - -status = inSection(8); -pattern.lastIndex = Math.pow(2,32) + 1; -actualmatch = pattern.exec(string); -expectedmatch = null; -addThis(); - -status = inSection(9); -pattern.lastIndex = -(Math.pow(2,32) + 1); -actualmatch = pattern.exec(string); -expectedmatch = null; -addThis(); - -status = inSection(10); -pattern.lastIndex = Math.pow(2,32) * 2; -actualmatch = pattern.exec(string); -expectedmatch = null; -addThis(); - -status = inSection(11); -pattern.lastIndex = -Math.pow(2,32) * 2; -actualmatch = pattern.exec(string); -expectedmatch = null; -addThis(); - -status = inSection(12); -pattern.lastIndex = Math.pow(2,40); -actualmatch = pattern.exec(string); -expectedmatch = null; -addThis(); - -status = inSection(13); -pattern.lastIndex = -Math.pow(2,40); -actualmatch = pattern.exec(string); -expectedmatch = null; -addThis(); - -status = inSection(14); -pattern.lastIndex = Number.MAX_VALUE; -actualmatch = pattern.exec(string); -expectedmatch = null; -addThis(); - -status = inSection(15); -pattern.lastIndex = -Number.MAX_VALUE; -actualmatch = pattern.exec(string); -expectedmatch = null; -addThis(); - - - -/****************************************************************************** - * - * Case 2: repeat all the above cases WITHOUT the global flag set. - * According to EMCA. |lastIndex| should get set to 0 before the match. - * - * Therefore re.exec(str) should be unaffected; thus our expected values - * below are now DIFFERENT when |lastIndex| is < 0 or > str.length - * - *****************************************************************************/ - -pattern = /abc/i; -string = 'AbcaBcabC'; - -status = inSection(16); -actualmatch = pattern.exec(string); -expectedmatch = Array('Abc'); -addThis(); - -status = inSection(17); -actualmatch = pattern.exec(string); -expectedmatch = Array('Abc'); // NOT Array('aBc') as before - -addThis(); - -status = inSection(18); -actualmatch = pattern.exec(string); -expectedmatch = Array('Abc'); // NOT Array('abC') as before - -addThis(); - -/* - * At this point above, |lastIndex| WAS > string.length, but not here - - */ -status = inSection(19); -actualmatch = pattern.exec(string); -expectedmatch = Array('Abc') // NOT null as before - - addThis(); - -/* - * Now let's set |lastIndex| to -1 - */ -status = inSection(20); -pattern.lastIndex = -1; -actualmatch = pattern.exec(string); -expectedmatch = Array('Abc') // NOT null as before - - addThis(); - -/* - * Now try some edge-case values. Thanks to the work done in - * http://bugzilla.mozilla.org/show_bug.cgi?id=124339, |lastIndex| - * is now stored as a double instead of a uint32 (unsigned integer). - * - * Note 2^32 -1 is the upper bound for uint32's, but doubles can go - * all the way up to Number.MAX_VALUE. So that's why we need cases - * between those two numbers. - */ -status = inSection(21); -pattern.lastIndex = Math.pow(2,32); -actualmatch = pattern.exec(string); -expectedmatch = Array('Abc') // NOT null as before - - addThis(); - -status = inSection(22); -pattern.lastIndex = -Math.pow(2,32); -actualmatch = pattern.exec(string); -expectedmatch = Array('Abc') // NOT null as before - - addThis(); - -status = inSection(23); -pattern.lastIndex = Math.pow(2,32) + 1; -actualmatch = pattern.exec(string); -expectedmatch = Array('Abc') // NOT null as before - - addThis(); - -status = inSection(24); -pattern.lastIndex = -(Math.pow(2,32) + 1); -actualmatch = pattern.exec(string); -expectedmatch = Array('Abc') // NOT null as before - - addThis(); - -status = inSection(25); -pattern.lastIndex = Math.pow(2,32) * 2; -actualmatch = pattern.exec(string); -expectedmatch = Array('Abc') // NOT null as before - - addThis(); - -status = inSection(26); -pattern.lastIndex = -Math.pow(2,32) * 2; -actualmatch = pattern.exec(string); -expectedmatch = Array('Abc') // NOT null as before - - addThis(); - -status = inSection(27); -pattern.lastIndex = Math.pow(2,40); -actualmatch = pattern.exec(string); -expectedmatch = Array('Abc') // NOT null as before -; - addThis(); - -status = inSection(28); -pattern.lastIndex = -Math.pow(2,40); -actualmatch = pattern.exec(string); -expectedmatch = Array('Abc') // NOT null as before - - addThis(); - -status = inSection(29); -pattern.lastIndex = Number.MAX_VALUE; -actualmatch = pattern.exec(string); -expectedmatch = Array('Abc') // NOT null as before - - addThis(); - -status = inSection(30); -pattern.lastIndex = -Number.MAX_VALUE; -actualmatch = pattern.exec(string); -expectedmatch = Array('Abc') // NOT null as before - - addThis(); - - - - -//------------------------------------------------------------------------------------------------- -test(); -//------------------------------------------------------------------------------------------------- - - - -function addThis() -{ - statusmessages[i] = status; - patterns[i] = pattern; - strings[i] = string; - actualmatches[i] = actualmatch; - expectedmatches[i] = expectedmatch; - i++; -} - - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - testRegExp(statusmessages, patterns, strings, actualmatches, expectedmatches); - exitFunc ('test'); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/browser.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/browser.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/octal-001.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/octal-001.js deleted file mode 100644 index f35724e47b..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/octal-001.js +++ /dev/null @@ -1,136 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * pschwartau@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * - * Date: 18 July 2002 - * SUMMARY: Testing octal sequences in regexps - * See http://bugzilla.mozilla.org/show_bug.cgi?id=141078 - * - */ -//----------------------------------------------------------------------------- -var gTestfile = 'octal-001.js'; -var i = 0; -var BUGNUMBER = 141078; -var summary = 'Testing octal sequences in regexps'; -var status = ''; -var statusmessages = new Array(); -var pattern = ''; -var patterns = new Array(); -var string = ''; -var strings = new Array(); -var actualmatch = ''; -var actualmatches = new Array(); -var expectedmatch = ''; -var expectedmatches = new Array(); - - -status = inSection(1); -pattern = /\240/; -string = 'abc'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -/* - * In the following sections, we test the octal escape sequence '\052'. - * This is character code 42, representing the asterisk character '*'. - * The Unicode escape for it would be '\u002A', the hex escape '\x2A'. - */ -status = inSection(2); -pattern = /ab\052c/; -string = 'ab*c'; -actualmatch = string.match(pattern); -expectedmatch = Array('ab*c'); -addThis(); - -status = inSection(3); -pattern = /ab\052*c/; -string = 'abc'; -actualmatch = string.match(pattern); -expectedmatch = Array('abc'); -addThis(); - -status = inSection(4); -pattern = /ab(\052)+c/; -string = 'ab****c'; -actualmatch = string.match(pattern); -expectedmatch = Array('ab****c', '*'); -addThis(); - -status = inSection(5); -pattern = /ab((\052)+)c/; -string = 'ab****c'; -actualmatch = string.match(pattern); -expectedmatch = Array('ab****c', '****', '*'); -addThis(); - -status = inSection(6); -pattern = /(?:\052)c/; -string = 'ab****c'; -actualmatch = string.match(pattern); -expectedmatch = Array('*c'); -addThis(); - - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - - - -function addThis() -{ - statusmessages[i] = status; - patterns[i] = pattern; - strings[i] = string; - actualmatches[i] = actualmatch; - expectedmatches[i] = expectedmatch; - i++; -} - - -function test() -{ - enterFunc('test'); - printBugNumber(BUGNUMBER); - printStatus(summary); - testRegExp(statusmessages, patterns, strings, actualmatches, expectedmatches); - exitFunc ('test'); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/octal-002.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/octal-002.js deleted file mode 100644 index 401ad43c11..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/octal-002.js +++ /dev/null @@ -1,218 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * pschwartau@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * - * Date: 31 July 2002 - * SUMMARY: Testing regexps containing octal escape sequences - * This is an elaboration of mozilla/js/tests/ecma_2/RegExp/octal-003.js - * - * See http://bugzilla.mozilla.org/show_bug.cgi?id=141078 - * for a reference on octal escape sequences in regexps. - * - * NOTE: - * We will use the identities '\011' === '\u0009' === '\x09' === '\t' - * - * The first is an octal escape sequence (\(0-3)OO; O an octal digit). - * See ECMA-262 Edition 2, Section 7.7.4 "String Literals". These were - * dropped in Edition 3 but we support them for backward compatibility. - * - * The second is a Unicode escape sequence (\uHHHH; H a hex digit). - * Since octal 11 = hex 9, the two escapes define the same character. - * - * The third is a hex escape sequence (\xHH; H a hex digit). - * Since hex 09 = hex 0009, this defines the same character. - * - * The fourth is the familiar escape sequence for a horizontal tab, - * defined in the ECMA spec as having Unicode value \u0009. - */ -//----------------------------------------------------------------------------- -var gTestfile = 'octal-002.js'; -var i = 0; -var BUGNUMBER = 141078; -var summary = 'Testing regexps containing octal escape sequences'; -var status = ''; -var statusmessages = new Array(); -var pattern = ''; -var patterns = new Array(); -var string = ''; -var strings = new Array(); -var actualmatch = ''; -var actualmatches = new Array(); -var expectedmatch = ''; -var expectedmatches = new Array(); - - -/* - * Test a string containing the null character '\0' followed by the string '11' - * - * 'a' + String.fromCharCode(0) + '11'; - * - * Note we can't simply write 'a\011', because '\011' would be interpreted - * as the octal escape sequence for the tab character (see above). - * - * We should get no match from the regexp /.\011/, because it should be - * looking for the octal escape sequence \011, i.e. the tab character - - * - */ -status = inSection(1); -pattern = /.\011/; -string = 'a' + String.fromCharCode(0) + '11'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - - -/* - * Try same thing with 'xx' in place of '11'. - * - * Should get a match now, because the octal escape sequence in the regexp - * has been reduced from \011 to \0, and '\0' is present in the string - - */ -status = inSection(2); -pattern = /.\0xx/; -string = 'a' + String.fromCharCode(0) + 'xx'; -actualmatch = string.match(pattern); -expectedmatch = Array(string); -addThis(); - - -/* - * Same thing; don't use |String.fromCharCode(0)| this time. - * There is no ambiguity in '\0xx': it is the null character - * followed by two x's, no other interpretation is possible. - */ -status = inSection(3); -pattern = /.\0xx/; -string = 'a\0xx'; -actualmatch = string.match(pattern); -expectedmatch = Array(string); -addThis(); - - -/* - * This one should produce a match. The two-character string - * 'a' + '\011' is duplicated in the pattern and test string: - */ -status = inSection(4); -pattern = /.\011/; -string = 'a\011'; -actualmatch = string.match(pattern); -expectedmatch = Array(string); -addThis(); - - -/* - * Same as above, only now, for the second character of the string, - * use the Unicode escape '\u0009' instead of the octal escape '\011' - */ -status = inSection(5); -pattern = /.\011/; -string = 'a\u0009'; -actualmatch = string.match(pattern); -expectedmatch = Array(string); -addThis(); - - -/* - * Same as above, only now for the second character of the string, - * use the hex escape '\x09' instead of the octal escape '\011' - */ -status = inSection(6); -pattern = /.\011/; -string = 'a\x09'; -actualmatch = string.match(pattern); -expectedmatch = Array(string); -addThis(); - - -/* - * Same as above, only now for the second character of the string, - * use the escape '\t' instead of the octal escape '\011' - */ -status = inSection(7); -pattern = /.\011/; -string = 'a\t'; -actualmatch = string.match(pattern); -expectedmatch = Array(string); -addThis(); - - -/* - * Return to the string from Section 1. - * - * Unlike Section 1, use the RegExp() function to create the - * regexp pattern: null character followed by the string '11'. - * - * Since this is exactly what the string is, we should get a match - - */ -status = inSection(8); -string = 'a' + String.fromCharCode(0) + '11'; -pattern = RegExp(string); -actualmatch = string.match(pattern); -expectedmatch = Array(string); -addThis(); - - - - -//------------------------------------------------------------------------------------------------- -test(); -//------------------------------------------------------------------------------------------------- - - - -function addThis() -{ - statusmessages[i] = status; - patterns[i] = pattern; - strings[i] = string; - actualmatches[i] = actualmatch; - expectedmatches[i] = expectedmatch; - i++; -} - - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - testRegExp(statusmessages, patterns, strings, actualmatches, expectedmatches); - exitFunc ('test'); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/perlstress-001.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/perlstress-001.js deleted file mode 100644 index 0b27529a32..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/perlstress-001.js +++ /dev/null @@ -1,3230 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * pschwartau@netscape.com, rogerl@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * - * Date: 2002-07-07 - * SUMMARY: Testing JS RegExp engine against Perl 5 RegExp engine. - * Adjust cnLBOUND, cnUBOUND below to restrict which sections are tested. - * - * This test was created by running various patterns and strings through the - * Perl 5 RegExp engine. We saved the results below to test the JS engine. - * - * NOTE: ECMA/JS and Perl do differ on certain points. We have either commented - * out such sections altogether, or modified them to fit what we expect from JS. - * - * EXAMPLES: - * - * - In JS, regexp captures (/(a) etc./) must hold |undefined| if not used. - * See http://bugzilla.mozilla.org/show_bug.cgi?id=123437. - * By contrast, in Perl, unmatched captures hold the empty string. - * We have modified such sections accordingly. Example: - - pattern = /^([^a-z])|(\^)$/; - string = '.'; - actualmatch = string.match(pattern); - //expectedmatch = Array('.', '.', ''); <<<--- Perl - expectedmatch = Array('.', '.', undefined); <<<--- JS - addThis(); - - - * - In JS, you can't refer to a capture before it's encountered & completed - * - * - Perl supports ] & ^] inside a [], ECMA does not - * - * - ECMA does support (?: (?= and (?! operators, but doesn't support (?< etc. - * - * - ECMA doesn't support (?imsx or (?-imsx - * - * - ECMA doesn't support (?(condition) - * - * - Perl has \Z has end-of-line, ECMA doesn't - * - * - In ECMA, ^ matches only the empty string before the first character - * - * - In ECMA, $ matches only the empty string at end of input (unless multiline) - * - * - ECMA spec says that each atom in a range must be a single character - * - * - ECMA doesn't support \A - * - * - ECMA doesn't have rules for [: - * - */ -//----------------------------------------------------------------------------- -var gTestfile = 'perlstress-001.js'; -var i = 0; -var BUGNUMBER = 85721; -var summary = 'Testing regular expression edge cases'; -var cnSingleSpace = ' '; -var status = ''; -var statusmessages = new Array(); -var pattern = ''; -var patterns = new Array(); -var string = ''; -var strings = new Array(); -var actualmatch = ''; -var actualmatches = new Array(); -var expectedmatch = ''; -var expectedmatches = new Array(); -var cnLBOUND = 1; -var cnUBOUND = 1000; - - -status = inSection(1); -pattern = /abc/; -string = 'abc'; -actualmatch = string.match(pattern); -expectedmatch = Array('abc'); -addThis(); - -status = inSection(2); -pattern = /abc/; -string = 'xabcy'; -actualmatch = string.match(pattern); -expectedmatch = Array('abc'); -addThis(); - -status = inSection(3); -pattern = /abc/; -string = 'ababc'; -actualmatch = string.match(pattern); -expectedmatch = Array('abc'); -addThis(); - -status = inSection(4); -pattern = /ab*c/; -string = 'abc'; -actualmatch = string.match(pattern); -expectedmatch = Array('abc'); -addThis(); - -status = inSection(5); -pattern = /ab*bc/; -string = 'abc'; -actualmatch = string.match(pattern); -expectedmatch = Array('abc'); -addThis(); - -status = inSection(6); -pattern = /ab*bc/; -string = 'abbc'; -actualmatch = string.match(pattern); -expectedmatch = Array('abbc'); -addThis(); - -status = inSection(7); -pattern = /ab*bc/; -string = 'abbbbc'; -actualmatch = string.match(pattern); -expectedmatch = Array('abbbbc'); -addThis(); - -status = inSection(8); -pattern = /.{1}/; -string = 'abbbbc'; -actualmatch = string.match(pattern); -expectedmatch = Array('a'); -addThis(); - -status = inSection(9); -pattern = /.{3,4}/; -string = 'abbbbc'; -actualmatch = string.match(pattern); -expectedmatch = Array('abbb'); -addThis(); - -status = inSection(10); -pattern = /ab{0,}bc/; -string = 'abbbbc'; -actualmatch = string.match(pattern); -expectedmatch = Array('abbbbc'); -addThis(); - -status = inSection(11); -pattern = /ab+bc/; -string = 'abbc'; -actualmatch = string.match(pattern); -expectedmatch = Array('abbc'); -addThis(); - -status = inSection(12); -pattern = /ab+bc/; -string = 'abbbbc'; -actualmatch = string.match(pattern); -expectedmatch = Array('abbbbc'); -addThis(); - -status = inSection(13); -pattern = /ab{1,}bc/; -string = 'abbbbc'; -actualmatch = string.match(pattern); -expectedmatch = Array('abbbbc'); -addThis(); - -status = inSection(14); -pattern = /ab{1,3}bc/; -string = 'abbbbc'; -actualmatch = string.match(pattern); -expectedmatch = Array('abbbbc'); -addThis(); - -status = inSection(15); -pattern = /ab{3,4}bc/; -string = 'abbbbc'; -actualmatch = string.match(pattern); -expectedmatch = Array('abbbbc'); -addThis(); - -status = inSection(16); -pattern = /ab?bc/; -string = 'abbc'; -actualmatch = string.match(pattern); -expectedmatch = Array('abbc'); -addThis(); - -status = inSection(17); -pattern = /ab?bc/; -string = 'abc'; -actualmatch = string.match(pattern); -expectedmatch = Array('abc'); -addThis(); - -status = inSection(18); -pattern = /ab{0,1}bc/; -string = 'abc'; -actualmatch = string.match(pattern); -expectedmatch = Array('abc'); -addThis(); - -status = inSection(19); -pattern = /ab?c/; -string = 'abc'; -actualmatch = string.match(pattern); -expectedmatch = Array('abc'); -addThis(); - -status = inSection(20); -pattern = /ab{0,1}c/; -string = 'abc'; -actualmatch = string.match(pattern); -expectedmatch = Array('abc'); -addThis(); - -status = inSection(21); -pattern = /^abc$/; -string = 'abc'; -actualmatch = string.match(pattern); -expectedmatch = Array('abc'); -addThis(); - -status = inSection(22); -pattern = /^abc/; -string = 'abcc'; -actualmatch = string.match(pattern); -expectedmatch = Array('abc'); -addThis(); - -status = inSection(23); -pattern = /abc$/; -string = 'aabc'; -actualmatch = string.match(pattern); -expectedmatch = Array('abc'); -addThis(); - -status = inSection(24); -pattern = /^/; -string = 'abc'; -actualmatch = string.match(pattern); -expectedmatch = Array(''); -addThis(); - -status = inSection(25); -pattern = /$/; -string = 'abc'; -actualmatch = string.match(pattern); -expectedmatch = Array(''); -addThis(); - -status = inSection(26); -pattern = /a.c/; -string = 'abc'; -actualmatch = string.match(pattern); -expectedmatch = Array('abc'); -addThis(); - -status = inSection(27); -pattern = /a.c/; -string = 'axc'; -actualmatch = string.match(pattern); -expectedmatch = Array('axc'); -addThis(); - -status = inSection(28); -pattern = /a.*c/; -string = 'axyzc'; -actualmatch = string.match(pattern); -expectedmatch = Array('axyzc'); -addThis(); - -status = inSection(29); -pattern = /a[bc]d/; -string = 'abd'; -actualmatch = string.match(pattern); -expectedmatch = Array('abd'); -addThis(); - -status = inSection(30); -pattern = /a[b-d]e/; -string = 'ace'; -actualmatch = string.match(pattern); -expectedmatch = Array('ace'); -addThis(); - -status = inSection(31); -pattern = /a[b-d]/; -string = 'aac'; -actualmatch = string.match(pattern); -expectedmatch = Array('ac'); -addThis(); - -status = inSection(32); -pattern = /a[-b]/; -string = 'a-'; -actualmatch = string.match(pattern); -expectedmatch = Array('a-'); -addThis(); - -status = inSection(33); -pattern = /a[b-]/; -string = 'a-'; -actualmatch = string.match(pattern); -expectedmatch = Array('a-'); -addThis(); - -status = inSection(34); -pattern = /a]/; -string = 'a]'; -actualmatch = string.match(pattern); -expectedmatch = Array('a]'); -addThis(); - -/* Perl supports ] & ^] inside a [], ECMA does not - pattern = /a[]]b/; - status = inSection(35); - string = 'a]b'; - actualmatch = string.match(pattern); - expectedmatch = Array('a]b'); - addThis(); -*/ - -status = inSection(36); -pattern = /a[^bc]d/; -string = 'aed'; -actualmatch = string.match(pattern); -expectedmatch = Array('aed'); -addThis(); - -status = inSection(37); -pattern = /a[^-b]c/; -string = 'adc'; -actualmatch = string.match(pattern); -expectedmatch = Array('adc'); -addThis(); - -/* Perl supports ] & ^] inside a [], ECMA does not - status = inSection(38); - pattern = /a[^]b]c/; - string = 'adc'; - actualmatch = string.match(pattern); - expectedmatch = Array('adc'); - addThis(); -*/ - -status = inSection(39); -pattern = /\ba\b/; -string = 'a-'; -actualmatch = string.match(pattern); -expectedmatch = Array('a'); -addThis(); - -status = inSection(40); -pattern = /\ba\b/; -string = '-a'; -actualmatch = string.match(pattern); -expectedmatch = Array('a'); -addThis(); - -status = inSection(41); -pattern = /\ba\b/; -string = '-a-'; -actualmatch = string.match(pattern); -expectedmatch = Array('a'); -addThis(); - -status = inSection(42); -pattern = /\By\b/; -string = 'xy'; -actualmatch = string.match(pattern); -expectedmatch = Array('y'); -addThis(); - -status = inSection(43); -pattern = /\by\B/; -string = 'yz'; -actualmatch = string.match(pattern); -expectedmatch = Array('y'); -addThis(); - -status = inSection(44); -pattern = /\By\B/; -string = 'xyz'; -actualmatch = string.match(pattern); -expectedmatch = Array('y'); -addThis(); - -status = inSection(45); -pattern = /\w/; -string = 'a'; -actualmatch = string.match(pattern); -expectedmatch = Array('a'); -addThis(); - -status = inSection(46); -pattern = /\W/; -string = '-'; -actualmatch = string.match(pattern); -expectedmatch = Array('-'); -addThis(); - -status = inSection(47); -pattern = /a\Sb/; -string = 'a-b'; -actualmatch = string.match(pattern); -expectedmatch = Array('a-b'); -addThis(); - -status = inSection(48); -pattern = /\d/; -string = '1'; -actualmatch = string.match(pattern); -expectedmatch = Array('1'); -addThis(); - -status = inSection(49); -pattern = /\D/; -string = '-'; -actualmatch = string.match(pattern); -expectedmatch = Array('-'); -addThis(); - -status = inSection(50); -pattern = /[\w]/; -string = 'a'; -actualmatch = string.match(pattern); -expectedmatch = Array('a'); -addThis(); - -status = inSection(51); -pattern = /[\W]/; -string = '-'; -actualmatch = string.match(pattern); -expectedmatch = Array('-'); -addThis(); - -status = inSection(52); -pattern = /a[\S]b/; -string = 'a-b'; -actualmatch = string.match(pattern); -expectedmatch = Array('a-b'); -addThis(); - -status = inSection(53); -pattern = /[\d]/; -string = '1'; -actualmatch = string.match(pattern); -expectedmatch = Array('1'); -addThis(); - -status = inSection(54); -pattern = /[\D]/; -string = '-'; -actualmatch = string.match(pattern); -expectedmatch = Array('-'); -addThis(); - -status = inSection(55); -pattern = /ab|cd/; -string = 'abc'; -actualmatch = string.match(pattern); -expectedmatch = Array('ab'); -addThis(); - -status = inSection(56); -pattern = /ab|cd/; -string = 'abcd'; -actualmatch = string.match(pattern); -expectedmatch = Array('ab'); -addThis(); - -status = inSection(57); -pattern = /()ef/; -string = 'def'; -actualmatch = string.match(pattern); -expectedmatch = Array('ef', ''); -addThis(); - -status = inSection(58); -pattern = /a\(b/; -string = 'a(b'; -actualmatch = string.match(pattern); -expectedmatch = Array('a(b'); -addThis(); - -status = inSection(59); -pattern = /a\(*b/; -string = 'ab'; -actualmatch = string.match(pattern); -expectedmatch = Array('ab'); -addThis(); - -status = inSection(60); -pattern = /a\(*b/; -string = 'a((b'; -actualmatch = string.match(pattern); -expectedmatch = Array('a((b'); -addThis(); - -status = inSection(61); -pattern = /a\\b/; -string = 'a\\b'; -actualmatch = string.match(pattern); -expectedmatch = Array('a\\b'); -addThis(); - -status = inSection(62); -pattern = /((a))/; -string = 'abc'; -actualmatch = string.match(pattern); -expectedmatch = Array('a', 'a', 'a'); -addThis(); - -status = inSection(63); -pattern = /(a)b(c)/; -string = 'abc'; -actualmatch = string.match(pattern); -expectedmatch = Array('abc', 'a', 'c'); -addThis(); - -status = inSection(64); -pattern = /a+b+c/; -string = 'aabbabc'; -actualmatch = string.match(pattern); -expectedmatch = Array('abc'); -addThis(); - -status = inSection(65); -pattern = /a{1,}b{1,}c/; -string = 'aabbabc'; -actualmatch = string.match(pattern); -expectedmatch = Array('abc'); -addThis(); - -status = inSection(66); -pattern = /a.+?c/; -string = 'abcabc'; -actualmatch = string.match(pattern); -expectedmatch = Array('abc'); -addThis(); - -status = inSection(67); -pattern = /(a+|b)*/; -string = 'ab'; -actualmatch = string.match(pattern); -expectedmatch = Array('ab', 'b'); -addThis(); - -status = inSection(68); -pattern = /(a+|b){0,}/; -string = 'ab'; -actualmatch = string.match(pattern); -expectedmatch = Array('ab', 'b'); -addThis(); - -status = inSection(69); -pattern = /(a+|b)+/; -string = 'ab'; -actualmatch = string.match(pattern); -expectedmatch = Array('ab', 'b'); -addThis(); - -status = inSection(70); -pattern = /(a+|b){1,}/; -string = 'ab'; -actualmatch = string.match(pattern); -expectedmatch = Array('ab', 'b'); -addThis(); - -status = inSection(71); -pattern = /(a+|b)?/; -string = 'ab'; -actualmatch = string.match(pattern); -expectedmatch = Array('a', 'a'); -addThis(); - -status = inSection(72); -pattern = /(a+|b){0,1}/; -string = 'ab'; -actualmatch = string.match(pattern); -expectedmatch = Array('a', 'a'); -addThis(); - -status = inSection(73); -pattern = /[^ab]*/; -string = 'cde'; -actualmatch = string.match(pattern); -expectedmatch = Array('cde'); -addThis(); - -status = inSection(74); -pattern = /([abc])*d/; -string = 'abbbcd'; -actualmatch = string.match(pattern); -expectedmatch = Array('abbbcd', 'c'); -addThis(); - -status = inSection(75); -pattern = /([abc])*bcd/; -string = 'abcd'; -actualmatch = string.match(pattern); -expectedmatch = Array('abcd', 'a'); -addThis(); - -status = inSection(76); -pattern = /a|b|c|d|e/; -string = 'e'; -actualmatch = string.match(pattern); -expectedmatch = Array('e'); -addThis(); - -status = inSection(77); -pattern = /(a|b|c|d|e)f/; -string = 'ef'; -actualmatch = string.match(pattern); -expectedmatch = Array('ef', 'e'); -addThis(); - -status = inSection(78); -pattern = /abcd*efg/; -string = 'abcdefg'; -actualmatch = string.match(pattern); -expectedmatch = Array('abcdefg'); -addThis(); - -status = inSection(79); -pattern = /ab*/; -string = 'xabyabbbz'; -actualmatch = string.match(pattern); -expectedmatch = Array('ab'); -addThis(); - -status = inSection(80); -pattern = /ab*/; -string = 'xayabbbz'; -actualmatch = string.match(pattern); -expectedmatch = Array('a'); -addThis(); - -status = inSection(81); -pattern = /(ab|cd)e/; -string = 'abcde'; -actualmatch = string.match(pattern); -expectedmatch = Array('cde', 'cd'); -addThis(); - -status = inSection(82); -pattern = /[abhgefdc]ij/; -string = 'hij'; -actualmatch = string.match(pattern); -expectedmatch = Array('hij'); -addThis(); - -status = inSection(83); -pattern = /(abc|)ef/; -string = 'abcdef'; -actualmatch = string.match(pattern); -expectedmatch = Array('ef', ''); -addThis(); - -status = inSection(84); -pattern = /(a|b)c*d/; -string = 'abcd'; -actualmatch = string.match(pattern); -expectedmatch = Array('bcd', 'b'); -addThis(); - -status = inSection(85); -pattern = /(ab|ab*)bc/; -string = 'abc'; -actualmatch = string.match(pattern); -expectedmatch = Array('abc', 'a'); -addThis(); - -status = inSection(86); -pattern = /a([bc]*)c*/; -string = 'abc'; -actualmatch = string.match(pattern); -expectedmatch = Array('abc', 'bc'); -addThis(); - -status = inSection(87); -pattern = /a([bc]*)(c*d)/; -string = 'abcd'; -actualmatch = string.match(pattern); -expectedmatch = Array('abcd', 'bc', 'd'); -addThis(); - -status = inSection(88); -pattern = /a([bc]+)(c*d)/; -string = 'abcd'; -actualmatch = string.match(pattern); -expectedmatch = Array('abcd', 'bc', 'd'); -addThis(); - -status = inSection(89); -pattern = /a([bc]*)(c+d)/; -string = 'abcd'; -actualmatch = string.match(pattern); -expectedmatch = Array('abcd', 'b', 'cd'); -addThis(); - -status = inSection(90); -pattern = /a[bcd]*dcdcde/; -string = 'adcdcde'; -actualmatch = string.match(pattern); -expectedmatch = Array('adcdcde'); -addThis(); - -status = inSection(91); -pattern = /(ab|a)b*c/; -string = 'abc'; -actualmatch = string.match(pattern); -expectedmatch = Array('abc', 'ab'); -addThis(); - -status = inSection(92); -pattern = /((a)(b)c)(d)/; -string = 'abcd'; -actualmatch = string.match(pattern); -expectedmatch = Array('abcd', 'abc', 'a', 'b', 'd'); -addThis(); - -status = inSection(93); -pattern = /[a-zA-Z_][a-zA-Z0-9_]*/; -string = 'alpha'; -actualmatch = string.match(pattern); -expectedmatch = Array('alpha'); -addThis(); - -status = inSection(94); -pattern = /^a(bc+|b[eh])g|.h$/; -string = 'abh'; -actualmatch = string.match(pattern); -expectedmatch = Array('bh', undefined); -addThis(); - -status = inSection(95); -pattern = /(bc+d$|ef*g.|h?i(j|k))/; -string = 'effgz'; -actualmatch = string.match(pattern); -expectedmatch = Array('effgz', 'effgz', undefined); -addThis(); - -status = inSection(96); -pattern = /(bc+d$|ef*g.|h?i(j|k))/; -string = 'ij'; -actualmatch = string.match(pattern); -expectedmatch = Array('ij', 'ij', 'j'); -addThis(); - -status = inSection(97); -pattern = /(bc+d$|ef*g.|h?i(j|k))/; -string = 'reffgz'; -actualmatch = string.match(pattern); -expectedmatch = Array('effgz', 'effgz', undefined); -addThis(); - -status = inSection(98); -pattern = /((((((((((a))))))))))/; -string = 'a'; -actualmatch = string.match(pattern); -expectedmatch = Array('a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a'); -addThis(); - -status = inSection(99); -pattern = /((((((((((a))))))))))\10/; -string = 'aa'; -actualmatch = string.match(pattern); -expectedmatch = Array('aa', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a'); -addThis(); - -status = inSection(100); -pattern = /((((((((((a))))))))))/; -string = 'a!'; -actualmatch = string.match(pattern); -expectedmatch = Array('a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a'); -addThis(); - -status = inSection(101); -pattern = /(((((((((a)))))))))/; -string = 'a'; -actualmatch = string.match(pattern); -expectedmatch = Array('a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a'); -addThis(); - -status = inSection(102); -pattern = /(.*)c(.*)/; -string = 'abcde'; -actualmatch = string.match(pattern); -expectedmatch = Array('abcde', 'ab', 'de'); -addThis(); - -status = inSection(103); -pattern = /abcd/; -string = 'abcd'; -actualmatch = string.match(pattern); -expectedmatch = Array('abcd'); -addThis(); - -status = inSection(104); -pattern = /a(bc)d/; -string = 'abcd'; -actualmatch = string.match(pattern); -expectedmatch = Array('abcd', 'bc'); -addThis(); - -status = inSection(105); -pattern = /a[-]?c/; -string = 'ac'; -actualmatch = string.match(pattern); -expectedmatch = Array('ac'); -addThis(); - -status = inSection(106); -pattern = /(abc)\1/; -string = 'abcabc'; -actualmatch = string.match(pattern); -expectedmatch = Array('abcabc', 'abc'); -addThis(); - -status = inSection(107); -pattern = /([a-c]*)\1/; -string = 'abcabc'; -actualmatch = string.match(pattern); -expectedmatch = Array('abcabc', 'abc'); -addThis(); - -status = inSection(108); -pattern = /(a)|\1/; -string = 'a'; -actualmatch = string.match(pattern); -expectedmatch = Array('a', 'a'); -addThis(); - -status = inSection(109); -pattern = /(([a-c])b*?\2)*/; -string = 'ababbbcbc'; -actualmatch = string.match(pattern); -expectedmatch = Array('ababb', 'bb', 'b'); -addThis(); - -status = inSection(110); -pattern = /(([a-c])b*?\2){3}/; -string = 'ababbbcbc'; -actualmatch = string.match(pattern); -expectedmatch = Array('ababbbcbc', 'cbc', 'c'); -addThis(); - -/* Can't refer to a capture before it's encountered & completed - status = inSection(111); - pattern = /((\3|b)\2(a)x)+/; - string = 'aaaxabaxbaaxbbax'; - actualmatch = string.match(pattern); - expectedmatch = Array('bbax', 'bbax', 'b', 'a'); - addThis(); - - status = inSection(112); - pattern = /((\3|b)\2(a)){2,}/; - string = 'bbaababbabaaaaabbaaaabba'; - actualmatch = string.match(pattern); - expectedmatch = Array('bbaaaabba', 'bba', 'b', 'a'); - addThis(); -*/ - -status = inSection(113); -pattern = /abc/i; -string = 'ABC'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABC'); -addThis(); - -status = inSection(114); -pattern = /abc/i; -string = 'XABCY'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABC'); -addThis(); - -status = inSection(115); -pattern = /abc/i; -string = 'ABABC'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABC'); -addThis(); - -status = inSection(116); -pattern = /ab*c/i; -string = 'ABC'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABC'); -addThis(); - -status = inSection(117); -pattern = /ab*bc/i; -string = 'ABC'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABC'); -addThis(); - -status = inSection(118); -pattern = /ab*bc/i; -string = 'ABBC'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABBC'); -addThis(); - -status = inSection(119); -pattern = /ab*?bc/i; -string = 'ABBBBC'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABBBBC'); -addThis(); - -status = inSection(120); -pattern = /ab{0,}?bc/i; -string = 'ABBBBC'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABBBBC'); -addThis(); - -status = inSection(121); -pattern = /ab+?bc/i; -string = 'ABBC'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABBC'); -addThis(); - -status = inSection(122); -pattern = /ab+bc/i; -string = 'ABBBBC'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABBBBC'); -addThis(); - -status = inSection(123); -pattern = /ab{1,}?bc/i; -string = 'ABBBBC'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABBBBC'); -addThis(); - -status = inSection(124); -pattern = /ab{1,3}?bc/i; -string = 'ABBBBC'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABBBBC'); -addThis(); - -status = inSection(125); -pattern = /ab{3,4}?bc/i; -string = 'ABBBBC'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABBBBC'); -addThis(); - -status = inSection(126); -pattern = /ab??bc/i; -string = 'ABBC'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABBC'); -addThis(); - -status = inSection(127); -pattern = /ab??bc/i; -string = 'ABC'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABC'); -addThis(); - -status = inSection(128); -pattern = /ab{0,1}?bc/i; -string = 'ABC'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABC'); -addThis(); - -status = inSection(129); -pattern = /ab??c/i; -string = 'ABC'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABC'); -addThis(); - -status = inSection(130); -pattern = /ab{0,1}?c/i; -string = 'ABC'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABC'); -addThis(); - -status = inSection(131); -pattern = /^abc$/i; -string = 'ABC'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABC'); -addThis(); - -status = inSection(132); -pattern = /^abc/i; -string = 'ABCC'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABC'); -addThis(); - -status = inSection(133); -pattern = /abc$/i; -string = 'AABC'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABC'); -addThis(); - -status = inSection(134); -pattern = /^/i; -string = 'ABC'; -actualmatch = string.match(pattern); -expectedmatch = Array(''); -addThis(); - -status = inSection(135); -pattern = /$/i; -string = 'ABC'; -actualmatch = string.match(pattern); -expectedmatch = Array(''); -addThis(); - -status = inSection(136); -pattern = /a.c/i; -string = 'ABC'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABC'); -addThis(); - -status = inSection(137); -pattern = /a.c/i; -string = 'AXC'; -actualmatch = string.match(pattern); -expectedmatch = Array('AXC'); -addThis(); - -status = inSection(138); -pattern = /a.*?c/i; -string = 'AXYZC'; -actualmatch = string.match(pattern); -expectedmatch = Array('AXYZC'); -addThis(); - -status = inSection(139); -pattern = /a[bc]d/i; -string = 'ABD'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABD'); -addThis(); - -status = inSection(140); -pattern = /a[b-d]e/i; -string = 'ACE'; -actualmatch = string.match(pattern); -expectedmatch = Array('ACE'); -addThis(); - -status = inSection(141); -pattern = /a[b-d]/i; -string = 'AAC'; -actualmatch = string.match(pattern); -expectedmatch = Array('AC'); -addThis(); - -status = inSection(142); -pattern = /a[-b]/i; -string = 'A-'; -actualmatch = string.match(pattern); -expectedmatch = Array('A-'); -addThis(); - -status = inSection(143); -pattern = /a[b-]/i; -string = 'A-'; -actualmatch = string.match(pattern); -expectedmatch = Array('A-'); -addThis(); - -status = inSection(144); -pattern = /a]/i; -string = 'A]'; -actualmatch = string.match(pattern); -expectedmatch = Array('A]'); -addThis(); - -/* Perl supports ] & ^] inside a [], ECMA does not - status = inSection(145); - pattern = /a[]]b/i; - string = 'A]B'; - actualmatch = string.match(pattern); - expectedmatch = Array('A]B'); - addThis(); -*/ - -status = inSection(146); -pattern = /a[^bc]d/i; -string = 'AED'; -actualmatch = string.match(pattern); -expectedmatch = Array('AED'); -addThis(); - -status = inSection(147); -pattern = /a[^-b]c/i; -string = 'ADC'; -actualmatch = string.match(pattern); -expectedmatch = Array('ADC'); -addThis(); - -/* Perl supports ] & ^] inside a [], ECMA does not - status = inSection(148); - pattern = /a[^]b]c/i; - string = 'ADC'; - actualmatch = string.match(pattern); - expectedmatch = Array('ADC'); - addThis(); -*/ - -status = inSection(149); -pattern = /ab|cd/i; -string = 'ABC'; -actualmatch = string.match(pattern); -expectedmatch = Array('AB'); -addThis(); - -status = inSection(150); -pattern = /ab|cd/i; -string = 'ABCD'; -actualmatch = string.match(pattern); -expectedmatch = Array('AB'); -addThis(); - -status = inSection(151); -pattern = /()ef/i; -string = 'DEF'; -actualmatch = string.match(pattern); -expectedmatch = Array('EF', ''); -addThis(); - -status = inSection(152); -pattern = /a\(b/i; -string = 'A(B'; -actualmatch = string.match(pattern); -expectedmatch = Array('A(B'); -addThis(); - -status = inSection(153); -pattern = /a\(*b/i; -string = 'AB'; -actualmatch = string.match(pattern); -expectedmatch = Array('AB'); -addThis(); - -status = inSection(154); -pattern = /a\(*b/i; -string = 'A((B'; -actualmatch = string.match(pattern); -expectedmatch = Array('A((B'); -addThis(); - -status = inSection(155); -pattern = /a\\b/i; -string = 'A\\B'; -actualmatch = string.match(pattern); -expectedmatch = Array('A\\B'); -addThis(); - -status = inSection(156); -pattern = /((a))/i; -string = 'ABC'; -actualmatch = string.match(pattern); -expectedmatch = Array('A', 'A', 'A'); -addThis(); - -status = inSection(157); -pattern = /(a)b(c)/i; -string = 'ABC'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABC', 'A', 'C'); -addThis(); - -status = inSection(158); -pattern = /a+b+c/i; -string = 'AABBABC'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABC'); -addThis(); - -status = inSection(159); -pattern = /a{1,}b{1,}c/i; -string = 'AABBABC'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABC'); -addThis(); - -status = inSection(160); -pattern = /a.+?c/i; -string = 'ABCABC'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABC'); -addThis(); - -status = inSection(161); -pattern = /a.*?c/i; -string = 'ABCABC'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABC'); -addThis(); - -status = inSection(162); -pattern = /a.{0,5}?c/i; -string = 'ABCABC'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABC'); -addThis(); - -status = inSection(163); -pattern = /(a+|b)*/i; -string = 'AB'; -actualmatch = string.match(pattern); -expectedmatch = Array('AB', 'B'); -addThis(); - -status = inSection(164); -pattern = /(a+|b){0,}/i; -string = 'AB'; -actualmatch = string.match(pattern); -expectedmatch = Array('AB', 'B'); -addThis(); - -status = inSection(165); -pattern = /(a+|b)+/i; -string = 'AB'; -actualmatch = string.match(pattern); -expectedmatch = Array('AB', 'B'); -addThis(); - -status = inSection(166); -pattern = /(a+|b){1,}/i; -string = 'AB'; -actualmatch = string.match(pattern); -expectedmatch = Array('AB', 'B'); -addThis(); - -status = inSection(167); -pattern = /(a+|b)?/i; -string = 'AB'; -actualmatch = string.match(pattern); -expectedmatch = Array('A', 'A'); -addThis(); - -status = inSection(168); -pattern = /(a+|b){0,1}/i; -string = 'AB'; -actualmatch = string.match(pattern); -expectedmatch = Array('A', 'A'); -addThis(); - -status = inSection(169); -pattern = /(a+|b){0,1}?/i; -string = 'AB'; -actualmatch = string.match(pattern); -expectedmatch = Array('', undefined); -addThis(); - -status = inSection(170); -pattern = /[^ab]*/i; -string = 'CDE'; -actualmatch = string.match(pattern); -expectedmatch = Array('CDE'); -addThis(); - -status = inSection(171); -pattern = /([abc])*d/i; -string = 'ABBBCD'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABBBCD', 'C'); -addThis(); - -status = inSection(172); -pattern = /([abc])*bcd/i; -string = 'ABCD'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABCD', 'A'); -addThis(); - -status = inSection(173); -pattern = /a|b|c|d|e/i; -string = 'E'; -actualmatch = string.match(pattern); -expectedmatch = Array('E'); -addThis(); - -status = inSection(174); -pattern = /(a|b|c|d|e)f/i; -string = 'EF'; -actualmatch = string.match(pattern); -expectedmatch = Array('EF', 'E'); -addThis(); - -status = inSection(175); -pattern = /abcd*efg/i; -string = 'ABCDEFG'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABCDEFG'); -addThis(); - -status = inSection(176); -pattern = /ab*/i; -string = 'XABYABBBZ'; -actualmatch = string.match(pattern); -expectedmatch = Array('AB'); -addThis(); - -status = inSection(177); -pattern = /ab*/i; -string = 'XAYABBBZ'; -actualmatch = string.match(pattern); -expectedmatch = Array('A'); -addThis(); - -status = inSection(178); -pattern = /(ab|cd)e/i; -string = 'ABCDE'; -actualmatch = string.match(pattern); -expectedmatch = Array('CDE', 'CD'); -addThis(); - -status = inSection(179); -pattern = /[abhgefdc]ij/i; -string = 'HIJ'; -actualmatch = string.match(pattern); -expectedmatch = Array('HIJ'); -addThis(); - -status = inSection(180); -pattern = /(abc|)ef/i; -string = 'ABCDEF'; -actualmatch = string.match(pattern); -expectedmatch = Array('EF', ''); -addThis(); - -status = inSection(181); -pattern = /(a|b)c*d/i; -string = 'ABCD'; -actualmatch = string.match(pattern); -expectedmatch = Array('BCD', 'B'); -addThis(); - -status = inSection(182); -pattern = /(ab|ab*)bc/i; -string = 'ABC'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABC', 'A'); -addThis(); - -status = inSection(183); -pattern = /a([bc]*)c*/i; -string = 'ABC'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABC', 'BC'); -addThis(); - -status = inSection(184); -pattern = /a([bc]*)(c*d)/i; -string = 'ABCD'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABCD', 'BC', 'D'); -addThis(); - -status = inSection(185); -pattern = /a([bc]+)(c*d)/i; -string = 'ABCD'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABCD', 'BC', 'D'); -addThis(); - -status = inSection(186); -pattern = /a([bc]*)(c+d)/i; -string = 'ABCD'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABCD', 'B', 'CD'); -addThis(); - -status = inSection(187); -pattern = /a[bcd]*dcdcde/i; -string = 'ADCDCDE'; -actualmatch = string.match(pattern); -expectedmatch = Array('ADCDCDE'); -addThis(); - -status = inSection(188); -pattern = /(ab|a)b*c/i; -string = 'ABC'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABC', 'AB'); -addThis(); - -status = inSection(189); -pattern = /((a)(b)c)(d)/i; -string = 'ABCD'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABCD', 'ABC', 'A', 'B', 'D'); -addThis(); - -status = inSection(190); -pattern = /[a-zA-Z_][a-zA-Z0-9_]*/i; -string = 'ALPHA'; -actualmatch = string.match(pattern); -expectedmatch = Array('ALPHA'); -addThis(); - -status = inSection(191); -pattern = /^a(bc+|b[eh])g|.h$/i; -string = 'ABH'; -actualmatch = string.match(pattern); -expectedmatch = Array('BH', undefined); -addThis(); - -status = inSection(192); -pattern = /(bc+d$|ef*g.|h?i(j|k))/i; -string = 'EFFGZ'; -actualmatch = string.match(pattern); -expectedmatch = Array('EFFGZ', 'EFFGZ', undefined); -addThis(); - -status = inSection(193); -pattern = /(bc+d$|ef*g.|h?i(j|k))/i; -string = 'IJ'; -actualmatch = string.match(pattern); -expectedmatch = Array('IJ', 'IJ', 'J'); -addThis(); - -status = inSection(194); -pattern = /(bc+d$|ef*g.|h?i(j|k))/i; -string = 'REFFGZ'; -actualmatch = string.match(pattern); -expectedmatch = Array('EFFGZ', 'EFFGZ', undefined); -addThis(); - -status = inSection(195); -pattern = /((((((((((a))))))))))/i; -string = 'A'; -actualmatch = string.match(pattern); -expectedmatch = Array('A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A'); -addThis(); - -status = inSection(196); -pattern = /((((((((((a))))))))))\10/i; -string = 'AA'; -actualmatch = string.match(pattern); -expectedmatch = Array('AA', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A'); -addThis(); - -status = inSection(197); -pattern = /((((((((((a))))))))))/i; -string = 'A!'; -actualmatch = string.match(pattern); -expectedmatch = Array('A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A'); -addThis(); - -status = inSection(198); -pattern = /(((((((((a)))))))))/i; -string = 'A'; -actualmatch = string.match(pattern); -expectedmatch = Array('A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A'); -addThis(); - -status = inSection(199); -pattern = /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a))))))))))/i; -string = 'A'; -actualmatch = string.match(pattern); -expectedmatch = Array('A', 'A'); -addThis(); - -status = inSection(200); -pattern = /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))/i; -string = 'C'; -actualmatch = string.match(pattern); -expectedmatch = Array('C', 'C'); -addThis(); - -status = inSection(201); -pattern = /(.*)c(.*)/i; -string = 'ABCDE'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABCDE', 'AB', 'DE'); -addThis(); - -status = inSection(202); -pattern = /abcd/i; -string = 'ABCD'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABCD'); -addThis(); - -status = inSection(203); -pattern = /a(bc)d/i; -string = 'ABCD'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABCD', 'BC'); -addThis(); - -status = inSection(204); -pattern = /a[-]?c/i; -string = 'AC'; -actualmatch = string.match(pattern); -expectedmatch = Array('AC'); -addThis(); - -status = inSection(205); -pattern = /(abc)\1/i; -string = 'ABCABC'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABCABC', 'ABC'); -addThis(); - -status = inSection(206); -pattern = /([a-c]*)\1/i; -string = 'ABCABC'; -actualmatch = string.match(pattern); -expectedmatch = Array('ABCABC', 'ABC'); -addThis(); - -status = inSection(207); -pattern = /a(?!b)./; -string = 'abad'; -actualmatch = string.match(pattern); -expectedmatch = Array('ad'); -addThis(); - -status = inSection(208); -pattern = /a(?=d)./; -string = 'abad'; -actualmatch = string.match(pattern); -expectedmatch = Array('ad'); -addThis(); - -status = inSection(209); -pattern = /a(?=c|d)./; -string = 'abad'; -actualmatch = string.match(pattern); -expectedmatch = Array('ad'); -addThis(); - -status = inSection(210); -pattern = /a(?:b|c|d)(.)/; -string = 'ace'; -actualmatch = string.match(pattern); -expectedmatch = Array('ace', 'e'); -addThis(); - -status = inSection(211); -pattern = /a(?:b|c|d)*(.)/; -string = 'ace'; -actualmatch = string.match(pattern); -expectedmatch = Array('ace', 'e'); -addThis(); - -status = inSection(212); -pattern = /a(?:b|c|d)+?(.)/; -string = 'ace'; -actualmatch = string.match(pattern); -expectedmatch = Array('ace', 'e'); -addThis(); - -status = inSection(213); -pattern = /a(?:b|c|d)+?(.)/; -string = 'acdbcdbe'; -actualmatch = string.match(pattern); -expectedmatch = Array('acd', 'd'); -addThis(); - -status = inSection(214); -pattern = /a(?:b|c|d)+(.)/; -string = 'acdbcdbe'; -actualmatch = string.match(pattern); -expectedmatch = Array('acdbcdbe', 'e'); -addThis(); - -status = inSection(215); -pattern = /a(?:b|c|d){2}(.)/; -string = 'acdbcdbe'; -actualmatch = string.match(pattern); -expectedmatch = Array('acdb', 'b'); -addThis(); - -status = inSection(216); -pattern = /a(?:b|c|d){4,5}(.)/; -string = 'acdbcdbe'; -actualmatch = string.match(pattern); -expectedmatch = Array('acdbcdb', 'b'); -addThis(); - -status = inSection(217); -pattern = /a(?:b|c|d){4,5}?(.)/; -string = 'acdbcdbe'; -actualmatch = string.match(pattern); -expectedmatch = Array('acdbcd', 'd'); -addThis(); - -// MODIFIED - ECMA has different rules for paren contents -status = inSection(218); -pattern = /((foo)|(bar))*/; -string = 'foobar'; -actualmatch = string.match(pattern); -//expectedmatch = Array('foobar', 'bar', 'foo', 'bar'); -expectedmatch = Array('foobar', 'bar', undefined, 'bar'); -addThis(); - -status = inSection(219); -pattern = /a(?:b|c|d){6,7}(.)/; -string = 'acdbcdbe'; -actualmatch = string.match(pattern); -expectedmatch = Array('acdbcdbe', 'e'); -addThis(); - -status = inSection(220); -pattern = /a(?:b|c|d){6,7}?(.)/; -string = 'acdbcdbe'; -actualmatch = string.match(pattern); -expectedmatch = Array('acdbcdbe', 'e'); -addThis(); - -status = inSection(221); -pattern = /a(?:b|c|d){5,6}(.)/; -string = 'acdbcdbe'; -actualmatch = string.match(pattern); -expectedmatch = Array('acdbcdbe', 'e'); -addThis(); - -status = inSection(222); -pattern = /a(?:b|c|d){5,6}?(.)/; -string = 'acdbcdbe'; -actualmatch = string.match(pattern); -expectedmatch = Array('acdbcdb', 'b'); -addThis(); - -status = inSection(223); -pattern = /a(?:b|c|d){5,7}(.)/; -string = 'acdbcdbe'; -actualmatch = string.match(pattern); -expectedmatch = Array('acdbcdbe', 'e'); -addThis(); - -status = inSection(224); -pattern = /a(?:b|c|d){5,7}?(.)/; -string = 'acdbcdbe'; -actualmatch = string.match(pattern); -expectedmatch = Array('acdbcdb', 'b'); -addThis(); - -status = inSection(225); -pattern = /a(?:b|(c|e){1,2}?|d)+?(.)/; -string = 'ace'; -actualmatch = string.match(pattern); -expectedmatch = Array('ace', 'c', 'e'); -addThis(); - -status = inSection(226); -pattern = /^(.+)?B/; -string = 'AB'; -actualmatch = string.match(pattern); -expectedmatch = Array('AB', 'A'); -addThis(); - -/* MODIFIED - ECMA has different rules for paren contents */ -status = inSection(227); -pattern = /^([^a-z])|(\^)$/; -string = '.'; -actualmatch = string.match(pattern); -//expectedmatch = Array('.', '.', ''); -expectedmatch = Array('.', '.', undefined); -addThis(); - -status = inSection(228); -pattern = /^[<>]&/; -string = '<&OUT'; -actualmatch = string.match(pattern); -expectedmatch = Array('<&'); -addThis(); - -/* Can't refer to a capture before it's encountered & completed - status = inSection(229); - pattern = /^(a\1?){4}$/; - string = 'aaaaaaaaaa'; - actualmatch = string.match(pattern); - expectedmatch = Array('aaaaaaaaaa', 'aaaa'); - addThis(); - - status = inSection(230); - pattern = /^(a(?(1)\1)){4}$/; - string = 'aaaaaaaaaa'; - actualmatch = string.match(pattern); - expectedmatch = Array('aaaaaaaaaa', 'aaaa'); - addThis(); -*/ - -status = inSection(231); -pattern = /((a{4})+)/; -string = 'aaaaaaaaa'; -actualmatch = string.match(pattern); -expectedmatch = Array('aaaaaaaa', 'aaaaaaaa', 'aaaa'); -addThis(); - -status = inSection(232); -pattern = /(((aa){2})+)/; -string = 'aaaaaaaaaa'; -actualmatch = string.match(pattern); -expectedmatch = Array('aaaaaaaa', 'aaaaaaaa', 'aaaa', 'aa'); -addThis(); - -status = inSection(233); -pattern = /(((a{2}){2})+)/; -string = 'aaaaaaaaaa'; -actualmatch = string.match(pattern); -expectedmatch = Array('aaaaaaaa', 'aaaaaaaa', 'aaaa', 'aa'); -addThis(); - -status = inSection(234); -pattern = /(?:(f)(o)(o)|(b)(a)(r))*/; -string = 'foobar'; -actualmatch = string.match(pattern); -//expectedmatch = Array('foobar', 'f', 'o', 'o', 'b', 'a', 'r'); -expectedmatch = Array('foobar', undefined, undefined, undefined, 'b', 'a', 'r'); -addThis(); - -/* ECMA supports (?: (?= and (?! but doesn't support (?< etc. - status = inSection(235); - pattern = /(?<=a)b/; - string = 'ab'; - actualmatch = string.match(pattern); - expectedmatch = Array('b'); - addThis(); - - status = inSection(236); - pattern = /(? - status = inSection(311); - pattern = /(?>a+)b/; - string = 'aaab'; - actualmatch = string.match(pattern); - expectedmatch = Array('aaab'); - addThis(); -*/ - -status = inSection(312); -pattern = /([[:]+)/; - string = 'a:[b]:'; - actualmatch = string.match(pattern); - expectedmatch = Array(':[', ':['); - addThis(); - - status = inSection(313); - pattern = /([[=]+)/; - string = 'a=[b]='; - actualmatch = string.match(pattern); - expectedmatch = Array('=[', '=['); - addThis(); - - status = inSection(314); - pattern = /([[.]+)/; - string = 'a.[b].'; - actualmatch = string.match(pattern); - expectedmatch = Array('.[', '.['); - addThis(); - -/* ECMA doesn't have rules for [: - status = inSection(315); - pattern = /[a[:]b[:c]/; - string = 'abc'; - actualmatch = string.match(pattern); - expectedmatch = Array('abc'); - addThis(); -*/ - -/* ECMA doesn't support (?> - status = inSection(316); - pattern = /((?>a+)b)/; - string = 'aaab'; - actualmatch = string.match(pattern); - expectedmatch = Array('aaab', 'aaab'); - addThis(); - - status = inSection(317); - pattern = /(?>(a+))b/; - string = 'aaab'; - actualmatch = string.match(pattern); - expectedmatch = Array('aaab', 'aaa'); - addThis(); - - status = inSection(318); - pattern = /((?>[^()]+)|\([^()]*\))+/; - string = '((abc(ade)ufh()()x'; - actualmatch = string.match(pattern); - expectedmatch = Array('abc(ade)ufh()()x', 'x'); - addThis(); -*/ - -/* Perl has \Z has end-of-line, ECMA doesn't - status = inSection(319); - pattern = /\Z/; - string = 'a\nb\n'; - actualmatch = string.match(pattern); - expectedmatch = Array(''); - addThis(); - - status = inSection(320); - pattern = /\z/; - string = 'a\nb\n'; - actualmatch = string.match(pattern); - expectedmatch = Array(''); - addThis(); -*/ - - status = inSection(321); - pattern = /$/; - string = 'a\nb\n'; - actualmatch = string.match(pattern); - expectedmatch = Array(''); - addThis(); - -/* Perl has \Z has end-of-line, ECMA doesn't - status = inSection(322); - pattern = /\Z/; - string = 'b\na\n'; - actualmatch = string.match(pattern); - expectedmatch = Array(''); - addThis(); - - status = inSection(323); - pattern = /\z/; - string = 'b\na\n'; - actualmatch = string.match(pattern); - expectedmatch = Array(''); - addThis(); -*/ - - status = inSection(324); - pattern = /$/; - string = 'b\na\n'; - actualmatch = string.match(pattern); - expectedmatch = Array(''); - addThis(); - -/* Perl has \Z has end-of-line, ECMA doesn't - status = inSection(325); - pattern = /\Z/; - string = 'b\na'; - actualmatch = string.match(pattern); - expectedmatch = Array(''); - addThis(); - - status = inSection(326); - pattern = /\z/; - string = 'b\na'; - actualmatch = string.match(pattern); - expectedmatch = Array(''); - addThis(); -*/ - - status = inSection(327); - pattern = /$/; - string = 'b\na'; - actualmatch = string.match(pattern); - expectedmatch = Array(''); - addThis(); - -/* Perl has \Z has end-of-line, ECMA doesn't - status = inSection(328); - pattern = /\Z/m; - string = 'a\nb\n'; - actualmatch = string.match(pattern); - expectedmatch = Array(''); - addThis(); - - status = inSection(329); - pattern = /\z/m; - string = 'a\nb\n'; - actualmatch = string.match(pattern); - expectedmatch = Array(''); - addThis(); -*/ - - status = inSection(330); - pattern = /$/m; - string = 'a\nb\n'; - actualmatch = string.match(pattern); - expectedmatch = Array(''); - addThis(); - -/* Perl has \Z has end-of-line, ECMA doesn't - status = inSection(331); - pattern = /\Z/m; - string = 'b\na\n'; - actualmatch = string.match(pattern); - expectedmatch = Array(''); - addThis(); - - status = inSection(332); - pattern = /\z/m; - string = 'b\na\n'; - actualmatch = string.match(pattern); - expectedmatch = Array(''); - addThis(); -*/ - - status = inSection(333); - pattern = /$/m; - string = 'b\na\n'; - actualmatch = string.match(pattern); - expectedmatch = Array(''); - addThis(); - -/* Perl has \Z has end-of-line, ECMA doesn't - status = inSection(334); - pattern = /\Z/m; - string = 'b\na'; - actualmatch = string.match(pattern); - expectedmatch = Array(''); - addThis(); - - status = inSection(335); - pattern = /\z/m; - string = 'b\na'; - actualmatch = string.match(pattern); - expectedmatch = Array(''); - addThis(); -*/ - - status = inSection(336); - pattern = /$/m; - string = 'b\na'; - actualmatch = string.match(pattern); - expectedmatch = Array(''); - addThis(); - -/* Perl has \Z has end-of-line, ECMA doesn't - status = inSection(337); - pattern = /a\Z/; - string = 'b\na\n'; - actualmatch = string.match(pattern); - expectedmatch = Array('a'); - addThis(); -*/ - -/* $ only matches end of input unless multiline - status = inSection(338); - pattern = /a$/; - string = 'b\na\n'; - actualmatch = string.match(pattern); - expectedmatch = Array('a'); - addThis(); -*/ - -/* Perl has \Z has end-of-line, ECMA doesn't - status = inSection(339); - pattern = /a\Z/; - string = 'b\na'; - actualmatch = string.match(pattern); - expectedmatch = Array('a'); - addThis(); - - status = inSection(340); - pattern = /a\z/; - string = 'b\na'; - actualmatch = string.match(pattern); - expectedmatch = Array('a'); - addThis(); -*/ - - status = inSection(341); - pattern = /a$/; - string = 'b\na'; - actualmatch = string.match(pattern); - expectedmatch = Array('a'); - addThis(); - - status = inSection(342); - pattern = /a$/m; - string = 'a\nb\n'; - actualmatch = string.match(pattern); - expectedmatch = Array('a'); - addThis(); - -/* Perl has \Z has end-of-line, ECMA doesn't - status = inSection(343); - pattern = /a\Z/m; - string = 'b\na\n'; - actualmatch = string.match(pattern); - expectedmatch = Array('a'); - addThis(); -*/ - - status = inSection(344); - pattern = /a$/m; - string = 'b\na\n'; - actualmatch = string.match(pattern); - expectedmatch = Array('a'); - addThis(); - -/* Perl has \Z has end-of-line, ECMA doesn't - status = inSection(345); - pattern = /a\Z/m; - string = 'b\na'; - actualmatch = string.match(pattern); - expectedmatch = Array('a'); - addThis(); - - status = inSection(346); - pattern = /a\z/m; - string = 'b\na'; - actualmatch = string.match(pattern); - expectedmatch = Array('a'); - addThis(); -*/ - - status = inSection(347); - pattern = /a$/m; - string = 'b\na'; - actualmatch = string.match(pattern); - expectedmatch = Array('a'); - addThis(); - -/* Perl has \Z has end-of-line, ECMA doesn't - status = inSection(348); - pattern = /aa\Z/; - string = 'b\naa\n'; - actualmatch = string.match(pattern); - expectedmatch = Array('aa'); - addThis(); -*/ - -/* $ only matches end of input unless multiline - status = inSection(349); - pattern = /aa$/; - string = 'b\naa\n'; - actualmatch = string.match(pattern); - expectedmatch = Array('aa'); - addThis(); -*/ - -/* Perl has \Z has end-of-line, ECMA doesn't - status = inSection(350); - pattern = /aa\Z/; - string = 'b\naa'; - actualmatch = string.match(pattern); - expectedmatch = Array('aa'); - addThis(); - - status = inSection(351); - pattern = /aa\z/; - string = 'b\naa'; - actualmatch = string.match(pattern); - expectedmatch = Array('aa'); - addThis(); -*/ - - status = inSection(352); - pattern = /aa$/; - string = 'b\naa'; - actualmatch = string.match(pattern); - expectedmatch = Array('aa'); - addThis(); - - status = inSection(353); - pattern = /aa$/m; - string = 'aa\nb\n'; - actualmatch = string.match(pattern); - expectedmatch = Array('aa'); - addThis(); - -/* Perl has \Z has end-of-line, ECMA doesn't - status = inSection(354); - pattern = /aa\Z/m; - string = 'b\naa\n'; - actualmatch = string.match(pattern); - expectedmatch = Array('aa'); - addThis(); -*/ - - status = inSection(355); - pattern = /aa$/m; - string = 'b\naa\n'; - actualmatch = string.match(pattern); - expectedmatch = Array('aa'); - addThis(); - -/* Perl has \Z has end-of-line, ECMA doesn't - status = inSection(356); - pattern = /aa\Z/m; - string = 'b\naa'; - actualmatch = string.match(pattern); - expectedmatch = Array('aa'); - addThis(); - - status = inSection(357); - pattern = /aa\z/m; - string = 'b\naa'; - actualmatch = string.match(pattern); - expectedmatch = Array('aa'); - addThis(); -*/ - - status = inSection(358); - pattern = /aa$/m; - string = 'b\naa'; - actualmatch = string.match(pattern); - expectedmatch = Array('aa'); - addThis(); - -/* Perl has \Z has end-of-line, ECMA doesn't - status = inSection(359); - pattern = /ab\Z/; - string = 'b\nab\n'; - actualmatch = string.match(pattern); - expectedmatch = Array('ab'); - addThis(); -*/ - -/* $ only matches end of input unless multiline - status = inSection(360); - pattern = /ab$/; - string = 'b\nab\n'; - actualmatch = string.match(pattern); - expectedmatch = Array('ab'); - addThis(); -*/ - -/* Perl has \Z has end-of-line, ECMA doesn't - status = inSection(361); - pattern = /ab\Z/; - string = 'b\nab'; - actualmatch = string.match(pattern); - expectedmatch = Array('ab'); - addThis(); - - status = inSection(362); - pattern = /ab\z/; - string = 'b\nab'; - actualmatch = string.match(pattern); - expectedmatch = Array('ab'); - addThis(); -*/ - - status = inSection(363); - pattern = /ab$/; - string = 'b\nab'; - actualmatch = string.match(pattern); - expectedmatch = Array('ab'); - addThis(); - - status = inSection(364); - pattern = /ab$/m; - string = 'ab\nb\n'; - actualmatch = string.match(pattern); - expectedmatch = Array('ab'); - addThis(); - -/* Perl has \Z has end-of-line, ECMA doesn't - status = inSection(365); - pattern = /ab\Z/m; - string = 'b\nab\n'; - actualmatch = string.match(pattern); - expectedmatch = Array('ab'); - addThis(); -*/ - - status = inSection(366); - pattern = /ab$/m; - string = 'b\nab\n'; - actualmatch = string.match(pattern); - expectedmatch = Array('ab'); - addThis(); - -/* Perl has \Z has end-of-line, ECMA doesn't - status = inSection(367); - pattern = /ab\Z/m; - string = 'b\nab'; - actualmatch = string.match(pattern); - expectedmatch = Array('ab'); - addThis(); - - status = inSection(368); - pattern = /ab\z/m; - string = 'b\nab'; - actualmatch = string.match(pattern); - expectedmatch = Array('ab'); - addThis(); -*/ - - status = inSection(369); - pattern = /ab$/m; - string = 'b\nab'; - actualmatch = string.match(pattern); - expectedmatch = Array('ab'); - addThis(); - -/* Perl has \Z has end-of-line, ECMA doesn't - status = inSection(370); - pattern = /abb\Z/; - string = 'b\nabb\n'; - actualmatch = string.match(pattern); - expectedmatch = Array('abb'); - addThis(); -*/ - -/* $ only matches end of input unless multiline - status = inSection(371); - pattern = /abb$/; - string = 'b\nabb\n'; - actualmatch = string.match(pattern); - expectedmatch = Array('abb'); - addThis(); -*/ - -/* Perl has \Z has end-of-line, ECMA doesn't - status = inSection(372); - pattern = /abb\Z/; - string = 'b\nabb'; - actualmatch = string.match(pattern); - expectedmatch = Array('abb'); - addThis(); - - status = inSection(373); - pattern = /abb\z/; - string = 'b\nabb'; - actualmatch = string.match(pattern); - expectedmatch = Array('abb'); - addThis(); -*/ - - status = inSection(374); - pattern = /abb$/; - string = 'b\nabb'; - actualmatch = string.match(pattern); - expectedmatch = Array('abb'); - addThis(); - - status = inSection(375); - pattern = /abb$/m; - string = 'abb\nb\n'; - actualmatch = string.match(pattern); - expectedmatch = Array('abb'); - addThis(); - -/* Perl has \Z has end-of-line, ECMA doesn't - status = inSection(376); - pattern = /abb\Z/m; - string = 'b\nabb\n'; - actualmatch = string.match(pattern); - expectedmatch = Array('abb'); - addThis(); -*/ - - status = inSection(377); - pattern = /abb$/m; - string = 'b\nabb\n'; - actualmatch = string.match(pattern); - expectedmatch = Array('abb'); - addThis(); - -/* Perl has \Z has end-of-line, ECMA doesn't - status = inSection(378); - pattern = /abb\Z/m; - string = 'b\nabb'; - actualmatch = string.match(pattern); - expectedmatch = Array('abb'); - addThis(); - - status = inSection(379); - pattern = /abb\z/m; - string = 'b\nabb'; - actualmatch = string.match(pattern); - expectedmatch = Array('abb'); - addThis(); -*/ - - status = inSection(380); - pattern = /abb$/m; - string = 'b\nabb'; - actualmatch = string.match(pattern); - expectedmatch = Array('abb'); - addThis(); - - status = inSection(381); - pattern = /(^|x)(c)/; - string = 'ca'; - actualmatch = string.match(pattern); - expectedmatch = Array('c', '', 'c'); - addThis(); - - status = inSection(382); - pattern = /foo.bart/; - string = 'foo.bart'; - actualmatch = string.match(pattern); - expectedmatch = Array('foo.bart'); - addThis(); - - status = inSection(383); - pattern = /^d[x][x][x]/m; - string = 'abcd\ndxxx'; - actualmatch = string.match(pattern); - expectedmatch = Array('dxxx'); - addThis(); - - status = inSection(384); - pattern = /tt+$/; - string = 'xxxtt'; - actualmatch = string.match(pattern); - expectedmatch = Array('tt'); - addThis(); - -/* ECMA spec says that each atom in a range must be a single character - status = inSection(385); - pattern = /([a-\d]+)/; - string = 'za-9z'; - actualmatch = string.match(pattern); - expectedmatch = Array('9', '9'); - addThis(); - - status = inSection(386); - pattern = /([\d-z]+)/; - string = 'a0-za'; - actualmatch = string.match(pattern); - expectedmatch = Array('0-z', '0-z'); - addThis(); -*/ - -/* ECMA doesn't support [: - status = inSection(387); - pattern = /([a-[:digit:]]+)/; - string = 'za-9z'; - actualmatch = string.match(pattern); - expectedmatch = Array('a-9', 'a-9'); - addThis(); - - status = inSection(388); - pattern = /([[:digit:]-z]+)/; - string = '=0-z='; - actualmatch = string.match(pattern); - expectedmatch = Array('0-z', '0-z'); - addThis(); - - status = inSection(389); - pattern = /([[:digit:]-[:alpha:]]+)/; - string = '=0-z='; - actualmatch = string.match(pattern); - expectedmatch = Array('0-z', '0-z'); - addThis(); -*/ - - status = inSection(390); - pattern = /(\d+\.\d+)/; - string = '3.1415926'; - actualmatch = string.match(pattern); - expectedmatch = Array('3.1415926', '3.1415926'); - addThis(); - - status = inSection(391); - pattern = /\.c(pp|xx|c)?$/i; - string = 'IO.c'; - actualmatch = string.match(pattern); - expectedmatch = Array('.c', undefined); - addThis(); - - status = inSection(392); - pattern = /(\.c(pp|xx|c)?$)/i; - string = 'IO.c'; - actualmatch = string.match(pattern); - expectedmatch = Array('.c', '.c', undefined); - addThis(); - - status = inSection(393); - pattern = /(^|a)b/; - string = 'ab'; - actualmatch = string.match(pattern); - expectedmatch = Array('ab', 'a'); - addThis(); - - status = inSection(394); - pattern = /^([ab]*?)(b)?(c)$/; - string = 'abac'; - actualmatch = string.match(pattern); - expectedmatch = Array('abac', 'aba', undefined, 'c'); - addThis(); - - status = inSection(395); - pattern = /^(?:.,){2}c/i; - string = 'a,b,c'; - actualmatch = string.match(pattern); - expectedmatch = Array('a,b,c'); - addThis(); - - status = inSection(396); - pattern = /^(.,){2}c/i; - string = 'a,b,c'; - actualmatch = string.match(pattern); - expectedmatch = Array('a,b,c', 'b,'); - addThis(); - - status = inSection(397); - pattern = /^(?:[^,]*,){2}c/; - string = 'a,b,c'; - actualmatch = string.match(pattern); - expectedmatch = Array('a,b,c'); - addThis(); - - status = inSection(398); - pattern = /^([^,]*,){2}c/; - string = 'a,b,c'; - actualmatch = string.match(pattern); - expectedmatch = Array('a,b,c', 'b,'); - addThis(); - - status = inSection(399); - pattern = /^([^,]*,){3}d/; - string = 'aaa,b,c,d'; - actualmatch = string.match(pattern); - expectedmatch = Array('aaa,b,c,d', 'c,'); - addThis(); - - status = inSection(400); - pattern = /^([^,]*,){3,}d/; - string = 'aaa,b,c,d'; - actualmatch = string.match(pattern); - expectedmatch = Array('aaa,b,c,d', 'c,'); - addThis(); - - status = inSection(401); - pattern = /^([^,]*,){0,3}d/; - string = 'aaa,b,c,d'; - actualmatch = string.match(pattern); - expectedmatch = Array('aaa,b,c,d', 'c,'); - addThis(); - - status = inSection(402); - pattern = /^([^,]{1,3},){3}d/i; - string = 'aaa,b,c,d'; - actualmatch = string.match(pattern); - expectedmatch = Array('aaa,b,c,d', 'c,'); - addThis(); - - status = inSection(403); - pattern = /^([^,]{1,3},){3,}d/; - string = 'aaa,b,c,d'; - actualmatch = string.match(pattern); - expectedmatch = Array('aaa,b,c,d', 'c,'); - addThis(); - - status = inSection(404); - pattern = /^([^,]{1,3},){0,3}d/; - string = 'aaa,b,c,d'; - actualmatch = string.match(pattern); - expectedmatch = Array('aaa,b,c,d', 'c,'); - addThis(); - - status = inSection(405); - pattern = /^([^,]{1,},){3}d/; - string = 'aaa,b,c,d'; - actualmatch = string.match(pattern); - expectedmatch = Array('aaa,b,c,d', 'c,'); - addThis(); - - status = inSection(406); - pattern = /^([^,]{1,},){3,}d/; - string = 'aaa,b,c,d'; - actualmatch = string.match(pattern); - expectedmatch = Array('aaa,b,c,d', 'c,'); - addThis(); - - status = inSection(407); - pattern = /^([^,]{1,},){0,3}d/; - string = 'aaa,b,c,d'; - actualmatch = string.match(pattern); - expectedmatch = Array('aaa,b,c,d', 'c,'); - addThis(); - - status = inSection(408); - pattern = /^([^,]{0,3},){3}d/i; - string = 'aaa,b,c,d'; - actualmatch = string.match(pattern); - expectedmatch = Array('aaa,b,c,d', 'c,'); - addThis(); - - status = inSection(409); - pattern = /^([^,]{0,3},){3,}d/; - string = 'aaa,b,c,d'; - actualmatch = string.match(pattern); - expectedmatch = Array('aaa,b,c,d', 'c,'); - addThis(); - - status = inSection(410); - pattern = /^([^,]{0,3},){0,3}d/; - string = 'aaa,b,c,d'; - actualmatch = string.match(pattern); - expectedmatch = Array('aaa,b,c,d', 'c,'); - addThis(); - -/* ECMA doesn't support \A - status = inSection(411); - pattern = /(?!\A)x/m; - string = 'a\nxb\n'; - actualmatch = string.match(pattern); - expectedmatch = Array('\n'); - addThis(); -*/ - - status = inSection(412); - pattern = /^(a(b)?)+$/; - string = 'aba'; - actualmatch = string.match(pattern); - expectedmatch = Array('aba', 'a', undefined); - addThis(); - - status = inSection(413); - pattern = /^(aa(bb)?)+$/; - string = 'aabbaa'; - actualmatch = string.match(pattern); - expectedmatch = Array('aabbaa', 'aa', undefined); - addThis(); - - status = inSection(414); - pattern = /^.{9}abc.*\n/m; - string = '123\nabcabcabcabc\n'; - actualmatch = string.match(pattern); - expectedmatch = Array('abcabcabcabc\n'); - addThis(); - - status = inSection(415); - pattern = /^(a)?a$/; - string = 'a'; - actualmatch = string.match(pattern); - expectedmatch = Array('a', undefined); - addThis(); - - status = inSection(416); - pattern = /^(a\1?)(a\1?)(a\2?)(a\3?)$/; - string = 'aaaaaa'; - actualmatch = string.match(pattern); - expectedmatch = Array('aaaaaa', 'a', 'aa', 'a', 'aa'); - addThis(); - -/* Can't refer to a capture before it's encountered & completed - status = inSection(417); - pattern = /^(a\1?){4}$/; - string = 'aaaaaa'; - actualmatch = string.match(pattern); - expectedmatch = Array('aaaaaa', 'aaa'); - addThis(); -*/ - - status = inSection(418); - pattern = /^(0+)?(?:x(1))?/; - string = 'x1'; - actualmatch = string.match(pattern); - expectedmatch = Array('x1', undefined, '1'); - addThis(); - - status = inSection(419); - pattern = /^([0-9a-fA-F]+)(?:x([0-9a-fA-F]+)?)(?:x([0-9a-fA-F]+))?/; - string = '012cxx0190'; - actualmatch = string.match(pattern); - expectedmatch = Array('012cxx0190', '012c', undefined, '0190'); - addThis(); - - status = inSection(420); - pattern = /^(b+?|a){1,2}c/; - string = 'bbbac'; - actualmatch = string.match(pattern); - expectedmatch = Array('bbbac', 'a'); - addThis(); - - status = inSection(421); - pattern = /^(b+?|a){1,2}c/; - string = 'bbbbac'; - actualmatch = string.match(pattern); - expectedmatch = Array('bbbbac', 'a'); - addThis(); - - status = inSection(422); - pattern = /((?:aaaa|bbbb)cccc)?/; - string = 'aaaacccc'; - actualmatch = string.match(pattern); - expectedmatch = Array('aaaacccc', 'aaaacccc'); - addThis(); - - status = inSection(423); - pattern = /((?:aaaa|bbbb)cccc)?/; - string = 'bbbbcccc'; - actualmatch = string.match(pattern); - expectedmatch = Array('bbbbcccc', 'bbbbcccc'); - addThis(); - - - - -//----------------------------------------------------------------------------- - test(); -//----------------------------------------------------------------------------- - - - - function addThis() - { - if(omitCurrentSection()) - return; - - statusmessages[i] = status; - patterns[i] = pattern; - strings[i] = string; - actualmatches[i] = actualmatch; - expectedmatches[i] = expectedmatch; - i++; - } - - - function omitCurrentSection() - { - try - { - // current section number is in global status variable - var n = status.match(/(\d+)/)[1]; - return ((n < cnLBOUND) || (n > cnUBOUND)); - } - catch(e) - { - return false; - } - } - - - function test() - { - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - testRegExp(statusmessages, patterns, strings, actualmatches, expectedmatches); - exitFunc ('test'); - } diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/perlstress-002.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/perlstress-002.js deleted file mode 100644 index a9b147b977..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/perlstress-002.js +++ /dev/null @@ -1,1842 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * pschwartau@netscape.com, rogerl@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * - * Date: 2002-07-07 - * SUMMARY: Testing JS RegExp engine against Perl 5 RegExp engine. - * Adjust cnLBOUND, cnUBOUND below to restrict which sections are tested. - * - * This test was created by running various patterns and strings through the - * Perl 5 RegExp engine. We saved the results below to test the JS engine. - * - * Each of the examples below is a negative test; that is, each produces a - * null match in Perl. Thus we set |expectedmatch| = |null| in each section. - * - * NOTE: ECMA/JS and Perl do differ on certain points. We have either commented - * out such sections altogether, or modified them to fit what we expect from JS. - * - * EXAMPLES: - * - * - ECMA does support (?: (?= and (?! operators, but doesn't support (?< etc. - * - * - ECMA doesn't support (?(condition) - * - */ -//----------------------------------------------------------------------------- -var gTestfile = 'perlstress-002.js'; -var i = 0; -var BUGNUMBER = 85721; -var summary = 'Testing regular expression edge cases'; -var cnSingleSpace = ' '; -var status = ''; -var statusmessages = new Array(); -var pattern = ''; -var patterns = new Array(); -var string = ''; -var strings = new Array(); -var actualmatch = ''; -var actualmatches = new Array(); -var expectedmatch = ''; -var expectedmatches = new Array(); -var cnLBOUND = 0; -var cnUBOUND = 1000; - - -status = inSection(1); -pattern = /abc/; -string = 'xbc'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(2); -pattern = /abc/; -string = 'axc'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(3); -pattern = /abc/; -string = 'abx'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(4); -pattern = /ab+bc/; -string = 'abc'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(5); -pattern = /ab+bc/; -string = 'abq'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(6); -pattern = /ab{1,}bc/; -string = 'abq'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(7); -pattern = /ab{4,5}bc/; -string = 'abbbbc'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(8); -pattern = /ab?bc/; -string = 'abbbbc'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(9); -pattern = /^abc$/; -string = 'abcc'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(10); -pattern = /^abc$/; -string = 'aabc'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(11); -pattern = /abc$/; -string = 'aabcd'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(12); -pattern = /a.*c/; -string = 'axyzd'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(13); -pattern = /a[bc]d/; -string = 'abc'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(14); -pattern = /a[b-d]e/; -string = 'abd'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(15); -pattern = /a[^bc]d/; -string = 'abd'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(16); -pattern = /a[^-b]c/; -string = 'a-c'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(17); -pattern = /a[^]b]c/; -string = 'a]c'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(18); -pattern = /\by\b/; -string = 'xy'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(19); -pattern = /\by\b/; -string = 'yz'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(20); -pattern = /\by\b/; -string = 'xyz'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(21); -pattern = /\Ba\B/; -string = 'a-'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(22); -pattern = /\Ba\B/; -string = '-a'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(23); -pattern = /\Ba\B/; -string = '-a-'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(24); -pattern = /\w/; -string = '-'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(25); -pattern = /\W/; -string = 'a'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(26); -pattern = /a\sb/; -string = 'a-b'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(27); -pattern = /\d/; -string = '-'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(28); -pattern = /\D/; -string = '1'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(29); -pattern = /[\w]/; -string = '-'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(30); -pattern = /[\W]/; -string = 'a'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(31); -pattern = /a[\s]b/; -string = 'a-b'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(32); -pattern = /[\d]/; -string = '-'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(33); -pattern = /[\D]/; -string = '1'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(34); -pattern = /$b/; -string = 'b'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(35); -pattern = /^(ab|cd)e/; -string = 'abcde'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(36); -pattern = /a[bcd]+dcdcde/; -string = 'adcdcde'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(37); -pattern = /(bc+d$|ef*g.|h?i(j|k))/; -string = 'effg'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(38); -pattern = /(bc+d$|ef*g.|h?i(j|k))/; -string = 'bcdd'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(39); -pattern = /[k]/; -string = 'ab'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -// MODIFIED - ECMA has different rules for paren contents. -status = inSection(40); -pattern = /(a)|\1/; -string = 'x'; -actualmatch = string.match(pattern); -//expectedmatch = null; -expectedmatch = Array("", undefined); -addThis(); - -// MODIFIED - ECMA has different rules for paren contents. -status = inSection(41); -pattern = /((\3|b)\2(a)x)+/; -string = 'aaxabxbaxbbx'; -actualmatch = string.match(pattern); -//expectedmatch = null; -expectedmatch = Array("ax", "ax", "", "a"); -addThis(); - -status = inSection(42); -pattern = /abc/i; -string = 'XBC'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(43); -pattern = /abc/i; -string = 'AXC'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(44); -pattern = /abc/i; -string = 'ABX'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(45); -pattern = /ab+bc/i; -string = 'ABC'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(46); -pattern = /ab+bc/i; -string = 'ABQ'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(47); -pattern = /ab{1,}bc/i; -string = 'ABQ'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(48); -pattern = /ab{4,5}?bc/i; -string = 'ABBBBC'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(49); -pattern = /ab??bc/i; -string = 'ABBBBC'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(50); -pattern = /^abc$/i; -string = 'ABCC'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(51); -pattern = /^abc$/i; -string = 'AABC'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(52); -pattern = /a.*c/i; -string = 'AXYZD'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(53); -pattern = /a[bc]d/i; -string = 'ABC'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(54); -pattern = /a[b-d]e/i; -string = 'ABD'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(55); -pattern = /a[^bc]d/i; -string = 'ABD'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(56); -pattern = /a[^-b]c/i; -string = 'A-C'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(57); -pattern = /a[^]b]c/i; -string = 'A]C'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(58); -pattern = /$b/i; -string = 'B'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(59); -pattern = /^(ab|cd)e/i; -string = 'ABCDE'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(60); -pattern = /a[bcd]+dcdcde/i; -string = 'ADCDCDE'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(61); -pattern = /(bc+d$|ef*g.|h?i(j|k))/i; -string = 'EFFG'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(62); -pattern = /(bc+d$|ef*g.|h?i(j|k))/i; -string = 'BCDD'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(63); -pattern = /[k]/i; -string = 'AB'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(64); -pattern = /^(a\1?){4}$/; -string = 'aaaaaaaaa'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(65); -pattern = /^(a\1?){4}$/; -string = 'aaaaaaaaaaa'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -/* ECMA doesn't support (?( - status = inSection(66); - pattern = /^(a(?(1)\1)){4}$/; - string = 'aaaaaaaaa'; - actualmatch = string.match(pattern); - expectedmatch = null; - addThis(); - - status = inSection(67); - pattern = /^(a(?(1)\1)){4}$/; - string = 'aaaaaaaaaaa'; - actualmatch = string.match(pattern); - expectedmatch = null; - addThis(); -*/ - -/* ECMA doesn't support (?< - status = inSection(68); - pattern = /(?<=a)b/; - string = 'cb'; - actualmatch = string.match(pattern); - expectedmatch = null; - addThis(); - - status = inSection(69); - pattern = /(?<=a)b/; - string = 'b'; - actualmatch = string.match(pattern); - expectedmatch = null; - addThis(); - - status = inSection(70); - pattern = /(?a+)ab/; -string = 'aaab'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(106); -pattern = /a\Z/; -string = 'a\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(107); -pattern = /a\z/; -string = 'a\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(108); -pattern = /a$/; -string = 'a\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(109); -pattern = /a\z/; -string = 'b\na\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(110); -pattern = /a\z/m; -string = 'a\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(111); -pattern = /a\z/m; -string = 'b\na\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(112); -pattern = /aa\Z/; -string = 'aa\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(113); -pattern = /aa\z/; -string = 'aa\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(114); -pattern = /aa$/; -string = 'aa\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(115); -pattern = /aa\z/; -string = 'b\naa\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(116); -pattern = /aa\z/m; -string = 'aa\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(117); -pattern = /aa\z/m; -string = 'b\naa\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(118); -pattern = /aa\Z/; -string = 'ac\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(119); -pattern = /aa\z/; -string = 'ac\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(120); -pattern = /aa$/; -string = 'ac\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(121); -pattern = /aa\Z/; -string = 'b\nac\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(122); -pattern = /aa\z/; -string = 'b\nac\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(123); -pattern = /aa$/; -string = 'b\nac\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(124); -pattern = /aa\Z/; -string = 'b\nac'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(125); -pattern = /aa\z/; -string = 'b\nac'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(126); -pattern = /aa$/; -string = 'b\nac'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(127); -pattern = /aa\Z/m; -string = 'ac\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(128); -pattern = /aa\z/m; -string = 'ac\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(129); -pattern = /aa$/m; -string = 'ac\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(130); -pattern = /aa\Z/m; -string = 'b\nac\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(131); -pattern = /aa\z/m; -string = 'b\nac\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(132); -pattern = /aa$/m; -string = 'b\nac\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(133); -pattern = /aa\Z/m; -string = 'b\nac'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(134); -pattern = /aa\z/m; -string = 'b\nac'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(135); -pattern = /aa$/m; -string = 'b\nac'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(136); -pattern = /aa\Z/; -string = 'ca\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(137); -pattern = /aa\z/; -string = 'ca\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(138); -pattern = /aa$/; -string = 'ca\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(139); -pattern = /aa\Z/; -string = 'b\nca\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(140); -pattern = /aa\z/; -string = 'b\nca\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(141); -pattern = /aa$/; -string = 'b\nca\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(142); -pattern = /aa\Z/; -string = 'b\nca'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(143); -pattern = /aa\z/; -string = 'b\nca'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(144); -pattern = /aa$/; -string = 'b\nca'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(145); -pattern = /aa\Z/m; -string = 'ca\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(146); -pattern = /aa\z/m; -string = 'ca\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(147); -pattern = /aa$/m; -string = 'ca\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(148); -pattern = /aa\Z/m; -string = 'b\nca\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(149); -pattern = /aa\z/m; -string = 'b\nca\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(150); -pattern = /aa$/m; -string = 'b\nca\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(151); -pattern = /aa\Z/m; -string = 'b\nca'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(152); -pattern = /aa\z/m; -string = 'b\nca'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(153); -pattern = /aa$/m; -string = 'b\nca'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(154); -pattern = /ab\Z/; -string = 'ab\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(155); -pattern = /ab\z/; -string = 'ab\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(156); -pattern = /ab$/; -string = 'ab\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(157); -pattern = /ab\z/; -string = 'b\nab\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(158); -pattern = /ab\z/m; -string = 'ab\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(159); -pattern = /ab\z/m; -string = 'b\nab\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(160); -pattern = /ab\Z/; -string = 'ac\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(161); -pattern = /ab\z/; -string = 'ac\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(162); -pattern = /ab$/; -string = 'ac\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(163); -pattern = /ab\Z/; -string = 'b\nac\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(164); -pattern = /ab\z/; -string = 'b\nac\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(165); -pattern = /ab$/; -string = 'b\nac\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(166); -pattern = /ab\Z/; -string = 'b\nac'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(167); -pattern = /ab\z/; -string = 'b\nac'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(168); -pattern = /ab$/; -string = 'b\nac'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(169); -pattern = /ab\Z/m; -string = 'ac\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(170); -pattern = /ab\z/m; -string = 'ac\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(171); -pattern = /ab$/m; -string = 'ac\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(172); -pattern = /ab\Z/m; -string = 'b\nac\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(173); -pattern = /ab\z/m; -string = 'b\nac\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(174); -pattern = /ab$/m; -string = 'b\nac\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(175); -pattern = /ab\Z/m; -string = 'b\nac'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(176); -pattern = /ab\z/m; -string = 'b\nac'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(177); -pattern = /ab$/m; -string = 'b\nac'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(178); -pattern = /ab\Z/; -string = 'ca\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(179); -pattern = /ab\z/; -string = 'ca\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(180); -pattern = /ab$/; -string = 'ca\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(181); -pattern = /ab\Z/; -string = 'b\nca\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(182); -pattern = /ab\z/; -string = 'b\nca\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(183); -pattern = /ab$/; -string = 'b\nca\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(184); -pattern = /ab\Z/; -string = 'b\nca'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(185); -pattern = /ab\z/; -string = 'b\nca'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(186); -pattern = /ab$/; -string = 'b\nca'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(187); -pattern = /ab\Z/m; -string = 'ca\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(188); -pattern = /ab\z/m; -string = 'ca\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(189); -pattern = /ab$/m; -string = 'ca\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(190); -pattern = /ab\Z/m; -string = 'b\nca\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(191); -pattern = /ab\z/m; -string = 'b\nca\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(192); -pattern = /ab$/m; -string = 'b\nca\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(193); -pattern = /ab\Z/m; -string = 'b\nca'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(194); -pattern = /ab\z/m; -string = 'b\nca'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(195); -pattern = /ab$/m; -string = 'b\nca'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(196); -pattern = /abb\Z/; -string = 'abb\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(197); -pattern = /abb\z/; -string = 'abb\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(198); -pattern = /abb$/; -string = 'abb\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(199); -pattern = /abb\z/; -string = 'b\nabb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(200); -pattern = /abb\z/m; -string = 'abb\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(201); -pattern = /abb\z/m; -string = 'b\nabb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(202); -pattern = /abb\Z/; -string = 'ac\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(203); -pattern = /abb\z/; -string = 'ac\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(204); -pattern = /abb$/; -string = 'ac\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(205); -pattern = /abb\Z/; -string = 'b\nac\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(206); -pattern = /abb\z/; -string = 'b\nac\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(207); -pattern = /abb$/; -string = 'b\nac\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(208); -pattern = /abb\Z/; -string = 'b\nac'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(209); -pattern = /abb\z/; -string = 'b\nac'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(210); -pattern = /abb$/; -string = 'b\nac'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(211); -pattern = /abb\Z/m; -string = 'ac\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(212); -pattern = /abb\z/m; -string = 'ac\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(213); -pattern = /abb$/m; -string = 'ac\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(214); -pattern = /abb\Z/m; -string = 'b\nac\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(215); -pattern = /abb\z/m; -string = 'b\nac\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(216); -pattern = /abb$/m; -string = 'b\nac\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(217); -pattern = /abb\Z/m; -string = 'b\nac'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(218); -pattern = /abb\z/m; -string = 'b\nac'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(219); -pattern = /abb$/m; -string = 'b\nac'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(220); -pattern = /abb\Z/; -string = 'ca\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(221); -pattern = /abb\z/; -string = 'ca\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(222); -pattern = /abb$/; -string = 'ca\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(223); -pattern = /abb\Z/; -string = 'b\nca\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(224); -pattern = /abb\z/; -string = 'b\nca\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(225); -pattern = /abb$/; -string = 'b\nca\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(226); -pattern = /abb\Z/; -string = 'b\nca'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(227); -pattern = /abb\z/; -string = 'b\nca'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(228); -pattern = /abb$/; -string = 'b\nca'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(229); -pattern = /abb\Z/m; -string = 'ca\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(230); -pattern = /abb\z/m; -string = 'ca\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(231); -pattern = /abb$/m; -string = 'ca\nb\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(232); -pattern = /abb\Z/m; -string = 'b\nca\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(233); -pattern = /abb\z/m; -string = 'b\nca\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(234); -pattern = /abb$/m; -string = 'b\nca\n'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(235); -pattern = /abb\Z/m; -string = 'b\nca'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(236); -pattern = /abb\z/m; -string = 'b\nca'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(237); -pattern = /abb$/m; -string = 'b\nca'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(238); -pattern = /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/; -string = 'x'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(239); -pattern = /\GX.*X/; -string = 'aaaXbX'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(240); -pattern = /\.c(pp|xx|c)?$/i; -string = 'Changes'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(241); -pattern = /^([a-z]:)/; -string = 'C:/'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(242); -pattern = /(\w)?(abc)\1b/; -string = 'abcab'; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -/* ECMA doesn't support (?( - status = inSection(243); - pattern = /^(a)?(?(1)a|b)+$/; - string = 'a'; - actualmatch = string.match(pattern); - expectedmatch = null; - addThis(); -*/ - - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - - - -function addThis() -{ - if(omitCurrentSection()) - return; - - statusmessages[i] = status; - patterns[i] = pattern; - strings[i] = string; - actualmatches[i] = actualmatch; - expectedmatches[i] = expectedmatch; - i++; -} - - -function omitCurrentSection() -{ - try - { - // current section number is in global status variable - var n = status.match(/(\d+)/)[1]; - return ((n < cnLBOUND) || (n > cnUBOUND)); - } - catch(e) - { - return false; - } -} - - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - testRegExp(statusmessages, patterns, strings, actualmatches, expectedmatches); - exitFunc ('test'); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-100199.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-100199.js deleted file mode 100644 index 8c88aa7f52..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-100199.js +++ /dev/null @@ -1,307 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * pschwartau@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * Date: 17 September 2001 - * - * SUMMARY: Regression test for Bugzilla bug 100199 - * See http://bugzilla.mozilla.org/show_bug.cgi?id=100199 - * - * The empty character class [] is a valid RegExp construct: the condition - * that a given character belong to a set containing no characters. As such, - * it can never be met and is always FALSE. Similarly, [^] is a condition - * that matches any given character and is always TRUE. - * - * Neither one of these conditions should cause syntax errors in a RegExp. - */ -//----------------------------------------------------------------------------- -var gTestfile = 'regress-100199.js'; -var i = 0; -var BUGNUMBER = 100199; -var summary = '[], [^] are valid RegExp conditions. Should not cause errors -'; -var status = ''; -var statusmessages = new Array(); -var pattern = ''; -var patterns = new Array(); -var string = ''; -var strings = new Array(); -var actualmatch = ''; -var actualmatches = new Array(); -var expectedmatch = ''; -var expectedmatches = new Array(); - - -pattern = /[]/; -string = 'abc'; -status = inSection(1); -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -string = ''; -status = inSection(2); -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -string = '['; -status = inSection(3); -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -string = '/'; -status = inSection(4); -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -string = '['; -status = inSection(5); -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -string = ']'; -status = inSection(6); -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -string = '[]'; -status = inSection(7); -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -string = '[ ]'; -status = inSection(8); -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -string = ']['; -status = inSection(9); -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - - -pattern = /a[]/; -string = 'abc'; -status = inSection(10); -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -string = ''; -status = inSection(11); -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -string = 'a['; -status = inSection(12); -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -string = 'a[]'; -status = inSection(13); -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -string = '['; -status = inSection(14); -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -string = ']'; -status = inSection(15); -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -string = '[]'; -status = inSection(16); -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -string = '[ ]'; -status = inSection(17); -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -string = ']['; -status = inSection(18); -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - - -pattern = /[^]/; -string = 'abc'; -status = inSection(19); -actualmatch = string.match(pattern); -expectedmatch = Array('a'); -addThis(); - -string = ''; -status = inSection(20); -actualmatch = string.match(pattern); -expectedmatch = null; //there are no characters to test against the condition -addThis(); - -string = '\/'; -status = inSection(21); -actualmatch = string.match(pattern); -expectedmatch = Array('/'); -addThis(); - -string = '\['; -status = inSection(22); -actualmatch = string.match(pattern); -expectedmatch = Array('['); -addThis(); - -string = '['; -status = inSection(23); -actualmatch = string.match(pattern); -expectedmatch = Array('['); -addThis(); - -string = ']'; -status = inSection(24); -actualmatch = string.match(pattern); -expectedmatch = Array(']'); -addThis(); - -string = '[]'; -status = inSection(25); -actualmatch = string.match(pattern); -expectedmatch = Array('['); -addThis(); - -string = '[ ]'; -status = inSection(26); -actualmatch = string.match(pattern); -expectedmatch = Array('['); -addThis(); - -string = ']['; -status = inSection(27); -actualmatch = string.match(pattern); -expectedmatch = Array(']'); -addThis(); - - -pattern = /a[^]/; -string = 'abc'; -status = inSection(28); -actualmatch = string.match(pattern); -expectedmatch = Array('ab'); -addThis(); - -string = ''; -status = inSection(29); -actualmatch = string.match(pattern); -expectedmatch = null; //there are no characters to test against the condition -addThis(); - -string = 'a['; -status = inSection(30); -actualmatch = string.match(pattern); -expectedmatch = Array('a['); -addThis(); - -string = 'a]'; -status = inSection(31); -actualmatch = string.match(pattern); -expectedmatch = Array('a]'); -addThis(); - -string = 'a[]'; -status = inSection(32); -actualmatch = string.match(pattern); -expectedmatch = Array('a['); -addThis(); - -string = 'a[ ]'; -status = inSection(33); -actualmatch = string.match(pattern); -expectedmatch = Array('a['); -addThis(); - -string = 'a]['; -status = inSection(34); -actualmatch = string.match(pattern); -expectedmatch = Array('a]'); -addThis(); - - - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - - - -function addThis() -{ - statusmessages[i] = status; - patterns[i] = pattern; - strings[i] = string; - actualmatches[i] = actualmatch; - expectedmatches[i] = expectedmatch; - i++; -} - - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - testRegExp(statusmessages, patterns, strings, actualmatches, expectedmatches); - exitFunc ('test'); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-105972.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-105972.js deleted file mode 100644 index e691c518b4..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-105972.js +++ /dev/null @@ -1,157 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * mozilla@pdavis.cx, pschwartau@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * Date: 22 October 2001 - * - * SUMMARY: Regression test for Bugzilla bug 105972: - * "/^.*?$/ will not match anything" - * - * See http://bugzilla.mozilla.org/show_bug.cgi?id=105972 - */ -//----------------------------------------------------------------------------- -var gTestfile = 'regress-105972.js'; -var i = 0; -var BUGNUMBER = 105972; -var summary = 'Regression test for Bugzilla bug 105972'; -var cnEmptyString = ''; -var status = ''; -var statusmessages = new Array(); -var pattern = ''; -var patterns = new Array(); -var string = ''; -var strings = new Array(); -var actualmatch = ''; -var actualmatches = new Array(); -var expectedmatch = ''; -var expectedmatches = new Array(); - - -/* - * The bug: this match was coming up null in Rhino and SpiderMonkey. - * It should match the whole string. The reason: - * - * The * operator is greedy, but *? is non-greedy: it will stop - * at the simplest match it can find. But the pattern here asks us - * to match till the end of the string. So the simplest match must - * go all the way out to the end, and *? has no choice but to do it. - */ -status = inSection(1); -pattern = /^.*?$/; -string = 'Hello World'; -actualmatch = string.match(pattern); -expectedmatch = Array(string); -addThis(); - - -/* - * Leave off the '$' condition - here we expect the empty string. - * Unlike the above pattern, we don't have to match till the end of - * the string, so the non-greedy operator *? doesn't try to... - */ -status = inSection(2); -pattern = /^.*?/; -string = 'Hello World'; -actualmatch = string.match(pattern); -expectedmatch = Array(cnEmptyString); -addThis(); - - -/* - * Try '$' combined with an 'or' operator. - * - * The operator *? will consume the string from left to right, - * attempting to satisfy the condition (:|$). When it hits ':', - * the match will stop because the operator *? is non-greedy. - * - * The submatch $1 = (:|$) will contain the ':' - */ -status = inSection(3); -pattern = /^.*?(:|$)/; -string = 'Hello: World'; -actualmatch = string.match(pattern); -expectedmatch = Array('Hello:', ':'); -addThis(); - - -/* - * Again, '$' combined with an 'or' operator. - * - * The operator * will consume the string from left to right, - * attempting to satisfy the condition (:|$). When it hits ':', - * the match will not stop since * is greedy. The match will - * continue until it hits $, the end-of-string boundary. - * - * The submatch $1 = (:|$) will contain the empty string - * conceived to exist at the end-of-string boundary. - */ -status = inSection(4); -pattern = /^.*(:|$)/; -string = 'Hello: World'; -actualmatch = string.match(pattern); -expectedmatch = Array(string, cnEmptyString); -addThis(); - - - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - - - -function addThis() -{ - statusmessages[i] = status; - patterns[i] = pattern; - strings[i] = string; - actualmatches[i] = actualmatch; - expectedmatches[i] = expectedmatch; - i++; -} - - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - testRegExp(statusmessages, patterns, strings, actualmatches, expectedmatches); - exitFunc ('test'); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-119909.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-119909.js deleted file mode 100644 index 97f6414bc7..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-119909.js +++ /dev/null @@ -1,92 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * 1010mozilla@Ostermiller.com, pschwartau@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * - * Date: 14 Jan 2002 - * SUMMARY: Shouldn't crash on regexps with many nested parentheses - * See http://bugzilla.mozilla.org/show_bug.cgi?id=119909 - * - */ -//----------------------------------------------------------------------------- -var gTestfile = 'regress-119909.js'; -var BUGNUMBER = 119909; -var summary = "Shouldn't crash on regexps with many nested parentheses"; -var NO_BACKREFS = false; -var DO_BACKREFS = true; - - -//-------------------------------------------------- -test(); -//-------------------------------------------------- - - -function test() -{ - enterFunc('test'); - printBugNumber(BUGNUMBER); - printStatus(summary); - - testThis(500, NO_BACKREFS, 'hello', 'goodbye'); - testThis(500, DO_BACKREFS, 'hello', 'goodbye'); - - reportCompare('No Crash', 'No Crash', ''); - - exitFunc('test'); -} - - -/* - * Creates a regexp pattern like (((((((((hello))))))))) - * and tests str.search(), str.match(), str.replace() - */ -function testThis(numParens, doBackRefs, strOriginal, strReplace) -{ - var openParen = doBackRefs? '(' : '(?:'; - var closeParen = ')'; - var pattern = ''; - - for (var i=0; i((.*\n?)*?)<\/body>/i; -actualmatch = string.match(pattern); -expectedmatch = Array(sBody, '\n

Kibology for all

\n

All for Kibology

\n', '

All for Kibology

\n'); -addThis(); - - - -//------------------------------------------------------------------------------------------------- -test(); -//------------------------------------------------------------------------------------------------- - - -function addThis() -{ - statusmessages[i] = status; - patterns[i] = pattern; - strings[i] = string; - actualmatches[i] = actualmatch; - expectedmatches[i] = expectedmatch; - i++; -} - - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - testRegExp(statusmessages, patterns, strings, actualmatches, expectedmatches); - exitFunc ('test'); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-169534.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-169534.js deleted file mode 100644 index c736631bd7..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-169534.js +++ /dev/null @@ -1,95 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * pschwartau@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * - * Date: 20 Sep 2002 - * SUMMARY: RegExp conformance test - * See http://bugzilla.mozilla.org/show_bug.cgi?id=169534 - * - */ -//----------------------------------------------------------------------------- -var gTestfile = 'regress-169534.js'; -var UBound = 0; -var BUGNUMBER = 169534; -var summary = 'RegExp conformance test'; -var status = ''; -var statusitems = []; -var actual = ''; -var actualvalues = []; -var expect= ''; -var expectedvalues = []; - - -status = inSection(1); -var re = /(\|)([\w\x81-\xff ]*)(\|)([\/a-z][\w:\/\.]*\.[a-z]{3,4})(\|)/ig; -var str = "To sign up click |here|https://www.xxxx.org/subscribe.htm|"; -actual = str.replace(re, '$2'); -expect = 'To sign up click here'; -addThis(); - - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - - - -function addThis() -{ - statusitems[UBound] = status; - actualvalues[UBound] = actual; - expectedvalues[UBound] = expect; - UBound++; -} - - -function test() -{ - enterFunc('test'); - printBugNumber(BUGNUMBER); - printStatus(summary); - - for (var i=0; i/g,'>'); - } - - h+='\n'; - h=h.replace(/&([^\s]+;)/g,'<&$1>'); - h=h.replace(new RegExp('','g'), S); - h=h.replace(/"[^"]*"/g,S); - h=h.replace(/'[^']*'/g,S); - - - h=h.replace(/<([^>]*)>/g, - function(s,p) - { - if(s.match(/!doctype/i)) - return'<' + p + '>'; - - p=p.replace(/\\'/g,'\\'').replace(/\\"/g,'\\"').replace(/^\s/,''); -p=p.replace(/(\s)([^<]+)$/g, - function(s,p1,p2) - { - p2=p2.replace(/(=)(\s*[^"'][^\s]*)(\s|$)/g,'$1$2$3'); - p2=p2.replace(/("[^"]*")/g,'$1'); - p2=p2.replace(/('[^']*')/g,'$1'); - return p1 + ''+p2+''; - } - ) - - return'<' + p + '>'; - } - ) - - - h=h.replace(/<(&[^\s]+;)>/g,'$1'); - h=h.replace(/(<!--[\s\S]*-->)/g,'$1'); - - - numer=1; - h=h.replace(/(.*\n)/g, - function(s,p) - { - return (numer++) +'. ' + p; - } - ) - - - return'' + h + ''; -} - - - -/* - * sanity check - */ -status = inSection(1); -actual = formatHTML('abc'); -expect = '1. abc\n'; -addThis(); - - -/* - * The real test: can we run this without crashing? - * We are not validating the result, just running it. - */ -status = inSection(2); -var HUGE_TEST_STRING = hugeString(); -formatHTML(HUGE_TEST_STRING); - - - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - - - -function addThis() -{ - statusitems[UBound] = status; - actualvalues[UBound] = actual; - expectedvalues[UBound] = expect; - UBound++; -} - - -function test() -{ - enterFunc('test'); - printBugNumber(BUGNUMBER); - printStatus(summary); - - for (var i=0; i','g'),""); - stra=stra.replace(new RegExp('','g'),"
"); -} - -function runTest() { - for (var j = 1000; j <= 10000; j += 1000) - { - neurodna(j); - } -} - -function neurodna(limit) { - var prepare=""; - for(var i=0;i])*-->', 'g'), ''); -printStatus(data); - -reportCompare(expect, actual, summary); diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-309840.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-309840.js deleted file mode 100755 index 8680b7bcfd..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-309840.js +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Mozilla Foundation. - * Portions created by the Initial Developer are Copyright (C) 2005 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Phil Schwartau - * Bob Clary - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -var gTestfile = 'regress-309840.js'; -//----------------------------------------------------------------------------- -var BUGNUMBER = 309840; -var summary = 'Treat / in a literal regexp class as valid'; -var actual = 'No error'; -var expect = 'No error'; - -printBugNumber(BUGNUMBER); -printStatus (summary); - -try -{ - var re = eval('/[/]/'); -} -catch(e) -{ - actual = e.toString(); -} - -reportCompare(expect, actual, summary); diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-311414.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-311414.js deleted file mode 100755 index a24a07bb2b..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-311414.js +++ /dev/null @@ -1,101 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Mozilla Foundation. - * Portions created by the Initial Developer are Copyright (C) 2005 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): timeless - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -var gTestfile = 'regress-311414.js'; -//----------------------------------------------------------------------------- -var BUGNUMBER = 311414; -var summary = 'RegExp captured tail match should be O(N)'; -var actual = ''; -var expect = ''; - -printBugNumber(BUGNUMBER); -printStatus (summary); - -function q1(n) { - var c = []; - c[n] = 1; - c = c.join(" "); - var d = Date.now(); - var e = c.match(/(.*)foo$/); - var f = Date.now(); - return (f - d); -} - -function q2(n) { - var c = []; - c[n] = 1; - c = c.join(" "); - var d = Date.now(); - var e = /foo$/.test(c) && c.match(/(.*)foo$/); - var f = Date.now(); - return (f - d); -} - -var data1 = {X:[], Y:[]}; -var data2 = {X:[], Y:[]}; - -for (var x = 500; x < 5000; x += 500) -{ - var y1 = q1(x); - var y2 = q2(x); - data1.X.push(x); - data1.Y.push(y1); - data2.X.push(x); - data2.Y.push(y2); - gc(); -} - -var order1 = BigO(data1); -var order2 = BigO(data2); - -var msg = ''; -for (var p = 0; p < data1.X.length; p++) -{ - msg += '(' + data1.X[p] + ', ' + data1.Y[p] + '); '; -} -printStatus(msg); -printStatus('Order: ' + order1); -reportCompare(true, order1 < 2 , summary + ' BigO ' + order1 + ' < 2'); - -msg = ''; -for (var p = 0; p < data2.X.length; p++) -{ - msg += '(' + data2.X[p] + ', ' + data2.Y[p] + '); '; -} -printStatus(msg); -printStatus('Order: ' + order2); -reportCompare(true, order2 < 2 , summary + ' BigO ' + order2 + ' < 2'); diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-312351.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-312351.js deleted file mode 100755 index a9b00d317c..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-312351.js +++ /dev/null @@ -1,50 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Mozilla Foundation. - * Portions created by the Initial Developer are Copyright (C) 2005 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): drimbk@yahoo.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -var gTestfile = 'regress-312351.js'; -//----------------------------------------------------------------------------- -var BUGNUMBER = 312351; -var summary = 'Do not crash on RegExp(null)'; -var actual = 'No Crash'; -var expect = 'No Crash'; - -printBugNumber(BUGNUMBER); -printStatus (summary); - -var x = RegExp(null); - -reportCompare(expect, actual, summary); diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-31316.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-31316.js deleted file mode 100644 index 594913f07c..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-31316.js +++ /dev/null @@ -1,96 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * pschwartau@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * Date: 01 May 2001 - * - * SUMMARY: Regression test for Bugzilla bug 31316: - * "Rhino: Regexp matches return garbage" - * - * See http://bugzilla.mozilla.org/show_bug.cgi?id=31316 - */ -//----------------------------------------------------------------------------- -var gTestfile = 'regress-31316.js'; -var i = 0; -var BUGNUMBER = 31316; -var summary = 'Regression test for Bugzilla bug 31316'; -var cnEmptyString = ''; -var status = ''; -var statusmessages = new Array(); -var pattern = ''; -var patterns = new Array(); -var string = ''; -var strings = new Array(); -var actualmatch = ''; -var actualmatches = new Array(); -var expectedmatch = ''; -var expectedmatches = new Array(); - - -status = inSection(1); -pattern = /<([^\/<>][^<>]*[^\/])>|<([^\/<>])>/; -string = '

Some
test

'; -actualmatch = string.match(pattern); -expectedmatch = Array('

', undefined, 'p'); -addThis(); - - -//------------------------------------------------------------------------------------------------- -test(); -//------------------------------------------------------------------------------------------------- - - -function addThis() -{ - statusmessages[i] = status; - patterns[i] = pattern; - strings[i] = string; - actualmatches[i] = actualmatch; - expectedmatches[i] = expectedmatch; - i++; -} - - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - testRegExp(statusmessages, patterns, strings, actualmatches, expectedmatches); - exitFunc ('test'); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-330684.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-330684.js deleted file mode 100755 index b097fbc3d7..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-330684.js +++ /dev/null @@ -1,53 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Mozilla Foundation. - * Portions created by the Initial Developer are Copyright (C) 2006 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Shaohua Wen - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -var gTestfile = 'regress-330684.js'; -//----------------------------------------------------------------------------- -var BUGNUMBER = 330684; -var summary = 'Do not hang on RegExp'; -var actual = 'Do not hang on RegExp'; -var expect = ''; - -printBugNumber(BUGNUMBER); -printStatus (summary); - -var re = /^(?:(?:%[0-9A-Fa-f]{2})*[!\$&'\*-;=\?-Z_a-z]*)+$/; -var url = "http://tw.yimg.com/a/tw/wenchuan/cam_240x400_381615_030806_2.swf?clickTAG=javascript:VRECopenWindow(1)"; - -printStatus(re.test(url)); - -reportCompare(expect, actual, summary); diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-334158.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-334158.js deleted file mode 100755 index 41ebf0a731..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-334158.js +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Mozilla Foundation. - * Portions created by the Initial Developer are Copyright (C) 2006 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Andreas - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -var gTestfile = 'regress-334158.js'; -//----------------------------------------------------------------------------- -var BUGNUMBER = 334158; -var summary = 'Parse error in control letter escapes (RegExp)'; -var actual = ''; -var expect = ''; - -printBugNumber(BUGNUMBER); -printStatus (summary); - -expect = true; -actual = /\ca/.test( "\x01" ); -reportCompare(expect, actual, summary + ':/\ca/.test( "\x01" )'); - -expect = false - actual = /\ca/.test( "\\ca" ); -reportCompare(expect, actual, summary + ': /\ca/.test( "\\ca" )'); - -expect = false - actual = /\c[a/]/.test( "\x1ba/]" ); -reportCompare(expect, actual, summary + ': /\c[a/]/.test( "\x1ba/]" )'); diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-346090.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-346090.js deleted file mode 100755 index dfd53a9922..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-346090.js +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Mozilla Foundation. - * Portions created by the Initial Developer are Copyright (C) 2006 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Priit Laes - * Brian Crowder - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -var gTestfile = 'regress-346090.js'; -//----------------------------------------------------------------------------- -var BUGNUMBER = 346090; -var summary = 'Do not crash with this regexp'; -var actual = 'No Crash'; -var expect = 'No Crash'; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - var r = /%((h[^l]+)|(l[^h]+)){0,2}?a/g; - r.exec('%lld %d'); - - reportCompare(expect, actual, summary); - - exitFunc ('test'); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-367888.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-367888.js deleted file mode 100755 index 923c1e5ab3..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-367888.js +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Mozilla Foundation. - * Portions created by the Initial Developer are Copyright (C) 2007 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Jesse Ruderman - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -var gTestfile = 'regress-367888.js'; -//----------------------------------------------------------------------------- -var BUGNUMBER = 367888; -var summary = 'RegExp /(|)??x/g.exec("y") barfs'; -var actual = ''; -var expect = ''; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - expect = null; - actual = /(|)??x/g.exec("y"); - - reportCompare(expect, actual, summary); - - exitFunc ('test'); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-375642.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-375642.js deleted file mode 100755 index 236eb00d28..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-375642.js +++ /dev/null @@ -1,61 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Mozilla Foundation. - * Portions created by the Initial Developer are Copyright (C) 2007 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Jesse Ruderman - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -var gTestfile = 'regress-375642.js'; -//----------------------------------------------------------------------------- -var BUGNUMBER = 375642; -var summary = 'RegExp /(?:a??)+?/.exec("")'; -var actual = ''; -var expect = ''; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - /(?:a??)+?/.exec("") - - reportCompare(expect, actual, summary); - - exitFunc ('test'); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-375711.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-375711.js deleted file mode 100755 index 6e7339f9e9..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-375711.js +++ /dev/null @@ -1,118 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Mozilla Foundation. - * Portions created by the Initial Developer are Copyright (C) 2007 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Jesse Ruderman - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -var gTestfile = 'regress-375711.js'; -//----------------------------------------------------------------------------- -var BUGNUMBER = 375711; -var summary = 'Do not assert with /[Q-b]/i.exec("")'; -var actual = ''; -var expect = ''; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - var s; - - // see bug 416933 - print('see bug 416933 for changed behavior on Gecko 1.9'); - - try - { - s = '/[Q-b]/.exec("")'; - expect = 'No Error'; - print(s + ' expect ' + expect); - eval(s); - actual = 'No Error'; - } - catch(ex) - { - actual = ex + ''; - } - reportCompare(expect, actual, summary + ': ' + s); - - try - { - s ='/[Q-b]/i.exec("")'; - expect = 'No Error'; - print(s + ' expect ' + expect); - eval(s); - actual = 'No Error'; - } - catch(ex) - { - actual = ex + ''; - } - reportCompare(expect, actual, summary + ': ' + s); - - try - { - s = '/[q-b]/.exec("")'; - expect = 'SyntaxError: invalid range in character class'; - print(s + ' expect ' + expect); - eval(s); - actual = 'No Error'; - } - catch(ex) - { - actual = ex + ''; - } - reportCompare(expect, actual, summary + ': ' + s); - - try - { - s ='/[q-b]/i.exec("")'; - expect = 'SyntaxError: invalid range in character class'; - print(s + ' expect ' + expect); - eval(s); - actual = 'No Error'; - } - catch(ex) - { - actual = ex + ''; - } - reportCompare(expect, actual, summary + ': ' + s); - - exitFunc ('test'); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-375715-01-n.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-375715-01-n.js deleted file mode 100755 index 437dcbd5c5..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-375715-01-n.js +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Mozilla Foundation. - * Portions created by the Initial Developer are Copyright (C) 2007 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Jesse Ruderman - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -var gTestfile = 'regress-375715-01-n.js'; -//----------------------------------------------------------------------------- -var BUGNUMBER = 375715; -var summary = 'Do not assert: (c2 <= cs->length) && (c1 <= c2)'; -var actual = ''; -var expect = ''; - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - // note that the assertion does not fire if the regexp is - // evald or used in new RegExp, so this test must be an -n - // with uncaught SyntaxError. - - /[\Wb-G]/.exec(""); - reportCompare(expect, actual, summary + ' /[\Wb-G]/.exec("")'); - - exitFunc ('test'); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-375715-02.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-375715-02.js deleted file mode 100755 index 3cd858e845..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-375715-02.js +++ /dev/null @@ -1,60 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Mozilla Foundation. - * Portions created by the Initial Developer are Copyright (C) 2007 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Jesse Ruderman - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -var gTestfile = 'regress-375715-02.js'; -//----------------------------------------------------------------------------- -var BUGNUMBER = 375715; -var summary = 'Do not assert: (c2 <= cs->length) && (c1 <= c2)'; -var actual = ''; -var expect = ''; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - /[\s-:]/; - reportCompare(expect, actual, summary + '/[\s-:]/'); - - exitFunc ('test'); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-375715-03.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-375715-03.js deleted file mode 100755 index ffc5c5a4cc..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-375715-03.js +++ /dev/null @@ -1,60 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Mozilla Foundation. - * Portions created by the Initial Developer are Copyright (C) 2007 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Jesse Ruderman - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -var gTestfile = 'regress-375715-03.js'; -//----------------------------------------------------------------------------- -var BUGNUMBER = 375715; -var summary = 'Do not assert: (c2 <= cs->length) && (c1 <= c2)'; -var actual = ''; -var expect = ''; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - /[_-t]/i.exec(""); - reportCompare(expect, actual, summary + '/[_-t]/i.exec("")'); - - exitFunc ('test'); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-375715-04.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-375715-04.js deleted file mode 100755 index 0c78a372ee..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-375715-04.js +++ /dev/null @@ -1,68 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Mozilla Foundation. - * Portions created by the Initial Developer are Copyright (C) 2007 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Jesse Ruderman - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -var gTestfile = 'regress-375715-04.js'; -//----------------------------------------------------------------------------- -var BUGNUMBER = 375715; -var summary = 'Do not assert: (c2 <= cs->length) && (c1 <= c2)'; -var actual = ''; -var expect = ''; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - try - { - expect = 'SyntaxError: invalid range in character class'; - (new RegExp("[\xDF-\xC7]]", "i")).exec(""); - } - catch(ex) - { - actual = ex + ''; - } - reportCompare(expect, actual, summary + '(new RegExp("[\xDF-\xC7]]", "i")).exec("")'); - - exitFunc ('test'); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-57572.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-57572.js deleted file mode 100644 index c7abd410bf..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-57572.js +++ /dev/null @@ -1,150 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * pschwartau@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * Date: 28 December 2000 - * - * SUMMARY: Testing regular expressions containing the ? character. - * Arose from Bugzilla bug 57572: "RegExp with ? matches incorrectly" - * - * See http://bugzilla.mozilla.org/show_bug.cgi?id=57572 - * - */ -//----------------------------------------------------------------------------- -var gTestfile = 'regress-57572.js'; -var i = 0; -var BUGNUMBER = 57572; -var summary = 'Testing regular expressions containing "?"'; -var cnEmptyString = ''; var cnSingleSpace = ' '; -var status = ''; -var statusmessages = new Array(); -var pattern = ''; -var patterns = new Array(); -var string = ''; -var strings = new Array(); -var actualmatch = ''; -var actualmatches = new Array(); -var expectedmatch = ''; -var expectedmatches = new Array(); - - -status = inSection(1); -pattern = /(\S+)?(.*)/; -string = 'Test this'; -actualmatch = string.match(pattern); -expectedmatch = Array(string, 'Test', ' this'); //single space in front of 'this' -addThis(); - -status = inSection(2); -pattern = /(\S+)? ?(.*)/; //single space between the ? characters -string= 'Test this'; -actualmatch = string.match(pattern); -expectedmatch = Array(string, 'Test', 'this'); //NO space in front of 'this' -addThis(); - -status = inSection(3); -pattern = /(\S+)?(.*)/; -string = 'Stupid phrase, with six - (short) words'; -actualmatch = string.match(pattern); -expectedmatch = Array(string, 'Stupid', ' phrase, with six - (short) words'); //single space in front of 'phrase' -addThis(); - -status = inSection(4); -pattern = /(\S+)? ?(.*)/; //single space between the ? characters -string = 'Stupid phrase, with six - (short) words'; -actualmatch = string.match(pattern); -expectedmatch = Array(string, 'Stupid', 'phrase, with six - (short) words'); //NO space in front of 'phrase' -addThis(); - - -// let's add an extra back-reference this time - three instead of two - -status = inSection(5); -pattern = /(\S+)?( ?)(.*)/; //single space before second ? character -string = 'Stupid phrase, with six - (short) words'; -actualmatch = string.match(pattern); -expectedmatch = Array(string, 'Stupid', cnSingleSpace, 'phrase, with six - (short) words'); -addThis(); - -status = inSection(6); -pattern = /^(\S+)?( ?)(B+)$/; //single space before second ? character -string = 'AAABBB'; -actualmatch = string.match(pattern); -expectedmatch = Array(string, 'AAABB', cnEmptyString, 'B'); -addThis(); - -status = inSection(7); -pattern = /(\S+)?(!?)(.*)/; -string = 'WOW !!! !!!'; -actualmatch = string.match(pattern); -expectedmatch = Array(string, 'WOW', cnEmptyString, ' !!! !!!'); -addThis(); - -status = inSection(8); -pattern = /(.+)?(!?)(!+)/; -string = 'WOW !!! !!!'; -actualmatch = string.match(pattern); -expectedmatch = Array(string, 'WOW !!! !!', cnEmptyString, '!'); -addThis(); - - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - - - -function addThis() -{ - statusmessages[i] = status; - patterns[i] = pattern; - strings[i] = string; - actualmatches[i] = actualmatch; - expectedmatches[i] = expectedmatch; - i++; -} - - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - testRegExp(statusmessages, patterns, strings, actualmatches, expectedmatches); - exitFunc ('test'); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-57631.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-57631.js deleted file mode 100644 index dc222bfc0f..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-57631.js +++ /dev/null @@ -1,152 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * pschwartau@netscape.com, zack-weg@gmx.de - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * Date: 26 November 2000 - * - * - * SUMMARY: This test arose from Bugzilla bug 57631: - * "RegExp with invalid pattern or invalid flag causes segfault" - * - * Either error should throw an exception of type SyntaxError, - * and we check to see that it does... - */ -//----------------------------------------------------------------------------- -var gTestfile = 'regress-57631.js'; -var BUGNUMBER = '57631'; -var summary = 'Testing new RegExp(pattern,flag) with illegal pattern or flag'; -var statprefix = 'Testing for error creating illegal RegExp object on pattern '; -var statsuffix = 'and flag '; -var cnSUCCESS = 'SyntaxError'; -var cnFAILURE = 'not a SyntaxError'; -var singlequote = "'"; -var i = -1; var j = -1; var s = ''; var f = ''; -var obj = {}; -var status = ''; var actual = ''; var expect = ''; var msg = ''; -var legalpatterns = new Array(); var illegalpatterns = new Array(); -var legalflags = new Array(); var illegalflags = new Array(); - - -// valid regular expressions to try - -legalpatterns[0] = ''; -legalpatterns[1] = 'abc'; -legalpatterns[2] = '(.*)(3-1)\s\w'; -legalpatterns[3] = '(.*)(...)\\s\\w'; -legalpatterns[4] = '[^A-Za-z0-9_]'; -legalpatterns[5] = '[^\f\n\r\t\v](123.5)([4 - 8]$)'; - -// invalid regular expressions to try - -illegalpatterns[0] = '(?)'; -illegalpatterns[1] = '(a'; -illegalpatterns[2] = '( ]'; -//illegalpatterns[3] = '\d{1,s}'; - -// valid flags to try - -legalflags[0] = 'i'; -legalflags[1] = 'g'; -legalflags[2] = 'm'; -legalflags[3] = undefined; - -// invalid flags to try - -illegalflags[0] = 'a'; -illegalflags[1] = 123; -illegalflags[2] = new RegExp(); - - - -//------------------------------------------------------------------------------------------------- -test(); -//------------------------------------------------------------------------------------------------- - - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - testIllegalRegExps(legalpatterns, illegalflags); - testIllegalRegExps(illegalpatterns, legalflags); - testIllegalRegExps(illegalpatterns, illegalflags); - - exitFunc ('test'); -} - - -// This function will only be called where all the patterns are illegal, or all the flags -function testIllegalRegExps(patterns, flags) -{ - for (i in patterns) - { - s = patterns[i]; - - for (j in flags) - { - f = flags[j]; - status = getStatus(s, f); - actual = cnFAILURE; - expect = cnSUCCESS; - - try - { - // This should cause an exception if either s or f is illegal - - eval('obj = new RegExp(s, f);'); - } - catch(e) - { - // We expect to get a SyntaxError - test for this: - if (e instanceof SyntaxError) - actual = cnSUCCESS; - } - - reportCompare(expect, actual, status); - } - } -} - - -function getStatus(regexp, flag) -{ - return (statprefix + quote(regexp) + statsuffix + quote(flag)); -} - - -function quote(text) -{ - return (singlequote + text + singlequote); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-67773.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-67773.js deleted file mode 100644 index 4ee0d52854..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-67773.js +++ /dev/null @@ -1,211 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * pschwartau@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * Date: 06 February 2001 - * - * SUMMARY: Arose from Bugzilla bug 67773: - * "Regular subexpressions followed by + failing to run to completion" - * - * See http://bugzilla.mozilla.org/show_bug.cgi?id=67773 - * See http://bugzilla.mozilla.org/show_bug.cgi?id=69989 - */ -//----------------------------------------------------------------------------- -var gTestfile = 'regress-67773.js'; -var i = 0; -var BUGNUMBER = 67773; -var summary = 'Testing regular subexpressions followed by ? or +\n'; -var cnSingleSpace = ' '; -var status = ''; -var statusmessages = new Array(); -var pattern = ''; -var patterns = new Array(); -var string = ''; -var strings = new Array(); -var actualmatch = ''; -var actualmatches = new Array(); -var expectedmatch = ''; -var expectedmatches = new Array(); - - -pattern = /^(\S+)?( ?)(B+)$/; //single space before second ? character -status = inSection(1); -string = 'AAABBB AAABBB '; //single space at middle and at end - -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(2); -string = 'AAABBB BBB'; //single space in the middle -actualmatch = string.match(pattern); -expectedmatch = Array(string, 'AAABBB', cnSingleSpace, 'BBB'); -addThis(); - -status = inSection(3); -string = 'AAABBB AAABBB'; //single space in the middle -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - - -pattern = /^(A+B)+$/; -status = inSection(4); -string = 'AABAAB'; -actualmatch = string.match(pattern); -expectedmatch = Array(string, 'AAB'); -addThis(); - -status = inSection(5); -string = 'ABAABAAAAAAB'; -actualmatch = string.match(pattern); -expectedmatch = Array(string, 'AAAAAAB'); -addThis(); - -status = inSection(6); -string = 'ABAABAABAB'; -actualmatch = string.match(pattern); -expectedmatch = Array(string, 'AB'); -addThis(); - -status = inSection(7); -string = 'ABAABAABABB'; -actualmatch = string.match(pattern); -expectedmatch = null; // because string doesn't match at end -addThis(); - - -pattern = /^(A+1)+$/; -status = inSection(8); -string = 'AA1AA1'; -actualmatch = string.match(pattern); -expectedmatch = Array(string, 'AA1'); -addThis(); - - -pattern = /^(\w+\-)+$/; -status = inSection(9); -string = ''; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(10); -string = 'bla-'; -actualmatch = string.match(pattern); -expectedmatch = Array(string, string); -addThis(); - -status = inSection(11); -string = 'bla-bla'; // hyphen missing at end - -actualmatch = string.match(pattern); -expectedmatch = null; //because string doesn't match at end -addThis(); - -status = inSection(12); -string = 'bla-bla-'; -actualmatch = string.match(pattern); -expectedmatch = Array(string, 'bla-'); -addThis(); - - -pattern = /^(\S+)+(A+)$/; -status = inSection(13); -string = 'asdldflkjAAA'; -actualmatch = string.match(pattern); -expectedmatch = Array(string, 'asdldflkjAA', 'A'); -addThis(); - -status = inSection(14); -string = 'asdldflkj AAA'; // space in middle -actualmatch = string.match(pattern); -expectedmatch = null; //because of the space -addThis(); - - -pattern = /^(\S+)+(\d+)$/; -status = inSection(15); -string = 'asdldflkj122211'; -actualmatch = string.match(pattern); -expectedmatch = Array(string, 'asdldflkj12221', '1'); -addThis(); - -status = inSection(16); -string = 'asdldflkj1111111aaa1'; -actualmatch = string.match(pattern); -expectedmatch = Array(string, 'asdldflkj1111111aaa', '1'); -addThis(); - - -/* - * This one comes from Stephen Ostermiller. - * See http://bugzilla.mozilla.org/show_bug.cgi?id=69989 - */ -pattern = /^[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)+$/; -status = inSection(17); -string = 'some.host.tld'; -actualmatch = string.match(pattern); -expectedmatch = Array(string, '.tld', '.'); -addThis(); - - - -//------------------------------------------------------------------------------------------------- -test(); -//------------------------------------------------------------------------------------------------- - - - -function addThis() -{ - statusmessages[i] = status; - patterns[i] = pattern; - strings[i] = string; - actualmatches[i] = actualmatch; - expectedmatches[i] = expectedmatch; - i++; -} - - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - testRegExp(statusmessages, patterns, strings, actualmatches, expectedmatches); - exitFunc ('test'); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-72964.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-72964.js deleted file mode 100644 index 67a41e505c..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-72964.js +++ /dev/null @@ -1,121 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * pschwartau@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * Date: 2001-07-17 - * - * SUMMARY: Regression test for Bugzilla bug 72964: - * "String method for pattern matching failed for Chinese Simplified (GB2312)" - * - * See http://bugzilla.mozilla.org/show_bug.cgi?id=72964 - */ -//----------------------------------------------------------------------------- -var gTestfile = 'regress-72964.js'; -var i = 0; -var BUGNUMBER = 72964; -var summary = 'Testing regular expressions containing non-Latin1 characters'; -var cnSingleSpace = ' '; -var status = ''; -var statusmessages = new Array(); -var pattern = ''; -var patterns = new Array(); -var string = ''; -var strings = new Array(); -var actualmatch = ''; -var actualmatches = new Array(); -var expectedmatch = ''; -var expectedmatches = new Array(); - - -pattern = /[\S]+/; -// 4 low Unicode chars = Latin1; whole string should match -status = inSection(1); -string = '\u00BF\u00CD\u00BB\u00A7'; -actualmatch = string.match(pattern); -expectedmatch = Array(string); -addThis(); - -// Now put a space in the middle; first half of string should match -status = inSection(2); -string = '\u00BF\u00CD \u00BB\u00A7'; -actualmatch = string.match(pattern); -expectedmatch = Array('\u00BF\u00CD'); -addThis(); - - -// 4 high Unicode chars = non-Latin1; whole string should match -status = inSection(3); -string = '\u4e00\uac00\u4e03\u4e00'; -actualmatch = string.match(pattern); -expectedmatch = Array(string); -addThis(); - -// Now put a space in the middle; first half of string should match -status = inSection(4); -string = '\u4e00\uac00 \u4e03\u4e00'; -actualmatch = string.match(pattern); -expectedmatch = Array('\u4e00\uac00'); -addThis(); - - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - - - -function addThis() -{ - statusmessages[i] = status; - patterns[i] = pattern; - strings[i] = string; - actualmatches[i] = actualmatch; - expectedmatches[i] = expectedmatch; - i++; -} - - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - testRegExp(statusmessages, patterns, strings, actualmatches, expectedmatches); - exitFunc ('test'); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-76683.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-76683.js deleted file mode 100644 index 8792e379ca..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-76683.js +++ /dev/null @@ -1,114 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * pschwartau@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * Date: 01 May 2001 - * - * SUMMARY: Regression test for Bugzilla bug 76683 on Rhino: - * "RegExp regression (NullPointerException)" - * - * See http://bugzilla.mozilla.org/show_bug.cgi?id=76683 - */ -//----------------------------------------------------------------------------- -var gTestfile = 'regress-76683.js'; -var i = 0; -var BUGNUMBER = 76683; -var summary = 'Regression test for Bugzilla bug 76683'; -var status = ''; -var statusmessages = new Array(); -var pattern = ''; -var patterns = new Array(); -var string = ''; -var strings = new Array(); -var actualmatch = ''; -var actualmatches = new Array(); -var expectedmatch = ''; -var expectedmatches = new Array(); - - -/* - * Rhino (2001-04-19) crashed on the 3rd regular expression below. - * It didn't matter what the string was. No problem in SpiderMonkey - - */ -string = 'abc'; -status = inSection(1); -pattern = /()|(<([\$\w:\.\-]+)((([ ][^\/>]*)?\/>)|(([ ][^>]*)?>)))/; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -status = inSection(2); -pattern = /()|(<(tagPattern)((([ ][^\/>]*)?\/>)|(([ ][^>]*)?>)))/; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - -// This was the one causing a Rhino crash - -status = inSection(3); -pattern = /()|(<(tagPattern)((([ ][^\/>]*)?\/>)|(([ ][^>]*)?>)))|(<\/tagPattern[^>]*>)/; -actualmatch = string.match(pattern); -expectedmatch = null; -addThis(); - - - -//------------------------------------------------------------------------------------------------- -test(); -//------------------------------------------------------------------------------------------------- - - - -function addThis() -{ - statusmessages[i] = status; - patterns[i] = pattern; - strings[i] = string; - actualmatches[i] = actualmatch; - expectedmatches[i] = expectedmatch; - i++; -} - - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - testRegExp(statusmessages, patterns, strings, actualmatches, expectedmatches); - exitFunc ('test'); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-78156.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-78156.js deleted file mode 100644 index dd42ce060b..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-78156.js +++ /dev/null @@ -1,123 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * pschwartau@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * Date: 06 February 2001 - * - * SUMMARY: Arose from Bugzilla bug 78156: - * "m flag of regular expression does not work with $" - * - * See http://bugzilla.mozilla.org/show_bug.cgi?id=78156 - * - * The m flag means a regular expression should search strings - * across multiple lines, i.e. across '\n', '\r'. - */ -//----------------------------------------------------------------------------- -var gTestfile = 'regress-78156.js'; -var i = 0; -var BUGNUMBER = 78156; -var summary = 'Testing regular expressions with ^, $, and the m flag -'; -var status = ''; -var statusmessages = new Array(); -var pattern = ''; -var patterns = new Array(); -var string = ''; -var strings = new Array(); -var actualmatch = ''; -var actualmatches = new Array(); -var expectedmatch = ''; -var expectedmatches = new Array(); - -/* - * All patterns have an m flag; all strings are multiline. - * Looking for digit characters at beginning/end of lines. - */ - -string = 'aaa\n789\r\nccc\r\n345'; -status = inSection(1); -pattern = /^\d/gm; -actualmatch = string.match(pattern); -expectedmatch = ['7','3']; -addThis(); - -status = inSection(2); -pattern = /\d$/gm; -actualmatch = string.match(pattern); -expectedmatch = ['9','5']; -addThis(); - -string = 'aaa\n789\r\nccc\r\nddd'; -status = inSection(3); -pattern = /^\d/gm; -actualmatch = string.match(pattern); -expectedmatch = ['7']; -addThis(); - -status = inSection(4); -pattern = /\d$/gm; -actualmatch = string.match(pattern); -expectedmatch = ['9']; -addThis(); - - - -//------------------------------------------------------------------------------------------------- -test(); -//------------------------------------------------------------------------------------------------- - - - -function addThis() -{ - statusmessages[i] = status; - patterns[i] = pattern; - strings[i] = string; - actualmatches[i] = actualmatch; - expectedmatches[i] = expectedmatch; - i++; -} - - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - testRegExp(statusmessages, patterns, strings, actualmatches, expectedmatches); - exitFunc ('test'); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-85721.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-85721.js deleted file mode 100644 index bca1a15e19..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-85721.js +++ /dev/null @@ -1,276 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * rogerl@netscape.com, pschwartau@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * - * Date: 14 Feb 2002 - * SUMMARY: Performance: Regexp performance degraded from 4.7 - * See http://bugzilla.mozilla.org/show_bug.cgi?id=85721 - * - * Adjust this testcase if necessary. The FAST constant defines - * an upper bound in milliseconds for any execution to take. - * - */ -//----------------------------------------------------------------------------- -var gTestfile = 'regress-85721.js'; -var BUGNUMBER = 85721; -var summary = 'Performance: execution of regular expression'; -var FAST = 100; // execution should be 100 ms or less to pass the test -var MSG_FAST = 'Execution took less than ' + FAST + ' ms'; -var MSG_SLOW = 'Execution took '; -var MSG_MS = ' ms'; -var str = ''; -var re = ''; -var status = ''; -var actual = ''; -var expect= ''; - -printBugNumber(BUGNUMBER); -printStatus (summary); - - -function elapsedTime(startTime) -{ - return new Date() - startTime; -} - - -function isThisFast(ms) -{ - if (ms <= FAST) - return MSG_FAST; - return MSG_SLOW + ms + MSG_MS; -} - - - -/* - * The first regexp. We'll test for performance (Section 1) and accuracy (Section 2). - */ -str=' www.m.com drive.class\nfoo goo '; -re = /\s*\s*([^\r\n]*?)\s*<\/sql:url>\s*\s*([^\r\n]*?)\s*<\/sql:driver>\s*(\s*\s*([^\r\n]*?)\s*<\/sql:userId>\s*)?\s*(\s*\s*([^\r\n]*?)\s*<\/sql:password>\s*)?\s*<\/sql:connection>/; -expect = Array(" www.m.com drive.class\nfoo goo ","conn1","www.m.com","drive.class","foo ","foo","goo ","goo"); - -/* - * Check performance - - */ -status = inSection(1); -var start = new Date(); -var result = re.exec(str); -actual = elapsedTime(start); -reportCompare(isThisFast(FAST), isThisFast(actual), status); - -/* - * Check accuracy - - */ -status = inSection(2); -testRegExp([status], [re], [str], [result], [expect]); - - - -/* - * The second regexp (HUGE!). We'll test for performance (Section 3) and accuracy (Section 4). - * It comes from the O'Reilly book "Mastering Regular Expressions" by Jeffrey Friedl, Appendix B - */ - -//# Some things for avoiding backslashitis later on. -$esc = '\\\\'; -$Period = '\.'; -$space = '\040'; $tab = '\t'; -$OpenBR = '\\['; $CloseBR = '\\]'; -$OpenParen = '\\('; $CloseParen = '\\)'; -$NonASCII = '\x80-\xff'; $ctrl = '\000-\037'; -$CRlist = '\n\015'; //# note: this should really be only \015. -// Items 19, 20, 21 -$qtext = '[^' + $esc + $NonASCII + $CRlist + '\"]'; // # for within "..." -$dtext = '[^' + $esc + $NonASCII + $CRlist + $OpenBR + $CloseBR + ']'; // # for within [...] -$quoted_pair = $esc + '[^' + $NonASCII + ']'; // # an escaped character - -//############################################################################## -//# Items 22 and 23, comment. -//# Impossible to do properly with a regex, I make do by allowing at most one level of nesting. -$ctext = '[^' + $esc + $NonASCII + $CRlist + '()]'; - -//# $Cnested matches one non-nested comment. -//# It is unrolled, with normal of $ctext, special of $quoted_pair. -$Cnested = - $OpenParen + // # ( - $ctext + '*' + // # normal* - '(?:' + $quoted_pair + $ctext + '*)*' + // # (special normal*)* - $CloseParen; // # ) - - -//# $comment allows one level of nested parentheses -//# It is unrolled, with normal of $ctext, special of ($quoted_pair|$Cnested) -$comment = - $OpenParen + // # ( - $ctext + '*' + // # normal* - '(?:' + // # ( - '(?:' + $quoted_pair + '|' + $Cnested + ')' + // # special - $ctext + '*' + // # normal* - ')*' + // # )* - $CloseParen; // # ) - - -//############################################################################## -//# $X is optional whitespace/comments. -$X = - '[' + $space + $tab + ']*' + // # Nab whitespace. - '(?:' + $comment + '[' + $space + $tab + ']*)*'; // # If comment found, allow more spaces. - - -//# Item 10: atom -$atom_char = '[^(' + $space + '<>\@,;:\".' + $esc + $OpenBR + $CloseBR + $ctrl + $NonASCII + ']'; -$atom = - $atom_char + '+' + // # some number of atom characters... - '(?!' + $atom_char + ')'; // # ..not followed by something that could be part of an atom - -// # Item 11: doublequoted string, unrolled. -$quoted_str = - '\"' + // # " - $qtext + '*' + // # normal - '(?:' + $quoted_pair + $qtext + '*)*' + // # ( special normal* )* - '\"'; // # " - -//# Item 7: word is an atom or quoted string -$word = - '(?:' + - $atom + // # Atom - '|' + // # or - $quoted_str + // # Quoted string - ')' - -//# Item 12: domain-ref is just an atom - $domain_ref = $atom; - -//# Item 13: domain-literal is like a quoted string, but [...] instead of "..." -$domain_lit = - $OpenBR + // # [ - '(?:' + $dtext + '|' + $quoted_pair + ')*' + // # stuff - $CloseBR; // # ] - -// # Item 9: sub-domain is a domain-ref or domain-literal -$sub_domain = - '(?:' + - $domain_ref + - '|' + - $domain_lit + - ')' + - $X; // # optional trailing comments - -// # Item 6: domain is a list of subdomains separated by dots. -$domain = - $sub_domain + - '(?:' + - $Period + $X + $sub_domain + - ')*'; - -//# Item 8: a route. A bunch of "@ $domain" separated by commas, followed by a colon. -$route = - '\@' + $X + $domain + - '(?:,' + $X + '\@' + $X + $domain + ')*' + // # additional domains - ':' + - $X; // # optional trailing comments - -//# Item 6: local-part is a bunch of $word separated by periods -$local_part = - $word + $X - '(?:' + - $Period + $X + $word + $X + // # additional words - ')*'; - -// # Item 2: addr-spec is local@domain -$addr_spec = - $local_part + '\@' + $X + $domain; - -//# Item 4: route-addr is -$route_addr = - '<' + $X + // # < - '(?:' + $route + ')?' + // # optional route - $addr_spec + // # address spec - '>'; // # > - -//# Item 3: phrase........ -$phrase_ctrl = '\000-\010\012-\037'; // # like ctrl, but without tab - -//# Like atom-char, but without listing space, and uses phrase_ctrl. -//# Since the class is negated, this matches the same as atom-char plus space and tab -$phrase_char = - '[^()<>\@,;:\".' + $esc + $OpenBR + $CloseBR + $NonASCII + $phrase_ctrl + ']'; - -// # We've worked it so that $word, $comment, and $quoted_str to not consume trailing $X -// # because we take care of it manually. -$phrase = - $word + // # leading word - $phrase_char + '*' + // # "normal" atoms and/or spaces - '(?:' + - '(?:' + $comment + '|' + $quoted_str + ')' + // # "special" comment or quoted string - $phrase_char + '*' + // # more "normal" - ')*'; - -// ## Item #1: mailbox is an addr_spec or a phrase/route_addr -$mailbox = - $X + // # optional leading comment - '(?:' + - $phrase + $route_addr + // # name and address - '|' + // # or - $addr_spec + // # address - ')'; - - -//########################################################################### - - -re = new RegExp($mailbox, "g"); -str = 'Jeffy<"That Tall Guy"@ora.com (this address is no longer active)>'; -expect = Array('Jeffy<"That Tall Guy"@ora.com (this address is no longer active)>'); - -/* - * Check performance - - */ -status = inSection(3); -var start = new Date(); -var result = re.exec(str); -actual = elapsedTime(start); -reportCompare(isThisFast(FAST), isThisFast(actual), status); - -/* - * Check accuracy - - */ -status = inSection(4); -testRegExp([status], [re], [str], [result], [expect]); diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-87231.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-87231.js deleted file mode 100644 index b5467322eb..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-87231.js +++ /dev/null @@ -1,145 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * pschwartau@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * Date: 22 June 2001 - * - * SUMMARY: Regression test for Bugzilla bug 87231: - * "Regular expression /(A)?(A.*)/ picks 'A' twice" - * - * See http://bugzilla.mozilla.org/show_bug.cgi?id=87231 - * Key case: - * - * pattern = /^(A)?(A.*)$/; - * string = 'A'; - * expectedmatch = Array('A', '', 'A'); - * - * - * We expect the 1st subexpression (A)? NOT to consume the single 'A'. - * Recall that "?" means "match 0 or 1 times". Here, it should NOT do - * greedy matching: it should match 0 times instead of 1. This allows - * the 2nd subexpression to make the only match it can: the single 'A'. - * Such "altruism" is the only way there can be a successful global match... - */ -//----------------------------------------------------------------------------- -var gTestfile = 'regress-87231.js'; -var i = 0; -var BUGNUMBER = 87231; -var cnEmptyString = ''; -var summary = 'Testing regular expression /(A)?(A.*)/'; -var status = ''; -var statusmessages = new Array(); -var pattern = ''; -var patterns = new Array(); -var string = ''; -var strings = new Array(); -var actualmatch = ''; -var actualmatches = new Array(); -var expectedmatch = ''; -var expectedmatches = new Array(); - - -pattern = /^(A)?(A.*)$/; -status = inSection(1); -string = 'AAA'; -actualmatch = string.match(pattern); -expectedmatch = Array('AAA', 'A', 'AA'); -addThis(); - -status = inSection(2); -string = 'AA'; -actualmatch = string.match(pattern); -expectedmatch = Array('AA', 'A', 'A'); -addThis(); - -status = inSection(3); -string = 'A'; -actualmatch = string.match(pattern); -expectedmatch = Array('A', undefined, 'A'); // 'altruistic' case: see above -addThis(); - - -pattern = /(A)?(A.*)/; -var strL = 'zxcasd;fl\\\ ^'; -var strR = 'aaAAaaaf;lrlrzs'; - -status = inSection(4); -string = strL + 'AAA' + strR; -actualmatch = string.match(pattern); -expectedmatch = Array('AAA' + strR, 'A', 'AA' + strR); -addThis(); - -status = inSection(5); -string = strL + 'AA' + strR; -actualmatch = string.match(pattern); -expectedmatch = Array('AA' + strR, 'A', 'A' + strR); -addThis(); - -status = inSection(6); -string = strL + 'A' + strR; -actualmatch = string.match(pattern); -expectedmatch = Array('A' + strR, undefined, 'A' + strR); // 'altruistic' case: see above -addThis(); - - - -//------------------------------------------------------------------------------------------------- -test(); -//------------------------------------------------------------------------------------------------- - - - -function addThis() -{ - statusmessages[i] = status; - patterns[i] = pattern; - strings[i] = string; - actualmatches[i] = actualmatch; - expectedmatches[i] = expectedmatch; - i++; -} - - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - testRegExp(statusmessages, patterns, strings, actualmatches, expectedmatches); - exitFunc ('test'); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-98306.js b/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-98306.js deleted file mode 100644 index a2bfc2bf93..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/RegExp/regress-98306.js +++ /dev/null @@ -1,99 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * jrgm@netscape.com, pschwartau@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * Date: 04 September 2001 - * - * SUMMARY: Regression test for Bugzilla bug 98306 - * "JS parser crashes in ParseAtom for script using Regexp()" - * - * See http://bugzilla.mozilla.org/show_bug.cgi?id=98306 - */ -//----------------------------------------------------------------------------- -var gTestfile = 'regress-98306.js'; -var BUGNUMBER = 98306; -var summary = "Testing that we don't crash on this code -"; -var cnUBOUND = 10; -var re; -var s; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - s = '"Hello".match(/[/]/)'; - tryThis(s); - - s = 're = /[/'; - tryThis(s); - - s = 're = /[/]/'; - tryThis(s); - - s = 're = /[//]/'; - tryThis(s); - - reportCompare('No Crash', 'No Crash', ''); - exitFunc ('test'); -} - - -// Try to provoke a crash - -function tryThis(sCode) -{ - // sometimes more than one attempt is necessary - - for (var i=0; i 5) - throw "bad"; - i++; - continue; - } - } - catch(ex) - { - actual = ex + ''; - } - reportCompare(expect, actual, summary); - - exitFunc ('test'); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/Regress/shell.js b/tests/auto/declarative/parserstress/tests/ecma_3/Regress/shell.js deleted file mode 100644 index 8c83369020..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/Regress/shell.js +++ /dev/null @@ -1 +0,0 @@ -gTestsubsuite = 'Regress'; diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/Statements/12.6.3.js b/tests/auto/declarative/parserstress/tests/ecma_3/Statements/12.6.3.js deleted file mode 100755 index 97c3ca3136..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/Statements/12.6.3.js +++ /dev/null @@ -1,80 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Mozilla Foundation. - * Portions created by the Initial Developer are Copyright (C) 2005 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Bryant Chen - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -var gTestfile = '12.6.3.js'; -//----------------------------------------------------------------------------- -var BUGNUMBER = 292731; -var summary = 'for-in should not call valueOf method'; -var actual = ''; -var expect = ''; -var i; - -printBugNumber(BUGNUMBER); -printStatus (summary); - -function MyObject() -{ -} - -MyObject.prototype.valueOf = function() -{ - actual += 'MyObject.prototype.valueOf called. '; -} - - var myobject = new MyObject(); - -var myfunction = new function() -{ - this.valueOf = function() - { - actual += 'this.valueOf called. '; - } -} - - actual = ''; -for (i in myobject) -{ - //calls valueOf -} -reportCompare(expect, actual, 'for-in custom object'); - -actual = ''; -for (i in myfunction) -{ - //calls valueOf -} -reportCompare(expect, actual, 'for-in function expression'); diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/Statements/browser.js b/tests/auto/declarative/parserstress/tests/ecma_3/Statements/browser.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/Statements/regress-121744.js b/tests/auto/declarative/parserstress/tests/ecma_3/Statements/regress-121744.js deleted file mode 100644 index 828cc5d8d5..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/Statements/regress-121744.js +++ /dev/null @@ -1,217 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * pschwartau@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * - * Date: 30 Jan 2002 - * Revised: 10 Apr 2002 - * Revised: 14 July 2002 - * - * SUMMARY: JS should error on |for(i in undefined)|, |for(i in null)| - * See http://bugzilla.mozilla.org/show_bug.cgi?id=121744 - * - * ECMA-262 3rd Edition Final spec says such statements should error. See: - * - * Section 12.6.4 The for-in Statement - * Section 9.9 ToObject - * - * - * BUT: SpiderMonkey has decided NOT to follow this; it's a bug in the spec. - * See http://bugzilla.mozilla.org/show_bug.cgi?id=131348 - * - * UPDATE: Rhino has also decided not to follow the spec on this. - * See http://bugzilla.mozilla.org/show_bug.cgi?id=136893 - * - - |--------------------------------------------------------------------| - | | - | So for now, adding an early return for this test so it won't run. | - | | - |--------------------------------------------------------------------| - - * - */ -//----------------------------------------------------------------------------- -var gTestfile = 'regress-121744.js'; -var UBound = 0; -var BUGNUMBER = 121744; -var summary = 'JS should error on |for(i in undefined)|, |for(i in null)|'; -var TEST_PASSED = 'TypeError'; -var TEST_FAILED = 'Generated an error, but NOT a TypeError!'; -var TEST_FAILED_BADLY = 'Did not generate ANY error!!!'; -var status = ''; -var statusitems = []; -var actual = ''; -var actualvalues = []; -var expect= ''; -var expectedvalues = []; - -/* - * AS OF 14 JULY 2002, DON'T RUN THIS TEST IN EITHER RHINO OR SPIDERMONKEY - - */ -quit(); - - -status = inSection(1); -expect = TEST_PASSED; -actual = TEST_FAILED_BADLY; -/* - * OK, this should generate a TypeError - */ -try -{ - for (var i in undefined) - { - print(i); - } -} -catch(e) -{ - if (e instanceof TypeError) - actual = TEST_PASSED; - else - actual = TEST_FAILED; -} -addThis(); - - - -status = inSection(2); -expect = TEST_PASSED; -actual = TEST_FAILED_BADLY; -/* - * OK, this should generate a TypeError - */ -try -{ - for (var i in null) - { - print(i); - } -} -catch(e) -{ - if (e instanceof TypeError) - actual = TEST_PASSED; - else - actual = TEST_FAILED; -} -addThis(); - - - -status = inSection(3); -expect = TEST_PASSED; -actual = TEST_FAILED_BADLY; -/* - * Variable names that cannot be looked up generate ReferenceErrors; however, - * property names like obj.ZZZ that cannot be looked up are set to |undefined| - * - * Therefore, this should indirectly test | for (var i in undefined) | - */ -try -{ - for (var i in this.ZZZ) - { - print(i); - } -} -catch(e) -{ - if(e instanceof TypeError) - actual = TEST_PASSED; - else - actual = TEST_FAILED; -} -addThis(); - - - -status = inSection(4); -expect = TEST_PASSED; -actual = TEST_FAILED_BADLY; -/* - * The result of an unsuccessful regexp match is the null value - * Therefore, this should indirectly test | for (var i in null) | - */ -try -{ - for (var i in 'bbb'.match(/aaa/)) - { - print(i); - } -} -catch(e) -{ - if(e instanceof TypeError) - actual = TEST_PASSED; - else - actual = TEST_FAILED; -} -addThis(); - - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - - - -function addThis() -{ - statusitems[UBound] = status; - actualvalues[UBound] = actual; - expectedvalues[UBound] = expect; - UBound++; -} - - -function test() -{ - enterFunc('test'); - printBugNumber(BUGNUMBER); - printStatus(summary); - - for (var i=0; i - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -var gTestfile = '15.5.4.11.js'; -var BUGNUMBER = 392378; -var summary = '15.5.4.11 - String.prototype.replace'; -var rex, f, a, i; - -reportCompare( - 2, - String.prototype.replace.length, - "Section 1" -); - -reportCompare( - "321", - String.prototype.replace.call(123, "123", "321"), - "Section 2" -); - -reportCompare( - "ok", - "ok".replace(), - "Section 3" -); - -reportCompare( - "undefined**", - "***".replace("*"), - "Section 4" -); - -reportCompare( - "xnullz", - "xyz".replace("y", null), - "Section 5" -); - -reportCompare( - "x123", - "xyz".replace("yz", 123), - "Section 6" -); - -reportCompare( - "/x/g/x/g/x/g", - "xxx".replace(/x/g, /x/g), - "Section 7" -); - -reportCompare( - "ok", - "undefined".replace(undefined, "ok"), - "Section 8" -); - -reportCompare( - "ok", - "null".replace(null, "ok"), - "Section 9" -); - -reportCompare( - "ok", - "123".replace(123, "ok"), - "Section 10" -); - -reportCompare( - "xzyxyz", - "xyzxyz".replace("yz", "zy"), - "Section 11" -); - -reportCompare( - "ok", - "(xyz)".replace("(xyz)", "ok"), - "Section 12" -); - -reportCompare( - "*$&yzxyz", - "xyzxyz".replace("x", "*$$&"), - "Section 13" -); - -reportCompare( - "xy*z*", - "xyz".replace("z", "*$&*"), - "Section 14" -); - -reportCompare( - "xyxyzxyz", - "xyzxyzxyz".replace("zxy", "$`"), - "Section 15" -); - -reportCompare( - "zxyzxyzzxyz", - "xyzxyz".replace("xy", "$'xyz"), - "Section 16" -); - -reportCompare( - "$", - "xyzxyz".replace("xyzxyz", "$"), - "Section 17" -); - -reportCompare( - "x$0$00xyz", - "xyzxyz".replace("yz", "$0$00"), - "Section 18" -); - -// Result for $1/$01 .. $99 is implementation-defined if searchValue is no -// regular expression. $+ is a non-standard Mozilla extension. - -reportCompare( - "$!$\"$-1$*$#$.$xyz$$", - "xyzxyz$$".replace("xyz", "$!$\"$-1$*$#$.$"), - "Section 19" -); - -reportCompare( - "$$$&$$$&$&", - "$$$&".replace("$$", "$$$$$$&$&$$&"), - "Section 20" -); - -reportCompare( - "yxx", - "xxx".replace(/x/, "y"), - "Section 21" -); - -reportCompare( - "yyy", - "xxx".replace(/x/g, "y"), - "Section 22" -); - -rex = /x/, rex.lastIndex = 1; -reportCompare( - "yxx1", - "xxx".replace(rex, "y") + rex.lastIndex, - "Section 23" -); - -rex = /x/g, rex.lastIndex = 1; -reportCompare( - "yyy0", - "xxx".replace(rex, "y") + rex.lastIndex, - "Section 24" -); - -rex = /y/, rex.lastIndex = 1; -reportCompare( - "xxx1", - "xxx".replace(rex, "y") + rex.lastIndex, - "Section 25" -); - -rex = /y/g, rex.lastIndex = 1; -reportCompare( - "xxx0", - "xxx".replace(rex, "y") + rex.lastIndex, - "Section 26" -); - -rex = /x?/, rex.lastIndex = 1; -reportCompare( - "(x)xx1", - "xxx".replace(rex, "($&)") + rex.lastIndex, - "Section 27" -); - -rex = /x?/g, rex.lastIndex = 1; -reportCompare( - "(x)(x)(x)()0", - "xxx".replace(rex, "($&)") + rex.lastIndex, - "Section 28" -); - -rex = /y?/, rex.lastIndex = 1; -reportCompare( - "()xxx1", - "xxx".replace(rex, "($&)") + rex.lastIndex, - "Section 29" -); - -rex = /y?/g, rex.lastIndex = 1; -reportCompare( - "()x()x()x()0", - "xxx".replace(rex, "($&)") + rex.lastIndex, - "Section 30" -); - -reportCompare( - "xy$0xy$zxy$zxyz$zxyz", - "xyzxyzxyz".replace(/zxy/, "$0$`$$$&$$$'$"), - "Section 31" -); - -reportCompare( - "xy$0xy$zxy$zxyz$$0xyzxy$zxy$z$z", - "xyzxyzxyz".replace(/zxy/g, "$0$`$$$&$$$'$"), - "Section 32" -); - -reportCompare( - "xyxyxyzxyxyxyz", - "xyzxyz".replace(/(((x)(y)()()))()()()(z)/g, "$01$2$3$04$5$6$7$8$09$10"), - "Section 33" -); - -rex = RegExp( - "()()()()()()()()()()" + - "()()()()()()()()()()" + - "()()()()()()()()()()" + - "()()()()()()()()()()" + - "()()()()()()()()()()" + - "()()()()()()()()()()" + - "()()()()()()()()()()" + - "()()()()()()()()()()" + - "()()()()()()()()()()" + - "()()()()()()()()(y)"); -reportCompare( - "x(y)z", - "xyz".replace(rex, "($99)"), - "Section 34" -); - -rex = RegExp( - "()()()()()()()()()(x)" + - "()()()()()()()()()()" + - "()()()()()()()()()()" + - "()()()()()()()()()()" + - "()()()()()()()()()()" + - "()()()()()()()()()()" + - "()()()()()()()()()()" + - "()()()()()()()()()()" + - "()()()()()()()()()()" + - "()()()()()()()()()(y)"); -reportCompare( - "(x0)z", - "xyz".replace(rex, "($100)"), - "Section 35" -); - -reportCompare( - "xyz(XYZ)", - "xyzXYZ".replace(/XYZ/g, "($&)"), - "Section 36" -); - -reportCompare( - "(xyz)(XYZ)", - "xyzXYZ".replace(/xYz/gi, "($&)"), - "Section 37" -); - -reportCompare( - "xyz\rxyz\n", - "xyz\rxyz\n".replace(/xyz$/g, "($&)"), - "Section 38" -); - -reportCompare( - "(xyz)\r(xyz)\n", - "xyz\rxyz\n".replace(/xyz$/gm, "($&)"), - "Section 39" -); - -f = function () { return "failure" }; - -reportCompare( - "ok", - "ok".replace("x", f), - "Section 40" -); - -reportCompare( - "ok", - "ok".replace(/(?=k)ok/, f), - "Section 41" -); - -reportCompare( - "ok", - "ok".replace(/(?!)ok/, f), - "Section 42" -); - -reportCompare( - "ok", - "ok".replace(/ok(?!$)/, f), - "Section 43" -); - -f = function (sub, offs, str) { - return ["", sub, typeof sub, offs, typeof offs, str, typeof str, ""] - .join("|"); -}; - -reportCompare( - "x|y|string|1|number|xyz|string|z", - "xyz".replace("y", f), - "Section 44" -); - -reportCompare( - "x|(y)|string|1|number|x(y)z|string|z", - "x(y)z".replace("(y)", f), - "Section 45" -); - -reportCompare( - "x|y*|string|1|number|xy*z|string|z", - "xy*z".replace("y*", f), - "Section 46" -); - -reportCompare( - "12|3|string|2|number|12345|string|45", - String.prototype.replace.call(1.2345e4, 3, f), - "Section 47" -); - -reportCompare( - "|x|string|0|number|xxx|string|xx", - "xxx".replace(/^x/g, f), - "Section 48" -); - -reportCompare( - "xx|x|string|2|number|xxx|string|", - "xxx".replace(/x$/g, f), - "Section 49" -); - -f = function (sub, paren, offs, str) { - return ["", sub, typeof sub, paren, typeof paren, offs, typeof offs, - str, typeof str, ""].join("|"); -}; - -reportCompare( - "xy|z|string|z|string|2|number|xyz|string|", - "xyz".replace(/(z)/g, f), - "Section 50" -); - -reportCompare( - "xyz||string||string|3|number|xyz|string|", - "xyz".replace(/($)/g, f), - "Section 51" -); - -reportCompare( - "|xy|string|y|string|0|number|xyz|string|z", - "xyz".replace(/(?:x)(y)/g, f), - "Section 52" -); - -reportCompare( - "|x|string|x|string|0|number|xyz|string|yz", - "xyz".replace(/((?=xy)x)/g, f), - "Section 53" -); - -reportCompare( - "|x|string|x|string|0|number|xyz|string|yz", - "xyz".replace(/(x(?=y))/g, f), - "Section 54" -); - -reportCompare( - "x|y|string|y|string|1|number|xyz|string|z", - "xyz".replace(/((?!x)y)/g, f), - "Section 55" -); - -reportCompare( - "|x|string|x|string|0|number|xyz|string|" + - "|y|string||undefined|1|number|xyz|string|z", - "xyz".replace(/y|(x)/g, f), - "Section 56" -); - -reportCompare( - "xy|z|string||string|2|number|xyz|string|", - "xyz".replace(/(z?)z/, f), - "Section 57" -); - -reportCompare( - "xy|z|string||undefined|2|number|xyz|string|", - "xyz".replace(/(z)?z/, f), - "Section 58" -); - -reportCompare( - "xy|z|string||undefined|2|number|xyz|string|", - "xyz".replace(/(z)?\1z/, f), - "Section 59" -); - -reportCompare( - "xy|z|string||undefined|2|number|xyz|string|", - "xyz".replace(/\1(z)?z/, f), - "Section 60" -); - -reportCompare( - "xy|z|string||string|2|number|xyz|string|", - "xyz".replace(/(z?\1)z/, f), - "Section 61" -); - -f = function (sub, paren1, paren2, offs, str) { - return ["", sub, typeof sub, paren1, typeof paren1, paren2, typeof paren2, - offs, typeof offs, str, typeof str, ""].join("|"); -}; - -reportCompare( - "x|y|string|y|string||undefined|1|number|xyz|string|z", - "xyz".replace(/(y)(\1)?/, f), - "Section 62" -); - -reportCompare( - "x|yy|string|y|string|y|string|1|number|xyyz|string|z", - "xyyz".replace(/(y)(\1)?/g, f), - "Section 63" -); - -reportCompare( - "x|y|string|y|string||undefined|1|number|xyyz|string|" + - "|y|string|y|string||undefined|2|number|xyyz|string|z", - "xyyz".replace(/(y)(\1)??/g, f), - "Section 64" -); - -reportCompare( - "x|y|string|y|string|y|string|1|number|xyz|string|z", - "xyz".replace(/(?=(y))(\1)?/, f), - "Section 65" -); - -reportCompare( - "xyy|z|string||undefined||string|3|number|xyyz|string|", - "xyyz".replace(/(?!(y)y)(\1)z/, f), - "Section 66" -); - -rex = RegExp( - "()()()()()()()()()()" + - "()()()()()()()()()()" + - "()()()()()()()()()()" + - "()()()()()()()()()()" + - "()()()()()()()()()()" + - "()()()()()()()()()()" + - "()()()()()()()()()()" + - "()()()()()()()()()()" + - "()()()()()()()()()()" + - "()()()()()()()()()()(z)?(y)"); -a = ["sub"]; -for (i = 1; i <= 102; ++i) - a[i] = "p" + i; -a[103] = "offs"; -a[104] = "str"; -a[105] = "return ['', sub, typeof sub, offs, typeof offs, str, typeof str, " + - "p100, typeof p100, p101, typeof p101, p102, typeof p102, ''].join('|');"; -f = Function.apply(null, a); -reportCompare( - "x|y|string|1|number|xyz|string||string||undefined|y|string|z", - "xyz".replace(rex, f), - "Section 67" -); - -reportCompare( - "undefined", - "".replace(/.*/g, function () {}), - "Section 68" -); - -reportCompare( - "nullxnullynullznull", - "xyz".replace(/.??/g, function () { return null; }), - "Section 69" -); - -reportCompare( - "111", - "xyz".replace(/./g, function () { return 1; }), - "Section 70" -); diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/String/15.5.4.14.js b/tests/auto/declarative/parserstress/tests/ecma_3/String/15.5.4.14.js deleted file mode 100644 index aa6c7354c2..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/String/15.5.4.14.js +++ /dev/null @@ -1,50 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Mozilla Foundation. - * Portions created by the Initial Developer are Copyright (C) 2005 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Karsten Sperling - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -var gTestfile = '15.5.4.14.js'; -//----------------------------------------------------------------------------- -var BUGNUMBER = 287630; -var summary = '15.5.4.14 - String.prototype.split(/()/)'; -var actual = ''; -var expect = ['a'].toString(); - -printBugNumber(BUGNUMBER); -printStatus (summary); - -actual = 'a'.split(/()/).toString(); - -reportCompare(expect, actual, summary); diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/String/browser.js b/tests/auto/declarative/parserstress/tests/ecma_3/String/browser.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/String/regress-104375.js b/tests/auto/declarative/parserstress/tests/ecma_3/String/regress-104375.js deleted file mode 100644 index c5593948d7..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/String/regress-104375.js +++ /dev/null @@ -1,116 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * k.mike@gmx.net, pschwartau@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * Date: 12 October 2001 - * - * SUMMARY: Regression test for string.replace bug 104375 - * See http://bugzilla.mozilla.org/show_bug.cgi?id=104375 - */ -//----------------------------------------------------------------------------- -var gTestfile = 'regress-104375.js'; -var UBound = 0; -var BUGNUMBER = 104375; -var summary = 'Testing string.replace() with backreferences'; -var status = ''; -var statusitems = []; -var actual = ''; -var actualvalues = []; -var expect= ''; -var expectedvalues = []; - - -/* - * Use the regexp to replace 'uid=31' with 'uid=15' - * - * In the second parameter of string.replace() method, - * "$1" refers to the first backreference: 'uid=' - */ -var str = 'uid=31'; -var re = /(uid=)(\d+)/; - -// try the numeric literal 15 -status = inSection(1); -actual = str.replace (re, "$1" + 15); -expect = 'uid=15'; -addThis(); - -// try the string literal '15' -status = inSection(2); -actual = str.replace (re, "$1" + '15'); -expect = 'uid=15'; -addThis(); - -// try a letter before the '15' -status = inSection(3); -actual = str.replace (re, "$1" + 'A15'); -expect = 'uid=A15'; -addThis(); - - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - - - -function addThis() -{ - statusitems[UBound] = status; - actualvalues[UBound] = actual; - expectedvalues[UBound] = expect; - UBound++; -} - - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - for (var i=0; i 'aaZaa' - expect = strJim.replace(new RegExp(strA), strB); // expect 'aa$aaZ' - reportCompare(expect, actual, status); - - - * - * Note: 'Zabc' is the result we expect for 'abc'.replace('', 'Z'). - * - * The string '' is supposed to be equivalent to new RegExp('') = //. - * The regexp // means we should match the "empty string" conceived of - * at the beginning boundary of the word, before the first character. - * - status = 'Section F of test'; - strA = cnEmptyString; - actual = str.replace(strA, strB); - expect = 'Zabc'; - reportCompare(expect, actual, status); - - status = 'Section G of test'; - strA = cnEmptyString; - actual = str.replace(strA, strB); - expect = str.replace(new RegExp(strA), strB); - reportCompare(expect, actual, status); - - ************************* END OF INCORRECT CASES ****************************/ - - -////////////////////////// OK, LET'S START OVER ////////////////////////////// - - status = 'Section 1 of test'; - actual = 'abc'.replace('a', 'Z'); - expect = 'Zbc'; - reportCompare(expect, actual, status); - - status = 'Section 2 of test'; - actual = 'abc'.replace('b', 'Z'); - expect = 'aZc'; - reportCompare(expect, actual, status); - - status = 'Section 3 of test'; - actual = 'abc'.replace(undefined, 'Z'); - expect = 'abc'; // String(undefined) == 'undefined'; no replacement possible - reportCompare(expect, actual, status); - - status = 'Section 4 of test'; - actual = 'abc'.replace(null, 'Z'); - expect = 'abc'; // String(null) == 'null'; no replacement possible - reportCompare(expect, actual, status); - - status = 'Section 5 of test'; - actual = 'abc'.replace(true, 'Z'); - expect = 'abc'; // String(true) == 'true'; no replacement possible - reportCompare(expect, actual, status); - - status = 'Section 6 of test'; - actual = 'abc'.replace(false, 'Z'); - expect = 'abc'; // String(false) == 'false'; no replacement possible - reportCompare(expect, actual, status); - - status = 'Section 7 of test'; - actual = 'aa$aa'.replace('$', 'Z'); - expect = 'aaZaa'; // NOT 'aa$aaZ' as in ECMA Final Draft; see above - reportCompare(expect, actual, status); - - status = 'Section 8 of test'; - actual = 'abc'.replace('.*', 'Z'); - expect = 'abc'; // not 'Z' as in EMCA Final Draft - reportCompare(expect, actual, status); - - status = 'Section 9 of test'; - actual = 'abc'.replace('', 'Z'); - expect = 'Zabc'; // Still expect 'Zabc' for this - reportCompare(expect, actual, status); - - exitFunc ('test'); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/String/shell.js b/tests/auto/declarative/parserstress/tests/ecma_3/String/shell.js deleted file mode 100644 index 7d850446cc..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/String/shell.js +++ /dev/null @@ -1 +0,0 @@ -gTestsubsuite = 'String'; diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/Unicode/browser.js b/tests/auto/declarative/parserstress/tests/ecma_3/Unicode/browser.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/Unicode/regress-352044-01.js b/tests/auto/declarative/parserstress/tests/ecma_3/Unicode/regress-352044-01.js deleted file mode 100755 index bb10ac6f7a..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/Unicode/regress-352044-01.js +++ /dev/null @@ -1,72 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Mozilla Foundation. - * Portions created by the Initial Developer are Copyright (C) 2007 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Martin Honnen - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -var gTestfile = 'regress-352044-01.js'; -//----------------------------------------------------------------------------- -var BUGNUMBER = 352044; -var summary = 'issues with Unicode escape sequences in JavaScript source code'; -var actual = ''; -var expect = ''; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - expect = 'SyntaxError: illegal character'; - - try - { - var i = 1; - eval('i \\u002b= 1'); - print(i); - } - catch(ex) - { - actual = ex + ''; - } - - reportCompare(expect, actual, summary); - - exitFunc ('test'); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/Unicode/regress-352044-02-n.js b/tests/auto/declarative/parserstress/tests/ecma_3/Unicode/regress-352044-02-n.js deleted file mode 100755 index 0e3c4b0189..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/Unicode/regress-352044-02-n.js +++ /dev/null @@ -1,72 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Mozilla Foundation. - * Portions created by the Initial Developer are Copyright (C) 2007 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): Martin Honnen - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -var gTestfile = 'regress-352044-02-n.js'; -//----------------------------------------------------------------------------- -var BUGNUMBER = 352044; -var summary = 'issues with Unicode escape sequences in JavaScript source code'; -var actual = 'No Error'; -var expect = 'SyntaxError'; - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - -function test() -{ - enterFunc ('test'); - printBugNumber(BUGNUMBER); - printStatus (summary); - - print('This test case is expected to throw an uncaught SyntaxError'); - - try - { - var i = 1; - i \u002b= 1; - print(i); - } - catch(ex) - { - actual = ex + ''; - } - - reportCompare(expect, actual, summary); - - exitFunc ('test'); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/Unicode/shell.js b/tests/auto/declarative/parserstress/tests/ecma_3/Unicode/shell.js deleted file mode 100644 index 97a64fe83d..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/Unicode/shell.js +++ /dev/null @@ -1 +0,0 @@ -gTestsubsuite = 'Unicode'; diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/Unicode/uc-001-n.js b/tests/auto/declarative/parserstress/tests/ecma_3/Unicode/uc-001-n.js deleted file mode 100644 index 31a13f70e2..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/Unicode/uc-001-n.js +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Rob Ginda rginda@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -var gTestfile = 'uc-001-n.js'; - -test(); - -function test() -{ - enterFunc ("test"); - - printStatus ("Unicode Characters 1C-1F negative test."); - printBugNumber (23612); - - reportCompare ("error", eval ("'no'\u001C+' error'"), - "Unicode whitespace test (1C.)"); - reportCompare ("error", eval ("'no'\u001D+' error'"), - "Unicode whitespace test (1D.)"); - reportCompare ("error", eval ("'no'\u001E+' error'"), - "Unicode whitespace test (1E.)"); - reportCompare ("error", eval ("'no'\u001F+' error'"), - "Unicode whitespace test (1F.)"); - - exitFunc ("test"); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/Unicode/uc-001.js b/tests/auto/declarative/parserstress/tests/ecma_3/Unicode/uc-001.js deleted file mode 100644 index 3fc0c8d927..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/Unicode/uc-001.js +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Rob Ginda rginda@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -var gTestfile = 'uc-001.js'; - -test(); - -function test() -{ - enterFunc ("test"); - - printStatus ("Unicode format-control character (Category Cf) test."); - printBugNumber (23610); - - reportCompare ("no error", eval('"no\u200E error"'), - "Unicode format-control character test (Category Cf.)"); - - exitFunc ("test"); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/Unicode/uc-002-n.js b/tests/auto/declarative/parserstress/tests/ecma_3/Unicode/uc-002-n.js deleted file mode 100644 index f1ae9a749d..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/Unicode/uc-002-n.js +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Rob Ginda rginda@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -var gTestfile = 'uc-002-n.js'; - -DESCRIPTION = "Non-character escapes in identifiers negative test."; -EXPECTED = "error"; - -enterFunc ("test"); - -printStatus ("Non-character escapes in identifiers negative test."); -printBugNumber (23607); - -eval("\u0020 = 5"); -reportCompare('PASS', 'FAIL', "Previous statement should have thrown an error."); - -exitFunc ("test"); - diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/Unicode/uc-002.js b/tests/auto/declarative/parserstress/tests/ecma_3/Unicode/uc-002.js deleted file mode 100644 index d19b2c4786..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/Unicode/uc-002.js +++ /dev/null @@ -1,60 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Rob Ginda rginda@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -var gTestfile = 'uc-002.js'; - -test(); - -function test() -{ - enterFunc ("test"); - - printStatus ("Unicode non-breaking space character test."); - printBugNumber (23613); - - reportCompare ("no error", eval("'no'\u00A0+ ' error'"), - "Unicode non-breaking space character test."); - - var str = "\u00A0foo"; - reportCompare (0, str.search(/^\sfoo$/), - "Unicode non-breaking space character regexp test."); - - exitFunc ("test"); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/Unicode/uc-003.js b/tests/auto/declarative/parserstress/tests/ecma_3/Unicode/uc-003.js deleted file mode 100644 index 66c3f09860..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/Unicode/uc-003.js +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Rob Ginda rginda@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -var gTestfile = 'uc-003.js'; - -test(); - -function test() -{ - enterFunc ("test"); - - var \u0041 = 5; - var A\u03B2 = 15; - var c\u0061se = 25; - - printStatus ("Escapes in identifiers test."); - printBugNumber (23608); - printBugNumber (23607); - - reportCompare (5, eval("\u0041"), - "Escaped ASCII Identifier test."); - reportCompare (6, eval("++\u0041"), - "Escaped ASCII Identifier test"); - reportCompare (15, eval("A\u03B2"), - "Escaped non-ASCII Identifier test"); - reportCompare (16, eval("++A\u03B2"), - "Escaped non-ASCII Identifier test"); - reportCompare (25, eval("c\\u00" + "61se"), - "Escaped keyword Identifier test"); - reportCompare (26, eval("++c\\u00" + "61se"), - "Escaped keyword Identifier test"); - - exitFunc ("test"); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/Unicode/uc-004.js b/tests/auto/declarative/parserstress/tests/ecma_3/Unicode/uc-004.js deleted file mode 100644 index a54923c525..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/Unicode/uc-004.js +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Rob Ginda rginda@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -var gTestfile = 'uc-004.js'; - -test(); - -function test() -{ - enterFunc ("test"); - - printStatus ("Unicode Characters 1C-1F with regexps test."); - printBugNumber (23612); - - var ary = ["\u001Cfoo", "\u001Dfoo", "\u001Efoo", "\u001Ffoo"]; - - for (var i in ary) - { - reportCompare (0, ary[Number(i)].search(/^\Sfoo$/), - "Unicode characters 1C-1F in regexps, ary[" + - i + "] did not match \\S test (it should not.)"); - reportCompare (-1, ary[Number(i)].search(/^\sfoo$/), - "Unicode characters 1C-1F in regexps, ary[" + - i + "] matched \\s test (it should not.)"); - } - - exitFunc ("test"); -} diff --git a/tests/auto/declarative/parserstress/tests/ecma_3/Unicode/uc-005.js b/tests/auto/declarative/parserstress/tests/ecma_3/Unicode/uc-005.js deleted file mode 100644 index 3727042046..0000000000 --- a/tests/auto/declarative/parserstress/tests/ecma_3/Unicode/uc-005.js +++ /dev/null @@ -1,276 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (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/MPL/ - * - * 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 JavaScript Engine testing utilities. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corp. - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * rogerl@netscape.com, pschwartau@netscape.com - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * - * Date: 15 July 2002 - * SUMMARY: Testing identifiers with double-byte names - * See http://bugzilla.mozilla.org/show_bug.cgi?id=58274 - * - * Here is a sample of the problem: - * - * js> function f\u02B1 () {} - * - * js> f\u02B1.toSource(); - * function f¦() {} - * - * js> f\u02B1.toSource().toSource(); - * (new String("function f\xB1() {}")) - * - * - * See how the high-byte information (the 02) has been lost? - * The same thing was happening with the toString() method: - * - * js> f\u02B1.toString(); - * - * function f¦() { - * } - * - * js> f\u02B1.toString().toSource(); - * (new String("\nfunction f\xB1() {\n}\n")) - * - */ -//----------------------------------------------------------------------------- -var gTestfile = 'uc-005.js'; -var UBound = 0; -var BUGNUMBER = 58274; -var summary = 'Testing identifiers with double-byte names'; -var status = ''; -var statusitems = []; -var actual = ''; -var actualvalues = []; -var expect= ''; -var expectedvalues = []; - - -/* - * Define a function that uses double-byte identifiers in - * "every possible way" - * - * Then recover each double-byte identifier via f.toString(). - * To make this easier, put a 'Z' token before every one. - * - * Our eval string will be: - * - * sEval = "function Z\u02b1(Z\u02b2, b) { - * try { Z\u02b3 : var Z\u02b4 = Z\u02b1; } - * catch (Z\u02b5) { for (var Z\u02b6 in Z\u02b5) - * {for (1; 1<0; Z\u02b7++) {new Array()[Z\u02b6] = 1;} };} }"; - * - * It will be helpful to build this string in stages: - */ -var s0 = 'function Z'; -var s1 = '\u02b1(Z'; -var s2 = '\u02b2, b) {try { Z'; -var s3 = '\u02b3 : var Z'; -var s4 = '\u02b4 = Z'; -var s5 = '\u02b1; } catch (Z' - var s6 = '\u02b5) { for (var Z'; -var s7 = '\u02b6 in Z'; -var s8 = '\u02b5){for (1; 1<0; Z'; -var s9 = '\u02b7++) {new Array()[Z'; -var s10 = '\u02b6] = 1;} };} }'; - - -/* - * Concatenate these and eval() to create the function Z\u02b1 - */ -var sEval = s0 + s1 + s2 + s3 + s4 + s5 + s6 + s7 + s8 + s9 + s10; -eval(sEval); - - -/* - * Recover all the double-byte identifiers via Z\u02b1.toString(). - * We'll recover the 1st one as arrID[1], the 2nd one as arrID[2], - * and so on ... - */ -var arrID = getIdentifiers(Z\u02b1); - - -/* - * Now check that we got back what we put in - - */ -status = inSection(1); -actual = arrID[1]; -expect = s1.charAt(0); -addThis(); - -status = inSection(2); -actual = arrID[2]; -expect = s2.charAt(0); -addThis(); - -status = inSection(3); -actual = arrID[3]; -expect = s3.charAt(0); -addThis(); - -status = inSection(4); -actual = arrID[4]; -expect = s4.charAt(0); -addThis(); - -status = inSection(5); -actual = arrID[5]; -expect = s5.charAt(0); -addThis(); - -status = inSection(6); -actual = arrID[6]; -expect = s6.charAt(0); -addThis(); - -status = inSection(7); -actual = arrID[7]; -expect = s7.charAt(0); -addThis(); - -status = inSection(8); -actual = arrID[8]; -expect = s8.charAt(0); -addThis(); - -status = inSection(9); -actual = arrID[9]; -expect = s9.charAt(0); -addThis(); - -status = inSection(10); -actual = arrID[10]; -expect = s10.charAt(0); -addThis(); - - - - -//----------------------------------------------------------------------------- -test(); -//----------------------------------------------------------------------------- - - - -/* - * Goal: recover the double-byte identifiers from f.toString() - * by getting the very next character after each 'Z' token. - * - * The return value will be an array |arr| indexed such that - * |arr[1]| is the 1st identifier, |arr[2]| the 2nd, and so on. - * - * Note, however, f.toString() is implementation-independent. - * For example, it may begin with '\nfunction' instead of 'function'. - * - * Rhino uses a Unicode representation for f.toString(); whereas - * SpiderMonkey uses an ASCII representation, putting escape sequences - * for non-ASCII characters. For example, if a function is called f\u02B1, - * then in Rhino the toString() method will present a 2-character Unicode - * string for its name, whereas SpiderMonkey will present a 7-character - * ASCII string for its name: the string literal 'f\u02B1'. - * - * So we force the lexer to condense the string before we use it. - * This will give uniform results in Rhino and SpiderMonkey. - */ -function getIdentifiers(f) -{ - var str = condenseStr(f.toString()); - var arr = str.split('Z'); - - /* - * The identifiers are the 1st char of each split substring - * EXCEPT the first one, which is just ('\n' +) 'function '. - * - * Thus note the 1st identifier will be stored in |arr[1]|, - * the 2nd one in |arr[2]|, etc., making the indexing easy - - */ - for (i in arr) - arr[i] = arr[i].charAt(0); - return arr; -} - - -/* - * This function is the opposite of a functions like escape(), which take - * Unicode characters and return escape sequences for them. Here, we force - * the lexer to turn escape sequences back into single characters. - * - * Note we can't simply do |eval(str)|, since in practice |str| will be an - * identifier somewhere in the program (e.g. a function name); thus |eval(str)| - * would return the object that the identifier represents: not what we want. - * - * So we surround |str| lexicographically with quotes to force the lexer to - * evaluate it as a string. Have to strip out any linefeeds first, however - - */ -function condenseStr(str) -{ - /* - * You won't be able to do the next step if |str| has - * any carriage returns or linefeeds in it. For example: - * - * js> eval("'" + '\nHello' + "'"); - * 1: SyntaxError: unterminated string literal: - * 1: ' - * 1: ^ - * - * So replace them with the empty string - - */ - str = str.replace(/[\r\n]/g, '') - return eval("'" + str + "'") - } - - -function addThis() -{ - statusitems[UBound] = status; - actualvalues[UBound] = actual; - expectedvalues[UBound] = expect; - UBound++; -} - - -function test() -{ - enterFunc('test'); - printBugNumber(BUGNUMBER); - printStatus(summary); - - for (var i=0; i?"; -var UntilRSBs = "[^]]*]([^]]+])*]+"; -var CDATA_CE = UntilRSBs + "([^]>]" + UntilRSBs + ")*>"; -var S = "[ \\n\\t\\r]+"; -var QuoteSE = '"[^"]' + "*" + '"' + "|'[^']*'"; -var DT_IdentSE = S + Name + "(" + S + "(" + Name + "|" + QuoteSE + "))*"; -var MarkupDeclCE = "([^]\"'><]+|" + QuoteSE + ")*>"; -var S1 = "[\\n\\r\\t ]"; -var UntilQMs = "[^?]*\\?+"; -var PI_Tail = "\\?>|" + S1 + UntilQMs + "([^>?]" + UntilQMs + ")*>"; -var DT_ItemSE = "<(!(--" + Until2Hyphens + ">|[^-]" + MarkupDeclCE + ")|\\?" + Name + "(" + PI_Tail + "))|%" + Name + ";|" + S; -var DocTypeCE = DT_IdentSE + "(" + S + ")?(\\[(" + DT_ItemSE + ")*](" + S + ")?)?>?"; -var DeclCE = "--(" + CommentCE + ")?|\\[CDATA\\[(" + CDATA_CE + ")?|DOCTYPE(" + DocTypeCE + ")?"; -var PI_CE = Name + "(" + PI_Tail + ")?"; -var EndTagCE = Name + "(" + S + ")?>?"; -var AttValSE = '"[^<"]' + "*" + '"' + "|'[^<']*'"; -var ElemTagCE = Name + "(" + S + Name + "(" + S + ")?=(" + S + ")?(" + AttValSE + "))*(" + S + ")?/?>?"; -var MarkupSPE = "<(!(" + DeclCE + ")?|\\?(" + PI_CE + ")?|/(" + EndTagCE + ")?|(" + ElemTagCE + ")?)"; -var XML_SPE = TextSE + "|" + MarkupSPE; -var CommentRE = " casting fails - { - Bar *pbar = qscriptvalue_cast(baz2Value); - QVERIFY(pbar == 0); - } - - { - QScriptValue ret = toBaz.callWithInstance(scriptZoo, QScriptValueList() << baz2Value); - QVERIFY(ret.isError()); - QCOMPARE(ret.toString(), QLatin1String("TypeError: incompatible type of argument(s) in call to toBaz(); candidates were\n toBaz(Bar*)")); - } - - // establish chain -- now casting should work - // Why? because qscriptvalue_cast() does magic again. - // It the instance itself is not of type T, qscriptvalue_cast() - // searches the prototype chain for T, and if it finds one, it infers - // that the instance can also be casted to that type. This cast is - // _not_ safe and thus relies on the developer doing the right thing. - // This is an undocumented feature to enable qscriptvalue_cast() to - // be used by prototype functions to cast the JS this-object to C++. - bazProto.setPrototype(barProto); - - { - Bar *pbar = qscriptvalue_cast(baz2Value); - QVERIFY(pbar != 0); - QCOMPARE(pbar->a, baz2.a); - } - - { - QScriptValue ret = toBaz.callWithInstance(scriptZoo, QScriptValueList() << baz2Value); - QEXPECT_FAIL("", "Cannot convert Baz* to Bar*", Continue); - QVERIFY(!ret.isError()); - QEXPECT_FAIL("", "Cannot convert Baz* to Bar*", Continue); - QCOMPARE(qscriptvalue_cast(ret), pbaz); - } - } - - bazProto.setPrototype(barProto.prototype()); // kill chain - { - Baz *pbaz = qscriptvalue_cast(baz2Value); - QVERIFY(pbaz != 0); - // should not work anymore - Bar *pbar = qscriptvalue_cast(baz2Value); - QVERIFY(pbar == 0); - } - - bazProto.setPrototype(eng.newQObject(this)); - { - Baz *pbaz = qscriptvalue_cast(baz2Value); - QVERIFY(pbaz != 0); - // should not work now either - Bar *pbar = qscriptvalue_cast(baz2Value); - QVERIFY(pbar == 0); - } - - { - QScriptValue b = eng.toScriptValue(QBrush()); - b.setPrototype(barProto); - // this shows that a "wrong" cast is possible, if you - // don't play by the rules (the pointer is actually a QBrush*)... - Bar *pbar = qscriptvalue_cast(b); - QVERIFY(pbar != 0); - } - - { - QScriptValue gradientProto = eng.toScriptValue(QGradient()); - QScriptValue linearGradientProto = eng.toScriptValue(QLinearGradient()); - linearGradientProto.setPrototype(gradientProto); - QLinearGradient lg(10, 20, 30, 40); - QScriptValue linearGradient = eng.toScriptValue(lg); - { - QGradient *pgrad = qscriptvalue_cast(linearGradient); - QVERIFY(pgrad == 0); - } - linearGradient.setPrototype(linearGradientProto); - { - QGradient *pgrad = qscriptvalue_cast(linearGradient); - QVERIFY(pgrad != 0); - QCOMPARE(pgrad->type(), QGradient::LinearGradient); - QLinearGradient *plingrad = static_cast(pgrad); - QCOMPARE(plingrad->start(), lg.start()); - QCOMPARE(plingrad->finalStop(), lg.finalStop()); - } - } -} -#endif - -class Klazz : public QWidget, - public QStandardItem, - public QGraphicsItem -{ - Q_INTERFACES(QGraphicsItem) - Q_OBJECT -public: - Klazz(QWidget *parent = 0) : QWidget(parent) { } - virtual QRectF boundingRect() const { return QRectF(); } - virtual void paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget*) { } -}; - -Q_DECLARE_METATYPE(Klazz*) -Q_DECLARE_METATYPE(QStandardItem*) - -void tst_QJSEngine::castWithMultipleInheritance() -{ - QJSEngine eng; - Klazz klz; - QJSValue v = eng.newQObject(&klz); - - QCOMPARE(qjsvalue_cast(v), &klz); - QCOMPARE(qjsvalue_cast(v), (QWidget *)&klz); - QCOMPARE(qjsvalue_cast(v), (QObject *)&klz); - QCOMPARE(qjsvalue_cast(v), (QStandardItem *)&klz); - QCOMPARE(qjsvalue_cast(v), (QGraphicsItem *)&klz); -} - -void tst_QJSEngine::collectGarbage() -{ - QJSEngine eng; - eng.evaluate("a = new Object(); a = new Object(); a = new Object()"); - QJSValue a = eng.newObject(); - a = eng.newObject(); - a = eng.newObject(); - QPointer ptr = new QObject(); - QVERIFY(ptr != 0); - (void)eng.newQObject(ptr); - collectGarbage_helper(eng); - if (ptr) - QGuiApplication::sendPostedEvents(ptr, QEvent::DeferredDelete); - QVERIFY(ptr == 0); -} - -#if 0 // ###FIXME: no reportAdditionalMemoryCost API -void tst_QJSEngine::reportAdditionalMemoryCost() -{ - QScriptEngine eng; - // There isn't any reliable way to test whether calling - // this function affects garbage collection responsiveness; - // the best we can do is call it with a few different values. - for (int x = 0; x < 100; ++x) { - eng.reportAdditionalMemoryCost(0); - eng.reportAdditionalMemoryCost(10); - eng.reportAdditionalMemoryCost(1000); - eng.reportAdditionalMemoryCost(10000); - eng.reportAdditionalMemoryCost(100000); - eng.reportAdditionalMemoryCost(1000000); - eng.reportAdditionalMemoryCost(10000000); - eng.reportAdditionalMemoryCost(-1); - eng.reportAdditionalMemoryCost(-1000); - QScriptValue obj = eng.newObject(); - eng.collectGarbage(); - } -} -#endif - -void tst_QJSEngine::gcWithNestedDataStructure() -{ - // The GC must be able to traverse deeply nested objects, otherwise this - // test would crash. - QJSEngine eng; - eng.evaluate( - "function makeList(size)" - "{" - " var head = { };" - " var l = head;" - " for (var i = 0; i < size; ++i) {" - " l.data = i + \"\";" - " l.next = { }; l = l.next;" - " }" - " l.next = null;" - " return head;" - "}"); - QCOMPARE(eng.hasUncaughtException(), false); - const int size = 200; - QJSValue head = eng.evaluate(QString::fromLatin1("makeList(%0)").arg(size)); - QCOMPARE(eng.hasUncaughtException(), false); - for (int x = 0; x < 2; ++x) { - if (x == 1) - eng.evaluate("gc()"); - QJSValue l = head; - // Make sure all the nodes are still alive. - for (int i = 0; i < 200; ++i) { - QCOMPARE(l.property("data").toString(), QString::number(i)); - l = l.property("next"); - } - } -} - -#if 0 // ###FIXME: No processEvents handling -class EventReceiver : public QObject -{ -public: - EventReceiver() { - received = false; - } - - bool event(QEvent *e) { - received |= (e->type() == QEvent::User + 1); - return QObject::event(e); - } - - bool received; -}; - -void tst_QJSEngine::processEventsWhileRunning() -{ - for (int x = 0; x < 2; ++x) { - QScriptEngine eng; - if (x == 0) - eng.pushContext(); - - // This is running for a silly amount of time just to make sure - // the script doesn't finish before event processing is triggered. - QString script = QString::fromLatin1( - "var end = Number(new Date()) + 2000;" - "var x = 0;" - "while (Number(new Date()) < end) {" - " ++x;" - "}"); - - EventReceiver receiver; - QCoreApplication::postEvent(&receiver, new QEvent(QEvent::Type(QEvent::User+1))); - - eng.evaluate(script); - QVERIFY(!eng.hasUncaughtException()); - QVERIFY(!receiver.received); - - QCOMPARE(eng.processEventsInterval(), -1); - eng.setProcessEventsInterval(100); - eng.evaluate(script); - QVERIFY(!eng.hasUncaughtException()); - QVERIFY(receiver.received); - - if (x == 0) - eng.popContext(); - } -} - -void tst_QJSEngine::processEventsWhileRunning_function() -{ - QScriptEngine eng; - QScriptValue script = eng.evaluate(QString::fromLatin1( - "(function() { var end = Number(new Date()) + 2000;" - "var x = 0;" - "while (Number(new Date()) < end) {" - " ++x;" - "} })")); - - eng.setProcessEventsInterval(100); - - for (int x = 0; x < 2; ++x) { - EventReceiver receiver; - QCoreApplication::postEvent(&receiver, new QEvent(QEvent::Type(QEvent::User+1))); - QVERIFY(!eng.hasUncaughtException()); - QVERIFY(!receiver.received); - QCOMPARE(eng.processEventsInterval(), 100); - - if (x) script.call(); - else script.callAsConstructor(); - - QVERIFY(!eng.hasUncaughtException()); - QVERIFY(receiver.received); - } -} - - -class EventReceiver2 : public QObject -{ -public: - EventReceiver2(QScriptEngine *eng) { - engine = eng; - } - - bool event(QEvent *e) { - if (e->type() == QEvent::User + 1) { - engine->currentContext()->throwError("Killed"); - } - return QObject::event(e); - } - - QScriptEngine *engine; -}; - -void tst_QJSEngine::throwErrorFromProcessEvents_data() -{ - QTest::addColumn("script"); - QTest::addColumn("error"); - - QTest::newRow("while (1)") - << QString::fromLatin1("while (1) { }") - << QString::fromLatin1("Error: Killed"); - QTest::newRow("while (1) i++") - << QString::fromLatin1("i = 0; while (1) { i++; }") - << QString::fromLatin1("Error: Killed"); - // Unlike abortEvaluation(), scripts should be able to catch the - // exception. - QTest::newRow("try catch") - << QString::fromLatin1("try {" - " while (1) { }" - "} catch(e) {" - " throw new Error('Caught');" - "}") - << QString::fromLatin1("Error: Caught"); -} - -void tst_QJSEngine::throwErrorFromProcessEvents() -{ - QFETCH(QString, script); - QFETCH(QString, error); - - QScriptEngine eng; - - EventReceiver2 receiver(&eng); - QCoreApplication::postEvent(&receiver, new QEvent(QEvent::Type(QEvent::User+1))); - - eng.setProcessEventsInterval(100); - QScriptValue ret = eng.evaluate(script); - QVERIFY(ret.isError()); - QCOMPARE(ret.toString(), error); -} - -void tst_QJSEngine::disableProcessEventsInterval() -{ - QScriptEngine eng; - eng.setProcessEventsInterval(100); - QCOMPARE(eng.processEventsInterval(), 100); - eng.setProcessEventsInterval(0); - QCOMPARE(eng.processEventsInterval(), 0); - eng.setProcessEventsInterval(-1); - QCOMPARE(eng.processEventsInterval(), -1); - eng.setProcessEventsInterval(-100); - QCOMPARE(eng.processEventsInterval(), -100); -} -#endif - - -void tst_QJSEngine::stacktrace() -{ - QString script = QString::fromLatin1( - "function foo(counter) {\n" - " switch (counter) {\n" - " case 0: foo(counter+1); break;\n" - " case 1: foo(counter+1); break;\n" - " case 2: foo(counter+1); break;\n" - " case 3: foo(counter+1); break;\n" - " case 4: foo(counter+1); break;\n" - " default:\n" - " throw new Error('blah');\n" - " }\n" - "}\n" - "foo(0);"); - - const QString fileName("testfile"); - - QStringList backtrace; - backtrace << "foo(5)@testfile:9" - << "foo(4)@testfile:7" - << "foo(3)@testfile:6" - << "foo(2)@testfile:5" - << "foo(1)@testfile:4" - << "foo(0)@testfile:3" - << "()@testfile:12"; - - QJSEngine eng; - QJSValue result = eng.evaluate(script, fileName); - QVERIFY(eng.hasUncaughtException()); - QVERIFY(result.isError()); - - // QEXPECT_FAIL("", "QTBUG-6139: uncaughtExceptionBacktrace() doesn't give the full backtrace", Abort); - // ###FIXME: no uncahgutExceptionBacktrace: QCOMPARE(eng.uncaughtExceptionBacktrace(), backtrace); - QVERIFY(eng.hasUncaughtException()); - QVERIFY(result.strictlyEquals(eng.uncaughtException())); - - // FIXME? it is not standard. - //QCOMPARE(result.property("fileName").toString(), fileName); - //QCOMPARE(result.property("lineNumber").toInt(), 9); - - QJSValue stack = result.property("stack"); - - // FIXME? it is not standard. - // QVERIFY(stack.isArray()); - //QCOMPARE(stack.property("length").toInt(), 7); - - QJSValueIterator it(stack); - int counter = 5; - while (it.hasNext()) { - it.next(); - QJSValue obj = it.value(); - QJSValue frame = obj.property("frame"); - - QCOMPARE(obj.property("fileName").toString(), fileName); - if (counter >= 0) { - QJSValue callee = frame.property("arguments").property("callee"); - QVERIFY(callee.strictlyEquals(eng.globalObject().property("foo"))); - QCOMPARE(obj.property("functionName").toString(), QString("foo")); - int line = obj.property("lineNumber").toInt(); - if (counter == 5) - QCOMPARE(line, 9); - else - QCOMPARE(line, 3 + counter); - } else { - QVERIFY(frame.strictlyEquals(eng.globalObject())); - QVERIFY(obj.property("functionName").toString().isEmpty()); - } - - --counter; - } - -// FIXME? it is not standard. -// { -// QJSValue bt = result.property("backtrace").call(result); -// QCOMPARE(qjsvalue_cast(bt), backtrace); -// } - - // throw something that isn't an Error object - eng.clearExceptions(); - // ###FIXME: No uncaughtExceptionBacktrace: QVERIFY(eng.uncaughtExceptionBacktrace().isEmpty()); - QString script2 = QString::fromLatin1( - "function foo(counter) {\n" - " switch (counter) {\n" - " case 0: foo(counter+1); break;\n" - " case 1: foo(counter+1); break;\n" - " case 2: foo(counter+1); break;\n" - " case 3: foo(counter+1); break;\n" - " case 4: foo(counter+1); break;\n" - " default:\n" - " throw 'just a string';\n" - " }\n" - "}\n" - "foo(0);"); - - QJSValue result2 = eng.evaluate(script2, fileName); - QVERIFY(eng.hasUncaughtException()); - QVERIFY(!result2.isError()); - QVERIFY(result2.isString()); - - // ###FIXME: No uncaughtExceptionBacktrace: QCOMPARE(eng.uncaughtExceptionBacktrace(), backtrace); - QVERIFY(eng.hasUncaughtException()); - - eng.clearExceptions(); - QVERIFY(!eng.hasUncaughtException()); - // ###FIXME: No uncaughtExceptionBacktrace: QVERIFY(eng.uncaughtExceptionBacktrace().isEmpty()); -} - -void tst_QJSEngine::numberParsing_data() -{ - QTest::addColumn("string"); - QTest::addColumn("expect"); - - QTest::newRow("decimal 0") << QString("0") << qreal(0); - QTest::newRow("octal 0") << QString("00") << qreal(00); - QTest::newRow("hex 0") << QString("0x0") << qreal(0x0); - QTest::newRow("decimal 100") << QString("100") << qreal(100); - QTest::newRow("hex 100") << QString("0x100") << qreal(0x100); - QTest::newRow("octal 100") << QString("0100") << qreal(0100); - QTest::newRow("decimal 4G") << QString("4294967296") << qreal(Q_UINT64_C(4294967296)); - QTest::newRow("hex 4G") << QString("0x100000000") << qreal(Q_UINT64_C(0x100000000)); - QTest::newRow("octal 4G") << QString("040000000000") << qreal(Q_UINT64_C(040000000000)); - QTest::newRow("0.5") << QString("0.5") << qreal(0.5); - QTest::newRow("1.5") << QString("1.5") << qreal(1.5); - QTest::newRow("1e2") << QString("1e2") << qreal(100); -} - -void tst_QJSEngine::numberParsing() -{ - QFETCH(QString, string); - QFETCH(qreal, expect); - - QJSEngine eng; - QJSValue ret = eng.evaluate(string); - QVERIFY(ret.isNumber()); - qreal actual = ret.toNumber(); - QCOMPARE(actual, expect); -} - -// see ECMA-262, section 7.9 -// This is testing ECMA compliance, not our C++ API, but it's important that -// the back-end is conformant in this regard. -void tst_QJSEngine::automaticSemicolonInsertion() -{ - QJSEngine eng; - { - QJSValue ret = eng.evaluate("{ 1 2 } 3"); - QVERIFY(ret.isError()); - QVERIFY(ret.toString().contains("SyntaxError")); - } - { - QJSValue ret = eng.evaluate("{ 1\n2 } 3"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 3); - } - { - QJSValue ret = eng.evaluate("for (a; b\n)"); - QVERIFY(ret.isError()); - QVERIFY(ret.toString().contains("SyntaxError")); - } - { - QJSValue ret = eng.evaluate("(function() { return\n1 + 2 })()"); - QVERIFY(ret.isUndefined()); - } - { - eng.evaluate("c = 2; b = 1"); - QJSValue ret = eng.evaluate("a = b\n++c"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 3); - } - { - QJSValue ret = eng.evaluate("if (a > b)\nelse c = d"); - QVERIFY(ret.isError()); - QVERIFY(ret.toString().contains("SyntaxError")); - } - { - eng.evaluate("function c() { return { foo: function() { return 5; } } }"); - eng.evaluate("b = 1; d = 2; e = 3"); - QJSValue ret = eng.evaluate("a = b + c\n(d + e).foo()"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 6); - } - { - QJSValue ret = eng.evaluate("throw\n1"); - QVERIFY(ret.isError()); - QVERIFY(ret.toString().contains("SyntaxError")); - } - { - QJSValue ret = eng.evaluate("a = Number(1)\n++a"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 2); - } - - // "a semicolon is never inserted automatically if the semicolon - // would then be parsed as an empty statement" - { - eng.evaluate("a = 123"); - QJSValue ret = eng.evaluate("if (0)\n ++a; a"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 123); - } - { - eng.evaluate("a = 123"); - QJSValue ret = eng.evaluate("if (0)\n --a; a"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 123); - } - { - eng.evaluate("a = 123"); - QJSValue ret = eng.evaluate("if ((0))\n ++a; a"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 123); - } - { - eng.evaluate("a = 123"); - QJSValue ret = eng.evaluate("if ((0))\n --a; a"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 123); - } - { - eng.evaluate("a = 123"); - QJSValue ret = eng.evaluate("if (0\n)\n ++a; a"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 123); - } - { - eng.evaluate("a = 123"); - QJSValue ret = eng.evaluate("if (0\n ++a; a"); - QVERIFY(ret.isError()); - } - { - eng.evaluate("a = 123"); - QJSValue ret = eng.evaluate("if (0))\n ++a; a"); - QVERIFY(ret.isError()); - } - { - QJSValue ret = eng.evaluate("n = 0; for (i = 0; i < 10; ++i)\n ++n; n"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 10); - } - { - QJSValue ret = eng.evaluate("n = 30; for (i = 0; i < 10; ++i)\n --n; n"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 20); - } - { - QJSValue ret = eng.evaluate("n = 0; for (var i = 0; i < 10; ++i)\n ++n; n"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 10); - } - { - QJSValue ret = eng.evaluate("n = 30; for (var i = 0; i < 10; ++i)\n --n; n"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 20); - } - { - QJSValue ret = eng.evaluate("n = 0; i = 0; while (i++ < 10)\n ++n; n"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 10); - } - { - QJSValue ret = eng.evaluate("n = 30; i = 0; while (i++ < 10)\n --n; n"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 20); - } - { - QJSValue ret = eng.evaluate("o = { a: 0, b: 1, c: 2 }; n = 0; for (i in o)\n ++n; n"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 3); - } - { - QJSValue ret = eng.evaluate("o = { a: 0, b: 1, c: 2 }; n = 9; for (i in o)\n --n; n"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 6); - } - { - QJSValue ret = eng.evaluate("o = { a: 0, b: 1, c: 2 }; n = 0; for (var i in o)\n ++n; n"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 3); - } - { - QJSValue ret = eng.evaluate("o = { a: 0, b: 1, c: 2 }; n = 9; for (var i in o)\n --n; n"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 6); - } - { - QJSValue ret = eng.evaluate("o = { n: 3 }; n = 5; with (o)\n ++n; n"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 5); - } - { - QJSValue ret = eng.evaluate("o = { n: 3 }; n = 10; with (o)\n --n; n"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 10); - } - { - QJSValue ret = eng.evaluate("n = 5; i = 0; do\n ++n; while (++i < 10); n"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 15); - } - { - QJSValue ret = eng.evaluate("n = 20; i = 0; do\n --n; while (++i < 10); n"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 10); - } - - { - QJSValue ret = eng.evaluate("n = 1; i = 0; if (n) i\n++n; n"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 2); - } - { - QJSValue ret = eng.evaluate("n = 1; i = 0; if (n) i\n--n; n"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 0); - } - - { - QJSValue ret = eng.evaluate("if (0)"); - QVERIFY(ret.isError()); - } - { - QJSValue ret = eng.evaluate("while (0)"); - QVERIFY(ret.isError()); - } - { - QJSValue ret = eng.evaluate("for (;;)"); - QVERIFY(ret.isError()); - } - { - QJSValue ret = eng.evaluate("for (p in this)"); - QVERIFY(ret.isError()); - } - { - QJSValue ret = eng.evaluate("with (this)"); - QVERIFY(ret.isError()); - } - { - QJSValue ret = eng.evaluate("do"); - QVERIFY(ret.isError()); - } -} - -#if 0 // ###FIXME: no abortEvaluation API -class EventReceiver3 : public QObject -{ -public: - enum AbortionResult { - None = 0, - String = 1, - Error = 2, - Number = 3 - }; - - EventReceiver3(QScriptEngine *eng) { - engine = eng; - resultType = None; - } - - bool event(QEvent *e) { - if (e->type() == QEvent::User + 1) { - switch (resultType) { - case None: - engine->abortEvaluation(); - break; - case String: - engine->abortEvaluation(QScriptValue(engine, QString::fromLatin1("Aborted"))); - break; - case Error: - engine->abortEvaluation(engine->currentContext()->throwError("AbortedWithError")); - break; - case Number: - engine->abortEvaluation(QScriptValue(1234)); - } - } - return QObject::event(e); - } - - AbortionResult resultType; - QScriptEngine *engine; -}; - -static QScriptValue myFunctionAbortingEvaluation(QScriptContext *, QScriptEngine *eng) -{ - eng->abortEvaluation(); - return eng->nullValue(); // should be ignored -} - -void tst_QJSEngine::abortEvaluation_notEvaluating() -{ - QScriptEngine eng; - - eng.abortEvaluation(); - QVERIFY(!eng.hasUncaughtException()); - - eng.abortEvaluation(123); - { - QScriptValue ret = eng.evaluate("'ciao'"); - QVERIFY(ret.isString()); - QCOMPARE(ret.toString(), QString::fromLatin1("ciao")); - } -} - -void tst_QJSEngine::abortEvaluation_data() -{ - QTest::addColumn("script"); - - QTest::newRow("while (1)") - << QString::fromLatin1("while (1) { }"); - QTest::newRow("while (1) i++") - << QString::fromLatin1("i = 0; while (1) { i++; }"); - QTest::newRow("try catch") - << QString::fromLatin1("try {" - " while (1) { }" - "} catch(e) {" - " throw new Error('Caught');" - "}"); -} - -void tst_QJSEngine::abortEvaluation() -{ - QFETCH(QString, script); - - QScriptEngine eng; - EventReceiver3 receiver(&eng); - - eng.setProcessEventsInterval(100); - for (int x = 0; x < 4; ++x) { - QCoreApplication::postEvent(&receiver, new QEvent(QEvent::Type(QEvent::User+1))); - receiver.resultType = EventReceiver3::AbortionResult(x); - QScriptValue ret = eng.evaluate(script); - switch (receiver.resultType) { - case EventReceiver3::None: - QVERIFY(!eng.hasUncaughtException()); - QVERIFY(ret.isUndefined()); - break; - case EventReceiver3::Number: - QVERIFY(!eng.hasUncaughtException()); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 1234); - break; - case EventReceiver3::String: - QVERIFY(!eng.hasUncaughtException()); - QVERIFY(ret.isString()); - QCOMPARE(ret.toString(), QString::fromLatin1("Aborted")); - break; - case EventReceiver3::Error: - QVERIFY(eng.hasUncaughtException()); - QVERIFY(ret.isError()); - QCOMPARE(ret.toString(), QString::fromLatin1("Error: AbortedWithError")); - break; - } - } - -} - -void tst_QJSEngine::abortEvaluation_tryCatch() -{ - QSKIP("It crashes"); - QScriptEngine eng; - EventReceiver3 receiver(&eng); - eng.setProcessEventsInterval(100); - // scripts cannot intercept the abortion with try/catch - for (int y = 0; y < 4; ++y) { - QCoreApplication::postEvent(&receiver, new QEvent(QEvent::Type(QEvent::User+1))); - receiver.resultType = EventReceiver3::AbortionResult(y); - QScriptValue ret = eng.evaluate(QString::fromLatin1( - "while (1) {\n" - " try {\n" - " (function() { while (1) { } })();\n" - " } catch (e) {\n" - " ;\n" - " }\n" - "}")); - switch (receiver.resultType) { - case EventReceiver3::None: - QVERIFY(!eng.hasUncaughtException()); - QVERIFY(ret.isUndefined()); - break; - case EventReceiver3::Number: - QVERIFY(!eng.hasUncaughtException()); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 1234); - break; - case EventReceiver3::String: - QVERIFY(!eng.hasUncaughtException()); - QVERIFY(ret.isString()); - QCOMPARE(ret.toString(), QString::fromLatin1("Aborted")); - break; - case EventReceiver3::Error: - QVERIFY(eng.hasUncaughtException()); - QVERIFY(ret.isError()); - break; - } - } -} - -void tst_QJSEngine::abortEvaluation_fromNative() -{ - QScriptEngine eng; - QScriptValue fun = eng.newFunction(myFunctionAbortingEvaluation); - eng.globalObject().setProperty("myFunctionAbortingEvaluation", fun); - QScriptValue ret = eng.evaluate("myFunctionAbortingEvaluation()"); - QVERIFY(ret.isUndefined()); -} - -class ThreadedEngine : public QThread { - Q_OBJECT; - -private: - QScriptEngine* m_engine; -protected: - void run() { - m_engine = new QScriptEngine(); - m_engine->setGlobalObject(m_engine->newQObject(this)); - m_engine->evaluate("while (1) { sleep(); }"); - delete m_engine; - } - -public slots: - void sleep() - { - QTest::qSleep(25); - m_engine->abortEvaluation(); - } -}; - -void tst_QJSEngine::abortEvaluation_QTBUG9433() -{ - ThreadedEngine engine; - engine.start(); - QVERIFY(engine.isRunning()); - QTest::qSleep(50); - for (uint i = 0; i < 50; ++i) { // up to ~2500 ms - if (engine.isFinished()) - return; - QTest::qSleep(50); - } - if (!engine.isFinished()) { - engine.terminate(); - engine.wait(7000); - QFAIL("abortEvaluation doesn't work"); - } - -} -#endif - -#if 0 // ###FIXME: no QScriptEngine::isEvaluating -static QScriptValue myFunctionReturningIsEvaluating(QScriptContext *, QScriptEngine *eng) -{ - return QScriptValue(eng, eng->isEvaluating()); -} - -class EventReceiver4 : public QObject -{ -public: - EventReceiver4(QScriptEngine *eng) { - engine = eng; - wasEvaluating = false; - } - - bool event(QEvent *e) { - if (e->type() == QEvent::User + 1) { - wasEvaluating = engine->isEvaluating(); - } - return QObject::event(e); - } - - QScriptEngine *engine; - bool wasEvaluating; -}; - -void tst_QJSEngine::isEvaluating_notEvaluating() -{ - QScriptEngine eng; - - QVERIFY(!eng.isEvaluating()); - - eng.evaluate(""); - QVERIFY(!eng.isEvaluating()); - eng.evaluate("123"); - QVERIFY(!eng.isEvaluating()); - eng.evaluate("0 = 0"); - QVERIFY(!eng.isEvaluating()); -} - -void tst_QJSEngine::isEvaluating_fromNative() -{ - QScriptEngine eng; - QScriptValue fun = eng.newFunction(myFunctionReturningIsEvaluating); - eng.globalObject().setProperty("myFunctionReturningIsEvaluating", fun); - QScriptValue ret = eng.evaluate("myFunctionReturningIsEvaluating()"); - QVERIFY(ret.isBool()); - QVERIFY(ret.toBool()); - ret = fun.call(); - QVERIFY(ret.isBool()); - QVERIFY(ret.toBool()); - ret = myFunctionReturningIsEvaluating(eng.currentContext(), &eng); - QVERIFY(ret.isBool()); - QVERIFY(!ret.toBool()); -} - -void tst_QJSEngine::isEvaluating_fromEvent() -{ - QScriptEngine eng; - EventReceiver4 receiver(&eng); - QCoreApplication::postEvent(&receiver, new QEvent(QEvent::Type(QEvent::User+1))); - - QString script = QString::fromLatin1( - "var end = Number(new Date()) + 1000;" - "var x = 0;" - "while (Number(new Date()) < end) {" - " ++x;" - "}"); - - eng.setProcessEventsInterval(100); - eng.evaluate(script); - QVERIFY(receiver.wasEvaluating); -} -#endif - -static QtMsgType theMessageType; -static QString theMessage; - -static void myMsgHandler(QtMsgType type, const char *msg) -{ - theMessageType = type; - theMessage = QString::fromLatin1(msg); -} - -#if 0 -void tst_QJSEngine::printFunctionWithCustomHandler() -{ - // The built-in print() function passes the output to Qt's message - // handler. By installing a custom message handler, the output can be - // redirected without changing the print() function itself. - // This behavior is not documented. - QJSEngine eng; - QtMsgHandler oldHandler = qInstallMsgHandler(myMsgHandler); - QVERIFY(eng.globalObject().property("print").isCallable()); - - theMessageType = QtSystemMsg; - QVERIFY(theMessage.isEmpty()); - QVERIFY(eng.evaluate("print('test')").isUndefined()); - QCOMPARE(theMessageType, QtDebugMsg); - QCOMPARE(theMessage, QString::fromLatin1("test")); - - theMessageType = QtSystemMsg; - theMessage.clear(); - QVERIFY(eng.evaluate("print(3, true, 'little pigs')").isUndefined()); - QCOMPARE(theMessageType, QtDebugMsg); - QCOMPARE(theMessage, QString::fromLatin1("3 true little pigs")); - - qInstallMsgHandler(oldHandler); -} - -void tst_QJSEngine::printThrowsException() -{ - // If an argument to print() causes an exception to be thrown when - // it's converted to a string, print() should propagate the exception. - QJSEngine eng; - QJSValue ret = eng.evaluate("print({ toString: function() { throw 'foo'; } });"); - QVERIFY(eng.hasUncaughtException()); - QVERIFY(ret.strictlyEquals(eng.toScriptValue(QLatin1String("foo")))); -} -#endif - -void tst_QJSEngine::errorConstructors() -{ - QJSEngine eng; - QStringList prefixes; - prefixes << "" << "Eval" << "Range" << "Reference" << "Syntax" << "Type" << "URI"; - for (int x = 0; x < 3; ++x) { - for (int i = 0; i < prefixes.size(); ++i) { - QString name = prefixes.at(i) + QLatin1String("Error"); - QString code = QString(i+1, QLatin1Char('\n')); - if (x == 0) - code += QLatin1String("throw "); - else if (x == 1) - code += QLatin1String("new "); - code += name + QLatin1String("()"); - QJSValue ret = eng.evaluate(code); - QVERIFY(ret.isError()); - QCOMPARE(eng.hasUncaughtException(), x == 0); - eng.clearExceptions(); - QVERIFY(ret.toString().startsWith(name)); - //QTBUG-6138: JSC doesn't assign lineNumber when errors are not thrown - QEXPECT_FAIL("", "we have no more lineNumber property ", Continue); - QCOMPARE(ret.property("lineNumber").toInt(), i+2); - } - } -} - -void tst_QJSEngine::argumentsProperty_globalContext() -{ - QJSEngine eng; - { - // Unlike function calls, the global context doesn't have an - // arguments property. - QJSValue ret = eng.evaluate("arguments"); - QVERIFY(ret.isError()); - QVERIFY(ret.toString().contains(QString::fromLatin1("ReferenceError"))); - } - eng.evaluate("arguments = 10"); - { - QJSValue ret = eng.evaluate("arguments"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 10); - } - QVERIFY(eng.evaluate("delete arguments").toBool()); - QVERIFY(eng.globalObject().property("arguments").isUndefined()); -} - -void tst_QJSEngine::argumentsProperty_JS() -{ - { - QJSEngine eng; - eng.evaluate("o = { arguments: 123 }"); - QJSValue ret = eng.evaluate("with (o) { arguments; }"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 123); - } - { - QJSEngine eng; - QVERIFY(eng.globalObject().property("arguments").isUndefined()); - // This is testing ECMA-262 compliance. In function calls, "arguments" - // appears like a local variable, and it can be replaced. - QJSValue ret = eng.evaluate("(function() { arguments = 456; return arguments; })()"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 456); - QVERIFY(eng.globalObject().property("arguments").isUndefined()); - } -} - -#if 0 // ###FIXME: no QScriptContext API -static QScriptValue argumentsProperty_fun(QScriptContext *, QScriptEngine *eng) -{ - // Since evaluate() is done in the current context, "arguments" should - // refer to currentContext()->argumentsObject(). - // This is for consistency with the built-in JS eval() function. - eng->evaluate("var a = arguments[0];"); - eng->evaluate("arguments[0] = 200;"); - return eng->evaluate("a + arguments[0]"); -} - -void tst_QJSEngine::argumentsProperty_evaluateInNativeFunction() -{ - QScriptEngine eng; - QScriptValue fun = eng.newFunction(argumentsProperty_fun); - eng.globalObject().setProperty("fun", eng.newFunction(argumentsProperty_fun)); - QScriptValue result = eng.evaluate("fun(18)"); - QVERIFY(result.isNumber()); - QCOMPARE(result.toInt(), 200+18); -} -#endif - -void tst_QJSEngine::jsNumberClass() -{ - // See ECMA-262 Section 15.7, "Number Objects". - - QJSEngine eng; - - QJSValue ctor = eng.globalObject().property("Number"); - QVERIFY(ctor.property("length").isNumber()); - QCOMPARE(ctor.property("length").toNumber(), qreal(1)); - QJSValue proto = ctor.property("prototype"); - QVERIFY(proto.isObject()); - { - QVERIFY(ctor.property("MAX_VALUE").isNumber()); - QVERIFY(ctor.property("MIN_VALUE").isNumber()); - QVERIFY(ctor.property("NaN").isNumber()); - QVERIFY(ctor.property("NEGATIVE_INFINITY").isNumber()); - QVERIFY(ctor.property("POSITIVE_INFINITY").isNumber()); - } - QCOMPARE(proto.toNumber(), qreal(0)); - QVERIFY(proto.property("constructor").strictlyEquals(ctor)); - - { - QJSValue ret = eng.evaluate("Number()"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toNumber(), qreal(0)); - } - { - QJSValue ret = eng.evaluate("Number(123)"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toNumber(), qreal(123)); - } - { - QJSValue ret = eng.evaluate("Number('456')"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toNumber(), qreal(456)); - } - { - QJSValue ret = eng.evaluate("new Number()"); - QVERIFY(!ret.isNumber()); - QVERIFY(ret.isObject()); - QCOMPARE(ret.toNumber(), qreal(0)); - } - { - QJSValue ret = eng.evaluate("new Number(123)"); - QVERIFY(!ret.isNumber()); - QVERIFY(ret.isObject()); - QCOMPARE(ret.toNumber(), qreal(123)); - } - { - QJSValue ret = eng.evaluate("new Number('456')"); - QVERIFY(!ret.isNumber()); - QVERIFY(ret.isObject()); - QCOMPARE(ret.toNumber(), qreal(456)); - } - - QVERIFY(proto.property("toString").isCallable()); - { - QJSValue ret = eng.evaluate("new Number(123).toString()"); - QVERIFY(ret.isString()); - QCOMPARE(ret.toString(), QString::fromLatin1("123")); - } - { - QJSValue ret = eng.evaluate("new Number(123).toString(8)"); - QVERIFY(ret.isString()); - QCOMPARE(ret.toString(), QString::fromLatin1("173")); - } - { - QJSValue ret = eng.evaluate("new Number(123).toString(16)"); - QVERIFY(ret.isString()); - QCOMPARE(ret.toString(), QString::fromLatin1("7b")); - } - QVERIFY(proto.property("toLocaleString").isCallable()); - { - QJSValue ret = eng.evaluate("new Number(123).toLocaleString()"); - QVERIFY(ret.isString()); - QCOMPARE(ret.toString(), QString::fromLatin1("123")); - } - QVERIFY(proto.property("valueOf").isCallable()); - { - QJSValue ret = eng.evaluate("new Number(123).valueOf()"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toNumber(), qreal(123)); - } - QVERIFY(proto.property("toExponential").isCallable()); - { - QJSValue ret = eng.evaluate("new Number(123).toExponential()"); - QVERIFY(ret.isString()); - QCOMPARE(ret.toString(), QString::fromLatin1("1.23e+2")); - } - QVERIFY(proto.property("toFixed").isCallable()); - { - QJSValue ret = eng.evaluate("new Number(123).toFixed()"); - QVERIFY(ret.isString()); - QCOMPARE(ret.toString(), QString::fromLatin1("123")); - } - QVERIFY(proto.property("toPrecision").isCallable()); - { - QJSValue ret = eng.evaluate("new Number(123).toPrecision()"); - QVERIFY(ret.isString()); - QCOMPARE(ret.toString(), QString::fromLatin1("123")); - } -} - -void tst_QJSEngine::jsForInStatement_simple() -{ - QJSEngine eng; - { - QJSValue ret = eng.evaluate("o = { }; r = []; for (var p in o) r[r.length] = p; r"); - QStringList lst = qjsvalue_cast(ret); - QVERIFY(lst.isEmpty()); - } - { - QJSValue ret = eng.evaluate("o = { p: 123 }; r = [];" - "for (var p in o) r[r.length] = p; r"); - QStringList lst = qjsvalue_cast(ret); - QCOMPARE(lst.size(), 1); - QCOMPARE(lst.at(0), QString::fromLatin1("p")); - } - { - QJSValue ret = eng.evaluate("o = { p: 123, q: 456 }; r = [];" - "for (var p in o) r[r.length] = p; r"); - QStringList lst = qjsvalue_cast(ret); - QCOMPARE(lst.size(), 2); - QCOMPARE(lst.at(0), QString::fromLatin1("p")); - QCOMPARE(lst.at(1), QString::fromLatin1("q")); - } -} - -void tst_QJSEngine::jsForInStatement_prototypeProperties() -{ - QJSEngine eng; - { - QJSValue ret = eng.evaluate("o = { }; o.__proto__ = { p: 123 }; r = [];" - "for (var p in o) r[r.length] = p; r"); - QStringList lst = qjsvalue_cast(ret); - QCOMPARE(lst.size(), 1); - QCOMPARE(lst.at(0), QString::fromLatin1("p")); - } - { - QJSValue ret = eng.evaluate("o = { p: 123 }; o.__proto__ = { q: 456 }; r = [];" - "for (var p in o) r[r.length] = p; r"); - QStringList lst = qjsvalue_cast(ret); - QCOMPARE(lst.size(), 2); - QCOMPARE(lst.at(0), QString::fromLatin1("p")); - QCOMPARE(lst.at(1), QString::fromLatin1("q")); - } - { - // shadowed property - QJSValue ret = eng.evaluate("o = { p: 123 }; o.__proto__ = { p: 456 }; r = [];" - "for (var p in o) r[r.length] = p; r"); - QStringList lst = qjsvalue_cast(ret); - QCOMPARE(lst.size(), 1); - QCOMPARE(lst.at(0), QString::fromLatin1("p")); - } - -} - -void tst_QJSEngine::jsForInStatement_mutateWhileIterating() -{ - QJSEngine eng; - // deleting property during enumeration - { - QJSValue ret = eng.evaluate("o = { p: 123 }; r = [];" - "for (var p in o) { r[r.length] = p; delete r[p]; } r"); - QStringList lst = qjsvalue_cast(ret); - QCOMPARE(lst.size(), 1); - QCOMPARE(lst.at(0), QString::fromLatin1("p")); - } - { - QJSValue ret = eng.evaluate("o = { p: 123, q: 456 }; r = [];" - "for (var p in o) { r[r.length] = p; delete o.q; } r"); - QStringList lst = qjsvalue_cast(ret); - QCOMPARE(lst.size(), 1); - QCOMPARE(lst.at(0), QString::fromLatin1("p")); - } - - // adding property during enumeration - { - QJSValue ret = eng.evaluate("o = { p: 123 }; r = [];" - "for (var p in o) { r[r.length] = p; o.q = 456; } r"); - QStringList lst = qjsvalue_cast(ret); - QCOMPARE(lst.size(), 1); - QCOMPARE(lst.at(0), QString::fromLatin1("p")); - } - -} - -void tst_QJSEngine::jsForInStatement_arrays() -{ - QJSEngine eng; - { - QJSValue ret = eng.evaluate("a = [123, 456]; r = [];" - "for (var p in a) r[r.length] = p; r"); - QStringList lst = qjsvalue_cast(ret); - QCOMPARE(lst.size(), 2); - QCOMPARE(lst.at(0), QString::fromLatin1("0")); - QCOMPARE(lst.at(1), QString::fromLatin1("1")); - } - { - QJSValue ret = eng.evaluate("a = [123, 456]; a.foo = 'bar'; r = [];" - "for (var p in a) r[r.length] = p; r"); - QStringList lst = qjsvalue_cast(ret); - QCOMPARE(lst.size(), 3); - QCOMPARE(lst.at(0), QString::fromLatin1("0")); - QCOMPARE(lst.at(1), QString::fromLatin1("1")); - QCOMPARE(lst.at(2), QString::fromLatin1("foo")); - } - { - QJSValue ret = eng.evaluate("a = [123, 456]; a.foo = 'bar';" - "b = [111, 222, 333]; b.bar = 'baz';" - "a.__proto__ = b; r = [];" - "for (var p in a) r[r.length] = p; r"); - QStringList lst = qjsvalue_cast(ret); - QCOMPARE(lst.size(), 5); - QCOMPARE(lst.at(0), QString::fromLatin1("0")); - QCOMPARE(lst.at(1), QString::fromLatin1("1")); - QCOMPARE(lst.at(2), QString::fromLatin1("foo")); - QCOMPARE(lst.at(3), QString::fromLatin1("2")); - QCOMPARE(lst.at(4), QString::fromLatin1("bar")); - } -} - -void tst_QJSEngine::jsForInStatement_nullAndUndefined() -{ - QJSEngine eng; - { - QJSValue ret = eng.evaluate("r = true; for (var p in undefined) r = false; r"); - QVERIFY(ret.isBool()); - QVERIFY(ret.toBool()); - } - { - QJSValue ret = eng.evaluate("r = true; for (var p in null) r = false; r"); - QVERIFY(ret.isBool()); - QVERIFY(ret.toBool()); - } -} - -void tst_QJSEngine::jsFunctionDeclarationAsStatement() -{ - // ECMA-262 does not allow function declarations to be used as statements, - // but several popular implementations (including JSC) do. See the NOTE - // at the beginning of chapter 12 in ECMA-262 5th edition, where it's - // recommended that implementations either disallow this usage or issue - // a warning. - // Since we had a bug report long ago about QtScript not supporting this - // "feature" (and thus deviating from other implementations), we still - // check this behavior. - - QJSEngine eng; - QVERIFY(eng.globalObject().property("bar").isUndefined()); - eng.evaluate("function foo(arg) {\n" - " if (arg == 'bar')\n" - " function bar() { return 'bar'; }\n" - " else\n" - " function baz() { return 'baz'; }\n" - " return (arg == 'bar') ? bar : baz;\n" - "}"); - QVERIFY(eng.globalObject().property("bar").isUndefined()); - QVERIFY(eng.globalObject().property("baz").isUndefined()); - QVERIFY(eng.evaluate("foo").isCallable()); - { - QJSValue ret = eng.evaluate("foo('bar')"); - QVERIFY(ret.isCallable()); - QJSValue ret2 = ret.call(); - QCOMPARE(ret2.toString(), QString::fromLatin1("bar")); - QVERIFY(eng.globalObject().property("bar").isUndefined()); - QVERIFY(eng.globalObject().property("baz").isUndefined()); - } - { - QJSValue ret = eng.evaluate("foo('baz')"); - QVERIFY(ret.isCallable()); - QJSValue ret2 = ret.call(); - QCOMPARE(ret2.toString(), QString::fromLatin1("baz")); - QVERIFY(eng.globalObject().property("bar").isUndefined()); - QVERIFY(eng.globalObject().property("baz").isUndefined()); - } -} - -void tst_QJSEngine::stringObjects() -{ - // See ECMA-262 Section 15.5, "String Objects". - - QJSEngine eng; - QString str("ciao"); - // in C++ - { - QJSValue obj = eng.evaluate(QString::fromLatin1("new String('%0')").arg(str)); - QCOMPARE(obj.property("length").toInt(), str.length()); - for (int i = 0; i < str.length(); ++i) { - QString pname = QString::number(i); - QVERIFY(obj.property(pname).isString()); - QCOMPARE(obj.property(pname).toString(), QString(str.at(i))); - QEXPECT_FAIL("", "FIXME: This is V8 issue 862. ECMA script standard 15.5.5.2 compliance.", Continue); - QVERIFY(!obj.deleteProperty(pname)); - obj.setProperty(pname, 123); - QVERIFY(obj.property(pname).isString()); - QCOMPARE(obj.property(pname).toString(), QString(str.at(i))); - } - QVERIFY(obj.property("-1").isUndefined()); - QVERIFY(obj.property(QString::number(str.length())).isUndefined()); - - QJSValue val = eng.toScriptValue(123); - obj.setProperty("-1", val); - QVERIFY(obj.property("-1").strictlyEquals(val)); - obj.setProperty("100", val); - QVERIFY(obj.property("100").strictlyEquals(val)); - } - - { - QJSValue ret = eng.evaluate("s = new String('ciao'); r = []; for (var p in s) r.push(p); r"); - QVERIFY(ret.isArray()); - QStringList lst = qjsvalue_cast(ret); - QCOMPARE(lst.size(), str.length()); - for (int i = 0; i < str.length(); ++i) - QCOMPARE(lst.at(i), QString::number(i)); - - QJSValue ret2 = eng.evaluate("s[0] = 123; s[0]"); - QVERIFY(ret2.isString()); - QCOMPARE(ret2.toString().length(), 1); - QCOMPARE(ret2.toString().at(0), str.at(0)); - - QJSValue ret3 = eng.evaluate("s[-1] = 123; s[-1]"); - QVERIFY(ret3.isNumber()); - QCOMPARE(ret3.toInt(), 123); - - QJSValue ret4 = eng.evaluate("s[s.length] = 456; s[s.length]"); - QVERIFY(ret4.isNumber()); - QCOMPARE(ret4.toInt(), 456); - - QJSValue ret5 = eng.evaluate("delete s[0]"); - QVERIFY(ret5.isBool()); - QEXPECT_FAIL("", "FIXME: This is V8 bug, please report it! ECMA script standard 15.5.5.2", Abort); - QVERIFY(!ret5.toBool()); - - QJSValue ret6 = eng.evaluate("delete s[-1]"); - QVERIFY(ret6.isBool()); - QVERIFY(ret6.toBool()); - - QJSValue ret7 = eng.evaluate("delete s[s.length]"); - QVERIFY(ret7.isBool()); - QVERIFY(ret7.toBool()); - } -} - -void tst_QJSEngine::jsStringPrototypeReplaceBugs() -{ - QJSEngine eng; - // task 212440 - { - QJSValue ret = eng.evaluate("replace_args = []; \"a a a\".replace(/(a)/g, function() { replace_args.push(arguments); }); replace_args"); - QVERIFY(ret.isArray()); - int len = ret.property("length").toInt(); - QCOMPARE(len, 3); - for (int i = 0; i < len; ++i) { - QJSValue args = ret.property(i); - QCOMPARE(args.property("length").toInt(), 4); - QCOMPARE(args.property(0).toString(), QString::fromLatin1("a")); // matched string - QCOMPARE(args.property(1).toString(), QString::fromLatin1("a")); // capture - QVERIFY(args.property(2).isNumber()); - QCOMPARE(args.property(2).toInt(), i*2); // index of match - QCOMPARE(args.property(3).toString(), QString::fromLatin1("a a a")); - } - } - // task 212501 - { - QJSValue ret = eng.evaluate("\"foo\".replace(/a/g, function() {})"); - QVERIFY(ret.isString()); - QCOMPARE(ret.toString(), QString::fromLatin1("foo")); - } -} - -void tst_QJSEngine::getterSetterThisObject_global() -{ - { - QJSEngine eng; - // read - eng.evaluate("__defineGetter__('x', function() { return this; });"); - { - QJSValue ret = eng.evaluate("x"); - QVERIFY(ret.equals(eng.globalObject())); - } - { - QJSValue ret = eng.evaluate("(function() { return x; })()"); - QVERIFY(ret.equals(eng.globalObject())); - } - { - QJSValue ret = eng.evaluate("with (this) x"); - QVERIFY(ret.equals(eng.globalObject())); - } - { - QJSValue ret = eng.evaluate("with ({}) x"); - QVERIFY(ret.equals(eng.globalObject())); - } - { - QJSValue ret = eng.evaluate("(function() { with ({}) return x; })()"); - QVERIFY(ret.equals(eng.globalObject())); - } - // write - eng.evaluate("__defineSetter__('x', function() { return this; });"); - { - QJSValue ret = eng.evaluate("x = 'foo'"); - // SpiderMonkey says setter return value, JSC says RHS. - QVERIFY(ret.isString()); - QCOMPARE(ret.toString(), QString::fromLatin1("foo")); - } - { - QJSValue ret = eng.evaluate("(function() { return x = 'foo'; })()"); - // SpiderMonkey says setter return value, JSC says RHS. - QVERIFY(ret.isString()); - QCOMPARE(ret.toString(), QString::fromLatin1("foo")); - } - { - QJSValue ret = eng.evaluate("with (this) x = 'foo'"); - // SpiderMonkey says setter return value, JSC says RHS. - QVERIFY(ret.isString()); - QCOMPARE(ret.toString(), QString::fromLatin1("foo")); - } - { - QJSValue ret = eng.evaluate("with ({}) x = 'foo'"); - // SpiderMonkey says setter return value, JSC says RHS. - QVERIFY(ret.isString()); - QCOMPARE(ret.toString(), QString::fromLatin1("foo")); - } - { - QJSValue ret = eng.evaluate("(function() { with ({}) return x = 'foo'; })()"); - // SpiderMonkey says setter return value, JSC says RHS. - QVERIFY(ret.isString()); - QCOMPARE(ret.toString(), QString::fromLatin1("foo")); - } - } -} - -void tst_QJSEngine::getterSetterThisObject_plain() -{ - { - QJSEngine eng; - eng.evaluate("o = {}"); - // read - eng.evaluate("o.__defineGetter__('x', function() { return this; })"); - QVERIFY(eng.evaluate("o.x === o").toBool()); - QVERIFY(eng.evaluate("with (o) x").equals(eng.evaluate("o"))); - QVERIFY(eng.evaluate("(function() { with (o) return x; })() === o").toBool()); - eng.evaluate("q = {}; with (o) with (q) x").equals(eng.evaluate("o")); - // write - eng.evaluate("o.__defineSetter__('x', function() { return this; });"); - // SpiderMonkey says setter return value, JSC says RHS. - QVERIFY(eng.evaluate("(o.x = 'foo') === 'foo'").toBool()); - QVERIFY(eng.evaluate("with (o) x = 'foo'").equals("foo")); - QVERIFY(eng.evaluate("with (o) with (q) x = 'foo'").equals("foo")); - } -} - -void tst_QJSEngine::getterSetterThisObject_prototypeChain() -{ - { - QJSEngine eng; - eng.evaluate("o = {}; p = {}; o.__proto__ = p"); - // read - eng.evaluate("p.__defineGetter__('x', function() { return this; })"); - QVERIFY(eng.evaluate("o.x === o").toBool()); - QVERIFY(eng.evaluate("with (o) x").equals(eng.evaluate("o"))); - QVERIFY(eng.evaluate("(function() { with (o) return x; })() === o").toBool()); - eng.evaluate("q = {}; with (o) with (q) x").equals(eng.evaluate("o")); - eng.evaluate("with (q) with (o) x").equals(eng.evaluate("o")); - // write - eng.evaluate("o.__defineSetter__('x', function() { return this; });"); - // SpiderMonkey says setter return value, JSC says RHS. - QVERIFY(eng.evaluate("(o.x = 'foo') === 'foo'").toBool()); - QVERIFY(eng.evaluate("with (o) x = 'foo'").equals("foo")); - QVERIFY(eng.evaluate("with (o) with (q) x = 'foo'").equals("foo")); - } -} - -#if 0 // ###FIXME: no QScriptContext API -void tst_QJSEngine::getterSetterThisObject_activation() -{ - { - QScriptEngine eng; - QScriptContext *ctx = eng.pushContext(); - QVERIFY(ctx != 0); - QScriptValue act = ctx->activationObject(); - act.setProperty("act", act); - // read - eng.evaluate("act.__defineGetter__('x', function() { return this; })"); - QVERIFY(eng.evaluate("x === act").toBool()); - QEXPECT_FAIL("", "QTBUG-17605: Not possible to implement local variables as getter/setter properties", Abort); - QVERIFY(!eng.hasUncaughtException()); - QVERIFY(eng.evaluate("with (act) x").equals("foo")); - QVERIFY(eng.evaluate("(function() { with (act) return x; })() === act").toBool()); - eng.evaluate("q = {}; with (act) with (q) x").equals(eng.evaluate("act")); - eng.evaluate("with (q) with (act) x").equals(eng.evaluate("act")); - // write - eng.evaluate("act.__defineSetter__('x', function() { return this; });"); - QVERIFY(eng.evaluate("(x = 'foo') === 'foo'").toBool()); - QVERIFY(eng.evaluate("with (act) x = 'foo'").equals("foo")); - QVERIFY(eng.evaluate("with (act) with (q) x = 'foo'").equals("foo")); - eng.popContext(); - } -} -#endif - -void tst_QJSEngine::jsContinueInSwitch() -{ - // This is testing ECMA-262 compliance, not C++ API. - - QJSEngine eng; - // switch - continue - { - QJSValue ret = eng.evaluate("switch (1) { default: continue; }"); - QVERIFY(ret.isError()); - } - // for - switch - case - continue - { - QJSValue ret = eng.evaluate("j = 0; for (i = 0; i < 100000; ++i) {\n" - " switch (i) {\n" - " case 1: ++j; continue;\n" - " case 100: ++j; continue;\n" - " case 1000: ++j; continue;\n" - " }\n" - "}; j"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 3); - } - // for - switch - case - default - continue - { - QJSValue ret = eng.evaluate("j = 0; for (i = 0; i < 100000; ++i) {\n" - " switch (i) {\n" - " case 1: ++j; continue;\n" - " case 100: ++j; continue;\n" - " case 1000: ++j; continue;\n" - " default: if (i < 50000) break; else continue;\n" - " }\n" - "}; j"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 3); - } - // switch - for - continue - { - QJSValue ret = eng.evaluate("j = 123; switch (j) {\n" - " case 123:\n" - " for (i = 0; i < 100000; ++i) {\n" - " continue;\n" - " }\n" - "}; i\n"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 100000); - } - // switch - switch - continue - { - QJSValue ret = eng.evaluate("i = 1; switch (i) { default: switch (i) { case 1: continue; } }"); - QVERIFY(ret.isError()); - } - // for - switch - switch - continue - { - QJSValue ret = eng.evaluate("j = 0; for (i = 0; i < 100000; ++i) {\n" - " switch (i) {\n" - " case 1:\n" - " switch (i) {\n" - " case 1: ++j; continue;\n" - " }\n" - " }\n" - "}; j"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 1); - } - // switch - for - switch - continue - { - QJSValue ret = eng.evaluate("j = 123; switch (j) {\n" - " case 123:\n" - " for (i = 0; i < 100000; ++i) {\n" - " switch (i) {\n" - " case 1:\n" - " ++j; continue;\n" - " }\n" - " }\n" - "}; i\n"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 100000); - } -} - -void tst_QJSEngine::jsShadowReadOnlyPrototypeProperty() -{ - // SpiderMonkey has different behavior than JSC and V8; it disallows - // creating a property on the instance if there's a property with the - // same name in the prototype, and that property is read-only. We - // adopted that behavior in the old (4.5) QtScript back-end, but it - // just seems weird -- and non-compliant. Adopt the JSC behavior instead. - QJSEngine eng; - QVERIFY(eng.evaluate("o = {}; o.__proto__ = parseInt; o.length").isNumber()); - QCOMPARE(eng.evaluate("o.length = 123; o.length").toInt(), 123); - QVERIFY(eng.evaluate("o.hasOwnProperty('length')").toBool()); -} - -void tst_QJSEngine::jsReservedWords_data() -{ - QTest::addColumn("word"); - QTest::newRow("break") << QString("break"); - QTest::newRow("case") << QString("case"); - QTest::newRow("catch") << QString("catch"); - QTest::newRow("continue") << QString("continue"); - QTest::newRow("default") << QString("default"); - QTest::newRow("delete") << QString("delete"); - QTest::newRow("do") << QString("do"); - QTest::newRow("else") << QString("else"); - QTest::newRow("false") << QString("false"); - QTest::newRow("finally") << QString("finally"); - QTest::newRow("for") << QString("for"); - QTest::newRow("function") << QString("function"); - QTest::newRow("if") << QString("if"); - QTest::newRow("in") << QString("in"); - QTest::newRow("instanceof") << QString("instanceof"); - QTest::newRow("new") << QString("new"); - QTest::newRow("null") << QString("null"); - QTest::newRow("return") << QString("return"); - QTest::newRow("switch") << QString("switch"); - QTest::newRow("this") << QString("this"); - QTest::newRow("throw") << QString("throw"); - QTest::newRow("true") << QString("true"); - QTest::newRow("try") << QString("try"); - QTest::newRow("typeof") << QString("typeof"); - QTest::newRow("var") << QString("var"); - QTest::newRow("void") << QString("void"); - QTest::newRow("while") << QString("while"); - QTest::newRow("with") << QString("with"); -} - -void tst_QJSEngine::jsReservedWords() -{ - // See ECMA-262 Section 7.6.1, "Reserved Words". - // We prefer that the implementation is less strict than the spec; e.g. - // it's good to allow reserved words as identifiers in object literals, - // and when accessing properties using dot notation. - - QFETCH(QString, word); - { - QJSEngine eng; - QJSValue ret = eng.evaluate(word + " = 123"); - QVERIFY(ret.isError()); - QString str = ret.toString(); - QVERIFY(str.startsWith("SyntaxError") || str.startsWith("ReferenceError")); - } - { - QJSEngine eng; - QJSValue ret = eng.evaluate("var " + word + " = 123"); - QVERIFY(ret.isError()); - QVERIFY(ret.toString().startsWith("SyntaxError")); - } - { - QJSEngine eng; - QJSValue ret = eng.evaluate("o = {}; o." + word + " = 123"); - // in the old back-end, in SpiderMonkey and in v8, this is allowed, but not in JSC - QVERIFY(!ret.isError()); - QVERIFY(ret.strictlyEquals(eng.evaluate("o." + word))); - } - { - QJSEngine eng; - QJSValue ret = eng.evaluate("o = { " + word + ": 123 }"); - // in the old back-end, in SpiderMonkey and in v8, this is allowed, but not in JSC - QVERIFY(!ret.isError()); - QVERIFY(ret.property(word).isNumber()); - } - { - // SpiderMonkey allows this, but we don't - QJSEngine eng; - QJSValue ret = eng.evaluate("function " + word + "() {}"); - QVERIFY(ret.isError()); - QVERIFY(ret.toString().startsWith("SyntaxError")); - } -} - -void tst_QJSEngine::jsFutureReservedWords_data() -{ - QTest::addColumn("word"); - QTest::addColumn("allowed"); - QTest::newRow("abstract") << QString("abstract") << true; - QTest::newRow("boolean") << QString("boolean") << true; - QTest::newRow("byte") << QString("byte") << true; - QTest::newRow("char") << QString("char") << true; - QTest::newRow("class") << QString("class") << false; - QTest::newRow("const") << QString("const") << false; - QTest::newRow("debugger") << QString("debugger") << false; - QTest::newRow("double") << QString("double") << true; - QTest::newRow("enum") << QString("enum") << false; - QTest::newRow("export") << QString("export") << false; - QTest::newRow("extends") << QString("extends") << false; - QTest::newRow("final") << QString("final") << true; - QTest::newRow("float") << QString("float") << true; - QTest::newRow("goto") << QString("goto") << true; - QTest::newRow("implements") << QString("implements") << true; - QTest::newRow("import") << QString("import") << false; - QTest::newRow("int") << QString("int") << true; - QTest::newRow("interface") << QString("interface") << true; - QTest::newRow("long") << QString("long") << true; - QTest::newRow("native") << QString("native") << true; - QTest::newRow("package") << QString("package") << true; - QTest::newRow("private") << QString("private") << true; - QTest::newRow("protected") << QString("protected") << true; - QTest::newRow("public") << QString("public") << true; - QTest::newRow("short") << QString("short") << true; - QTest::newRow("static") << QString("static") << true; - QTest::newRow("super") << QString("super") << false; - QTest::newRow("synchronized") << QString("synchronized") << true; - QTest::newRow("throws") << QString("throws") << true; - QTest::newRow("transient") << QString("transient") << true; - QTest::newRow("volatile") << QString("volatile") << true; -} - -void tst_QJSEngine::jsFutureReservedWords() -{ - QSKIP("Fails"); - // See ECMA-262 Section 7.6.1.2, "Future Reserved Words". - // In real-world implementations, most of these words are - // actually allowed as normal identifiers. - - QFETCH(QString, word); - QFETCH(bool, allowed); - { - QJSEngine eng; - QJSValue ret = eng.evaluate(word + " = 123"); - QCOMPARE(!ret.isError(), allowed); - } - { - QJSEngine eng; - QJSValue ret = eng.evaluate("var " + word + " = 123"); - QCOMPARE(!ret.isError(), allowed); - } - { - // this should probably be allowed (see task 162567) - QJSEngine eng; - QJSValue ret = eng.evaluate("o = {}; o." + word + " = 123"); - QCOMPARE(ret.isNumber(), allowed); - QCOMPARE(!ret.isError(), allowed); - } - { - // this should probably be allowed (see task 162567) - QJSEngine eng; - QJSValue ret = eng.evaluate("o = { " + word + ": 123 }"); - QCOMPARE(!ret.isError(), allowed); - } -} - -void tst_QJSEngine::jsThrowInsideWithStatement() -{ - // This is testing ECMA-262 compliance, not C++ API. - - // task 209988 - QJSEngine eng; - { - QJSValue ret = eng.evaluate( - "try {" - " o = { bad : \"bug\" };" - " with (o) {" - " throw 123;" - " }" - "} catch (e) {" - " bad;" - "}"); - QVERIFY(ret.isError()); - QVERIFY(ret.toString().contains(QString::fromLatin1("ReferenceError"))); - } - { - QJSValue ret = eng.evaluate( - "try {" - " o = { bad : \"bug\" };" - " with (o) {" - " throw 123;" - " }" - "} finally {" - " bad;" - "}"); - QVERIFY(ret.isError()); - QVERIFY(ret.toString().contains(QString::fromLatin1("ReferenceError"))); - } - { - eng.clearExceptions(); - QJSValue ret = eng.evaluate( - "o = { bug : \"no bug\" };" - "with (o) {" - " try {" - " throw 123;" - " } finally {" - " bug;" - " }" - "}"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 123); - QVERIFY(eng.hasUncaughtException()); - } - { - eng.clearExceptions(); - QJSValue ret = eng.evaluate( - "o = { bug : \"no bug\" };" - "with (o) {" - " throw 123;" - "}"); - QVERIFY(ret.isNumber()); - QJSValue ret2 = eng.evaluate("bug"); - QVERIFY(ret2.isError()); - QVERIFY(ret2.toString().contains(QString::fromLatin1("ReferenceError"))); - } -} - -#if 0 // ###FIXME: No QScriptEngineAgent API -class TestAgent : public QScriptEngineAgent -{ -public: - TestAgent(QScriptEngine *engine) : QScriptEngineAgent(engine) {} -}; - -void tst_QJSEngine::getSetAgent_ownership() -{ - // engine deleted before agent --> agent deleted too - QScriptEngine *eng = new QScriptEngine; - QCOMPARE(eng->agent(), (QScriptEngineAgent*)0); - TestAgent *agent = new TestAgent(eng); - eng->setAgent(agent); - QCOMPARE(eng->agent(), (QScriptEngineAgent*)agent); - eng->setAgent(0); // the engine maintains ownership of the old agent - QCOMPARE(eng->agent(), (QScriptEngineAgent*)0); - delete eng; -} - -void tst_QJSEngine::getSetAgent_deleteAgent() -{ - // agent deleted before engine --> engine's agent should become 0 - QScriptEngine *eng = new QScriptEngine; - TestAgent *agent = new TestAgent(eng); - eng->setAgent(agent); - QCOMPARE(eng->agent(), (QScriptEngineAgent*)agent); - delete agent; - QCOMPARE(eng->agent(), (QScriptEngineAgent*)0); - eng->evaluate("(function(){ return 123; })()"); - delete eng; -} - -void tst_QJSEngine::getSetAgent_differentEngine() -{ - QScriptEngine eng; - QScriptEngine eng2; - TestAgent *agent = new TestAgent(&eng); - QTest::ignoreMessage(QtWarningMsg, "QScriptEngine::setAgent(): cannot set agent belonging to different engine"); - eng2.setAgent(agent); - QCOMPARE(eng2.agent(), (QScriptEngineAgent*)0); -} -#endif - -#if 0 // ###FIXME: No QScriptString API -void tst_QJSEngine::reentrancy_stringHandles() -{ - QScriptEngine eng1; - QScriptEngine eng2; - QScriptString s1 = eng1.toStringHandle("foo"); - QScriptString s2 = eng2.toStringHandle("foo"); - QVERIFY(s1 != s2); -} -#endif - -#if 0 // ###FIXME: No processEventsInterval API -void tst_QJSEngine::reentrancy_processEventsInterval() -{ - QScriptEngine eng1; - QScriptEngine eng2; - eng1.setProcessEventsInterval(123); - QCOMPARE(eng2.processEventsInterval(), -1); - eng2.setProcessEventsInterval(456); - QCOMPARE(eng1.processEventsInterval(), 123); -} -#endif - -#if 0 // FIXME: No support for custom types -void tst_QJSEngine::reentrancy_typeConversion() -{ - QScriptEngine eng1; - QScriptEngine eng2; - qScriptRegisterMetaType(&eng1, fooToScriptValue, fooFromScriptValue); - Foo foo; - foo.x = 12; - foo.y = 34; - { - QScriptValue fooVal = qScriptValueFromValue(&eng1, foo); - QVERIFY(fooVal.isObject()); - QVERIFY(!fooVal.isVariant()); - QCOMPARE(fooVal.property("x").toInt(), 12); - QCOMPARE(fooVal.property("y").toInt(), 34); - fooVal.setProperty("x", 56); - fooVal.setProperty("y", 78); - - Foo foo2 = eng.fromScriptValue(fooVal); - QCOMPARE(foo2.x, 56); - QCOMPARE(foo2.y, 78); - } - { - QScriptValue fooVal = qScriptValueFromValue(&eng2, foo); - QVERIFY(fooVal.isVariant()); - - Foo foo2 = eng.fromScriptValue(fooVal); - QCOMPARE(foo2.x, 12); - QCOMPARE(foo2.y, 34); - } - QVERIFY(eng1.defaultPrototype(qMetaTypeId()).isUndefined()); - QVERIFY(eng2.defaultPrototype(qMetaTypeId()).isUndefined()); - QScriptValue proto1 = eng1.newObject(); - eng1.setDefaultPrototype(qMetaTypeId(), proto1); - QVERIFY(eng2.defaultPrototype(qMetaTypeId()).isUndefined()); - QScriptValue proto2 = eng2.newObject(); - eng2.setDefaultPrototype(qMetaTypeId(), proto2); - QVERIFY(!eng2.defaultPrototype(qMetaTypeId()).isUndefined()); - QVERIFY(eng1.defaultPrototype(qMetaTypeId()).strictlyEquals(proto1)); -} -#endif - -void tst_QJSEngine::reentrancy_globalObjectProperties() -{ - QJSEngine eng1; - QJSEngine eng2; - QVERIFY(eng2.globalObject().property("a").isUndefined()); - eng1.evaluate("a = 10"); - QVERIFY(eng1.globalObject().property("a").isNumber()); - QVERIFY(eng2.globalObject().property("a").isUndefined()); - eng2.evaluate("a = 20"); - QVERIFY(eng2.globalObject().property("a").isNumber()); - QCOMPARE(eng1.globalObject().property("a").toInt(), 10); -} - -void tst_QJSEngine::reentrancy_Array() -{ - // weird bug with JSC backend - { - QJSEngine eng; - QCOMPARE(eng.evaluate("Array()").toString(), QString()); - eng.evaluate("Array.prototype.toString"); - QCOMPARE(eng.evaluate("Array()").toString(), QString()); - } - { - QJSEngine eng; - QCOMPARE(eng.evaluate("Array()").toString(), QString()); - } -} - -void tst_QJSEngine::reentrancy_objectCreation() -{ - QJSEngine eng1; - QJSEngine eng2; - { - QDateTime dt = QDateTime::currentDateTime(); - QJSValue d1 = eng1.toScriptValue(dt); - QJSValue d2 = eng2.toScriptValue(dt); - QCOMPARE(d1.toDateTime(), d2.toDateTime()); - QCOMPARE(d2.toDateTime(), d1.toDateTime()); - } - { - QJSValue r1 = eng1.evaluate("new RegExp('foo', 'gim')"); - QJSValue r2 = eng2.evaluate("new RegExp('foo', 'gim')"); - QCOMPARE(qjsvalue_cast(r1), qjsvalue_cast(r2)); - QCOMPARE(qjsvalue_cast(r2), qjsvalue_cast(r1)); - } - { - QJSValue o1 = eng1.newQObject(this); - QJSValue o2 = eng2.newQObject(this); - QCOMPARE(o1.toQObject(), o2.toQObject()); - QCOMPARE(o2.toQObject(), o1.toQObject()); - } -#if 0 // ###FIXME: No QScriptEngine::newQMetaObject API - { - QScriptValue mo1 = eng1.newQMetaObject(&staticMetaObject); - QScriptValue mo2 = eng2.newQMetaObject(&staticMetaObject); - QCOMPARE(mo1.toQMetaObject(), mo2.toQMetaObject()); - QCOMPARE(mo2.toQMetaObject(), mo1.toQMetaObject()); - } -#endif -} - -void tst_QJSEngine::jsIncDecNonObjectProperty() -{ - // This is testing ECMA-262 compliance, not C++ API. - - QJSEngine eng; - { - QJSValue ret = eng.evaluate("var a; a.n++"); - QVERIFY(ret.isError()); - QVERIFY(ret.toString().contains(QString::fromLatin1("TypeError"))); - } - { - QJSValue ret = eng.evaluate("var a; a.n--"); - QVERIFY(ret.isError()); - QVERIFY(ret.toString().contains(QString::fromLatin1("TypeError"))); - } - { - QJSValue ret = eng.evaluate("var a = null; a.n++"); - QVERIFY(ret.isError()); - QVERIFY(ret.toString().contains(QString::fromLatin1("TypeError"))); - } - { - QJSValue ret = eng.evaluate("var a = null; a.n--"); - QVERIFY(ret.isError()); - QVERIFY(ret.toString().contains(QString::fromLatin1("TypeError"))); - } - { - QJSValue ret = eng.evaluate("var a; ++a.n"); - QVERIFY(ret.isError()); - QVERIFY(ret.toString().contains(QString::fromLatin1("TypeError"))); - } - { - QJSValue ret = eng.evaluate("var a; --a.n"); - QVERIFY(ret.isError()); - QVERIFY(ret.toString().contains(QString::fromLatin1("TypeError"))); - } - { - QJSValue ret = eng.evaluate("var a; a.n += 1"); - QVERIFY(ret.isError()); - QVERIFY(ret.toString().contains(QString::fromLatin1("TypeError"))); - } - { - QJSValue ret = eng.evaluate("var a; a.n -= 1"); - QVERIFY(ret.isError()); - QVERIFY(ret.toString().contains(QString::fromLatin1("TypeError"))); - } - { - QJSValue ret = eng.evaluate("var a = 'ciao'; a.length++"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 4); - } - { - QJSValue ret = eng.evaluate("var a = 'ciao'; a.length--"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 4); - } - { - QJSValue ret = eng.evaluate("var a = 'ciao'; ++a.length"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 5); - } - { - QJSValue ret = eng.evaluate("var a = 'ciao'; --a.length"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 3); - } -} - -#if 0 // ###FIXME: no installTranslatorFunctions API -void tst_QJSEngine::installTranslatorFunctions() -{ - QScriptEngine eng; - QScriptValue global = eng.globalObject(); - QVERIFY(global.property("qsTranslate").isUndefined()); - QVERIFY(global.property("QT_TRANSLATE_NOOP").isUndefined()); - QVERIFY(global.property("qsTr").isUndefined()); - QVERIFY(global.property("QT_TR_NOOP").isUndefined()); - QVERIFY(global.property("qsTrId").isUndefined()); - QVERIFY(global.property("QT_TRID_NOOP").isUndefined()); - QVERIFY(global.property("String").property("prototype").property("arg").isUndefined()); - - eng.installTranslatorFunctions(); - QVERIFY(global.property("qsTranslate").isCallable()); - QVERIFY(global.property("QT_TRANSLATE_NOOP").isCallable()); - QVERIFY(global.property("qsTr").isCallable()); - QVERIFY(global.property("QT_TR_NOOP").isCallable()); - QVERIFY(global.property("qsTrId").isCallable()); - QVERIFY(global.property("QT_TRID_NOOP").isCallable()); - QVERIFY(global.property("String").property("prototype").property("arg").isCallable()); - - { - QScriptValue ret = eng.evaluate("qsTr('foo')"); - QVERIFY(ret.isString()); - QCOMPARE(ret.toString(), QString::fromLatin1("foo")); - } - { - QScriptValue ret = eng.evaluate("qsTranslate('foo', 'bar')"); - QVERIFY(ret.isString()); - QCOMPARE(ret.toString(), QString::fromLatin1("bar")); - } - { - QScriptValue ret = eng.evaluate("QT_TR_NOOP('foo')"); - QVERIFY(ret.isString()); - QCOMPARE(ret.toString(), QString::fromLatin1("foo")); - } - { - QScriptValue ret = eng.evaluate("QT_TRANSLATE_NOOP('foo', 'bar')"); - QVERIFY(ret.isString()); - QCOMPARE(ret.toString(), QString::fromLatin1("bar")); - } - { - QScriptValue ret = eng.evaluate("'foo%0'.arg('bar')"); - QEXPECT_FAIL("Custom global object", "FIXME: why we expect that String prototype exists?", Abort); - QVERIFY(ret.isString()); - QCOMPARE(ret.toString(), QString::fromLatin1("foobar")); - } - { - QScriptValue ret = eng.evaluate("'foo%0'.arg(123)"); - QVERIFY(ret.isString()); - QCOMPARE(ret.toString(), QString::fromLatin1("foo123")); - } - { - // Maybe this should throw an error? - QScriptValue ret = eng.evaluate("'foo%0'.arg()"); - QVERIFY(ret.isString()); - QCOMPARE(ret.toString(), QString()); - } - - { - QScriptValue ret = eng.evaluate("qsTrId('foo')"); - QVERIFY(ret.isString()); - QCOMPARE(ret.toString(), QString::fromLatin1("foo")); - } - { - QScriptValue ret = eng.evaluate("QT_TRID_NOOP('foo')"); - QVERIFY(ret.isString()); - QCOMPARE(ret.toString(), QString::fromLatin1("foo")); - } - QVERIFY(eng.evaluate("QT_TRID_NOOP()").isUndefined()); -} - -class TranslationScope -{ -public: - TranslationScope(const QString &fileName) - { - translator.load(fileName); - QCoreApplication::instance()->installTranslator(&translator); - } - ~TranslationScope() - { - QCoreApplication::instance()->removeTranslator(&translator); - } - -private: - QTranslator translator; -}; - -void tst_QJSEngine::translateScript_data() -{ - QTest::addColumn("expression"); - QTest::addColumn("fileName"); - QTest::addColumn("expectedTranslation"); - - QString fileName = QString::fromLatin1("translatable.js"); - // Top-level - QTest::newRow("qsTr('One')@translatable.js") - << QString::fromLatin1("qsTr('One')") << fileName << QString::fromLatin1("En"); - QTest::newRow("qsTr('Hello')@translatable.js") - << QString::fromLatin1("qsTr('Hello')") << fileName << QString::fromLatin1("Hallo"); - // From function - QTest::newRow("(function() { return qsTr('One'); })()@translatable.js") - << QString::fromLatin1("(function() { return qsTr('One'); })()") << fileName << QString::fromLatin1("En"); - QTest::newRow("(function() { return qsTr('Hello'); })()@translatable.js") - << QString::fromLatin1("(function() { return qsTr('Hello'); })()") << fileName << QString::fromLatin1("Hallo"); - // From eval - QTest::newRow("eval('qsTr(\\'One\\')')@translatable.js") - << QString::fromLatin1("eval('qsTr(\\'One\\')')") << fileName << QString::fromLatin1("En"); - QTest::newRow("eval('qsTr(\\'Hello\\')')@translatable.js") - << QString::fromLatin1("eval('qsTr(\\'Hello\\')')") << fileName << QString::fromLatin1("Hallo"); - // Plural - QTest::newRow("qsTr('%n message(s) saved', '', 1)@translatable.js") - << QString::fromLatin1("qsTr('%n message(s) saved', '', 1)") << fileName << QString::fromLatin1("1 melding lagret"); - QTest::newRow("qsTr('%n message(s) saved', '', 3).arg@translatable.js") - << QString::fromLatin1("qsTr('%n message(s) saved', '', 3)") << fileName << QString::fromLatin1("3 meldinger lagret"); - - // Top-level - QTest::newRow("qsTranslate('FooContext', 'Two')@translatable.js") - << QString::fromLatin1("qsTranslate('FooContext', 'Two')") << fileName << QString::fromLatin1("To"); - QTest::newRow("qsTranslate('FooContext', 'Goodbye')@translatable.js") - << QString::fromLatin1("qsTranslate('FooContext', 'Goodbye')") << fileName << QString::fromLatin1("Farvel"); - // From eval - QTest::newRow("eval('qsTranslate(\\'FooContext\\', \\'Two\\')')@translatable.js") - << QString::fromLatin1("eval('qsTranslate(\\'FooContext\\', \\'Two\\')')") << fileName << QString::fromLatin1("To"); - QTest::newRow("eval('qsTranslate(\\'FooContext\\', \\'Goodbye\\')')@translatable.js") - << QString::fromLatin1("eval('qsTranslate(\\'FooContext\\', \\'Goodbye\\')')") << fileName << QString::fromLatin1("Farvel"); - - QTest::newRow("qsTranslate('FooContext', 'Goodbye', '', 'UnicodeUTF8')@translatable.js") - << QString::fromLatin1("qsTranslate('FooContext', 'Goodbye', '', 'UnicodeUTF8')") << fileName << QString::fromLatin1("Farvel"); - QTest::newRow("qsTranslate('FooContext', 'Goodbye', '', 'CodecForTr')@translatable.js") - << QString::fromLatin1("qsTranslate('FooContext', 'Goodbye', '', 'CodecForTr')") << fileName << QString::fromLatin1("Farvel"); - - QTest::newRow("qsTranslate('FooContext', 'Goodbye', '', 'UnicodeUTF8', 42)@translatable.js") - << QString::fromLatin1("qsTranslate('FooContext', 'Goodbye', '', 'UnicodeUTF8', 42)") << fileName << QString::fromLatin1("Goodbye"); - - QTest::newRow("qsTr('One', 'not the same one')@translatable.js") - << QString::fromLatin1("qsTr('One', 'not the same one')") << fileName << QString::fromLatin1("Enda en"); - - QTest::newRow("qsTr('One', 'not the same one', 42)@translatable.js") - << QString::fromLatin1("qsTr('One', 'not the same one', 42)") << fileName << QString::fromLatin1("One"); - - // Plural - QTest::newRow("qsTranslate('FooContext', '%n fooish bar(s) found', '', 'UnicodeUTF8', 1)@translatable.js") - << QString::fromLatin1("qsTranslate('FooContext', '%n fooish bar(s) found', '', 'UnicodeUTF8', 1)") << fileName << QString::fromLatin1("1 fooaktig bar funnet"); - QTest::newRow("qsTranslate('FooContext', '%n fooish bar(s) found', '', 'UnicodeUTF8', 2)@translatable.js") - << QString::fromLatin1("qsTranslate('FooContext', '%n fooish bar(s) found', '', 'UnicodeUTF8', 2)") << fileName << QString::fromLatin1("2 fooaktige barer funnet"); - - // Don't exist in translation - QTest::newRow("qsTr('Three')@translatable.js") - << QString::fromLatin1("qsTr('Three')") << fileName << QString::fromLatin1("Three"); - QTest::newRow("qsTranslate('FooContext', 'So long')@translatable.js") - << QString::fromLatin1("qsTranslate('FooContext', 'So long')") << fileName << QString::fromLatin1("So long"); - QTest::newRow("qsTranslate('BarContext', 'Goodbye')@translatable.js") - << QString::fromLatin1("qsTranslate('BarContext', 'Goodbye')") << fileName << QString::fromLatin1("Goodbye"); - - // Translate strings from the second script (translatable2.js) - - QString fileName2 = QString::fromLatin1("translatable2.js"); - QTest::newRow("qsTr('Three')@translatable2.js") - << QString::fromLatin1("qsTr('Three')") << fileName2 << QString::fromLatin1("Tre"); - QTest::newRow("qsTr('Happy birthday!')@translatable2.js") - << QString::fromLatin1("qsTr('Happy birthday!')") << fileName2 << QString::fromLatin1("Gratulerer med dagen!"); - - // Not translated because translation is only in translatable.js - QTest::newRow("qsTr('One')@translatable2.js") - << QString::fromLatin1("qsTr('One')") << fileName2 << QString::fromLatin1("One"); - QTest::newRow("(function() { return qsTr('One'); })()@translatable2.js") - << QString::fromLatin1("(function() { return qsTr('One'); })()") << fileName2 << QString::fromLatin1("One"); - - // For qsTranslate() the filename shouldn't matter - QTest::newRow("qsTranslate('FooContext', 'Two')@translatable2.js") - << QString::fromLatin1("qsTranslate('FooContext', 'Two')") << fileName2 << QString::fromLatin1("To"); - QTest::newRow("qsTranslate('BarContext', 'Congratulations!')@translatable.js") - << QString::fromLatin1("qsTranslate('BarContext', 'Congratulations!')") << fileName << QString::fromLatin1("Gratulerer!"); -} - -void tst_QJSEngine::translateScript() -{ - QFETCH(QString, expression); - QFETCH(QString, fileName); - QFETCH(QString, expectedTranslation); - - QScriptEngine engine; - - TranslationScope tranScope(":/translations/translatable_la"); - engine.installTranslatorFunctions(); - - QCOMPARE(engine.evaluate(expression, fileName).toString(), expectedTranslation); - QVERIFY(!engine.hasUncaughtException()); -} - -void tst_QJSEngine::translateScript_crossScript() -{ - QScriptEngine engine; - TranslationScope tranScope(":/translations/translatable_la"); - engine.installTranslatorFunctions(); - - QString fileName = QString::fromLatin1("translatable.js"); - QString fileName2 = QString::fromLatin1("translatable2.js"); - // qsTr() should use the innermost filename as context - engine.evaluate("function foo(s) { return bar(s); }", fileName); - engine.evaluate("function bar(s) { return qsTr(s); }", fileName2); - QCOMPARE(engine.evaluate("bar('Three')", fileName2).toString(), QString::fromLatin1("Tre")); - QCOMPARE(engine.evaluate("bar('Three')", fileName).toString(), QString::fromLatin1("Tre")); - QCOMPARE(engine.evaluate("bar('One')", fileName2).toString(), QString::fromLatin1("One")); - - engine.evaluate("function foo(s) { return bar(s); }", fileName2); - engine.evaluate("function bar(s) { return qsTr(s); }", fileName); - QCOMPARE(engine.evaluate("bar('Three')", fileName2).toString(), QString::fromLatin1("Three")); - QCOMPARE(engine.evaluate("bar('One')", fileName).toString(), QString::fromLatin1("En")); - QCOMPARE(engine.evaluate("bar('One')", fileName2).toString(), QString::fromLatin1("En")); -} - -static QScriptValue callQsTr(QScriptContext *ctx, QScriptEngine *eng) -{ - return eng->globalObject().property("qsTr").callWithInstance(ctx->thisObject(), ctx->argumentsObject()); -} - -void tst_QJSEngine::translateScript_callQsTrFromNative() -{ - QScriptEngine engine; - TranslationScope tranScope(":/translations/translatable_la"); - engine.installTranslatorFunctions(); - - QString fileName = QString::fromLatin1("translatable.js"); - QString fileName2 = QString::fromLatin1("translatable2.js"); - // Calling qsTr() from a native function - engine.globalObject().setProperty("qsTrProxy", engine.newFunction(callQsTr)); - QCOMPARE(engine.evaluate("qsTrProxy('One')", fileName).toString(), QString::fromLatin1("En")); - QCOMPARE(engine.evaluate("qsTrProxy('One')", fileName2).toString(), QString::fromLatin1("One")); - QCOMPARE(engine.evaluate("qsTrProxy('Three')", fileName).toString(), QString::fromLatin1("Three")); - QCOMPARE(engine.evaluate("qsTrProxy('Three')", fileName2).toString(), QString::fromLatin1("Tre")); -} - -void tst_QJSEngine::translateScript_trNoOp() -{ - QScriptEngine engine; - TranslationScope tranScope(":/translations/translatable_la"); - engine.installTranslatorFunctions(); - - QVERIFY(engine.evaluate("QT_TR_NOOP()").isUndefined()); - QCOMPARE(engine.evaluate("QT_TR_NOOP('One')").toString(), QString::fromLatin1("One")); - - QVERIFY(engine.evaluate("QT_TRANSLATE_NOOP()").isUndefined()); - QVERIFY(engine.evaluate("QT_TRANSLATE_NOOP('FooContext')").isUndefined()); - QCOMPARE(engine.evaluate("QT_TRANSLATE_NOOP('FooContext', 'Two')").toString(), QString::fromLatin1("Two")); -} - -void tst_QJSEngine::translateScript_callQsTrFromCpp() -{ - QScriptEngine engine; - TranslationScope tranScope(":/translations/translatable_la"); - engine.installTranslatorFunctions(); - - // There is no context, but it shouldn't crash - QCOMPARE(engine.globalObject().property("qsTr").call( - QScriptValueList() << "One").toString(), QString::fromLatin1("One")); -} - -void tst_QJSEngine::translateWithInvalidArgs_data() -{ - QTest::addColumn("expression"); - QTest::addColumn("expectedError"); - - QTest::newRow("qsTr()") << "qsTr()" << "Error: qsTr() requires at least one argument"; - QTest::newRow("qsTr(123)") << "qsTr(123)" << "Error: qsTr(): first argument (text) must be a string"; - QTest::newRow("qsTr('foo', 123)") << "qsTr('foo', 123)" << "Error: qsTr(): second argument (comment) must be a string"; - QTest::newRow("qsTr('foo', 'bar', 'baz')") << "qsTr('foo', 'bar', 'baz')" << "Error: qsTr(): third argument (n) must be a number"; - QTest::newRow("qsTr('foo', 'bar', true)") << "qsTr('foo', 'bar', true)" << "Error: qsTr(): third argument (n) must be a number"; - - QTest::newRow("qsTranslate()") << "qsTranslate()" << "Error: qsTranslate() requires at least two arguments"; - QTest::newRow("qsTranslate('foo')") << "qsTranslate('foo')" << "Error: qsTranslate() requires at least two arguments"; - QTest::newRow("qsTranslate(123, 'foo')") << "qsTranslate(123, 'foo')" << "Error: qsTranslate(): first argument (context) must be a string"; - QTest::newRow("qsTranslate('foo', 123)") << "qsTranslate('foo', 123)" << "Error: qsTranslate(): second argument (text) must be a string"; - QTest::newRow("qsTranslate('foo', 'bar', 123)") << "qsTranslate('foo', 'bar', 123)" << "Error: qsTranslate(): third argument (comment) must be a string"; - QTest::newRow("qsTranslate('foo', 'bar', 'baz', 123)") << "qsTranslate('foo', 'bar', 'baz', 123)" << "Error: qsTranslate(): fourth argument (encoding) must be a string"; - QTest::newRow("qsTranslate('foo', 'bar', 'baz', 'zab', 'rab')") << "qsTranslate('foo', 'bar', 'baz', 'zab', 'rab')" << "Error: qsTranslate(): fifth argument (n) must be a number"; - QTest::newRow("qsTranslate('foo', 'bar', 'baz', 'zab', 123)") << "qsTranslate('foo', 'bar', 'baz', 'zab', 123)" << "Error: qsTranslate(): invalid encoding 'zab'"; - - QTest::newRow("qsTrId()") << "qsTrId()" << "Error: qsTrId() requires at least one argument"; - QTest::newRow("qsTrId(123)") << "qsTrId(123)" << "TypeError: qsTrId(): first argument (id) must be a string"; - QTest::newRow("qsTrId('foo', 'bar')") << "qsTrId('foo', 'bar')" << "TypeError: qsTrId(): second argument (n) must be a number"; -} - -void tst_QJSEngine::translateWithInvalidArgs() -{ - QFETCH(QString, expression); - QFETCH(QString, expectedError); - QScriptEngine engine; - engine.installTranslatorFunctions(); - QScriptValue result = engine.evaluate(expression); - QVERIFY(result.isError()); - QCOMPARE(result.toString(), expectedError); -} - -void tst_QJSEngine::translationContext_data() -{ - QTest::addColumn("path"); - QTest::addColumn("text"); - QTest::addColumn("expectedTranslation"); - - QTest::newRow("translatable.js") << "translatable.js" << "One" << "En"; - QTest::newRow("/translatable.js") << "/translatable.js" << "One" << "En"; - QTest::newRow("/foo/translatable.js") << "/foo/translatable.js" << "One" << "En"; - QTest::newRow("/foo/bar/translatable.js") << "/foo/bar/translatable.js" << "One" << "En"; - QTest::newRow("./translatable.js") << "./translatable.js" << "One" << "En"; - QTest::newRow("../translatable.js") << "../translatable.js" << "One" << "En"; - QTest::newRow("foo/translatable.js") << "foo/translatable.js" << "One" << "En"; - QTest::newRow("file:///home/qt/translatable.js") << "file:///home/qt/translatable.js" << "One" << "En"; - QTest::newRow(":/resources/translatable.js") << ":/resources/translatable.js" << "One" << "En"; - QTest::newRow("/translatable.js.foo") << "/translatable.js.foo" << "One" << "En"; - QTest::newRow("/translatable.txt") << "/translatable.txt" << "One" << "En"; - QTest::newRow("translatable") << "translatable" << "One" << "En"; - QTest::newRow("foo/translatable") << "foo/translatable" << "One" << "En"; - - QTest::newRow("native separators") - << (QDir::toNativeSeparators(QDir::currentPath()) + QDir::separator() + "translatable.js") - << "One" << "En"; - - QTest::newRow("translatable.js/") << "translatable.js/" << "One" << "One"; - QTest::newRow("nosuchscript.js") << "" << "One" << "One"; - QTest::newRow("(empty)") << "" << "One" << "One"; -} - -void tst_QJSEngine::translationContext() -{ - TranslationScope tranScope(":/translations/translatable_la"); - - QScriptEngine engine; - engine.installTranslatorFunctions(); - - QFETCH(QString, path); - QFETCH(QString, text); - QFETCH(QString, expectedTranslation); - QScriptValue ret = engine.evaluate(QString::fromLatin1("qsTr('%0')").arg(text), path); - QVERIFY(ret.isString()); - QCOMPARE(ret.toString(), expectedTranslation); -} - -void tst_QJSEngine::translateScriptIdBased() -{ - QScriptEngine engine; - - TranslationScope tranScope(":/translations/idtranslatable_la"); - engine.installTranslatorFunctions(); - - QString fileName = QString::fromLatin1("idtranslatable.js"); - - QHash expectedTranslations; - expectedTranslations["qtn_foo_bar"] = "First string"; - expectedTranslations["qtn_needle"] = "Second string"; - expectedTranslations["qtn_haystack"] = "Third string"; - expectedTranslations["qtn_bar_baz"] = "Fourth string"; - - QHash::const_iterator it; - for (it = expectedTranslations.constBegin(); it != expectedTranslations.constEnd(); ++it) { - for (int x = 0; x < 2; ++x) { - QString fn; - if (x) - fn = fileName; - // Top-level - QCOMPARE(engine.evaluate(QString::fromLatin1("qsTrId('%0')") - .arg(it.key()), fn).toString(), - it.value()); - QCOMPARE(engine.evaluate(QString::fromLatin1("QT_TRID_NOOP('%0')") - .arg(it.key()), fn).toString(), - it.key()); - // From function - QCOMPARE(engine.evaluate(QString::fromLatin1("(function() { return qsTrId('%0'); })()") - .arg(it.key()), fn).toString(), - it.value()); - QCOMPARE(engine.evaluate(QString::fromLatin1("(function() { return QT_TRID_NOOP('%0'); })()") - .arg(it.key()), fn).toString(), - it.key()); - } - } - - // Plural form - QCOMPARE(engine.evaluate("qsTrId('qtn_bar_baz', 10)").toString(), - QString::fromLatin1("10 fooish bar(s) found")); - QCOMPARE(engine.evaluate("qsTrId('qtn_foo_bar', 10)").toString(), - QString::fromLatin1("qtn_foo_bar")); // Doesn't have plural -} - -// How to add a new test row: -// - Find a nice list of Unicode characters to choose from -// - Write source string/context/comment in .js using Unicode escape sequences (\uABCD) -// - Update corresponding .ts file (e.g. lupdate foo.js -ts foo.ts -codecfortr UTF-8) -// - Enter translation in Linguist -// - Update corresponding .qm file (e.g. lrelease foo.ts) -// - Evaluate script that performs translation; make sure the correct result is returned -// (e.g. by setting the resulting string as the text of a QLabel and visually verifying -// that it looks the same as what you entered in Linguist :-) ) -// - Generate the expectedTranslation column data using toUtf8().toHex() -void tst_QJSEngine::translateScriptUnicode_data() -{ - QTest::addColumn("expression"); - QTest::addColumn("fileName"); - QTest::addColumn("expectedTranslation"); - - QString fileName = QString::fromLatin1("translatable-unicode.js"); - QTest::newRow("qsTr('H\\u2082O')@translatable-unicode.js") - << QString::fromLatin1("qsTr('H\\u2082O')") << fileName << QString::fromUtf8("\xcd\xbb\xcd\xbc\xcd\xbd"); - QTest::newRow("qsTranslate('\\u010C\\u0101\\u011F\\u0115', 'CO\\u2082')@translatable-unicode.js") - << QString::fromLatin1("qsTranslate('\\u010C\\u0101\\u011F\\u0115', 'CO\\u2082')") << fileName << QString::fromUtf8("\xd7\x91\xd7\x9a\xd7\xa2"); - QTest::newRow("qsTr('\\u0391\\u0392\\u0393')@translatable-unicode.js") - << QString::fromLatin1("qsTr('\\u0391\\u0392\\u0393')") << fileName << QString::fromUtf8("\xd3\x9c\xd2\xb4\xd1\xbc"); - QTest::newRow("qsTranslate('\\u010C\\u0101\\u011F\\u0115', '\\u0414\\u0415\\u0416')@translatable-unicode.js") - << QString::fromLatin1("qsTranslate('\\u010C\\u0101\\u011F\\u0115', '\\u0414\\u0415\\u0416')") << fileName << QString::fromUtf8("\xd8\xae\xd8\xb3\xd8\xb3"); - QTest::newRow("qsTr('H\\u2082O', 'not the same H\\u2082O')@translatable-unicode.js") - << QString::fromLatin1("qsTr('H\\u2082O', 'not the same H\\u2082O')") << fileName << QString::fromUtf8("\xd4\xb6\xd5\x8a\xd5\x92"); - QTest::newRow("qsTr('H\\u2082O')") - << QString::fromLatin1("qsTr('H\\u2082O')") << QString() << QString::fromUtf8("\x48\xe2\x82\x82\x4f"); - QTest::newRow("qsTranslate('\\u010C\\u0101\\u011F\\u0115', 'CO\\u2082')") - << QString::fromLatin1("qsTranslate('\\u010C\\u0101\\u011F\\u0115', 'CO\\u2082')") << QString() << QString::fromUtf8("\xd7\x91\xd7\x9a\xd7\xa2"); -} - -void tst_QJSEngine::translateScriptUnicode() -{ - QFETCH(QString, expression); - QFETCH(QString, fileName); - QFETCH(QString, expectedTranslation); - - QScriptEngine engine; - - TranslationScope tranScope(":/translations/translatable-unicode"); - engine.installTranslatorFunctions(); - - QCOMPARE(engine.evaluate(expression, fileName).toString(), expectedTranslation); - QVERIFY(!engine.hasUncaughtException()); -} - -void tst_QJSEngine::translateScriptUnicodeIdBased_data() -{ - QTest::addColumn("expression"); - QTest::addColumn("expectedTranslation"); - - QTest::newRow("qsTrId('\\u01F8\\u01D2\\u0199\\u01D0\\u01E1'')") - << QString::fromLatin1("qsTrId('\\u01F8\\u01D2\\u0199\\u01D0\\u01E1')") << QString::fromUtf8("\xc6\xa7\xc6\xb0\xc6\x88\xc8\xbc\xc8\x9d\xc8\xbf\xc8\x99"); - QTest::newRow("qsTrId('\\u0191\\u01CE\\u0211\\u0229\\u019C\\u018E\\u019A\\u01D0')") - << QString::fromLatin1("qsTrId('\\u0191\\u01CE\\u0211\\u0229\\u019C\\u018E\\u019A\\u01D0')") << QString::fromUtf8("\xc7\xa0\xc8\xa1\xc8\x8b\xc8\x85\xc8\x95"); - QTest::newRow("qsTrId('\\u0181\\u01A1\\u0213\\u018F\\u018C', 10)") - << QString::fromLatin1("qsTrId('\\u0181\\u01A1\\u0213\\u018F\\u018C', 10)") << QString::fromUtf8("\x31\x30\x20\xc6\x92\xc6\xa1\xc7\x92\x28\xc8\x99\x29"); - QTest::newRow("qsTrId('\\u0181\\u01A1\\u0213\\u018F\\u018C')") - << QString::fromLatin1("qsTrId('\\u0181\\u01A1\\u0213\\u018F\\u018C')") << QString::fromUtf8("\xc6\x91\xc6\xb0\xc7\xb9"); - QTest::newRow("qsTrId('\\u01CD\\u0180\\u01A8\\u0190\\u019E\\u01AB')") - << QString::fromLatin1("qsTrId('\\u01CD\\u0180\\u01A8\\u0190\\u019E\\u01AB')") << QString::fromUtf8("\xc7\x8d\xc6\x80\xc6\xa8\xc6\x90\xc6\x9e\xc6\xab"); -} - -void tst_QJSEngine::translateScriptUnicodeIdBased() -{ - QFETCH(QString, expression); - QFETCH(QString, expectedTranslation); - - QScriptEngine engine; - - TranslationScope tranScope(":/translations/idtranslatable-unicode"); - engine.installTranslatorFunctions(); - - QCOMPARE(engine.evaluate(expression).toString(), expectedTranslation); - QVERIFY(!engine.hasUncaughtException()); -} - -void tst_QJSEngine::translateFromBuiltinCallback() -{ - QScriptEngine eng; - eng.installTranslatorFunctions(); - - // Callback has no translation context. - eng.evaluate("function foo() { qsTr('foo'); }"); - - // Stack at translation time will be: - // qsTr, foo, forEach, global - // qsTr() needs to walk to the outer-most (global) frame before it finds - // a translation context, and this should not crash. - eng.evaluate("[10,20].forEach(foo)", "script.js"); -} -#endif - -#if 0 // ###FIXME: No QScriptValue::scope API -void tst_QJSEngine::functionScopes() -{ - QScriptEngine eng; - { - // top-level functions have only the global object in their scope - QScriptValue fun = eng.evaluate("(function() {})"); - QVERIFY(fun.isCallable()); - QEXPECT_FAIL("", "QScriptValue::scope() is internal, not implemented", Abort); - QVERIFY(fun.scope().isObject()); - QVERIFY(fun.scope().strictlyEquals(eng.globalObject())); - QVERIFY(eng.globalObject().scope().isUndefined()); - } - { - QScriptValue fun = eng.globalObject().property("Object"); - QVERIFY(fun.isCallable()); - // native built-in functions don't have scope - QVERIFY(fun.scope().isUndefined()); - } - { - // closure - QScriptValue fun = eng.evaluate("(function(arg) { var foo = arg; return function() { return foo; }; })(123)"); - QVERIFY(fun.isCallable()); - { - QScriptValue ret = fun.call(); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 123); - } - QScriptValue scope = fun.scope(); - QVERIFY(scope.isObject()); - { - QScriptValue ret = scope.property("foo"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 123); - } - { - QScriptValue ret = scope.property("arg"); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 123); - } - - scope.setProperty("foo", 456); - { - QScriptValue ret = fun.call(); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 456); - } - - scope = scope.scope(); - QVERIFY(scope.isObject()); - QVERIFY(scope.strictlyEquals(eng.globalObject())); - } -} -#endif - -#if 0 // ###FIXME: No QScriptContext API -static QScriptValue counter_inner(QScriptContext *ctx, QScriptEngine *) -{ - QScriptValue outerAct = ctx->callee().scope(); - double count = outerAct.property("count").toNumber(); - outerAct.setProperty("count", count+1); - return count; -} - -static QScriptValue counter(QScriptContext *ctx, QScriptEngine *eng) -{ - QScriptValue act = ctx->activationObject(); - act.setProperty("count", ctx->argument(0).toInt()); - QScriptValue result = eng->newFunction(counter_inner); - result.setScope(act); - return result; -} - -static QScriptValue counter_hybrid(QScriptContext *ctx, QScriptEngine *eng) -{ - QScriptValue act = ctx->activationObject(); - act.setProperty("count", ctx->argument(0).toInt()); - return eng->evaluate("(function() { return count++; })"); -} - -void tst_QJSEngine::nativeFunctionScopes() -{ - QScriptEngine eng; - { - QScriptValue fun = eng.newFunction(counter); - QScriptValue cnt = fun.call(QScriptValueList() << 123); - QVERIFY(cnt.isCallable()); - { - QScriptValue ret = cnt.call(); - QVERIFY(ret.isNumber()); - QEXPECT_FAIL("", "QScriptValue::setScope not implemented", Continue); - QCOMPARE(ret.toInt(), 123); - } - } - { - QScriptValue fun = eng.newFunction(counter_hybrid); - QScriptValue cnt = fun.call(QScriptValueList() << 123); - QVERIFY(cnt.isCallable()); - { - QScriptValue ret = cnt.call(); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 123); - } - } - - //from http://doc.trolltech.com/latest/qtscript.html#nested-functions-and-the-scope-chain - { - QScriptEngine eng; - eng.evaluate("function counter() { var count = 0; return function() { return count++; } }\n" - "var c1 = counter(); var c2 = counter(); "); - QCOMPARE(eng.evaluate("c1()").toString(), QString::fromLatin1("0")); - QCOMPARE(eng.evaluate("c1()").toString(), QString::fromLatin1("1")); - QCOMPARE(eng.evaluate("c2()").toString(), QString::fromLatin1("0")); - QCOMPARE(eng.evaluate("c2()").toString(), QString::fromLatin1("1")); - QVERIFY(!eng.hasUncaughtException()); - } - { - QScriptEngine eng; - eng.globalObject().setProperty("counter", eng.newFunction(counter)); - eng.evaluate("var c1 = counter(); var c2 = counter(); "); - QCOMPARE(eng.evaluate("c1()").toString(), QString::fromLatin1("0")); - QEXPECT_FAIL("", "QScriptValue::setScope not implemented", Continue); - QCOMPARE(eng.evaluate("c1()").toString(), QString::fromLatin1("1")); - QCOMPARE(eng.evaluate("c2()").toString(), QString::fromLatin1("0")); - QEXPECT_FAIL("", "QScriptValue::setScope not implemented", Continue); - QCOMPARE(eng.evaluate("c2()").toString(), QString::fromLatin1("1")); - QVERIFY(!eng.hasUncaughtException()); - } - { - QScriptEngine eng; - eng.globalObject().setProperty("counter", eng.newFunction(counter_hybrid)); - eng.evaluate("var c1 = counter(); var c2 = counter(); "); - QCOMPARE(eng.evaluate("c1()").toString(), QString::fromLatin1("0")); - QCOMPARE(eng.evaluate("c1()").toString(), QString::fromLatin1("1")); - QCOMPARE(eng.evaluate("c2()").toString(), QString::fromLatin1("0")); - QCOMPARE(eng.evaluate("c2()").toString(), QString::fromLatin1("1")); - QVERIFY(!eng.hasUncaughtException()); - } -} -#endif - -#if 0 // ###FIXME: No QScriptProgram API -static QScriptValue createProgram(QScriptContext *ctx, QScriptEngine *eng) -{ - QString code = ctx->argument(0).toString(); - QScriptProgram result(code); - return qScriptValueFromValue(eng, result); -} - -void tst_QJSEngine::evaluateProgram() -{ - QScriptEngine eng; - - { - QString code("1 + 2"); - QString fileName("hello.js"); - int lineNumber(123); - QScriptProgram program(code, fileName, lineNumber); - QVERIFY(!program.isNull()); - QCOMPARE(program.sourceCode(), code); - QCOMPARE(program.fileName(), fileName); - QCOMPARE(program.firstLineNumber(), lineNumber); - - QScriptValue expected = eng.evaluate(code); - for (int x = 0; x < 10; ++x) { - QScriptValue ret = eng.evaluate(program); - QVERIFY(ret.equals(expected)); - } - - // operator= - QScriptProgram sameProgram = program; - QVERIFY(sameProgram == program); - QVERIFY(eng.evaluate(sameProgram).equals(expected)); - - // copy constructor - QScriptProgram sameProgram2(program); - QVERIFY(sameProgram2 == program); - QVERIFY(eng.evaluate(sameProgram2).equals(expected)); - - QScriptProgram differentProgram("2 + 3"); - QVERIFY(differentProgram != program); - QVERIFY(!eng.evaluate(differentProgram).equals(expected)); - } -} - -void tst_QJSEngine::evaluateProgram_customScope() -{ - QScriptEngine eng; - { - QScriptProgram program("a"); - QVERIFY(!program.isNull()); - { - QScriptValue ret = eng.evaluate(program); - QVERIFY(ret.isError()); - QCOMPARE(ret.toString(), QString::fromLatin1("ReferenceError: a is not defined")); - } - - QScriptValue obj = eng.newObject(); - obj.setProperty("a", 123); - QScriptContext *ctx = eng.currentContext(); - ctx->pushScope(obj); - { - QScriptValue ret = eng.evaluate(program); - QVERIFY(!ret.isError()); - QVERIFY(ret.equals(obj.property("a"))); - } - - obj.setProperty("a", QScriptValue()); - { - QScriptValue ret = eng.evaluate(program); - QVERIFY(ret.isError()); - } - - QScriptValue obj2 = eng.newObject(); - obj2.setProperty("a", 456); - ctx->pushScope(obj2); - { - QScriptValue ret = eng.evaluate(program); - QVERIFY(!ret.isError()); - QVERIFY(ret.equals(obj2.property("a"))); - } - - ctx->popScope(); - } -} - -void tst_QJSEngine::evaluateProgram_closure() -{ - QScriptEngine eng; - { - QScriptProgram program("(function() { var count = 0; return function() { return count++; }; })"); - QVERIFY(!program.isNull()); - QScriptValue createCounter = eng.evaluate(program); - QVERIFY(createCounter.isCallable()); - QScriptValue counter = createCounter.call(); - QVERIFY(counter.isCallable()); - { - QScriptValue ret = counter.call(); - QVERIFY(ret.isNumber()); - } - QScriptValue counter2 = createCounter.call(); - QVERIFY(counter2.isCallable()); - QVERIFY(!counter2.equals(counter)); - { - QScriptValue ret = counter2.call(); - QVERIFY(ret.isNumber()); - } - } -} - -void tst_QJSEngine::evaluateProgram_executeLater() -{ - QScriptEngine eng; - // Program created in a function call, then executed later - { - QScriptValue fun = eng.newFunction(createProgram); - QScriptProgram program = qscriptvalue_cast( - fun.call(QScriptValueList() << "a + 1")); - QVERIFY(!program.isNull()); - eng.globalObject().setProperty("a", QScriptValue()); - { - QScriptValue ret = eng.evaluate(program); - QVERIFY(ret.isError()); - QCOMPARE(ret.toString(), QString::fromLatin1("ReferenceError: a is not defined")); - } - eng.globalObject().setProperty("a", 122); - { - QScriptValue ret = eng.evaluate(program); - QVERIFY(!ret.isError()); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 123); - } - } -} - -void tst_QJSEngine::evaluateProgram_multipleEngines() -{ - QScriptEngine eng; - { - QString code("1 + 2"); - QScriptProgram program(code); - QVERIFY(!program.isNull()); - double expected = eng.evaluate(program).toNumber(); - for (int x = 0; x < 2; ++x) { - QScriptEngine eng2; - for (int y = 0; y < 2; ++y) { - double ret = eng2.evaluate(program).toNumber(); - QCOMPARE(ret, expected); - } - } - } -} - -void tst_QJSEngine::evaluateProgram_empty() -{ - QScriptEngine eng; - { - QScriptProgram program; - QVERIFY(program.isNull()); - QScriptValue ret = eng.evaluate(program); - QVERIFY(ret.isUndefined()); - } -} -#endif - -#if 0 // ###FIXME: No ScriptOwnership API -void tst_QJSEngine::collectGarbageAfterConnect() -{ - // QTBUG-6366 - QScriptEngine engine; - QPointer widget = new QWidget; - engine.globalObject().setProperty( - "widget", engine.newQObject(widget, QScriptEngine::ScriptOwnership)); - QVERIFY(engine.evaluate("widget.customContextMenuRequested.connect(\n" - " function() { print('hello'); }\n" - ");") - .isUndefined()); - QVERIFY(widget != 0); - engine.evaluate("widget = null;"); - // The connection should not keep the widget alive. - collectGarbage_helper(engine); - QVERIFY(widget == 0); -} -#endif - -#if 0 // ###FIXME: No QScriptContext API -void tst_QJSEngine::collectGarbageAfterNativeArguments() -{ - // QTBUG-17788 - QScriptEngine eng; - QScriptContext *ctx = eng.pushContext(); - QScriptValue arguments = ctx->argumentsObject(); - // Shouldn't crash when marking the arguments object. - collectGarbage_helper(eng); -} - -static QScriptValue constructQObjectFromThisObject(QScriptContext *ctx, QScriptEngine *eng) -{ - if (!ctx->isCalledAsConstructor()) { - qWarning("%s: ctx->isCalledAsConstructor() returned false", Q_FUNC_INFO); - return QScriptValue(); - } - return eng->newQObject(ctx->thisObject(), new QObject, QScriptEngine::ScriptOwnership); -} - -void tst_QJSEngine::promoteThisObjectToQObjectInConstructor() -{ - QScriptEngine engine; - QScriptValue ctor = engine.newFunction(constructQObjectFromThisObject); - engine.globalObject().setProperty("Ctor", ctor); - QScriptValue object = engine.evaluate("new Ctor"); - QVERIFY(!object.isError()); - QVERIFY(object.isQObject()); - QVERIFY(object.toQObject() != 0); - QVERIFY(object.property("objectName").isString()); - QVERIFY(object.property("deleteLater").isCallable()); -} -#endif - -static QRegExp minimal(QRegExp r) { r.setMinimal(true); return r; } - -void tst_QJSEngine::qRegExpInport_data() -{ - QTest::addColumn("rx"); - QTest::addColumn("string"); - QTest::addColumn("matched"); - - QTest::newRow("normal") << QRegExp("(test|foo)") << "test _ foo _ test _ Foo"; - QTest::newRow("normal2") << QRegExp("(Test|Foo)") << "test _ foo _ test _ Foo"; - QTest::newRow("case insensitive)") << QRegExp("(test|foo)", Qt::CaseInsensitive) << "test _ foo _ test _ Foo"; - QTest::newRow("case insensitive2)") << QRegExp("(Test|Foo)", Qt::CaseInsensitive) << "test _ foo _ test _ Foo"; - QTest::newRow("b(a*)(b*)") << QRegExp("b(a*)(b*)", Qt::CaseInsensitive) << "aaabbBbaAabaAaababaaabbaaab"; - QTest::newRow("greedy") << QRegExp("a*(a*)", Qt::CaseInsensitive, QRegExp::RegExp2) << "aaaabaaba"; - // this one will fail because we do not support the QRegExp::RegExp in JSC - //QTest::newRow("not_greedy") << QRegExp("a*(a*)", Qt::CaseInsensitive, QRegExp::RegExp) << "aaaabaaba"; - QTest::newRow("willcard") << QRegExp("*.txt", Qt::CaseSensitive, QRegExp::Wildcard) << "file.txt"; - QTest::newRow("willcard 2") << QRegExp("a?b.txt", Qt::CaseSensitive, QRegExp::Wildcard) << "ab.txt abb.rtc acb.txt"; - QTest::newRow("slash") << QRegExp("g/.*/s", Qt::CaseInsensitive, QRegExp::RegExp2) << "string/string/string"; - QTest::newRow("slash2") << QRegExp("g / .* / s", Qt::CaseInsensitive, QRegExp::RegExp2) << "string / string / string"; - QTest::newRow("fixed") << QRegExp("a*aa.a(ba)*a\\ba", Qt::CaseInsensitive, QRegExp::FixedString) << "aa*aa.a(ba)*a\\ba"; - QTest::newRow("fixed insensitive") << QRegExp("A*A", Qt::CaseInsensitive, QRegExp::FixedString) << "a*A A*a A*A a*a"; - QTest::newRow("fixed sensitive") << QRegExp("A*A", Qt::CaseSensitive, QRegExp::FixedString) << "a*A A*a A*A a*a"; - QTest::newRow("html") << QRegExp("(.*)", Qt::CaseSensitive, QRegExp::RegExp2) << "bolditalicbold"; - QTest::newRow("html minimal") << minimal(QRegExp("(.*)", Qt::CaseSensitive, QRegExp::RegExp2)) << "bolditalicbold"; - QTest::newRow("aaa") << QRegExp("a{2,5}") << "aAaAaaaaaAa"; - QTest::newRow("aaa minimal") << minimal(QRegExp("a{2,5}")) << "aAaAaaaaaAa"; - QTest::newRow("minimal") << minimal(QRegExp(".*\\} [*8]")) << "}?} ?} *"; - QTest::newRow(".? minimal") << minimal(QRegExp(".?")) << ".?"; - QTest::newRow(".+ minimal") << minimal(QRegExp(".+")) << ".+"; - QTest::newRow("[.?] minimal") << minimal(QRegExp("[.?]")) << ".?"; - QTest::newRow("[.+] minimal") << minimal(QRegExp("[.+]")) << ".+"; -} - -void tst_QJSEngine::qRegExpInport() -{ - QSKIP("Test failing - QTBUG-22238"); - QFETCH(QRegExp, rx); - QFETCH(QString, string); - - QJSEngine eng; - QJSValue rexp; - rexp = eng.toScriptValue(rx); - - QCOMPARE(rexp.isRegExp(), true); - QVERIFY(rexp.isCallable()); - - QJSValue func = eng.evaluate("(function(string, regexp) { return string.match(regexp); })"); - QJSValue result = func.call(QJSValueList() << string << rexp); - - rx.indexIn(string); - for (int i = 0; i <= rx.captureCount(); i++) { - QCOMPARE(result.property(i).toString(), rx.cap(i)); - } -} - -// QScriptValue::toDateTime() returns a local time, whereas JS dates -// are always stored as UTC. QtScript must respect the current time -// zone, and correctly adjust for daylight saving time that may be in -// effect at a given date (QTBUG-9770). -void tst_QJSEngine::dateRoundtripJSQtJS() -{ - uint secs = QDateTime(QDate(2009, 1, 1)).toUTC().toTime_t(); - QJSEngine eng; - for (int i = 0; i < 8000; ++i) { - QJSValue jsDate = eng.evaluate(QString::fromLatin1("new Date(%0)").arg(secs * 1000.0)); - QDateTime qtDate = jsDate.toDateTime(); - QJSValue jsDate2 = eng.toScriptValue(qtDate); - if (jsDate2.toNumber() != jsDate.toNumber()) - QFAIL(qPrintable(jsDate.toString())); - secs += 2*60*60; - } -} - -void tst_QJSEngine::dateRoundtripQtJSQt() -{ - QDateTime qtDate = QDateTime(QDate(2009, 1, 1)); - QJSEngine eng; - for (int i = 0; i < 8000; ++i) { - QJSValue jsDate = eng.toScriptValue(qtDate); - QDateTime qtDate2 = jsDate.toDateTime(); - if (qtDate2 != qtDate) - QFAIL(qPrintable(qtDate.toString())); - qtDate = qtDate.addSecs(2*60*60); - } -} - -void tst_QJSEngine::dateConversionJSQt() -{ - uint secs = QDateTime(QDate(2009, 1, 1)).toUTC().toTime_t(); - QJSEngine eng; - for (int i = 0; i < 8000; ++i) { - QJSValue jsDate = eng.evaluate(QString::fromLatin1("new Date(%0)").arg(secs * 1000.0)); - QDateTime qtDate = jsDate.toDateTime(); - QString qtUTCDateStr = qtDate.toUTC().toString(Qt::ISODate); - QString jsUTCDateStr = jsDate.property("toISOString").callWithInstance(jsDate).toString(); - jsUTCDateStr.remove(jsUTCDateStr.length() - 5, 4); // get rid of milliseconds (".000") - if (qtUTCDateStr != jsUTCDateStr) - QFAIL(qPrintable(jsDate.toString())); - secs += 2*60*60; - } -} - -void tst_QJSEngine::dateConversionQtJS() -{ - QDateTime qtDate = QDateTime(QDate(2009, 1, 1)); - QJSEngine eng; - for (int i = 0; i < 8000; ++i) { - QJSValue jsDate = eng.toScriptValue(qtDate); - QString jsUTCDateStr = jsDate.property("toISOString").callWithInstance(jsDate).toString(); - jsUTCDateStr.remove(jsUTCDateStr.length() - 5, 4); // get rid of milliseconds (".000") - QString qtUTCDateStr = qtDate.toUTC().toString(Qt::ISODate); - if (jsUTCDateStr != qtUTCDateStr) - QFAIL(qPrintable(qtDate.toString())); - qtDate = qtDate.addSecs(2*60*60); - } -} - -#if 0 // ###FIXME: No QScriptContext API -static QScriptValue createAnotherEngine(QScriptContext *, QScriptEngine *) -{ - QScriptEngine eng; - eng.evaluate("function foo(x, y) { return x + y; }" ); - eng.evaluate("hello = 5; world = 6" ); - return eng.evaluate("foo(hello,world)").toInt(); -} - - -void tst_QJSEngine::reentrency() -{ - QScriptEngine eng; - eng.globalObject().setProperty("foo", eng.newFunction(createAnotherEngine)); - eng.evaluate("function bar() { return foo(); } hello = 9; function getHello() { return hello; }"); - QCOMPARE(eng.evaluate("foo() + getHello() + foo()").toInt(), 5+6 + 9 + 5+6); - QCOMPARE(eng.evaluate("foo").call().toInt(), 5+6); - QCOMPARE(eng.evaluate("hello").toInt(), 9); - QCOMPARE(eng.evaluate("foo() + hello").toInt(), 5+6+9); -} -#endif - -#if 0 // ###FIXME: No QSCriptDeclarativeClass API -void tst_QJSEngine::newFixedStaticScopeObject() -{ - // "Static scope objects" is an optimization we do for QML. - // It enables the creation of JS objects that can guarantee to the - // compiler that no properties will be added or removed. This enables - // the compiler to generate a very simple (fast) property access, as - // opposed to a full virtual lookup. Due to the inherent use of scope - // chains in QML, this can make a huge difference (10x improvement for - // benchmark in QTBUG-8576). - // Ideally we would not need a special object type for this, and the - // VM would dynamically optimize it to be fast... - // See also QScriptEngine benchmark. - - QScriptEngine eng; - static const int propertyCount = 4; - QString names[] = { "foo", "bar", "baz", "Math" }; - QScriptValue values[] = { 123, "ciao", true, false }; - QScriptValue::PropertyFlags flags[] = { QScriptValue::Undeletable, - QScriptValue::ReadOnly | QScriptValue::Undeletable, - QScriptValue::SkipInEnumeration | QScriptValue::Undeletable, - QScriptValue::Undeletable }; - QScriptValue scope = QScriptDeclarativeClass::newStaticScopeObject(&eng, propertyCount, names, values, flags); - - // Query property. - for (int i = 0; i < propertyCount; ++i) { - for (int x = 0; x < 2; ++x) { - if (x) { - // Properties can't be deleted. - scope.setProperty(names[i], QScriptValue()); - } - QVERIFY(scope.property(names[i]).equals(values[i])); - } - } - - // Property that doesn't exist. - QVERIFY(scope.property("noSuchProperty").isUndefined()); - - // Write to writable property. - { - QScriptValue oldValue = scope.property("foo"); - QVERIFY(oldValue.isNumber()); - QScriptValue newValue = oldValue.toNumber() * 2; - scope.setProperty("foo", newValue); - QVERIFY(scope.property("foo").equals(newValue)); - scope.setProperty("foo", oldValue); - QVERIFY(scope.property("foo").equals(oldValue)); - } - - // Write to read-only property. - scope.setProperty("bar", 456); - QVERIFY(scope.property("bar").equals("ciao")); - - // Iterate. - { - QScriptValueIterator it(scope); - QSet iteratedNames; - while (it.hasNext()) { - it.next(); - iteratedNames.insert(it.name()); - } - for (int i = 0; i < propertyCount; ++i) - QVERIFY(iteratedNames.contains(names[i])); - } - - // Push it on the scope chain of a new context. - QScriptContext *ctx = eng.pushContext(); - ctx->pushScope(scope); - QCOMPARE(ctx->scopeChain().size(), 3); // Global Object, native activation, custom scope - QEXPECT_FAIL("", "activationObject has not been implemented yet", Continue); - QVERIFY(ctx->activationObject().equals(scope)); - - // Read property from JS. - for (int i = 0; i < propertyCount; ++i) { - for (int x = 0; x < 2; ++x) { - if (x) { - // Property can't be deleted from JS. - QScriptValue ret = eng.evaluate(QString::fromLatin1("delete %0").arg(names[i])); - QVERIFY(ret.equals(false)); - } - QVERIFY(eng.evaluate(names[i]).equals(values[i])); - } - } - - // Property that doesn't exist. - QVERIFY(eng.evaluate("noSuchProperty").equals("ReferenceError: noSuchProperty is not defined")); - - // Write property from JS. - { - QScriptValue oldValue = eng.evaluate("foo"); - QVERIFY(oldValue.isNumber()); - QScriptValue newValue = oldValue.toNumber() * 2; - QVERIFY(eng.evaluate("foo = foo * 2; foo").equals(newValue)); - scope.setProperty("foo", oldValue); - QVERIFY(eng.evaluate("foo").equals(oldValue)); - } - - // Write to read-only property. - QVERIFY(eng.evaluate("bar = 456; bar").equals("ciao")); - - // Create a closure and return properties from there. - { - QScriptValue props = eng.evaluate("(function() { var baz = 'shadow'; return [foo, bar, baz, Math, Array]; })()"); - QVERIFY(props.isArray()); - // "foo" and "bar" come from scope object. - QVERIFY(props.property(0).equals(scope.property("foo"))); - QVERIFY(props.property(1).equals(scope.property("bar"))); - // "baz" shadows property in scope object. - QVERIFY(props.property(2).equals("shadow")); - // "Math" comes from scope object, and shadows Global Object's "Math". - QVERIFY(props.property(3).equals(scope.property("Math"))); - QVERIFY(!props.property(3).equals(eng.globalObject().property("Math"))); - // "Array" comes from Global Object. - QVERIFY(props.property(4).equals(eng.globalObject().property("Array"))); - } - - // As with normal JS, assigning to an undefined variable will create - // the property on the Global Object, not the inner scope. - QVERIFY(eng.globalObject().property("newProperty").isUndefined()); - QVERIFY(eng.evaluate("(function() { newProperty = 789; })()").isUndefined()); - QVERIFY(!scope.property("newProperty").isUndefined()); - QVERIFY(eng.globalObject().property("newProperty").isNumber()); - - // Nested static scope. - { - static const int propertyCount2 = 2; - QString names2[] = { "foo", "hum" }; - QScriptValue values2[] = { 321, "hello" }; - QScriptValue::PropertyFlags flags2[] = { QScriptValue::Undeletable, - QScriptValue::ReadOnly | QScriptValue::Undeletable }; - QScriptValue scope2 = QScriptDeclarativeClass::newStaticScopeObject(&eng, propertyCount2, names2, values2, flags2); - ctx->pushScope(scope2); - - // "foo" shadows scope.foo. - QVERIFY(eng.evaluate("foo").equals(scope2.property("foo"))); - QVERIFY(!eng.evaluate("foo").equals(scope.property("foo"))); - // "hum" comes from scope2. - QVERIFY(eng.evaluate("hum").equals(scope2.property("hum"))); - // "Array" comes from Global Object. - QVERIFY(eng.evaluate("Array").equals(eng.globalObject().property("Array"))); - - ctx->popScope(); - } - - QScriptValue fun = eng.evaluate("(function() { return foo; })"); - QVERIFY(fun.isCallable()); - eng.popContext(); - // Function's scope chain persists after popContext(). - QVERIFY(fun.call().equals(scope.property("foo"))); -} - -void tst_QJSEngine::newGrowingStaticScopeObject() -{ - // The main use case for a growing static scope object is to set it as - // the activation object of a QScriptContext, so that all JS variable - // declarations end up in that object. It needs to be "growable" since - // we don't know in advance how many variables a script will declare. - - QScriptEngine eng; - QScriptValue scope = QScriptDeclarativeClass::newStaticScopeObject(&eng); - - // Initially empty. - QVERIFY(!QScriptValueIterator(scope).hasNext()); - QVERIFY(scope.property("foo").isUndefined()); - - // Add a static property. - scope.setProperty("foo", 123); - QVERIFY(scope.property("foo").equals(123)); - QEXPECT_FAIL("", "FIXME: newStaticScopeObject not properly implemented", Abort); - - // Modify existing property. - scope.setProperty("foo", 456); - QVERIFY(scope.property("foo").equals(456)); - - // Add a read-only property. - scope.setProperty("bar", "ciao", QScriptValue::ReadOnly); - QVERIFY(scope.property("bar").equals("ciao")); - - // Attempt to modify read-only property. - scope.setProperty("bar", "hello"); - QVERIFY(scope.property("bar").equals("ciao")); - - // Properties can't be deleted. - scope.setProperty("foo", QScriptValue()); - QVERIFY(scope.property("foo").equals(456)); - scope.setProperty("bar", QScriptValue()); - QVERIFY(scope.property("bar").equals("ciao")); - - // Iterate. - { - QScriptValueIterator it(scope); - QSet iteratedNames; - while (it.hasNext()) { - it.next(); - iteratedNames.insert(it.name()); - } - QCOMPARE(iteratedNames.size(), 2); - QVERIFY(iteratedNames.contains("foo")); - QVERIFY(iteratedNames.contains("bar")); - } - - // Push it on the scope chain of a new context. - QScriptContext *ctx = eng.pushContext(); - ctx->pushScope(scope); - QCOMPARE(ctx->scopeChain().size(), 3); // Global Object, native activation, custom scope - QVERIFY(ctx->activationObject().equals(scope)); - - // Read property from JS. - QVERIFY(eng.evaluate("foo").equals(scope.property("foo"))); - QVERIFY(eng.evaluate("bar").equals(scope.property("bar"))); - - // Write property from JS. - { - QScriptValue oldValue = eng.evaluate("foo"); - QVERIFY(oldValue.isNumber()); - QScriptValue newValue = oldValue.toNumber() * 2; - QVERIFY(eng.evaluate("foo = foo * 2; foo").equals(newValue)); - scope.setProperty("foo", oldValue); - QVERIFY(eng.evaluate("foo").equals(oldValue)); - } - - // Write to read-only property. - QVERIFY(eng.evaluate("bar = 456; bar").equals("ciao")); - - // Shadow property. - QVERIFY(eng.evaluate("Math").equals(eng.globalObject().property("Math"))); - scope.setProperty("Math", "fake Math"); - QVERIFY(eng.evaluate("Math").equals(scope.property("Math"))); - - // Variable declarations will create properties on the scope. - eng.evaluate("var baz = 456"); - QVERIFY(scope.property("baz").equals(456)); - - // Function declarations will create properties on the scope. - eng.evaluate("function fun() { return baz; }"); - QVERIFY(scope.property("fun").isCallable()); - QVERIFY(scope.property("fun").call().equals(scope.property("baz"))); - - // Demonstrate the limitation of a growable static scope: Once a function that - // uses the scope has been compiled, it won't pick up properties that are added - // to the scope later. - { - QScriptValue fun = eng.evaluate("(function() { return futureProperty; })"); - QVERIFY(fun.isCallable()); - QVERIFY(fun.call().toString().contains(QString::fromLatin1("ReferenceError"))); - scope.setProperty("futureProperty", "added after the function was compiled"); - // If scope were dynamic, this would return the new property. - QVERIFY(fun.call().toString().contains(QString::fromLatin1("ReferenceError"))); - } - - eng.popContext(); -} -#endif - -#if 0 // ###FIXME: No QScript MetaObject API -QT_BEGIN_NAMESPACE -Q_SCRIPT_DECLARE_QMETAOBJECT(QStandardItemModel, QObject*) -QT_END_NAMESPACE - -void tst_QJSEngine::scriptValueFromQMetaObject() -{ - QScriptEngine eng; - { - QScriptValue meta = eng.scriptValueFromQMetaObject(); - QVERIFY(meta.isQMetaObject()); - QCOMPARE(meta.toQMetaObject(), &QScriptEngine::staticMetaObject); - // Because of missing Q_SCRIPT_DECLARE_QMETAOBJECT() for QScriptEngine. - QEXPECT_FAIL("", "FIXME: because construct never returns invalid values", Continue); - QVERIFY(meta.callAsConstructor().isUndefined()); - } - { - QScriptValue meta = eng.scriptValueFromQMetaObject(); - QVERIFY(meta.isQMetaObject()); - QCOMPARE(meta.toQMetaObject(), &QStandardItemModel::staticMetaObject); - QScriptValue obj = meta.callAsConstructor(QScriptValueList() << eng.newQObject(&eng)); - QVERIFY(obj.isQObject()); - QStandardItemModel *model = qobject_cast(obj.toQObject()); - QVERIFY(model != 0); - QCOMPARE(model->parent(), (QObject*)&eng); - } -} -#endif - -void tst_QJSEngine::functionPrototypeExtensions() -{ - // QJS adds connect and disconnect properties to Function.prototype. - QJSEngine eng; - QJSValue funProto = eng.globalObject().property("Function").property("prototype"); - QVERIFY(funProto.isCallable()); - QVERIFY(funProto.property("connect").isCallable()); - QVERIFY(funProto.property("disconnect").isCallable()); - - // No properties should appear in for-in statements. - QJSValue props = eng.evaluate("props = []; for (var p in Function.prototype) props.push(p); props"); - QVERIFY(!eng.hasUncaughtException()); - QVERIFY(props.isArray()); - QCOMPARE(props.property("length").toInt(), 0); -} - -class ThreadedTestEngine : public QThread { - Q_OBJECT; - -public: - int result; - - ThreadedTestEngine() - : result(0) {} - - void run() { - QJSEngine firstEngine; - QJSEngine secondEngine; - QJSValue value = firstEngine.evaluate("1"); - result = secondEngine.evaluate("1 + " + QString::number(value.toInt())).toInt(); - } -}; - -void tst_QJSEngine::threadedEngine() -{ - ThreadedTestEngine thread1; - ThreadedTestEngine thread2; - thread1.start(); - thread2.start(); - thread1.wait(); - thread2.wait(); - QCOMPARE(thread1.result, 2); - QCOMPARE(thread2.result, 2); -} - -QTEST_MAIN(tst_QJSEngine) - -#include "tst_qjsengine.moc" - diff --git a/tests/auto/declarative/qjsvalue/qjsvalue.pro b/tests/auto/declarative/qjsvalue/qjsvalue.pro deleted file mode 100644 index 3b40e92e67..0000000000 --- a/tests/auto/declarative/qjsvalue/qjsvalue.pro +++ /dev/null @@ -1,6 +0,0 @@ -CONFIG += testcase -TARGET = tst_qjsvalue -macx:CONFIG -= app_bundle -QT += declarative widgets testlib -SOURCES += tst_qjsvalue.cpp -HEADERS += tst_qjsvalue.h diff --git a/tests/auto/declarative/qjsvalue/tst_qjsvalue.cpp b/tests/auto/declarative/qjsvalue/tst_qjsvalue.cpp deleted file mode 100644 index cec10ccf38..0000000000 --- a/tests/auto/declarative/qjsvalue/tst_qjsvalue.cpp +++ /dev/null @@ -1,3655 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "tst_qjsvalue.h" -#include - -QT_BEGIN_NAMESPACE -extern bool qt_script_isJITEnabled(); -QT_END_NAMESPACE - -tst_QJSValue::tst_QJSValue() - : engine(0) -{ -} - -tst_QJSValue::~tst_QJSValue() -{ - if (engine) - delete engine; -} - -void tst_QJSValue::ctor_invalid() -{ - QJSEngine eng; - { - QJSValue v; - QVERIFY(v.isUndefined()); - QCOMPARE(v.engine(), (QJSEngine *)0); - } -} - -void tst_QJSValue::ctor_undefinedWithEngine() -{ - QJSEngine eng; - { - QJSValue v = eng.toScriptValue(QVariant()); - QVERIFY(v.isUndefined()); - QCOMPARE(v.isObject(), false); - QCOMPARE(v.engine(), &eng); - } -} - -void tst_QJSValue::ctor_nullWithEngine() -{ - QJSEngine eng; - { - QJSValue v = eng.evaluate("null"); - QVERIFY(!v.isUndefined()); - QCOMPARE(v.isNull(), true); - QCOMPARE(v.isObject(), false); - QCOMPARE(v.engine(), &eng); - } -} - -void tst_QJSValue::ctor_boolWithEngine() -{ - QJSEngine eng; - { - QJSValue v = eng.toScriptValue(false); - QVERIFY(!v.isUndefined()); - QCOMPARE(v.isBool(), true); - QCOMPARE(v.isObject(), false); - QCOMPARE(v.toBool(), false); - QCOMPARE(v.engine(), &eng); - } -} - -void tst_QJSValue::ctor_intWithEngine() -{ - QJSEngine eng; - { - QJSValue v = eng.toScriptValue(int(1)); - QVERIFY(!v.isUndefined()); - QCOMPARE(v.isNumber(), true); - QCOMPARE(v.isObject(), false); - QCOMPARE(v.toNumber(), 1.0); - QCOMPARE(v.engine(), &eng); - } -} - -void tst_QJSValue::ctor_int() -{ - { - QJSValue v(int(0x43211234)); - QVERIFY(v.isNumber()); - QCOMPARE(v.toInt(), 0x43211234); - } - { - QJSValue v(int(1)); - QVERIFY(!v.isUndefined()); - QCOMPARE(v.isNumber(), true); - QCOMPARE(v.isObject(), false); - QCOMPARE(v.toNumber(), 1.0); - QCOMPARE(v.engine(), (QJSEngine *)0); - } -} - -void tst_QJSValue::ctor_uintWithEngine() -{ - QJSEngine eng; - { - QJSValue v = eng.toScriptValue(uint(1)); - QVERIFY(!v.isUndefined()); - QCOMPARE(v.isNumber(), true); - QCOMPARE(v.isObject(), false); - QCOMPARE(v.toNumber(), 1.0); - QCOMPARE(v.engine(), &eng); - } -} - -void tst_QJSValue::ctor_uint() -{ - { - QJSValue v(uint(0x43211234)); - QVERIFY(v.isNumber()); - QCOMPARE(v.toUInt(), uint(0x43211234)); - } - { - QJSValue v(uint(1)); - QVERIFY(!v.isUndefined()); - QCOMPARE(v.isNumber(), true); - QCOMPARE(v.isObject(), false); - QCOMPARE(v.toNumber(), 1.0); - QCOMPARE(v.engine(), (QJSEngine *)0); - } -} - -void tst_QJSValue::ctor_floatWithEngine() -{ - QJSEngine eng; - { - QJSValue v = eng.toScriptValue(float(1.0)); - QVERIFY(!v.isUndefined()); - QCOMPARE(v.isNumber(), true); - QCOMPARE(v.isObject(), false); - QCOMPARE(v.toNumber(), 1.0); - QCOMPARE(v.engine(), &eng); - } -} - -void tst_QJSValue::ctor_float() -{ - { - QJSValue v(12345678910.5); - QVERIFY(v.isNumber()); - QCOMPARE(v.toNumber(), 12345678910.5); - } - { - QJSValue v(1.0); - QVERIFY(!v.isUndefined()); - QCOMPARE(v.isNumber(), true); - QCOMPARE(v.isObject(), false); - QCOMPARE(v.toNumber(), 1.0); - QCOMPARE(v.engine(), (QJSEngine *)0); - } -} - -void tst_QJSValue::ctor_stringWithEngine() -{ - QJSEngine eng; - { - QJSValue v = eng.toScriptValue(QString::fromLatin1("ciao")); - QVERIFY(!v.isUndefined()); - QCOMPARE(v.isString(), true); - QCOMPARE(v.isObject(), false); - QCOMPARE(v.toString(), QLatin1String("ciao")); - QCOMPARE(v.engine(), &eng); - } -} - -void tst_QJSValue::ctor_string() -{ - { - QJSValue v(QString("ciao")); - QVERIFY(!v.isUndefined()); - QCOMPARE(v.isString(), true); - QCOMPARE(v.isObject(), false); - QCOMPARE(v.toString(), QLatin1String("ciao")); - QCOMPARE(v.engine(), (QJSEngine *)0); - } - { - QJSValue v("ciao"); - QVERIFY(!v.isUndefined()); - QCOMPARE(v.isString(), true); - QCOMPARE(v.isObject(), false); - QCOMPARE(v.toString(), QLatin1String("ciao")); - QCOMPARE(v.engine(), (QJSEngine *)0); - } -} - -void tst_QJSValue::ctor_copyAndAssignWithEngine() -{ - QJSEngine eng; - // copy constructor, operator= - { - QJSValue v = eng.toScriptValue(1.0); - QJSValue v2(v); - QCOMPARE(v2.strictlyEquals(v), true); - QCOMPARE(v2.engine(), &eng); - - QJSValue v3(v); - QCOMPARE(v3.strictlyEquals(v), true); - QCOMPARE(v3.strictlyEquals(v2), true); - QCOMPARE(v3.engine(), &eng); - - QJSValue v4 = eng.toScriptValue(2.0); - QCOMPARE(v4.strictlyEquals(v), false); - v3 = v4; - QCOMPARE(v3.strictlyEquals(v), false); - QCOMPARE(v3.strictlyEquals(v4), true); - - v2 = QJSValue(); - QCOMPARE(v2.strictlyEquals(v), false); - QCOMPARE(v.toNumber(), 1.0); - - QJSValue v5(v); - QCOMPARE(v5.strictlyEquals(v), true); - v = QJSValue(); - QCOMPARE(v5.strictlyEquals(v), false); - QCOMPARE(v5.toNumber(), 1.0); - } -} - -void tst_QJSValue::ctor_undefined() -{ - QJSValue v(QJSValue::UndefinedValue); - QVERIFY(v.isUndefined()); - QCOMPARE(v.isObject(), false); - QCOMPARE(v.engine(), (QJSEngine *)0); -} - -void tst_QJSValue::ctor_null() -{ - QJSValue v(QJSValue::NullValue); - QVERIFY(!v.isUndefined()); - QCOMPARE(v.isNull(), true); - QCOMPARE(v.isObject(), false); - QCOMPARE(v.engine(), (QJSEngine *)0); -} - -void tst_QJSValue::ctor_bool() -{ - QJSValue v(false); - QVERIFY(!v.isUndefined()); - QCOMPARE(v.isBool(), true); - QCOMPARE(v.isBool(), true); - QCOMPARE(v.isObject(), false); - QCOMPARE(v.toBool(), false); - QCOMPARE(v.engine(), (QJSEngine *)0); -} - -void tst_QJSValue::ctor_copyAndAssign() -{ - QJSValue v(1.0); - QJSValue v2(v); - QCOMPARE(v2.strictlyEquals(v), true); - QCOMPARE(v2.engine(), (QJSEngine *)0); - - QJSValue v3(v); - QCOMPARE(v3.strictlyEquals(v), true); - QCOMPARE(v3.strictlyEquals(v2), true); - QCOMPARE(v3.engine(), (QJSEngine *)0); - - QJSValue v4(2.0); - QCOMPARE(v4.strictlyEquals(v), false); - v3 = v4; - QCOMPARE(v3.strictlyEquals(v), false); - QCOMPARE(v3.strictlyEquals(v4), true); - - v2 = QJSValue(); - QCOMPARE(v2.strictlyEquals(v), false); - QCOMPARE(v.toNumber(), 1.0); - - QJSValue v5(v); - QCOMPARE(v5.strictlyEquals(v), true); - v = QJSValue(); - QCOMPARE(v5.strictlyEquals(v), false); - QCOMPARE(v5.toNumber(), 1.0); -} - -#if 0 // FIXME: No c-style callbacks currently -static QJSValue myFunction(QScriptContext *, QScriptEngine *eng) -{ - return eng->undefinedValue(); -} -#endif - -void tst_QJSValue::toString() -{ - QJSEngine eng; - - QJSValue undefined = eng.toScriptValue(QVariant()); - QCOMPARE(undefined.toString(), QString("undefined")); - QCOMPARE(qjsvalue_cast(undefined), QString()); - - QJSValue null = eng.evaluate("null"); - QCOMPARE(null.toString(), QString("null")); - QCOMPARE(qjsvalue_cast(null), QString()); - - { - QJSValue falskt = eng.toScriptValue(false); - QCOMPARE(falskt.toString(), QString("false")); - QCOMPARE(qjsvalue_cast(falskt), QString("false")); - - QJSValue sant = eng.toScriptValue(true); - QCOMPARE(sant.toString(), QString("true")); - QCOMPARE(qjsvalue_cast(sant), QString("true")); - } - { - QJSValue number = eng.toScriptValue(123); - QCOMPARE(number.toString(), QString("123")); - QCOMPARE(qjsvalue_cast(number), QString("123")); - } - { - QJSValue number = eng.toScriptValue(6.37e-8); - QCOMPARE(number.toString(), QString("6.37e-8")); - } - { - QJSValue number = eng.toScriptValue(-6.37e-8); - QCOMPARE(number.toString(), QString("-6.37e-8")); - - QJSValue str = eng.toScriptValue(QString("ciao")); - QCOMPARE(str.toString(), QString("ciao")); - QCOMPARE(qjsvalue_cast(str), QString("ciao")); - } - - QJSValue object = eng.newObject(); - QCOMPARE(object.toString(), QString("[object Object]")); - QCOMPARE(qjsvalue_cast(object), QString("[object Object]")); - - // FIXME: No c-style callbacks currently -#if 0 - QJSValue fun = eng.newFunction(myFunction); - QCOMPARE(fun.toString().simplified(), QString("function () { [native code] }")); - QCOMPARE(qscriptvalue_cast(fun).simplified(), QString("function () { [native code] }")); -#endif - - // toString() that throws exception - { - QJSValue objectObject = eng.evaluate( - "(function(){" - " o = { };" - " o.toString = function() { throw new Error('toString'); };" - " return o;" - "})()"); - QCOMPARE(objectObject.toString(), QLatin1String("Error: toString")); - QVERIFY(eng.hasUncaughtException()); - QCOMPARE(eng.uncaughtException().toString(), QLatin1String("Error: toString")); - } - { - eng.clearExceptions(); - QJSValue objectObject = eng.evaluate( - "(function(){" - " var f = function() {};" - " f.prototype = Date;" - " return new f;" - "})()"); - QVERIFY(!eng.hasUncaughtException()); - QVERIFY(objectObject.isObject()); - QCOMPARE(objectObject.toString(), QString::fromLatin1("TypeError: Function.prototype.toString is not generic")); - QVERIFY(eng.hasUncaughtException()); - eng.clearExceptions(); - } - - QJSValue inv = QJSValue(); - QCOMPARE(inv.toString(), QString::fromLatin1("undefined")); - - // V2 constructors - { - QJSValue falskt = QJSValue(false); - QCOMPARE(falskt.toString(), QString("false")); - QCOMPARE(qjsvalue_cast(falskt), QString("false")); - - QJSValue sant = QJSValue(true); - QCOMPARE(sant.toString(), QString("true")); - QCOMPARE(qjsvalue_cast(sant), QString("true")); - - QJSValue number = QJSValue(123); - QCOMPARE(number.toString(), QString("123")); - QCOMPARE(qjsvalue_cast(number), QString("123")); - - QJSValue number2(int(0x43211234)); - QCOMPARE(number2.toString(), QString("1126240820")); - - QJSValue str = QJSValue(QString("ciao")); - QCOMPARE(str.toString(), QString("ciao")); - QCOMPARE(qjsvalue_cast(str), QString("ciao")); - } - - // variant should use internal valueOf(), then fall back to QVariant::toString(), - // then fall back to "QVariant(typename)" - QJSValue variant = eng.toScriptValue(QPoint(10, 20)); - QVERIFY(variant.isVariant()); - QCOMPARE(variant.toString(), QString::fromLatin1("QVariant(QPoint)")); - variant = eng.toScriptValue(QUrl()); - QVERIFY(variant.isVariant()); - QVERIFY(variant.toString().isEmpty()); -} - -void tst_QJSValue::toNumber() -{ - QJSEngine eng; - - QJSValue undefined = eng.toScriptValue(QVariant()); - QCOMPARE(qIsNaN(undefined.toNumber()), true); - QCOMPARE(qIsNaN(qjsvalue_cast(undefined)), true); - - QJSValue null = eng.evaluate("null"); - QCOMPARE(null.toNumber(), 0.0); - QCOMPARE(qjsvalue_cast(null), 0.0); - - { - QJSValue falskt = eng.toScriptValue(false); - QCOMPARE(falskt.toNumber(), 0.0); - QCOMPARE(qjsvalue_cast(falskt), 0.0); - - QJSValue sant = eng.toScriptValue(true); - QCOMPARE(sant.toNumber(), 1.0); - QCOMPARE(qjsvalue_cast(sant), 1.0); - - QJSValue number = eng.toScriptValue(123.0); - QCOMPARE(number.toNumber(), 123.0); - QCOMPARE(qjsvalue_cast(number), 123.0); - - QJSValue str = eng.toScriptValue(QString("ciao")); - QCOMPARE(qIsNaN(str.toNumber()), true); - QCOMPARE(qIsNaN(qjsvalue_cast(str)), true); - - QJSValue str2 = eng.toScriptValue(QString("123")); - QCOMPARE(str2.toNumber(), 123.0); - QCOMPARE(qjsvalue_cast(str2), 123.0); - } - - QJSValue object = eng.newObject(); - QCOMPARE(qIsNaN(object.toNumber()), true); - QCOMPARE(qIsNaN(qjsvalue_cast(object)), true); - - // FIXME: No c-style callbacks currently -#if 0 - QJSValue fun = eng.newFunction(myFunction); - QCOMPARE(qIsNaN(fun.toNumber()), true); - QCOMPARE(qIsNaN(qscriptvalue_cast(fun)), true); -#endif - - QJSValue inv = QJSValue(); - QVERIFY(qIsNaN(inv.toNumber())); - QVERIFY(qIsNaN(qjsvalue_cast(inv))); - - // V2 constructors - { - QJSValue falskt = QJSValue(false); - QCOMPARE(falskt.toNumber(), 0.0); - QCOMPARE(qjsvalue_cast(falskt), 0.0); - - QJSValue sant = QJSValue(true); - QCOMPARE(sant.toNumber(), 1.0); - QCOMPARE(qjsvalue_cast(sant), 1.0); - - QJSValue number = QJSValue(123.0); - QCOMPARE(number.toNumber(), 123.0); - QCOMPARE(qjsvalue_cast(number), 123.0); - - QJSValue number2(int(0x43211234)); - QCOMPARE(number2.toNumber(), 1126240820.0); - - QJSValue str = QJSValue(QString("ciao")); - QCOMPARE(qIsNaN(str.toNumber()), true); - QCOMPARE(qIsNaN(qjsvalue_cast(str)), true); - - QJSValue str2 = QJSValue(QString("123")); - QCOMPARE(str2.toNumber(), 123.0); - QCOMPARE(qjsvalue_cast(str2), 123.0); - } -} - -void tst_QJSValue::toBoolean() // deprecated -{ - QJSEngine eng; - - QJSValue undefined = eng.toScriptValue(QVariant()); - QCOMPARE(undefined.toBool(), false); - QCOMPARE(qjsvalue_cast(undefined), false); - - QJSValue null = eng.evaluate("null"); - QCOMPARE(null.toBool(), false); - QCOMPARE(qjsvalue_cast(null), false); - - { - QJSValue falskt = eng.toScriptValue(false); - QCOMPARE(falskt.toBool(), false); - QCOMPARE(qjsvalue_cast(falskt), false); - - QJSValue sant = eng.toScriptValue(true); - QCOMPARE(sant.toBool(), true); - QCOMPARE(qjsvalue_cast(sant), true); - - QJSValue number = eng.toScriptValue(0.0); - QCOMPARE(number.toBool(), false); - QCOMPARE(qjsvalue_cast(number), false); - - QJSValue number2 = eng.toScriptValue(qSNaN()); - QCOMPARE(number2.toBool(), false); - QCOMPARE(qjsvalue_cast(number2), false); - - QJSValue number3 = eng.toScriptValue(123.0); - QCOMPARE(number3.toBool(), true); - QCOMPARE(qjsvalue_cast(number3), true); - - QJSValue number4 = eng.toScriptValue(-456.0); - QCOMPARE(number4.toBool(), true); - QCOMPARE(qjsvalue_cast(number4), true); - - QJSValue str = eng.toScriptValue(QString("")); - QCOMPARE(str.toBool(), false); - QCOMPARE(qjsvalue_cast(str), false); - - QJSValue str2 = eng.toScriptValue(QString("123")); - QCOMPARE(str2.toBool(), true); - QCOMPARE(qjsvalue_cast(str2), true); - } - - QJSValue object = eng.newObject(); - QCOMPARE(object.toBool(), true); - QCOMPARE(qjsvalue_cast(object), true); - - // FIXME: No c-style callbacks currently -#if 0 - QJSValue fun = eng.newFunction(myFunction); - QCOMPARE(fun.toBoolean(), true); - QCOMPARE(qscriptvalue_cast(fun), true); -#endif - - QJSValue inv = QJSValue(); - QCOMPARE(inv.toBool(), false); - QCOMPARE(qjsvalue_cast(inv), false); - - // V2 constructors - { - QJSValue falskt = QJSValue(false); - QCOMPARE(falskt.toBool(), false); - QCOMPARE(qjsvalue_cast(falskt), false); - - QJSValue sant = QJSValue(true); - QCOMPARE(sant.toBool(), true); - QCOMPARE(qjsvalue_cast(sant), true); - - QJSValue number = QJSValue(0.0); - QCOMPARE(number.toBool(), false); - QCOMPARE(qjsvalue_cast(number), false); - - QJSValue number2 = QJSValue(qSNaN()); - QCOMPARE(number2.toBool(), false); - QCOMPARE(qjsvalue_cast(number2), false); - - QJSValue number3 = QJSValue(123.0); - QCOMPARE(number3.toBool(), true); - QCOMPARE(qjsvalue_cast(number3), true); - - QJSValue number4 = QJSValue(-456.0); - QCOMPARE(number4.toBool(), true); - QCOMPARE(qjsvalue_cast(number4), true); - - QJSValue number5 = QJSValue(0x43211234); - QCOMPARE(number5.toBool(), true); - - QJSValue str = QJSValue(QString("")); - QCOMPARE(str.toBool(), false); - QCOMPARE(qjsvalue_cast(str), false); - - QJSValue str2 = QJSValue(QString("123")); - QCOMPARE(str2.toBool(), true); - QCOMPARE(qjsvalue_cast(str2), true); - } -} - -void tst_QJSValue::toBool() -{ - QJSEngine eng; - - QJSValue undefined = eng.toScriptValue(QVariant()); - QCOMPARE(undefined.toBool(), false); - QCOMPARE(qjsvalue_cast(undefined), false); - - QJSValue null = eng.evaluate("null"); - QCOMPARE(null.toBool(), false); - QCOMPARE(qjsvalue_cast(null), false); - - { - QJSValue falskt = eng.toScriptValue(false); - QCOMPARE(falskt.toBool(), false); - QCOMPARE(qjsvalue_cast(falskt), false); - - QJSValue sant = eng.toScriptValue(true); - QCOMPARE(sant.toBool(), true); - QCOMPARE(qjsvalue_cast(sant), true); - - QJSValue number = eng.toScriptValue(0.0); - QCOMPARE(number.toBool(), false); - QCOMPARE(qjsvalue_cast(number), false); - - QJSValue number2 = eng.toScriptValue(qSNaN()); - QCOMPARE(number2.toBool(), false); - QCOMPARE(qjsvalue_cast(number2), false); - - QJSValue number3 = eng.toScriptValue(123.0); - QCOMPARE(number3.toBool(), true); - QCOMPARE(qjsvalue_cast(number3), true); - - QJSValue number4 = eng.toScriptValue(-456.0); - QCOMPARE(number4.toBool(), true); - QCOMPARE(qjsvalue_cast(number4), true); - - QJSValue str = eng.toScriptValue(QString("")); - QCOMPARE(str.toBool(), false); - QCOMPARE(qjsvalue_cast(str), false); - - QJSValue str2 = eng.toScriptValue(QString("123")); - QCOMPARE(str2.toBool(), true); - QCOMPARE(qjsvalue_cast(str2), true); - } - - QJSValue object = eng.newObject(); - QCOMPARE(object.toBool(), true); - QCOMPARE(qjsvalue_cast(object), true); - - // FIXME: No c-style callbacks currently -#if 0 - QJSValue fun = eng.newFunction(myFunction); - QCOMPARE(fun.toBool(), true); - QCOMPARE(qscriptvalue_cast(fun), true); -#endif - - QJSValue inv = QJSValue(); - QCOMPARE(inv.toBool(), false); - QCOMPARE(qjsvalue_cast(inv), false); - - // V2 constructors - { - QJSValue falskt = QJSValue(false); - QCOMPARE(falskt.toBool(), false); - QCOMPARE(qjsvalue_cast(falskt), false); - - QJSValue sant = QJSValue(true); - QCOMPARE(sant.toBool(), true); - QCOMPARE(qjsvalue_cast(sant), true); - - QJSValue number = QJSValue(0.0); - QCOMPARE(number.toBool(), false); - QCOMPARE(qjsvalue_cast(number), false); - - QJSValue number2 = QJSValue(qSNaN()); - QCOMPARE(number2.toBool(), false); - QCOMPARE(qjsvalue_cast(number2), false); - - QJSValue number3 = QJSValue(123.0); - QCOMPARE(number3.toBool(), true); - QCOMPARE(qjsvalue_cast(number3), true); - - QJSValue number4 = QJSValue(-456.0); - QCOMPARE(number4.toBool(), true); - QCOMPARE(qjsvalue_cast(number4), true); - - QJSValue number5 = QJSValue(0x43211234); - QCOMPARE(number5.toBool(), true); - - QJSValue str = QJSValue(QString("")); - QCOMPARE(str.toBool(), false); - QCOMPARE(qjsvalue_cast(str), false); - - QJSValue str2 = QJSValue(QString("123")); - QCOMPARE(str2.toBool(), true); - QCOMPARE(qjsvalue_cast(str2), true); - } -} - -void tst_QJSValue::toInt() -{ - QJSEngine eng; - - { - QJSValue zer0 = eng.toScriptValue(0.0); - QCOMPARE(zer0.toInt(), 0); - QCOMPARE(qjsvalue_cast(zer0), 0); - - QJSValue number = eng.toScriptValue(123.0); - QCOMPARE(number.toInt(), 123); - QCOMPARE(qjsvalue_cast(number), 123); - - QJSValue number2 = eng.toScriptValue(qSNaN()); - QCOMPARE(number2.toInt(), 0); - QCOMPARE(qjsvalue_cast(number2), 0); - - QJSValue number3 = eng.toScriptValue(+qInf()); - QCOMPARE(number3.toInt(), 0); - QCOMPARE(qjsvalue_cast(number3), 0); - - QJSValue number3_2 = eng.toScriptValue(-qInf()); - QCOMPARE(number3_2.toInt(), 0); - QCOMPARE(qjsvalue_cast(number3_2), 0); - - QJSValue number4 = eng.toScriptValue(0.5); - QCOMPARE(number4.toInt(), 0); - QCOMPARE(qjsvalue_cast(number4), 0); - - QJSValue number5 = eng.toScriptValue(123.5); - QCOMPARE(number5.toInt(), 123); - QCOMPARE(qjsvalue_cast(number5), 123); - - QJSValue number6 = eng.toScriptValue(-456.5); - QCOMPARE(number6.toInt(), -456); - QCOMPARE(qjsvalue_cast(number6), -456); - - QJSValue str = eng.toScriptValue(QString::fromLatin1("123.0")); - QCOMPARE(str.toInt(), 123); - QCOMPARE(qjsvalue_cast(str), 123); - - QJSValue str2 = eng.toScriptValue(QString::fromLatin1("NaN")); - QCOMPARE(str2.toInt(), 0); - QCOMPARE(qjsvalue_cast(str2), 0); - - QJSValue str3 = eng.toScriptValue(QString::fromLatin1("Infinity")); - QCOMPARE(str3.toInt(), 0); - QCOMPARE(qjsvalue_cast(str3), 0); - - QJSValue str3_2 = eng.toScriptValue(QString::fromLatin1("-Infinity")); - QCOMPARE(str3_2.toInt(), 0); - QCOMPARE(qjsvalue_cast(str3_2), 0); - - QJSValue str4 = eng.toScriptValue(QString::fromLatin1("0.5")); - QCOMPARE(str4.toInt(), 0); - QCOMPARE(qjsvalue_cast(str4), 0); - - QJSValue str5 = eng.toScriptValue(QString::fromLatin1("123.5")); - QCOMPARE(str5.toInt(), 123); - QCOMPARE(qjsvalue_cast(str5), 123); - - QJSValue str6 = eng.toScriptValue(QString::fromLatin1("-456.5")); - QCOMPARE(str6.toInt(), -456); - QCOMPARE(qjsvalue_cast(str6), -456); - } - // V2 constructors - { - QJSValue zer0 = QJSValue(0.0); - QCOMPARE(zer0.toInt(), 0); - QCOMPARE(qjsvalue_cast(zer0), 0); - - QJSValue number = QJSValue(123.0); - QCOMPARE(number.toInt(), 123); - QCOMPARE(qjsvalue_cast(number), 123); - - QJSValue number2 = QJSValue(qSNaN()); - QCOMPARE(number2.toInt(), 0); - QCOMPARE(qjsvalue_cast(number2), 0); - - QJSValue number3 = QJSValue(+qInf()); - QCOMPARE(number3.toInt(), 0); - QCOMPARE(qjsvalue_cast(number3), 0); - - QJSValue number3_2 = QJSValue(-qInf()); - QCOMPARE(number3_2.toInt(), 0); - QCOMPARE(qjsvalue_cast(number3_2), 0); - - QJSValue number4 = QJSValue(0.5); - QCOMPARE(number4.toInt(), 0); - QCOMPARE(qjsvalue_cast(number4), 0); - - QJSValue number5 = QJSValue(123.5); - QCOMPARE(number5.toInt(), 123); - QCOMPARE(qjsvalue_cast(number5), 123); - - QJSValue number6 = QJSValue(-456.5); - QCOMPARE(number6.toInt(), -456); - QCOMPARE(qjsvalue_cast(number6), -456); - - QJSValue number7 = QJSValue(0x43211234); - QCOMPARE(number7.toInt(), 0x43211234); - - QJSValue str = QJSValue("123.0"); - QCOMPARE(str.toInt(), 123); - QCOMPARE(qjsvalue_cast(str), 123); - - QJSValue str2 = QJSValue("NaN"); - QCOMPARE(str2.toInt(), 0); - QCOMPARE(qjsvalue_cast(str2), 0); - - QJSValue str3 = QJSValue("Infinity"); - QCOMPARE(str3.toInt(), 0); - QCOMPARE(qjsvalue_cast(str3), 0); - - QJSValue str3_2 = QJSValue("-Infinity"); - QCOMPARE(str3_2.toInt(), 0); - QCOMPARE(qjsvalue_cast(str3_2), 0); - - QJSValue str4 = QJSValue("0.5"); - QCOMPARE(str4.toInt(), 0); - QCOMPARE(qjsvalue_cast(str4), 0); - - QJSValue str5 = QJSValue("123.5"); - QCOMPARE(str5.toInt(), 123); - QCOMPARE(qjsvalue_cast(str5), 123); - - QJSValue str6 = QJSValue("-456.5"); - QCOMPARE(str6.toInt(), -456); - QCOMPARE(qjsvalue_cast(str6), -456); - } - - QJSValue inv; - QCOMPARE(inv.toInt(), 0); - QCOMPARE(qjsvalue_cast(inv), 0); -} - -void tst_QJSValue::toUInt() -{ - QJSEngine eng; - - { - QJSValue zer0 = eng.toScriptValue(0.0); - QCOMPARE(zer0.toUInt(), quint32(0)); - QCOMPARE(qjsvalue_cast(zer0), quint32(0)); - - QJSValue number = eng.toScriptValue(123.0); - QCOMPARE(number.toUInt(), quint32(123)); - QCOMPARE(qjsvalue_cast(number), quint32(123)); - - QJSValue number2 = eng.toScriptValue(qSNaN()); - QCOMPARE(number2.toUInt(), quint32(0)); - QCOMPARE(qjsvalue_cast(number2), quint32(0)); - - QJSValue number3 = eng.toScriptValue(+qInf()); - QCOMPARE(number3.toUInt(), quint32(0)); - QCOMPARE(qjsvalue_cast(number3), quint32(0)); - - QJSValue number3_2 = eng.toScriptValue(-qInf()); - QCOMPARE(number3_2.toUInt(), quint32(0)); - QCOMPARE(qjsvalue_cast(number3_2), quint32(0)); - - QJSValue number4 = eng.toScriptValue(0.5); - QCOMPARE(number4.toUInt(), quint32(0)); - - QJSValue number5 = eng.toScriptValue(123.5); - QCOMPARE(number5.toUInt(), quint32(123)); - - QJSValue number6 = eng.toScriptValue(-456.5); - QCOMPARE(number6.toUInt(), quint32(-456)); - QCOMPARE(qjsvalue_cast(number6), quint32(-456)); - - QJSValue str = eng.toScriptValue(QString::fromLatin1("123.0")); - QCOMPARE(str.toUInt(), quint32(123)); - QCOMPARE(qjsvalue_cast(str), quint32(123)); - - QJSValue str2 = eng.toScriptValue(QString::fromLatin1("NaN")); - QCOMPARE(str2.toUInt(), quint32(0)); - QCOMPARE(qjsvalue_cast(str2), quint32(0)); - - QJSValue str3 = eng.toScriptValue(QString::fromLatin1("Infinity")); - QCOMPARE(str3.toUInt(), quint32(0)); - QCOMPARE(qjsvalue_cast(str3), quint32(0)); - - QJSValue str3_2 = eng.toScriptValue(QString::fromLatin1("-Infinity")); - QCOMPARE(str3_2.toUInt(), quint32(0)); - QCOMPARE(qjsvalue_cast(str3_2), quint32(0)); - - QJSValue str4 = eng.toScriptValue(QString::fromLatin1("0.5")); - QCOMPARE(str4.toUInt(), quint32(0)); - QCOMPARE(qjsvalue_cast(str4), quint32(0)); - - QJSValue str5 = eng.toScriptValue(QString::fromLatin1("123.5")); - QCOMPARE(str5.toUInt(), quint32(123)); - QCOMPARE(qjsvalue_cast(str5), quint32(123)); - - QJSValue str6 = eng.toScriptValue(QString::fromLatin1("-456.5")); - QCOMPARE(str6.toUInt(), quint32(-456)); - QCOMPARE(qjsvalue_cast(str6), quint32(-456)); - } - // V2 constructors - { - QJSValue zer0 = QJSValue(0.0); - QCOMPARE(zer0.toUInt(), quint32(0)); - QCOMPARE(qjsvalue_cast(zer0), quint32(0)); - - QJSValue number = QJSValue(123.0); - QCOMPARE(number.toUInt(), quint32(123)); - QCOMPARE(qjsvalue_cast(number), quint32(123)); - - QJSValue number2 = QJSValue(qSNaN()); - QCOMPARE(number2.toUInt(), quint32(0)); - QCOMPARE(qjsvalue_cast(number2), quint32(0)); - - QJSValue number3 = QJSValue(+qInf()); - QCOMPARE(number3.toUInt(), quint32(0)); - QCOMPARE(qjsvalue_cast(number3), quint32(0)); - - QJSValue number3_2 = QJSValue(-qInf()); - QCOMPARE(number3_2.toUInt(), quint32(0)); - QCOMPARE(qjsvalue_cast(number3_2), quint32(0)); - - QJSValue number4 = QJSValue(0.5); - QCOMPARE(number4.toUInt(), quint32(0)); - - QJSValue number5 = QJSValue(123.5); - QCOMPARE(number5.toUInt(), quint32(123)); - - QJSValue number6 = QJSValue(-456.5); - QCOMPARE(number6.toUInt(), quint32(-456)); - QCOMPARE(qjsvalue_cast(number6), quint32(-456)); - - QJSValue number7 = QJSValue(0x43211234); - QCOMPARE(number7.toUInt(), quint32(0x43211234)); - - QJSValue str = QJSValue(QLatin1String("123.0")); - QCOMPARE(str.toUInt(), quint32(123)); - QCOMPARE(qjsvalue_cast(str), quint32(123)); - - QJSValue str2 = QJSValue(QLatin1String("NaN")); - QCOMPARE(str2.toUInt(), quint32(0)); - QCOMPARE(qjsvalue_cast(str2), quint32(0)); - - QJSValue str3 = QJSValue(QLatin1String("Infinity")); - QCOMPARE(str3.toUInt(), quint32(0)); - QCOMPARE(qjsvalue_cast(str3), quint32(0)); - - QJSValue str3_2 = QJSValue(QLatin1String("-Infinity")); - QCOMPARE(str3_2.toUInt(), quint32(0)); - QCOMPARE(qjsvalue_cast(str3_2), quint32(0)); - - QJSValue str4 = QJSValue(QLatin1String("0.5")); - QCOMPARE(str4.toUInt(), quint32(0)); - QCOMPARE(qjsvalue_cast(str4), quint32(0)); - - QJSValue str5 = QJSValue(QLatin1String("123.5")); - QCOMPARE(str5.toUInt(), quint32(123)); - QCOMPARE(qjsvalue_cast(str5), quint32(123)); - - QJSValue str6 = QJSValue(QLatin1String("-456.5")); - QCOMPARE(str6.toUInt(), quint32(-456)); - QCOMPARE(qjsvalue_cast(str6), quint32(-456)); - } - - QJSValue inv; - QCOMPARE(inv.toUInt(), quint32(0)); - QCOMPARE(qjsvalue_cast(inv), quint32(0)); -} - -#if defined Q_CC_MSVC && _MSC_VER < 1300 -Q_DECLARE_METATYPE(QVariant) -#endif - -void tst_QJSValue::toVariant() -{ - QJSEngine eng; - - QJSValue undefined = eng.toScriptValue(QVariant()); - QCOMPARE(undefined.toVariant(), QVariant()); - QCOMPARE(qjsvalue_cast(undefined), QVariant()); - - QJSValue null = eng.evaluate("null"); - QCOMPARE(null.toVariant(), QVariant()); - QCOMPARE(qjsvalue_cast(null), QVariant()); - - { - QJSValue number = eng.toScriptValue(123.0); - QCOMPARE(number.toVariant(), QVariant(123.0)); - QCOMPARE(qjsvalue_cast(number), QVariant(123.0)); - - QJSValue intNumber = eng.toScriptValue((qint32)123); - QCOMPARE(intNumber.toVariant().type(), QVariant((qint32)123).type()); - QCOMPARE((qjsvalue_cast(number)).type(), QVariant((qint32)123).type()); - - QJSValue falskt = eng.toScriptValue(false); - QCOMPARE(falskt.toVariant(), QVariant(false)); - QCOMPARE(qjsvalue_cast(falskt), QVariant(false)); - - QJSValue sant = eng.toScriptValue(true); - QCOMPARE(sant.toVariant(), QVariant(true)); - QCOMPARE(qjsvalue_cast(sant), QVariant(true)); - - QJSValue str = eng.toScriptValue(QString("ciao")); - QCOMPARE(str.toVariant(), QVariant(QString("ciao"))); - QCOMPARE(qjsvalue_cast(str), QVariant(QString("ciao"))); - } - - QJSValue object = eng.newObject(); - QCOMPARE(object.toVariant(), QVariant(QVariantMap())); - - QJSValue qobject = eng.newQObject(this); - { - QVariant var = qobject.toVariant(); - QCOMPARE(var.userType(), int(QMetaType::QObjectStar)); - QCOMPARE(qVariantValue(var), (QObject *)this); - } - - { - QDateTime dateTime = QDateTime(QDate(1980, 10, 4)); - QJSValue dateObject = eng.toScriptValue(dateTime); - QVariant var = dateObject.toVariant(); - QCOMPARE(var, QVariant(dateTime)); - } - - { - QRegExp rx = QRegExp("[0-9a-z]+", Qt::CaseSensitive, QRegExp::RegExp2); - QJSValue rxObject = eng.toScriptValue(rx); - QVERIFY(rxObject.isRegExp()); - QVariant var = rxObject.toVariant(); - QCOMPARE(var, QVariant(rx)); - } - - QJSValue inv; - QCOMPARE(inv.toVariant(), QVariant()); - QCOMPARE(qjsvalue_cast(inv), QVariant()); - - // V2 constructors - { - QJSValue number = QJSValue(123.0); - QCOMPARE(number.toVariant(), QVariant(123.0)); - QCOMPARE(qjsvalue_cast(number), QVariant(123.0)); - - QJSValue falskt = QJSValue(false); - QCOMPARE(falskt.toVariant(), QVariant(false)); - QCOMPARE(qjsvalue_cast(falskt), QVariant(false)); - - QJSValue sant = QJSValue(true); - QCOMPARE(sant.toVariant(), QVariant(true)); - QCOMPARE(qjsvalue_cast(sant), QVariant(true)); - - QJSValue str = QJSValue(QString("ciao")); - QCOMPARE(str.toVariant(), QVariant(QString("ciao"))); - QCOMPARE(qjsvalue_cast(str), QVariant(QString("ciao"))); - } - -#if 0 // FIXME: No automatic sequence conversion - // array - { - QVariantList listIn; - listIn << 123 << "hello"; - QJSValue array = qScriptValueFromValue(&eng, listIn); - QVERIFY(array.isArray()); - QCOMPARE(array.property("length").toInt(), 2); - QVariant ret = array.toVariant(); - QCOMPARE(ret.type(), QVariant::List); - QVariantList listOut = ret.toList(); - QCOMPARE(listOut.size(), listIn.size()); - for (int i = 0; i < listIn.size(); ++i) - QVERIFY(listOut.at(i) == listIn.at(i)); - // round-trip conversion - QJSValue array2 = qScriptValueFromValue(&eng, ret); - QVERIFY(array2.isArray()); - QCOMPARE(array2.property("length").toInt(), array.property("length").toInt()); - for (int i = 0; i < array.property("length").toInt(); ++i) - QVERIFY(array2.property(i).strictlyEquals(array.property(i))); - } -#endif -} - -void tst_QJSValue::toQObject_nonQObject_data() -{ - newEngine(); - QTest::addColumn("value"); - - QTest::newRow("invalid") << QJSValue(); - QTest::newRow("bool(false)") << QJSValue(false); - QTest::newRow("bool(true)") << QJSValue(true); - QTest::newRow("int") << QJSValue(123); - QTest::newRow("string") << QJSValue(QString::fromLatin1("ciao")); - QTest::newRow("undefined") << QJSValue(QJSValue::UndefinedValue); - QTest::newRow("null") << QJSValue(QJSValue::NullValue); - - QTest::newRow("bool bound(false)") << engine->toScriptValue(false); - QTest::newRow("bool bound(true)") << engine->toScriptValue(true); - QTest::newRow("int bound") << engine->toScriptValue(123); - QTest::newRow("string bound") << engine->toScriptValue(QString::fromLatin1("ciao")); - QTest::newRow("undefined bound") << engine->toScriptValue(QVariant()); - QTest::newRow("null bound") << engine->evaluate("null"); - QTest::newRow("object") << engine->newObject(); - QTest::newRow("array") << engine->newArray(); - QTest::newRow("date") << engine->evaluate("new Date(124)"); - QTest::newRow("variant(12345)") << engine->toScriptValue(QVariant(12345)); - QTest::newRow("variant((QObject*)0)") << engine->toScriptValue(qVariantFromValue((QObject*)0)); - QTest::newRow("newQObject(0)") << engine->newQObject(0); -} - - -void tst_QJSValue::toQObject_nonQObject() -{ - QFETCH(QJSValue, value); - QCOMPARE(value.toQObject(), (QObject *)0); - QCOMPARE(qjsvalue_cast(value), (QObject *)0); -} - -// unfortunately, this is necessary in order to do qscriptvalue_cast(...) -Q_DECLARE_METATYPE(QPushButton*); - -void tst_QJSValue::toQObject() -{ - QJSEngine eng; - - QJSValue qobject = eng.newQObject(this); - QCOMPARE(qobject.toQObject(), (QObject *)this); - QCOMPARE(qjsvalue_cast(qobject), (QObject *)this); - QCOMPARE(qjsvalue_cast(qobject), (QWidget *)0); - - QWidget widget; - QJSValue qwidget = eng.newQObject(&widget); - QCOMPARE(qwidget.toQObject(), (QObject *)&widget); - QCOMPARE(qjsvalue_cast(qwidget), (QObject *)&widget); - QCOMPARE(qjsvalue_cast(qwidget), &widget); - - QPushButton button; - QJSValue qbutton = eng.newQObject(&button); - QCOMPARE(qbutton.toQObject(), (QObject *)&button); - QCOMPARE(qjsvalue_cast(qbutton), (QObject *)&button); - QCOMPARE(qjsvalue_cast(qbutton), (QWidget *)&button); - QCOMPARE(qjsvalue_cast(qbutton), &button); -} - -void tst_QJSValue::toDateTime() -{ - QJSEngine eng; - QDateTime dt = eng.evaluate("new Date(0)").toDateTime(); - QVERIFY(dt.isValid()); - QCOMPARE(dt.timeSpec(), Qt::LocalTime); - QCOMPARE(dt.toUTC(), QDateTime(QDate(1970, 1, 1), QTime(0, 0, 0), Qt::UTC)); - - QVERIFY(!eng.evaluate("[]").toDateTime().isValid()); - QVERIFY(!eng.evaluate("{}").toDateTime().isValid()); - QVERIFY(!eng.globalObject().toDateTime().isValid()); - QVERIFY(!QJSValue().toDateTime().isValid()); - QVERIFY(!QJSValue(123).toDateTime().isValid()); - QVERIFY(!QJSValue(false).toDateTime().isValid()); - QVERIFY(!eng.evaluate("null").toDateTime().isValid()); - QVERIFY(!eng.toScriptValue(QVariant()).toDateTime().isValid()); -} - -void tst_QJSValue::toRegExp() -{ - QJSEngine eng; - { - QRegExp rx = qjsvalue_cast(eng.evaluate("/foo/")); - QVERIFY(rx.isValid()); - QCOMPARE(rx.patternSyntax(), QRegExp::RegExp2); - QCOMPARE(rx.pattern(), QString::fromLatin1("foo")); - QCOMPARE(rx.caseSensitivity(), Qt::CaseSensitive); - QVERIFY(!rx.isMinimal()); - } - { - QRegExp rx = qjsvalue_cast(eng.evaluate("/bar/gi")); - QVERIFY(rx.isValid()); - QCOMPARE(rx.patternSyntax(), QRegExp::RegExp2); - QCOMPARE(rx.pattern(), QString::fromLatin1("bar")); - QCOMPARE(rx.caseSensitivity(), Qt::CaseInsensitive); - QVERIFY(!rx.isMinimal()); - } - - QVERIFY(qjsvalue_cast(eng.evaluate("[]")).isEmpty()); - QVERIFY(qjsvalue_cast(eng.evaluate("{}")).isEmpty()); - QVERIFY(qjsvalue_cast(eng.globalObject()).isEmpty()); - QVERIFY(qjsvalue_cast(QJSValue()).isEmpty()); - QVERIFY(qjsvalue_cast(QJSValue(123)).isEmpty()); - QVERIFY(qjsvalue_cast(QJSValue(false)).isEmpty()); - QVERIFY(qjsvalue_cast(eng.evaluate("null")).isEmpty()); - QVERIFY(qjsvalue_cast(eng.toScriptValue(QVariant())).isEmpty()); -} - -void tst_QJSValue::isArray_data() -{ - newEngine(); - - QTest::addColumn("value"); - QTest::addColumn("array"); - - QTest::newRow("[]") << engine->evaluate("[]") << true; - QTest::newRow("{}") << engine->evaluate("{}") << false; - QTest::newRow("globalObject") << engine->globalObject() << false; - QTest::newRow("invalid") << QJSValue() << false; - QTest::newRow("number") << QJSValue(123) << false; - QTest::newRow("bool") << QJSValue(false) << false; - QTest::newRow("null") << engine->evaluate("null") << false; - QTest::newRow("undefined") << engine->toScriptValue(QVariant()) << false; -} - -void tst_QJSValue::isArray() -{ - QFETCH(QJSValue, value); - QFETCH(bool, array); - - QCOMPARE(value.isArray(), array); -} - -void tst_QJSValue::isDate_data() -{ - newEngine(); - - QTest::addColumn("value"); - QTest::addColumn("date"); - - QTest::newRow("date") << engine->evaluate("new Date()") << true; - QTest::newRow("[]") << engine->evaluate("[]") << false; - QTest::newRow("{}") << engine->evaluate("{}") << false; - QTest::newRow("globalObject") << engine->globalObject() << false; - QTest::newRow("invalid") << QJSValue() << false; - QTest::newRow("number") << QJSValue(123) << false; - QTest::newRow("bool") << QJSValue(false) << false; - QTest::newRow("null") << engine->evaluate("null") << false; - QTest::newRow("undefined") << engine->toScriptValue(QVariant()) << false; -} - -void tst_QJSValue::isDate() -{ - QFETCH(QJSValue, value); - QFETCH(bool, date); - - QCOMPARE(value.isDate(), date); -} - -void tst_QJSValue::isError_propertiesOfGlobalObject() -{ - QStringList errors; - errors << "Error" - << "EvalError" - << "RangeError" - << "ReferenceError" - << "SyntaxError" - << "TypeError" - << "URIError"; - QJSEngine eng; - for (int i = 0; i < errors.size(); ++i) { - QJSValue ctor = eng.globalObject().property(errors.at(i)); - QVERIFY(ctor.isCallable()); - QVERIFY(ctor.property("prototype").isError()); - } -} - -void tst_QJSValue::isError_data() -{ - newEngine(); - - QTest::addColumn("value"); - QTest::addColumn("error"); - - QTest::newRow("syntax error") << engine->evaluate("%fsdg's") << true; - QTest::newRow("[]") << engine->evaluate("[]") << false; - QTest::newRow("{}") << engine->evaluate("{}") << false; - QTest::newRow("globalObject") << engine->globalObject() << false; - QTest::newRow("invalid") << QJSValue() << false; - QTest::newRow("number") << QJSValue(123) << false; - QTest::newRow("bool") << QJSValue(false) << false; - QTest::newRow("null") << engine->evaluate("null") << false; - QTest::newRow("undefined") << engine->toScriptValue(QVariant()) << false; - QTest::newRow("newObject") << engine->newObject() << false; - QTest::newRow("new Object") << engine->evaluate("new Object()") << false; -} - -void tst_QJSValue::isError() -{ - QFETCH(QJSValue, value); - QFETCH(bool, error); - - QCOMPARE(value.isError(), error); -} - -void tst_QJSValue::isRegExp_data() -{ - newEngine(); - - QTest::addColumn("value"); - QTest::addColumn("regexp"); - - QTest::newRow("/foo/") << engine->evaluate("/foo/") << true; - QTest::newRow("[]") << engine->evaluate("[]") << false; - QTest::newRow("{}") << engine->evaluate("{}") << false; - QTest::newRow("globalObject") << engine->globalObject() << false; - QTest::newRow("invalid") << QJSValue() << false; - QTest::newRow("number") << QJSValue(123) << false; - QTest::newRow("bool") << QJSValue(false) << false; - QTest::newRow("null") << engine->evaluate("null") << false; - QTest::newRow("undefined") << engine->toScriptValue(QVariant()) << false; -} - -void tst_QJSValue::isRegExp() -{ - QFETCH(QJSValue, value); - QFETCH(bool, regexp); - - QCOMPARE(value.isRegExp(), regexp); -} - -#if 0 // FIXME: No c-style callbacks currently -static QJSValue getter(QScriptContext *ctx, QScriptEngine *) -{ - return ctx->thisObject().property("x"); -} - -static QJSValue setter(QScriptContext *ctx, QScriptEngine *) -{ - ctx->thisObject().setProperty("x", ctx->argument(0)); - return ctx->argument(0); -} - -static QJSValue getterSetter(QScriptContext *ctx, QScriptEngine *) -{ - if (ctx->argumentCount() > 0) - ctx->thisObject().setProperty("x", ctx->argument(0)); - return ctx->thisObject().property("x"); -} - -static QJSValue getterSetterThrowingError(QScriptContext *ctx, QScriptEngine *) -{ - if (ctx->argumentCount() > 0) - return ctx->throwError("set foo"); - else - return ctx->throwError("get foo"); -} - -static QJSValue getSet__proto__(QScriptContext *ctx, QScriptEngine *) -{ - if (ctx->argumentCount() > 0) - ctx->callee().setProperty("value", ctx->argument(0)); - return ctx->callee().property("value"); -} -#endif - -void tst_QJSValue::hasProperty_basic() -{ - QJSEngine eng; - QJSValue obj = eng.newObject(); - QVERIFY(obj.hasProperty("hasOwnProperty")); // inherited from Object.prototype - QVERIFY(!obj.hasOwnProperty("hasOwnProperty")); - - QVERIFY(!obj.hasProperty("foo")); - QVERIFY(!obj.hasOwnProperty("foo")); - obj.setProperty("foo", 123); - QVERIFY(obj.hasProperty("foo")); - QVERIFY(obj.hasOwnProperty("foo")); - - QVERIFY(!obj.hasProperty("bar")); - QVERIFY(!obj.hasOwnProperty("bar")); -} - -void tst_QJSValue::hasProperty_globalObject() -{ - QJSEngine eng; - QJSValue global = eng.globalObject(); - QVERIFY(global.hasProperty("Math")); - QVERIFY(global.hasOwnProperty("Math")); - QVERIFY(!global.hasProperty("NoSuchStandardProperty")); - QVERIFY(!global.hasOwnProperty("NoSuchStandardProperty")); - - QVERIFY(!global.hasProperty("foo")); - QVERIFY(!global.hasOwnProperty("foo")); - global.setProperty("foo", 123); - QVERIFY(global.hasProperty("foo")); - QVERIFY(global.hasOwnProperty("foo")); -} - -void tst_QJSValue::hasProperty_changePrototype() -{ - QJSEngine eng; - QJSValue obj = eng.newObject(); - QJSValue proto = eng.newObject(); - obj.setPrototype(proto); - - QVERIFY(!obj.hasProperty("foo")); - QVERIFY(!obj.hasOwnProperty("foo")); - proto.setProperty("foo", 123); - QVERIFY(obj.hasProperty("foo")); - QVERIFY(!obj.hasOwnProperty("foo")); - - obj.setProperty("foo", 456); // override prototype property - QVERIFY(obj.hasProperty("foo")); - QVERIFY(obj.hasOwnProperty("foo")); -} - -void tst_QJSValue::deleteProperty_basic() -{ - QJSEngine eng; - QJSValue obj = eng.newObject(); - // deleteProperty() behavior matches JS delete operator - QVERIFY(obj.deleteProperty("foo")); - - obj.setProperty("foo", 123); - QVERIFY(obj.deleteProperty("foo")); - QVERIFY(!obj.hasOwnProperty("foo")); -} - -void tst_QJSValue::deleteProperty_globalObject() -{ - QJSEngine eng; - QJSValue global = eng.globalObject(); - // deleteProperty() behavior matches JS delete operator - QVERIFY(global.deleteProperty("foo")); - - global.setProperty("foo", 123); - QVERIFY(global.deleteProperty("foo")); - QVERIFY(!global.hasProperty("foo")); - - QVERIFY(global.deleteProperty("Math")); - QVERIFY(!global.hasProperty("Math")); - - QVERIFY(!global.deleteProperty("NaN")); // read-only - QVERIFY(global.hasProperty("NaN")); -} - -void tst_QJSValue::deleteProperty_inPrototype() -{ - QJSEngine eng; - QJSValue obj = eng.newObject(); - QJSValue proto = eng.newObject(); - obj.setPrototype(proto); - - proto.setProperty("foo", 123); - QVERIFY(obj.hasProperty("foo")); - // deleteProperty() behavior matches JS delete operator - QVERIFY(obj.deleteProperty("foo")); - QVERIFY(obj.hasProperty("foo")); -} - -void tst_QJSValue::getSetProperty_HooliganTask162051() -{ - QJSEngine eng; - // task 162051 -- detecting whether the property is an array index or not - QVERIFY(eng.evaluate("a = []; a['00'] = 123; a['00']").strictlyEquals(eng.toScriptValue(123))); - QVERIFY(eng.evaluate("a.length").strictlyEquals(eng.toScriptValue(0))); - QVERIFY(eng.evaluate("a.hasOwnProperty('00')").strictlyEquals(eng.toScriptValue(true))); - QVERIFY(eng.evaluate("a.hasOwnProperty('0')").strictlyEquals(eng.toScriptValue(false))); - QVERIFY(eng.evaluate("a[0]").isUndefined()); - QVERIFY(eng.evaluate("a[0.5] = 456; a[0.5]").strictlyEquals(eng.toScriptValue(456))); - QVERIFY(eng.evaluate("a.length").strictlyEquals(eng.toScriptValue(0))); - QVERIFY(eng.evaluate("a.hasOwnProperty('0.5')").strictlyEquals(eng.toScriptValue(true))); - QVERIFY(eng.evaluate("a[0]").isUndefined()); - QVERIFY(eng.evaluate("a[0] = 789; a[0]").strictlyEquals(eng.toScriptValue(789))); - QVERIFY(eng.evaluate("a.length").strictlyEquals(eng.toScriptValue(1))); -} - -void tst_QJSValue::getSetProperty_HooliganTask183072() -{ - QJSEngine eng; - // task 183072 -- 0x800000000 is not an array index - eng.evaluate("a = []; a[0x800000000] = 123"); - QVERIFY(eng.evaluate("a.length").strictlyEquals(eng.toScriptValue(0))); - QVERIFY(eng.evaluate("a[0]").isUndefined()); - QVERIFY(eng.evaluate("a[0x800000000]").strictlyEquals(eng.toScriptValue(123))); -} - -void tst_QJSValue::getSetProperty_propertyRemoval() -{ - QJSEngine eng; - QJSValue object = eng.newObject(); - QJSValue str = eng.toScriptValue(QString::fromLatin1("bar")); - QJSValue num = eng.toScriptValue(123.0); - - object.setProperty("foo", num); - QCOMPARE(object.property("foo").strictlyEquals(num), true); - object.setProperty("bar", str); - QCOMPARE(object.property("bar").strictlyEquals(str), true); - QVERIFY(object.deleteProperty("foo")); - QVERIFY(!object.hasOwnProperty("foo")); - QCOMPARE(object.property("bar").strictlyEquals(str), true); - object.setProperty("foo", num); - QCOMPARE(object.property("foo").strictlyEquals(num), true); - QCOMPARE(object.property("bar").strictlyEquals(str), true); - QVERIFY(object.deleteProperty("bar")); - QVERIFY(!object.hasOwnProperty("bar")); - QCOMPARE(object.property("foo").strictlyEquals(num), true); - QVERIFY(object.deleteProperty("foo")); - QVERIFY(!object.hasOwnProperty("foo")); - - eng.globalObject().setProperty("object3", object); - QCOMPARE(eng.evaluate("object3.hasOwnProperty('foo')") - .strictlyEquals(eng.toScriptValue(false)), true); - object.setProperty("foo", num); - QCOMPARE(eng.evaluate("object3.hasOwnProperty('foo')") - .strictlyEquals(eng.toScriptValue(true)), true); - QVERIFY(eng.globalObject().deleteProperty("object3")); - QCOMPARE(eng.evaluate("this.hasOwnProperty('object3')") - .strictlyEquals(eng.toScriptValue(false)), true); -} - -void tst_QJSValue::getSetProperty_resolveMode() -{ - // test ResolveMode - QJSEngine eng; - QJSValue object = eng.newObject(); - QJSValue prototype = eng.newObject(); - object.setPrototype(prototype); - QJSValue num2 = eng.toScriptValue(456.0); - prototype.setProperty("propertyInPrototype", num2); - // default is ResolvePrototype - QCOMPARE(object.property("propertyInPrototype") - .strictlyEquals(num2), true); -#if 0 // FIXME: ResolveFlags removed from API - QCOMPARE(object.property("propertyInPrototype", QJSValue::ResolvePrototype) - .strictlyEquals(num2), true); - QCOMPARE(object.property("propertyInPrototype", QJSValue::ResolveLocal) - .isValid(), false); - QCOMPARE(object.property("propertyInPrototype", QJSValue::ResolveScope) - .strictlyEquals(num2), false); - QCOMPARE(object.property("propertyInPrototype", QJSValue::ResolveFull) - .strictlyEquals(num2), true); -#endif -} - -void tst_QJSValue::getSetProperty_twoEngines() -{ - QJSEngine engine; - QJSValue object = engine.newObject(); - - QJSEngine otherEngine; - QJSValue otherNum = otherEngine.toScriptValue(123); - QTest::ignoreMessage(QtWarningMsg, "QJSValue::setProperty(oof) failed: cannot set value created in a different engine"); - object.setProperty("oof", otherNum); - QVERIFY(!object.hasOwnProperty("oof")); - QVERIFY(object.property("oof").isUndefined()); -} - - -void tst_QJSValue::getSetProperty_gettersAndSetters() -{ -#if 0 // FIXME: No setters/getters right now - QScriptEngine eng; - QJSValue str = eng.toScriptValue(QString::fromLatin1("bar")); - QJSValue num = eng.toScriptValue(123.0); - QJSValue object = eng.newObject(); - for (int x = 0; x < 2; ++x) { - object.deleteProperty("foo"); - // getter() returns this.x - object.setProperty("foo", eng.newFunction(getter), - QJSValue::PropertyGetter | QJSValue::UserRange); - QCOMPARE(object.propertyFlags("foo") & ~QJSValue::UserRange, - QJSValue::PropertyGetter ); - - QEXPECT_FAIL("", "QTBUG-17615: User-range flags are not retained for getter/setter properties", Continue); - QCOMPARE(object.propertyFlags("foo"), - QJSValue::PropertyGetter | QJSValue::UserRange); - object.setProperty("x", num); - QCOMPARE(object.property("foo").strictlyEquals(num), true); - - // setter() sets this.x - object.setProperty("foo", eng.newFunction(setter), - QJSValue::PropertySetter); - QCOMPARE(object.propertyFlags("foo") & ~QJSValue::UserRange, - QJSValue::PropertySetter | QJSValue::PropertyGetter); - - QCOMPARE(object.propertyFlags("foo"), - QJSValue::PropertySetter | QJSValue::PropertyGetter); - object.setProperty("foo", str); - QCOMPARE(object.property("x").strictlyEquals(str), true); - QCOMPARE(object.property("foo").strictlyEquals(str), true); - - // kill the getter - object.setProperty("foo", QJSValue(), QJSValue::PropertyGetter); - QVERIFY(!(object.propertyFlags("foo") & QJSValue::PropertyGetter)); - QVERIFY(object.propertyFlags("foo") & QJSValue::PropertySetter); - QCOMPARE(object.property("foo").isUndefined(), true); - - // setter should still work - object.setProperty("foo", num); - QCOMPARE(object.property("x").strictlyEquals(num), true); - - // kill the setter too - object.setProperty("foo", QJSValue(), QJSValue::PropertySetter); - QVERIFY(!(object.propertyFlags("foo") & QJSValue::PropertySetter)); - // now foo is just a regular property - object.setProperty("foo", str); - QCOMPARE(object.property("x").strictlyEquals(num), true); - QCOMPARE(object.property("foo").strictlyEquals(str), true); - } - - for (int x = 0; x < 2; ++x) { - object.deleteProperty("foo"); - // setter() sets this.x - object.setProperty("foo", eng.newFunction(setter), QJSValue::PropertySetter); - object.setProperty("foo", str); - QCOMPARE(object.property("x").strictlyEquals(str), true); - QCOMPARE(object.property("foo").isUndefined(), true); - - // getter() returns this.x - object.setProperty("foo", eng.newFunction(getter), QJSValue::PropertyGetter); - object.setProperty("x", num); - QCOMPARE(object.property("foo").strictlyEquals(num), true); - - // kill the setter - object.setProperty("foo", QJSValue(), QJSValue::PropertySetter); - object.setProperty("foo", str); - - // getter should still work - QCOMPARE(object.property("foo").strictlyEquals(num), true); - - // kill the getter too - object.setProperty("foo", QJSValue(), QJSValue::PropertyGetter); - // now foo is just a regular property - object.setProperty("foo", str); - QCOMPARE(object.property("x").strictlyEquals(num), true); - QCOMPARE(object.property("foo").strictlyEquals(str), true); - } - - // use a single function as both getter and setter - object.deleteProperty("foo"); - object.setProperty("foo", eng.newFunction(getterSetter), - QJSValue::PropertyGetter | QJSValue::PropertySetter); - QCOMPARE(object.propertyFlags("foo"), - QJSValue::PropertyGetter | QJSValue::PropertySetter); - object.setProperty("x", num); - QCOMPARE(object.property("foo").strictlyEquals(num), true); - - // killing the getter will preserve the setter, even though they are the same function - object.setProperty("foo", QJSValue(), QJSValue::PropertyGetter); - QVERIFY(object.propertyFlags("foo") & QJSValue::PropertySetter); - QCOMPARE(object.property("foo").isUndefined(), true); -#endif -} - -void tst_QJSValue::getSetProperty_gettersAndSettersThrowErrorNative() -{ -#if 0 // FIXME: No setters/getters right now - // getter/setter that throws an error - QScriptEngine eng; - QJSValue str = eng.toScriptValue("bar"); - QJSValue object = eng.newObject(); - - object.setProperty("foo", eng.newFunction(getterSetterThrowingError), - QJSValue::PropertyGetter | QJSValue::PropertySetter); - QVERIFY(!eng.hasUncaughtException()); - QJSValue ret = object.property("foo"); - QVERIFY(ret.isError()); - QVERIFY(eng.hasUncaughtException()); - QVERIFY(ret.strictlyEquals(eng.uncaughtException())); - QCOMPARE(ret.toString(), QLatin1String("Error: get foo")); - eng.evaluate("Object"); // clear exception state... - QVERIFY(!eng.hasUncaughtException()); - object.setProperty("foo", str); - QVERIFY(eng.hasUncaughtException()); - QCOMPARE(eng.uncaughtException().toString(), QLatin1String("Error: set foo")); -#endif -} - -void tst_QJSValue::getSetProperty_gettersAndSettersThrowErrorJS() -{ - // getter/setter that throws an error (from js function) - QJSEngine eng; - QJSValue str = eng.toScriptValue(QString::fromLatin1("bar")); - - eng.evaluate("o = new Object; " - "o.__defineGetter__('foo', function() { throw new Error('get foo') }); " - "o.__defineSetter__('foo', function() { throw new Error('set foo') }); "); - QJSValue object = eng.evaluate("o"); - QVERIFY(!eng.hasUncaughtException()); - QJSValue ret = object.property("foo"); - QVERIFY(ret.isError()); - QVERIFY(eng.hasUncaughtException()); - QVERIFY(ret.strictlyEquals(eng.uncaughtException())); - QCOMPARE(ret.toString(), QLatin1String("Error: get foo")); - eng.evaluate("Object"); // clear exception state... - QVERIFY(!eng.hasUncaughtException()); - object.setProperty("foo", str); - QVERIFY(eng.hasUncaughtException()); - QCOMPARE(eng.uncaughtException().toString(), QLatin1String("Error: set foo")); -} - -void tst_QJSValue::getSetProperty_gettersAndSettersOnNative() -{ -#if 0 // FIXME: No c-style functions right now - // attempt to install getter+setter on built-in (native) property - QScriptEngine eng; - QJSValue object = eng.newObject(); - QVERIFY(object.property("__proto__").strictlyEquals(object.prototype())); - - QJSValue fun = eng.newFunction(getSet__proto__); - fun.setProperty("value", eng.toScriptValue("boo")); -/* QTest::ignoreMessage(QtWarningMsg, "QJSValue::setProperty() failed: " - "cannot set getter or setter of native property " - "`__proto__'");*/ - object.setProperty("__proto__", fun, - QJSValue::PropertyGetter | QJSValue::PropertySetter - | QJSValue::UserRange); - QVERIFY(object.property("__proto__").strictlyEquals(object.prototype())); - - object.setProperty("__proto__", QJSValue(), - QJSValue::PropertyGetter | QJSValue::PropertySetter); - QVERIFY(object.property("__proto__").strictlyEquals(object.prototype())); -#endif -} - -void tst_QJSValue::getSetProperty_gettersAndSettersOnGlobalObject() -{ -#if 0 // FIXME: No c-style functions right now - // global property that's a getter+setter - QScriptEngine eng; - eng.globalObject().setProperty("globalGetterSetterProperty", eng.newFunction(getterSetter), - QJSValue::PropertyGetter | QJSValue::PropertySetter); - eng.evaluate("globalGetterSetterProperty = 123"); - { - QJSValue ret = eng.evaluate("globalGetterSetterProperty"); - QVERIFY(ret.isNumber()); - QVERIFY(ret.strictlyEquals(eng.toScriptValue(123))); - } - QCOMPARE(eng.evaluate("typeof globalGetterSetterProperty").toString(), - QString::fromLatin1("number")); - { - QJSValue ret = eng.evaluate("this.globalGetterSetterProperty()"); - QVERIFY(ret.isError()); - QCOMPARE(ret.toString(), QString::fromLatin1("TypeError: Property 'globalGetterSetterProperty' of object # is not a function")); - } - { - QJSValue ret = eng.evaluate("new this.globalGetterSetterProperty()"); - QVERIFY(ret.isError()); - QCOMPARE(ret.toString(), QString::fromLatin1("TypeError: number is not a function")); - } -#endif -} - -void tst_QJSValue::getSetProperty_gettersAndSettersChange() -{ -#if 0 // FIXME: No setters/getters API right now - // "upgrading" an existing property to become a getter+setter - QScriptEngine eng; - QJSValue object = eng.newObject(); - QJSValue num(&eng, 123); - object.setProperty("foo", num); - object.setProperty("foo", eng.newFunction(getterSetter), - QJSValue::PropertyGetter | QJSValue::PropertySetter); - QVERIFY(!object.property("x").isValid()); - object.setProperty("foo", num); - QVERIFY(object.property("x").equals(num)); - - eng.globalObject().setProperty("object", object); - QJSValue res = eng.evaluate("object.x = 89; var a = object.foo; object.foo = 65; a"); - QCOMPARE(res.toInt(), 89); - QCOMPARE(object.property("x").toInt(), 65); - QCOMPARE(object.property("foo").toInt(), 65); -#endif -} - -void tst_QJSValue::getSetProperty_array() -{ - QJSEngine eng; - QJSValue str = eng.toScriptValue(QString::fromLatin1("bar")); - QJSValue num = eng.toScriptValue(123.0); - QJSValue array = eng.newArray(); - - QVERIFY(array.isArray()); - array.setProperty(0, num); - QCOMPARE(array.property(0).toNumber(), num.toNumber()); - QCOMPARE(array.property("0").toNumber(), num.toNumber()); - QCOMPARE(array.property("length").toUInt(), quint32(1)); - array.setProperty(1, str); - QCOMPARE(array.property(1).toString(), str.toString()); - QCOMPARE(array.property("1").toString(), str.toString()); - QCOMPARE(array.property("length").toUInt(), quint32(2)); - array.setProperty("length", eng.toScriptValue(1)); - QCOMPARE(array.property("length").toUInt(), quint32(1)); - QVERIFY(array.property(1).isUndefined()); -} - -void tst_QJSValue::getSetProperty_gettersAndSettersStupid() -{ -#if 0 // FIXME: No setters/getters API right now - //removing unexisting Setter or Getter should not crash. - QScriptEngine eng; - QJSValue num = eng.toScriptValue(123.0); - - { - QJSValue object = eng.newObject(); - object.setProperty("foo", QJSValue(), QJSValue::PropertyGetter); - QVERIFY(!object.property("foo").isValid()); - object.setProperty("foo", num); - QCOMPARE(object.property("foo").strictlyEquals(num), true); - } - - { - QJSValue object = eng.newObject(); - object.setProperty("foo", QJSValue(), QJSValue::PropertySetter); - QVERIFY(!object.property("foo").isValid()); - object.setProperty("foo", num); - QCOMPARE(object.property("foo").strictlyEquals(num), true); - } - - { - QJSValue object = eng.globalObject(); - object.setProperty("foo", QJSValue(), QJSValue::PropertySetter); - object.setProperty("foo", QJSValue(), QJSValue::PropertyGetter); - QVERIFY(!object.property("foo").isValid()); - object.setProperty("foo", num); - QCOMPARE(object.property("foo").strictlyEquals(num), true); - } -#endif -} - -void tst_QJSValue::getSetProperty() -{ - QJSEngine eng; - - QJSValue object = eng.newObject(); - - QJSValue str = eng.toScriptValue(QString::fromLatin1("bar")); - object.setProperty("foo", str); - QCOMPARE(object.property("foo").toString(), str.toString()); - - QJSValue num = eng.toScriptValue(123.0); - object.setProperty("baz", num); - QCOMPARE(object.property("baz").toNumber(), num.toNumber()); - - QJSValue strstr = QJSValue("bar"); - QCOMPARE(strstr.engine(), (QJSEngine *)0); - object.setProperty("foo", strstr); - QCOMPARE(object.property("foo").toString(), strstr.toString()); - QCOMPARE(strstr.engine(), &eng); // the value has been bound to the engine - - QJSValue numnum = QJSValue(123.0); - object.setProperty("baz", numnum); - QCOMPARE(object.property("baz").toNumber(), numnum.toNumber()); - - QJSValue inv; - inv.setProperty("foo", num); - QCOMPARE(inv.property("foo").isUndefined(), true); - - eng.globalObject().setProperty("object", object); - -#if 0 // FIXME: no setProperty API with flags - // ReadOnly - object.setProperty("readOnlyProperty", num, QJSValue::ReadOnly); - QCOMPARE(object.propertyFlags("readOnlyProperty"), QJSValue::ReadOnly); - QCOMPARE(object.property("readOnlyProperty").strictlyEquals(num), true); - eng.evaluate("object.readOnlyProperty = !object.readOnlyProperty"); - QCOMPARE(object.property("readOnlyProperty").strictlyEquals(num), true); - // should still be part of enumeration - { - QJSValue ret = eng.evaluate( - "found = false;" - "for (var p in object) {" - " if (p == 'readOnlyProperty') {" - " found = true; break;" - " }" - "} found"); - QCOMPARE(ret.strictlyEquals(eng.toScriptValue(true)), true); - } - // should still be deletable - { - QJSValue ret = eng.evaluate("delete object.readOnlyProperty"); - QCOMPARE(ret.strictlyEquals(eng.toScriptValue(true)), true); - QCOMPARE(object.property("readOnlyProperty").isValid(), false); - } - - // Undeletable - object.setProperty("undeletableProperty", num, QJSValue::Undeletable); - QCOMPARE(object.propertyFlags("undeletableProperty"), QJSValue::Undeletable); - QCOMPARE(object.property("undeletableProperty").strictlyEquals(num), true); - { - QJSValue ret = eng.evaluate("delete object.undeletableProperty"); - QCOMPARE(ret.strictlyEquals(eng.toScriptValue(true)), false); - QCOMPARE(object.property("undeletableProperty").strictlyEquals(num), true); - } - // should still be writable - eng.evaluate("object.undeletableProperty = object.undeletableProperty + 1"); - QCOMPARE(object.property("undeletableProperty").toNumber(), num.toNumber() + 1); - // should still be part of enumeration - { - QJSValue ret = eng.evaluate( - "found = false;" - "for (var p in object) {" - " if (p == 'undeletableProperty') {" - " found = true; break;" - " }" - "} found"); - QCOMPARE(ret.strictlyEquals(eng.toScriptValue(true)), true); - } - // should still be deletable from C++ - object.deleteProperty("undeletableProperty"); - QEXPECT_FAIL("", "QTBUG-17617: With JSC-based back-end, undeletable properties can't be deleted from C++", Continue); - QVERIFY(!object.property("undeletableProperty").isValid()); - QEXPECT_FAIL("", "QTBUG-17617: With JSC-based back-end, undeletable properties can't be deleted from C++", Continue); - QCOMPARE(object.propertyFlags("undeletableProperty"), 0); - - // SkipInEnumeration - object.setProperty("dontEnumProperty", num, QJSValue::SkipInEnumeration); - QCOMPARE(object.propertyFlags("dontEnumProperty"), QJSValue::SkipInEnumeration); - QCOMPARE(object.property("dontEnumProperty").strictlyEquals(num), true); - // should not be part of enumeration - { - QJSValue ret = eng.evaluate( - "found = false;" - "for (var p in object) {" - " if (p == 'dontEnumProperty') {" - " found = true; break;" - " }" - "} found"); - QCOMPARE(ret.strictlyEquals(eng.toScriptValue(false)), true); - } - // should still be writable - eng.evaluate("object.dontEnumProperty = object.dontEnumProperty + 1"); - QCOMPARE(object.property("dontEnumProperty").toNumber(), num.toNumber() + 1); - // should still be deletable - { - QJSValue ret = eng.evaluate("delete object.dontEnumProperty"); - QCOMPARE(ret.strictlyEquals(eng.toScriptValue(true)), true); - QCOMPARE(object.property("dontEnumProperty").isValid(), false); - } - - // change flags - object.setProperty("flagProperty", str); - QCOMPARE(object.propertyFlags("flagProperty"), static_cast(0)); - - QEXPECT_FAIL("", "FIXME: v8 does not support changing flags of existing properties", Continue); - //v8::i::JSObject::SetProperty(LookupResult* result, ... ) does not take in account the attributes - // if the result->isFound() - object.setProperty("flagProperty", str, QJSValue::ReadOnly); - QCOMPARE(object.propertyFlags("flagProperty"), QJSValue::ReadOnly); - - QEXPECT_FAIL("", "FIXME: v8 does not support changing flags of existing properties", Continue); - object.setProperty("flagProperty", str, object.propertyFlags("flagProperty") | QJSValue::SkipInEnumeration); - QCOMPARE(object.propertyFlags("flagProperty"), QJSValue::ReadOnly | QJSValue::SkipInEnumeration); - - QEXPECT_FAIL("", "FIXME: v8 does not support changing flags of existing properties", Continue); - object.setProperty("flagProperty", str, QJSValue::KeepExistingFlags); - QCOMPARE(object.propertyFlags("flagProperty"), QJSValue::ReadOnly | QJSValue::SkipInEnumeration); - - QEXPECT_FAIL("", "FIXME: v8 does not support UserRange", Continue); - object.setProperty("flagProperty", str, QJSValue::UserRange); - QCOMPARE(object.propertyFlags("flagProperty"), QJSValue::UserRange); - - // flags of property in the prototype - { - QJSValue object2 = eng.newObject(); - object2.setPrototype(object); - QCOMPARE(object2.propertyFlags("flagProperty", QJSValue::ResolveLocal), 0); - QEXPECT_FAIL("", "FIXME: v8 does not support UserRange", Continue); - QCOMPARE(object2.propertyFlags("flagProperty"), QJSValue::UserRange); - } - - // using interned strings - QScriptString foo = eng.toStringHandle("foo"); - - QVERIFY(object.deleteProperty(foo)); - QVERIFY(!object.property(foo).isValid()); - - object.setProperty(foo, num); - QVERIFY(object.property(foo).strictlyEquals(num)); - QVERIFY(object.property("foo").strictlyEquals(num)); - QVERIFY(object.propertyFlags(foo) == 0); -#endif - - // Setting index property on non-Array - object.setProperty(13, num); - QVERIFY(object.property(13).equals(num)); -} - -void tst_QJSValue::arrayElementGetterSetter() -{ -#if 0 // FIXME: No c-style functions - QScriptEngine eng; - QJSValue obj = eng.newObject(); - obj.setProperty(1, eng.newFunction(getterSetter), QJSValue::PropertyGetter|QJSValue::PropertySetter); - { - QJSValue num(123); - obj.setProperty("x", num); - QJSValue ret = obj.property(1); - QVERIFY(ret.isValid()); - QVERIFY(ret.equals(num)); - } - { - QJSValue num(456); - obj.setProperty(1, num); - QJSValue ret = obj.property(1); - QVERIFY(ret.isValid()); - QVERIFY(ret.equals(num)); - QVERIFY(ret.equals(obj.property("1"))); - } - QCOMPARE(obj.propertyFlags("1"), QJSValue::PropertyGetter|QJSValue::PropertySetter); - - obj.setProperty(1, QJSValue(), QJSValue::PropertyGetter|QJSValue::PropertySetter); - QVERIFY(obj.propertyFlags("1") == 0); -#endif -} - -void tst_QJSValue::getSetPrototype_cyclicPrototype() -{ - QJSEngine eng; - QJSValue prototype = eng.newObject(); - QJSValue object = eng.newObject(); - object.setPrototype(prototype); - - QJSValue previousPrototype = prototype.prototype(); - QTest::ignoreMessage(QtWarningMsg, "QJSValue::setPrototype() failed: cyclic prototype value"); - prototype.setPrototype(prototype); - QCOMPARE(prototype.prototype().strictlyEquals(previousPrototype), true); - - object.setPrototype(prototype); - QTest::ignoreMessage(QtWarningMsg, "QJSValue::setPrototype() failed: cyclic prototype value"); - prototype.setPrototype(object); - QCOMPARE(prototype.prototype().strictlyEquals(previousPrototype), true); - -} - -void tst_QJSValue::getSetPrototype_evalCyclicPrototype() -{ - QJSEngine eng; - QJSValue ret = eng.evaluate("o = { }; p = { }; o.__proto__ = p; p.__proto__ = o"); - QCOMPARE(eng.hasUncaughtException(), true); - QVERIFY(ret.strictlyEquals(eng.uncaughtException())); - QCOMPARE(ret.isError(), true); - QCOMPARE(ret.toString(), QLatin1String("Error: Cyclic __proto__ value")); -} - -void tst_QJSValue::getSetPrototype_eval() -{ - QJSEngine eng; - QJSValue ret = eng.evaluate("p = { }; p.__proto__ = { }"); - QCOMPARE(eng.hasUncaughtException(), false); - QCOMPARE(ret.isError(), false); -} - -void tst_QJSValue::getSetPrototype_invalidPrototype() -{ - QJSEngine eng; - QJSValue inv; - QJSValue object = eng.newObject(); - QJSValue proto = object.prototype(); - QVERIFY(object.prototype().strictlyEquals(proto)); - inv.setPrototype(object); - QVERIFY(inv.prototype().isUndefined()); - object.setPrototype(inv); - QVERIFY(object.prototype().strictlyEquals(proto)); -} - -void tst_QJSValue::getSetPrototype_twoEngines() -{ - QJSEngine eng; - QJSValue prototype = eng.newObject(); - QJSValue object = eng.newObject(); - object.setPrototype(prototype); - QJSEngine otherEngine; - QJSValue newPrototype = otherEngine.newObject(); - QTest::ignoreMessage(QtWarningMsg, "QJSValue::setPrototype() failed: cannot set a prototype created in a different engine"); - object.setPrototype(newPrototype); - QCOMPARE(object.prototype().strictlyEquals(prototype), true); - -} - -void tst_QJSValue::getSetPrototype_null() -{ - QJSEngine eng; - QJSValue object = eng.newObject(); - object.setPrototype(QJSValue(QJSValue::NullValue)); - QVERIFY(object.prototype().isNull()); - - QJSValue newProto = eng.newObject(); - object.setPrototype(newProto); - QVERIFY(object.prototype().equals(newProto)); - - object.setPrototype(eng.evaluate("null")); - QVERIFY(object.prototype().isNull()); -} - -void tst_QJSValue::getSetPrototype_notObjectOrNull() -{ - QJSEngine eng; - QJSValue object = eng.newObject(); - QJSValue originalProto = object.prototype(); - - // bool - object.setPrototype(true); - QVERIFY(object.prototype().equals(originalProto)); - object.setPrototype(eng.toScriptValue(true)); - QVERIFY(object.prototype().equals(originalProto)); - - // number - object.setPrototype(123); - QVERIFY(object.prototype().equals(originalProto)); - object.setPrototype(eng.toScriptValue(123)); - QVERIFY(object.prototype().equals(originalProto)); - - // string - object.setPrototype("foo"); - QVERIFY(object.prototype().equals(originalProto)); - object.setPrototype(eng.toScriptValue(QString::fromLatin1("foo"))); - QVERIFY(object.prototype().equals(originalProto)); - - // undefined - object.setPrototype(QJSValue(QJSValue::UndefinedValue)); - QVERIFY(object.prototype().equals(originalProto)); - object.setPrototype(eng.toScriptValue(QVariant())); - QVERIFY(object.prototype().equals(originalProto)); -} - -void tst_QJSValue::getSetPrototype() -{ - QJSEngine eng; - QJSValue prototype = eng.newObject(); - QJSValue object = eng.newObject(); - object.setPrototype(prototype); - QCOMPARE(object.prototype().strictlyEquals(prototype), true); -} - -void tst_QJSValue::getSetScope() -{ -#if 0 // FIXME: No QJSValue::scope - QScriptEngine eng; - - QJSValue object = eng.newObject(); - QCOMPARE(object.scope().isValid(), false); - - QJSValue object2 = eng.newObject(); - object2.setScope(object); - - QEXPECT_FAIL("", "FIXME: scope not implemented yet", Abort); - QCOMPARE(object2.scope().strictlyEquals(object), true); - - object.setProperty("foo", 123); - QVERIFY(!object2.property("foo").isValid()); - { - QJSValue ret = object2.property("foo", QJSValue::ResolveScope); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toInt(), 123); - } - - QJSValue inv; - inv.setScope(object); - QCOMPARE(inv.scope().isValid(), false); - - QScriptEngine otherEngine; - QJSValue object3 = otherEngine.newObject(); - QTest::ignoreMessage(QtWarningMsg, "QJSValue::setScope() failed: cannot set a scope object created in a different engine"); - object2.setScope(object3); - QCOMPARE(object2.scope().strictlyEquals(object), true); - - object2.setScope(QJSValue()); - QVERIFY(!object2.scope().isValid()); -#endif -} - -void tst_QJSValue::getSetData_objects_data() -{ -#if 0 // FIXME: no setData/data API - newEngine(); - - QTest::addColumn("object"); - - QTest::newRow("object from evaluate") << engine->evaluate("new Object()"); - QTest::newRow("object from engine") << engine->newObject(); - QTest::newRow("Array") << engine->newArray(); - QTest::newRow("Date") << engine->evaluate("new Date(12324)"); - QTest::newRow("QObject") << engine->newQObject(this); - QTest::newRow("RegExp") << engine->newRegExp(QRegExp()); -#endif -} - -void tst_QJSValue::getSetData_objects() -{ -#if 0 // FIXME: no setData/data API - QFETCH(QJSValue, object); - - QVERIFY(!object.data().isValid()); - QJSValue v1(true); - object.setData(v1); - QVERIFY(object.data().strictlyEquals(v1)); - QJSValue v2(123); - object.setData(v2); - QVERIFY(object.data().strictlyEquals(v2)); - QJSValue v3 = engine->newObject(); - object.setData(v3); - QVERIFY(object.data().strictlyEquals(v3)); - object.setData(QJSValue()); - QVERIFY(!object.data().isValid()); -#endif -} - -void tst_QJSValue::getSetData_nonObjects_data() -{ -#if 0 // FIXME: no setData/data API - newEngine(); - - QTest::addColumn("value"); - - QTest::newRow("undefined (bound)") << engine->toScriptValue(QVariant()); - QTest::newRow("null (bound)") << engine->evaluate("null"); - QTest::newRow("string (bound)") << engine->toScriptValue("Pong"); - QTest::newRow("bool (bound)") << engine->toScriptValue(false); - - QTest::newRow("undefined") << QJSValue(QJSValue::UndefinedValue); - QTest::newRow("null") << QJSValue(QJSValue::NullValue); - QTest::newRow("string") << QJSValue("Pong"); - QTest::newRow("bool") << QJSValue(true); -#endif -} - -void tst_QJSValue::getSetData_nonObjects() -{ -#if 0 // FIXME: no setData/data API - QFETCH(QJSValue, value); - - QVERIFY(!value.data().isValid()); - QJSValue v1(true); - value.setData(v1); - QVERIFY(!value.data().isValid()); - QJSValue v2(123); - value.setData(v2); - QVERIFY(!value.data().isValid()); - QJSValue v3 = engine->newObject(); - value.setData(v3); - QVERIFY(!value.data().isValid()); - value.setData(QJSValue()); - QVERIFY(!value.data().isValid()); -#endif -} - -void tst_QJSValue::setData_QTBUG15144() -{ -#if 0 // FIXME: no setData/data API - QScriptEngine eng; - QJSValue obj = eng.newObject(); - for (int i = 0; i < 10000; ++i) { - // Create an object with property 'fooN' on it, and immediately kill - // the reference to the object so it and the property name become garbage. - eng.evaluate(QString::fromLatin1("o = {}; o.foo%0 = 10; o = null;").arg(i)); - // Setting the data will cause a JS string to be allocated, which could - // trigger a GC. This should not cause a crash. - obj.setData("foodfight"); - } -#endif -} - -#if 0 // FIXME: no QScriptClass -class TestScriptClass : public QScriptClass -{ -public: - TestScriptClass(QScriptEngine *engine) : QScriptClass(engine) {} -}; - -void tst_QJSValue::getSetScriptClass_emptyClass_data() -{ - newEngine(); - QTest::addColumn("value"); - - QTest::newRow("invalid") << QJSValue(); - QTest::newRow("number") << QJSValue(123); - QTest::newRow("string") << QJSValue("pong"); - QTest::newRow("bool") << QJSValue(false); - QTest::newRow("null") << QJSValue(QJSValue::NullValue); - QTest::newRow("undefined") << QJSValue(QJSValue::UndefinedValue); - - QTest::newRow("number") << engine->toScriptValue(123); - QTest::newRow("string") << engine->toScriptValue("pong"); - QTest::newRow("bool") << engine->toScriptValue(true); - QTest::newRow("null") << QJSValue(engine->evaluate("null")); - QTest::newRow("undefined") << QJSValue(engine->toScriptValue(QVariant())); - QTest::newRow("object") << QJSValue(engine->newObject()); - QTest::newRow("date") << QJSValue(engine->evaluate("new Date()")); - QTest::newRow("qobject") << QJSValue(engine->newQObject(this)); -} - -void tst_QJSValue::getSetScriptClass_emptyClass() -{ - QFETCH(QJSValue, value); - QCOMPARE(value.scriptClass(), (QScriptClass*)0); -} - -void tst_QJSValue::getSetScriptClass_JSObjectFromCpp() -{ - QScriptEngine eng; - TestScriptClass testClass(&eng); - // object created in C++ (newObject()) - { - QJSValue obj = eng.newObject(); - obj.setScriptClass(&testClass); - QCOMPARE(obj.scriptClass(), (QScriptClass*)&testClass); - obj.setScriptClass(0); - QCOMPARE(obj.scriptClass(), (QScriptClass*)0); - } -} - -void tst_QJSValue::getSetScriptClass_JSObjectFromJS() -{ - QScriptEngine eng; - TestScriptClass testClass(&eng); - // object created in JS - { - QJSValue obj = eng.evaluate("new Object"); - QVERIFY(!eng.hasUncaughtException()); - QVERIFY(obj.isObject()); - QCOMPARE(obj.scriptClass(), (QScriptClass*)0); - obj.setScriptClass(&testClass); - QCOMPARE(obj.scriptClass(), (QScriptClass*)&testClass); - obj.setScriptClass(0); - QCOMPARE(obj.scriptClass(), (QScriptClass*)0); - } -} - -void tst_QJSValue::getSetScriptClass_QVariant() -{ - QScriptEngine eng; - TestScriptClass testClass(&eng); - // object that already has a(n internal) class - { - QJSValue obj = eng.toScriptValue(QUrl("http://example.com")); - QVERIFY(obj.isVariant()); - QCOMPARE(obj.scriptClass(), (QScriptClass*)0); - obj.setScriptClass(&testClass); - QCOMPARE(obj.scriptClass(), (QScriptClass*)&testClass); - QVERIFY(obj.isObject()); - QVERIFY(!obj.isVariant()); - QCOMPARE(obj.toVariant(), QVariant(QVariantMap())); - } -} - -void tst_QJSValue::getSetScriptClass_QObject() -{ - QScriptEngine eng; - TestScriptClass testClass(&eng); - { - QJSValue obj = eng.newQObject(this); - QVERIFY(obj.isQObject()); - obj.setScriptClass(&testClass); - QCOMPARE(obj.scriptClass(), (QScriptClass*)&testClass); - QVERIFY(obj.isObject()); - QVERIFY(!obj.isQObject()); - QVERIFY(obj.toQObject() == 0); - } -} -#endif - -#if 0 // FIXME: No c-style callbacks -static QJSValue getArg(QScriptContext *ctx, QScriptEngine *) -{ - return ctx->argument(0); -} - -static QJSValue evaluateArg(QScriptContext *, QScriptEngine *eng) -{ - return eng->evaluate("arguments[0]"); -} - -static QJSValue addArgs(QScriptContext *, QScriptEngine *eng) -{ - return eng->evaluate("arguments[0] + arguments[1]"); -} - -static QJSValue returnInvalidValue(QScriptContext *, QScriptEngine *) -{ - return QJSValue(); -} -#endif - -void tst_QJSValue::call_function() -{ - QJSEngine eng; - QJSValue fun = eng.evaluate("(function() { return 1; })"); - QVERIFY(fun.isCallable()); - QJSValue result = fun.call(); - QVERIFY(result.isNumber()); - QCOMPARE(result.toInt(), 1); -} - -void tst_QJSValue::call_object() -{ - QJSEngine eng; - QJSValue Object = eng.evaluate("Object"); - QCOMPARE(Object.isCallable(), true); - QJSValue result = Object.callWithInstance(Object); - QCOMPARE(result.isObject(), true); -} - -void tst_QJSValue::call_newObjects() -{ - QJSEngine eng; - // test that call() doesn't construct new objects - QJSValue Number = eng.evaluate("Number"); - QJSValue Object = eng.evaluate("Object"); - QCOMPARE(Object.isCallable(), true); - QJSValueList args; - args << eng.toScriptValue(123); - QJSValue result = Number.callWithInstance(Object, args); - QCOMPARE(result.strictlyEquals(args.at(0)), true); -} - -void tst_QJSValue::call_this() -{ - QJSEngine eng; - // test that correct "this" object is used - QJSValue fun = eng.evaluate("(function() { return this; })"); - QCOMPARE(fun.isCallable(), true); - - QJSValue numberObject = eng.evaluate("new Number(123)"); - QJSValue result = fun.callWithInstance(numberObject); - QCOMPARE(result.isObject(), true); - QCOMPARE(result.toNumber(), 123.0); -} - -void tst_QJSValue::call_arguments() -{ - QJSEngine eng; - // test that correct arguments are passed - - QJSValue fun = eng.evaluate("(function() { return arguments[0]; })"); - QCOMPARE(fun.isCallable(), true); - { - QJSValue result = fun.callWithInstance(eng.toScriptValue(QVariant())); - QCOMPARE(result.isUndefined(), true); - } - { - QJSValueList args; - args << eng.toScriptValue(123.0); - QJSValue result = fun.callWithInstance(eng.toScriptValue(QVariant()), args); - QCOMPARE(result.isNumber(), true); - QCOMPARE(result.toNumber(), 123.0); - } - // V2 constructors - { - QJSValueList args; - args << QJSValue(123.0); - QJSValue result = fun.callWithInstance(eng.toScriptValue(QVariant()), args); - QCOMPARE(result.isNumber(), true); - QCOMPARE(result.toNumber(), 123.0); - } -#if 0 // FIXME: The feature of interpreting a passed array as argument list has been removed from the API - { - QJSValue args = eng.newArray(); - args.setProperty(0, 123); - QJSValue result = fun.callWithInstance(eng.toScriptValue(QVariant()), args); - QVERIFY(result.isNumber()); - QCOMPARE(result.toNumber(), 123.0); - } -#endif -} - -void tst_QJSValue::call() -{ - QJSEngine eng; - { - QJSValue fun = eng.evaluate("(function() { return arguments[1]; })"); - QCOMPARE(fun.isCallable(), true); - - { - QJSValueList args; - args << eng.toScriptValue(123.0) << eng.toScriptValue(456.0); - QJSValue result = fun.callWithInstance(eng.toScriptValue(QVariant()), args); - QCOMPARE(result.isNumber(), true); - QCOMPARE(result.toNumber(), 456.0); - } -#if 0 // FIXME: The feature of interpreting a passed array as argument list has been removed from the API - { - QJSValue args = eng.newArray(); - args.setProperty(0, 123); - args.setProperty(1, 456); - QJSValue result = fun.callWithInstance(eng.toScriptValue(QVariant()), args); - QVERIFY(result.isNumber()); - QCOMPARE(result.toNumber(), 456.0); - } -#endif - } - { - QJSValue fun = eng.evaluate("(function() { throw new Error('foo'); })"); - QCOMPARE(fun.isCallable(), true); - QVERIFY(!eng.hasUncaughtException()); - - { - QJSValue result = fun.call(); - QCOMPARE(result.isError(), true); - QCOMPARE(eng.hasUncaughtException(), true); - QVERIFY(result.strictlyEquals(eng.uncaughtException())); - } - } -#if 0 // FIXME: No c-style callbacks - { - eng.clearExceptions(); - QJSValue fun = eng.newFunction(getArg); - { - QJSValueList args; - args << eng.toScriptValue(123.0); - QJSValue result = fun.callWithInstance(eng.toScriptValue(QVariant()), args); - QVERIFY(!eng.hasUncaughtException()); - QCOMPARE(result.isNumber(), true); - QCOMPARE(result.toNumber(), 123.0); - } - // V2 constructors - { - QJSValueList args; - args << QJSValue(123.0); - QJSValue result = fun.callWithInstance(eng.toScriptValue(QVariant()), args); - QCOMPARE(result.isNumber(), true); - QCOMPARE(result.toNumber(), 123.0); - } -#if 0 // FIXME: The feature of interpreting a passed array as argument list has been removed from the API - { - QJSValue args = eng.newArray(); - args.setProperty(0, 123); - QJSValue result = fun.callWithInstance(eng.toScriptValue(QVariant()), args); - QVERIFY(result.isNumber()); - QCOMPARE(result.toNumber(), 123.0); - } -#endif - } - { - QJSValue fun = eng.newFunction(evaluateArg); - { - QJSValueList args; - args << eng.toScriptValue(123.0); - QJSValue result = fun.callWithInstance(eng.toScriptValue(QVariant()), args); - QVERIFY(!eng.hasUncaughtException()); - QCOMPARE(result.isNumber(), true); - QCOMPARE(result.toNumber(), 123.0); - } - } -#endif -} - -void tst_QJSValue::call_invalidArguments() -{ -#if 0 // FIXME: No c-style callbacks - // test that invalid arguments are handled gracefully - QScriptEngine eng; - { - QJSValue fun = eng.newFunction(getArg); - { - QJSValueList args; - args << QJSValue(); - QJSValue ret = fun.callWithInstance(args); - QVERIFY(!eng.hasUncaughtException()); - QVERIFY(ret.isUndefined()); - } - } - { - QJSValue fun = eng.newFunction(evaluateArg); - { - QJSValueList args; - args << QJSValue(); - QJSValue ret = fun.call(args); - QVERIFY(ret.isUndefined()); - } - } - { - QJSValue fun = eng.newFunction(addArgs); - { - QJSValueList args; - args << QJSValue() << QJSValue(); - QJSValue ret = fun.call(args); - QVERIFY(!ret.isUndefined()); - QCOMPARE(ret.isNumber(), true); - QCOMPARE(qIsNaN(ret.toNumber()), true); - } - } -#endif -} - -void tst_QJSValue::call_invalidReturn() -{ -#if 0 // FIXME: No c-style callbacks - // test that invalid return value is handled gracefully - QScriptEngine eng; - QJSValue fun = eng.newFunction(returnInvalidValue); - eng.globalObject().setProperty("returnInvalidValue", fun); - QJSValue ret = eng.evaluate("returnInvalidValue() + returnInvalidValue()"); - QVERIFY(!ret.isUndefined()); - QCOMPARE(ret.isNumber(), true); - QCOMPARE(qIsNaN(ret.toNumber()), true); -#endif -} - -void tst_QJSValue::call_twoEngines() -{ - QJSEngine eng; - QJSValue object = eng.evaluate("Object"); - QJSEngine otherEngine; - QJSValue fun = otherEngine.evaluate("(function() { return 1; })"); - QVERIFY(fun.isCallable()); - QTest::ignoreMessage(QtWarningMsg, "JSValue can't be rassigned to an another engine."); - QTest::ignoreMessage(QtWarningMsg, "QJSValue::call() failed: " - "cannot call function with thisObject created in " - "a different engine"); - QVERIFY(fun.callWithInstance(object).isUndefined()); - QTest::ignoreMessage(QtWarningMsg, "QJSValue::call() failed: " - "cannot call function with argument created in " - "a different engine"); - QVERIFY(fun.call(QJSValueList() << eng.toScriptValue(123)).isUndefined()); - { - QJSValue fun = eng.evaluate("Object"); - QVERIFY(fun.isCallable()); - QJSEngine eng2; - QJSValue objectInDifferentEngine = eng2.newObject(); - QJSValueList args; - args << objectInDifferentEngine; - QTest::ignoreMessage(QtWarningMsg, "QJSValue::call() failed: cannot call function with argument created in a different engine"); - fun.call(args); - } -} - -void tst_QJSValue::call_array() -{ -#if 0 // FIXME: The feature of interpreting an array as argument list has been removed from the API - QScriptEngine eng; - QJSValue fun = eng.evaluate("(function() { return arguments; })"); - QVERIFY(fun.isCallable()); - QJSValue array = eng.newArray(3); - array.setProperty(0, eng.toScriptValue(123.0)); - array.setProperty(1, eng.toScriptValue(456.0)); - array.setProperty(2, eng.toScriptValue(789.0)); - // call with single array object as arguments - QJSValue ret = fun.call(QJSValue(), array); - QVERIFY(!eng.hasUncaughtException()); - QCOMPARE(ret.isError(), false); - QCOMPARE(ret.property(0).strictlyEquals(array.property(0)), true); - QCOMPARE(ret.property(1).strictlyEquals(array.property(1)), true); - QCOMPARE(ret.property(2).strictlyEquals(array.property(2)), true); - // call with arguments object as arguments - QJSValue ret2 = fun.call(QJSValue(), ret); - QCOMPARE(ret2.isError(), false); - QCOMPARE(ret2.property(0).strictlyEquals(ret.property(0)), true); - QCOMPARE(ret2.property(1).strictlyEquals(ret.property(1)), true); - QCOMPARE(ret2.property(2).strictlyEquals(ret.property(2)), true); - // call with null as arguments - QJSValue ret3 = fun.call(QJSValue(), eng.evaluate("null")); - QCOMPARE(ret3.isError(), false); - QCOMPARE(ret3.property("length").isNumber(), true); - QCOMPARE(ret3.property("length").toNumber(), 0.0); - // call with undefined as arguments - QJSValue ret4 = fun.call(QJSValue(), eng.toScriptValue(QVariant())); - QCOMPARE(ret4.isError(), false); - QCOMPARE(ret4.property("length").isNumber(), true); - QCOMPARE(ret4.property("length").toNumber(), 0.0); - // call with something else as arguments - QJSValue ret5 = fun.call(QJSValue(), eng.toScriptValue(123.0)); - QCOMPARE(ret5.isError(), true); - // call with a non-array object as arguments - QJSValue ret6 = fun.call(QJSValue(), eng.globalObject()); - QVERIFY(ret6.isError()); - QCOMPARE(ret6.toString(), QString::fromLatin1("TypeError: Arguments must be an array")); -#endif -} - - -void tst_QJSValue::call_nonFunction_data() -{ - newEngine(); - QTest::addColumn("value"); - - QTest::newRow("invalid") << QJSValue(); - QTest::newRow("bool") << QJSValue(false); - QTest::newRow("int") << QJSValue(123); - QTest::newRow("string") << QJSValue(QString::fromLatin1("ciao")); - QTest::newRow("undefined") << QJSValue(QJSValue::UndefinedValue); - QTest::newRow("null") << QJSValue(QJSValue::NullValue); - - QTest::newRow("bool bound") << engine->toScriptValue(false); - QTest::newRow("int bound") << engine->toScriptValue(123); - QTest::newRow("string bound") << engine->toScriptValue(QString::fromLatin1("ciao")); - QTest::newRow("undefined bound") << engine->toScriptValue(QVariant()); - QTest::newRow("null bound") << engine->evaluate("null"); -} - -void tst_QJSValue::call_nonFunction() -{ - // calling things that are not functions - QFETCH(QJSValue, value); - QVERIFY(value.call().isUndefined()); -} - -#if 0 // FIXME: no c-style callbacks -static QJSValue ctorReturningUndefined(QScriptContext *ctx, QScriptEngine *) -{ - ctx->thisObject().setProperty("foo", 123); - return QJSValue(QJSValue::UndefinedValue); -} - -static QJSValue ctorReturningNewObject(QScriptContext *, QScriptEngine *eng) -{ - QJSValue result = eng->newObject(); - result.setProperty("bar", 456); - return result; -} -#endif - -void tst_QJSValue::construct_nonFunction_data() -{ - newEngine(); - QTest::addColumn("value"); - - QTest::newRow("invalid") << QJSValue(); - QTest::newRow("bool") << QJSValue(false); - QTest::newRow("int") << QJSValue(123); - QTest::newRow("string") << QJSValue(QString::fromLatin1("ciao")); - QTest::newRow("undefined") << QJSValue(QJSValue::UndefinedValue); - QTest::newRow("null") << QJSValue(QJSValue::NullValue); - - QTest::newRow("bool bound") << engine->toScriptValue(false); - QTest::newRow("int bound") << engine->toScriptValue(123); - QTest::newRow("string bound") << engine->toScriptValue(QString::fromLatin1("ciao")); - QTest::newRow("undefined bound") << engine->toScriptValue(QVariant()); - QTest::newRow("null bound") << engine->evaluate("null"); -} - -void tst_QJSValue::construct_nonFunction() -{ - QFETCH(QJSValue, value); - QVERIFY(value.callAsConstructor().isUndefined()); -} - -void tst_QJSValue::construct_simple() -{ - QJSEngine eng; - QJSValue fun = eng.evaluate("(function () { this.foo = 123; })"); - QVERIFY(fun.isCallable()); - QJSValue ret = fun.callAsConstructor(); - QVERIFY(!ret.isUndefined()); - QVERIFY(ret.isObject()); - QVERIFY(ret.prototype().strictlyEquals(fun.property("prototype"))); - QCOMPARE(ret.property("foo").toInt(), 123); -} - -void tst_QJSValue::construct_newObjectJS() -{ - QJSEngine eng; - // returning a different object overrides the default-constructed one - QJSValue fun = eng.evaluate("(function () { return { bar: 456 }; })"); - QVERIFY(fun.isCallable()); - QJSValue ret = fun.callAsConstructor(); - QVERIFY(ret.isObject()); - QVERIFY(!ret.prototype().strictlyEquals(fun.property("prototype"))); - QCOMPARE(ret.property("bar").toInt(), 456); -} - -#if 0 // FIXME: no c-style callbacks -void tst_QJSValue::construct_undefined() -{ - QScriptEngine eng; - QJSValue fun = eng.newFunction(ctorReturningUndefined); - QJSValue ret = fun.callAsConstructor(); - QVERIFY(ret.isObject()); - QVERIFY(ret.instanceOf(fun)); - QCOMPARE(ret.property("foo").toInt(), 123); -} - -void tst_QJSValue::construct_newObjectCpp() -{ - QScriptEngine eng; - QJSValue fun = eng.newFunction(ctorReturningNewObject); - QJSValue ret = fun.callAsConstructor(); - QVERIFY(ret.isObject()); - QVERIFY(!ret.instanceOf(fun)); - QCOMPARE(ret.property("bar").toInt(), 456); -} -#endif - -void tst_QJSValue::construct_arg() -{ - QJSEngine eng; - QJSValue Number = eng.evaluate("Number"); - QCOMPARE(Number.isCallable(), true); - QJSValueList args; - args << eng.toScriptValue(123); - QJSValue ret = Number.callAsConstructor(args); - QCOMPARE(ret.isObject(), true); - QCOMPARE(ret.toNumber(), args.at(0).toNumber()); -} - -void tst_QJSValue::construct_proto() -{ - QJSEngine eng; - // test that internal prototype is set correctly - QJSValue fun = eng.evaluate("(function() { return this.__proto__; })"); - QCOMPARE(fun.isCallable(), true); - QCOMPARE(fun.property("prototype").isObject(), true); - QJSValue ret = fun.callAsConstructor(); - QCOMPARE(fun.property("prototype").strictlyEquals(ret), true); -} - -void tst_QJSValue::construct_returnInt() -{ - QJSEngine eng; - // test that we return the new object even if a non-object value is returned from the function - QJSValue fun = eng.evaluate("(function() { return 123; })"); - QCOMPARE(fun.isCallable(), true); - QJSValue ret = fun.callAsConstructor(); - QCOMPARE(ret.isObject(), true); -} - -void tst_QJSValue::construct_throw() -{ - QJSEngine eng; - QJSValue fun = eng.evaluate("(function() { throw new Error('foo'); })"); - QCOMPARE(fun.isCallable(), true); - QJSValue ret = fun.callAsConstructor(); - QCOMPARE(ret.isError(), true); - QCOMPARE(eng.hasUncaughtException(), true); - QVERIFY(ret.strictlyEquals(eng.uncaughtException())); -} - -#if 0 // FIXME: The feature of interpreting an array as argument list has been removed from the API -void tst_QJSValue::construct() -{ - QScriptEngine eng; - QJSValue fun = eng.evaluate("(function() { return arguments; })"); - QVERIFY(fun.isCallable()); - QJSValue array = eng.newArray(3); - array.setProperty(0, eng.toScriptValue(123.0)); - array.setProperty(1, eng.toScriptValue(456.0)); - array.setProperty(2, eng.toScriptValue(789.0)); - // construct with single array object as arguments - QJSValue ret = fun.callAsConstructor(array); - QVERIFY(!eng.hasUncaughtException()); - QVERIFY(ret.isObject()); - QCOMPARE(ret.property(0).strictlyEquals(array.property(0)), true); - QCOMPARE(ret.property(1).strictlyEquals(array.property(1)), true); - QCOMPARE(ret.property(2).strictlyEquals(array.property(2)), true); - // construct with arguments object as arguments - QJSValue ret2 = fun.callAsConstructor(ret); - QCOMPARE(ret2.property(0).strictlyEquals(ret.property(0)), true); - QCOMPARE(ret2.property(1).strictlyEquals(ret.property(1)), true); - QCOMPARE(ret2.property(2).strictlyEquals(ret.property(2)), true); - // construct with null as arguments - QJSValue ret3 = fun.callAsConstructor(eng.evaluate("null"); - QCOMPARE(ret3.isError(), false); - QCOMPARE(ret3.property("length").isNumber(), true); - QCOMPARE(ret3.property("length").toNumber(), 0.0); - // construct with undefined as arguments - QJSValue ret4 = fun.callAsConstructor(eng.toScriptValue(QVariant())); - QCOMPARE(ret4.isError(), false); - QCOMPARE(ret4.property("length").isNumber(), true); - QCOMPARE(ret4.property("length").toNumber(), 0.0); - // construct with something else as arguments - QJSValue ret5 = fun.callAsConstructor(eng.toScriptValue(123.0)); - QCOMPARE(ret5.isError(), true); - // construct with a non-array object as arguments - QJSValue ret6 = fun.callAsConstructor(eng.globalObject()); - QVERIFY(ret6.isError()); - QCOMPARE(ret6.toString(), QString::fromLatin1("TypeError: Arguments must be an array")); -} -#endif - -void tst_QJSValue::construct_twoEngines() -{ - QJSEngine engine; - QJSEngine otherEngine; - QJSValue ctor = engine.evaluate("(function (a, b) { this.foo = 123; })"); - QJSValue arg = otherEngine.toScriptValue(124567); - QTest::ignoreMessage(QtWarningMsg, "QJSValue::callAsConstructor() failed: cannot construct function with argument created in a different engine"); - QVERIFY(ctor.callAsConstructor(QJSValueList() << arg).isUndefined()); - QTest::ignoreMessage(QtWarningMsg, "QJSValue::callAsConstructor() failed: cannot construct function with argument created in a different engine"); - QVERIFY(ctor.callAsConstructor(QJSValueList() << arg << otherEngine.newObject()).isUndefined()); -} - -void tst_QJSValue::construct_constructorThrowsPrimitive() -{ - QJSEngine eng; - QJSValue fun = eng.evaluate("(function() { throw 123; })"); - QVERIFY(fun.isCallable()); - // construct(QJSValueList) - { - QJSValue ret = fun.callAsConstructor(); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toNumber(), 123.0); - QVERIFY(eng.hasUncaughtException()); - QVERIFY(ret.strictlyEquals(eng.uncaughtException())); - eng.clearExceptions(); - } -#if 0 // FIXME: The feature of interpreting an array as argument list has been removed from the API - // construct(QJSValue) - { - QJSValue ret = fun.callAsConstructor(eng.newArray()); - QVERIFY(ret.isNumber()); - QCOMPARE(ret.toNumber(), 123.0); - QVERIFY(eng.hasUncaughtException()); - QVERIFY(ret.strictlyEquals(eng.uncaughtException())); - eng.clearExceptions(); - } -#endif -} - -#if 0 // FIXME: No QJSValue::lessThan -void tst_QJSValue::lessThan() -{ - QScriptEngine eng; - - QVERIFY(!QJSValue().lessThan(QJSValue())); - - QJSValue num = eng.toScriptValue(123); - QCOMPARE(num.lessThan(eng.toScriptValue(124)), true); - QCOMPARE(num.lessThan(eng.toScriptValue(122)), false); - QCOMPARE(num.lessThan(eng.toScriptValue(123)), false); - QCOMPARE(num.lessThan(eng.toScriptValue("124")), true); - QCOMPARE(num.lessThan(eng.toScriptValue("122")), false); - QCOMPARE(num.lessThan(eng.toScriptValue("123")), false); - QCOMPARE(num.lessThan(eng.toScriptValue(qSNaN())), false); - QCOMPARE(num.lessThan(eng.toScriptValue(+qInf())), true); - QCOMPARE(num.lessThan(eng.toScriptValue(-qInf())), false); - QCOMPARE(num.lessThan(num), false); - QCOMPARE(num.lessThan(eng.toScriptValue(124).toObject()), true); - QCOMPARE(num.lessThan(eng.toScriptValue(122).toObject()), false); - QCOMPARE(num.lessThan(eng.toScriptValue(123).toObject()), false); - QCOMPARE(num.lessThan(eng.toScriptValue("124").toObject()), true); - QCOMPARE(num.lessThan(eng.toScriptValue("122").toObject()), false); - QCOMPARE(num.lessThan(eng.toScriptValue("123").toObject()), false); - QCOMPARE(num.lessThan(eng.toScriptValue(qSNaN()).toObject()), false); - QCOMPARE(num.lessThan(eng.toScriptValue(+qInf()).toObject()), true); - QCOMPARE(num.lessThan(eng.toScriptValue(-qInf()).toObject()), false); - QCOMPARE(num.lessThan(num.toObject()), false); - QCOMPARE(num.lessThan(QJSValue()), false); - - QJSValue str = eng.toScriptValue("123"); - QCOMPARE(str.lessThan(eng.toScriptValue("124")), true); - QCOMPARE(str.lessThan(eng.toScriptValue("122")), false); - QCOMPARE(str.lessThan(eng.toScriptValue("123")), false); - QCOMPARE(str.lessThan(eng.toScriptValue(124)), true); - QCOMPARE(str.lessThan(eng.toScriptValue(122)), false); - QCOMPARE(str.lessThan(eng.toScriptValue(123)), false); - QCOMPARE(str.lessThan(str), false); - QCOMPARE(str.lessThan(eng.toScriptValue("124").toObject()), true); - QCOMPARE(str.lessThan(eng.toScriptValue("122").toObject()), false); - QCOMPARE(str.lessThan(eng.toScriptValue("123").toObject()), false); - QCOMPARE(str.lessThan(eng.toScriptValue(124).toObject()), true); - QCOMPARE(str.lessThan(eng.toScriptValue(122).toObject()), false); - QCOMPARE(str.lessThan(eng.toScriptValue(123).toObject()), false); - QCOMPARE(str.lessThan(str.toObject()), false); - QCOMPARE(str.lessThan(QJSValue()), false); - - // V2 constructors - QJSValue num2 = QJSValue(123); - QCOMPARE(num2.lessThan(QJSValue(124)), true); - QCOMPARE(num2.lessThan(QJSValue(122)), false); - QCOMPARE(num2.lessThan(QJSValue(123)), false); - QCOMPARE(num2.lessThan(QJSValue("124")), true); - QCOMPARE(num2.lessThan(QJSValue("122")), false); - QCOMPARE(num2.lessThan(QJSValue("123")), false); - QCOMPARE(num2.lessThan(QJSValue(qSNaN())), false); - QCOMPARE(num2.lessThan(QJSValue(+qInf())), true); - QCOMPARE(num2.lessThan(QJSValue(-qInf())), false); - QCOMPARE(num2.lessThan(num), false); - QCOMPARE(num2.lessThan(QJSValue()), false); - - QJSValue str2 = QJSValue("123"); - QCOMPARE(str2.lessThan(QJSValue("124")), true); - QCOMPARE(str2.lessThan(QJSValue("122")), false); - QCOMPARE(str2.lessThan(QJSValue("123")), false); - QCOMPARE(str2.lessThan(QJSValue(124)), true); - QCOMPARE(str2.lessThan(QJSValue(122)), false); - QCOMPARE(str2.lessThan(QJSValue(123)), false); - QCOMPARE(str2.lessThan(str), false); - QCOMPARE(str2.lessThan(QJSValue()), false); - - QJSValue obj1 = eng.newObject(); - QJSValue obj2 = eng.newObject(); - QCOMPARE(obj1.lessThan(obj2), false); - QCOMPARE(obj2.lessThan(obj1), false); - QCOMPARE(obj1.lessThan(obj1), false); - QCOMPARE(obj2.lessThan(obj2), false); - - QJSValue date1 = eng.toScriptValue(QDateTime(QDate(2000, 1, 1))); - QJSValue date2 = eng.toScriptValue(QDateTime(QDate(1999, 1, 1))); - QCOMPARE(date1.lessThan(date2), false); - QCOMPARE(date2.lessThan(date1), true); - QCOMPARE(date1.lessThan(date1), false); - QCOMPARE(date2.lessThan(date2), false); - QCOMPARE(date1.lessThan(QJSValue()), false); - - QCOMPARE(QJSValue().lessThan(date2), false); - - QScriptEngine otherEngine; - QTest::ignoreMessage(QtWarningMsg, "QJSValue::lessThan: " - "cannot compare to a value created in " - "a different engine"); - QCOMPARE(date1.lessThan(otherEngine.toScriptValue(123)), false); -} -#endif - -void tst_QJSValue::equals() -{ - QJSEngine eng; - - QVERIFY(QJSValue().equals(QJSValue())); - - QJSValue num = eng.toScriptValue(123); - QCOMPARE(num.equals(eng.toScriptValue(123)), true); - QCOMPARE(num.equals(eng.toScriptValue(321)), false); - QCOMPARE(num.equals(eng.toScriptValue(QString::fromLatin1("123"))), true); - QCOMPARE(num.equals(eng.toScriptValue(QString::fromLatin1("321"))), false); - QCOMPARE(num.equals(eng.evaluate("new Number(123)")), true); - QCOMPARE(num.equals(eng.evaluate("new Number(321)")), false); - QCOMPARE(num.equals(eng.evaluate("new String('123')")), true); - QCOMPARE(num.equals(eng.evaluate("new String('321')")), false); - QVERIFY(eng.evaluate("new Number(123)").equals(num)); - QCOMPARE(num.equals(QJSValue()), false); - - QJSValue str = eng.toScriptValue(QString::fromLatin1("123")); - QCOMPARE(str.equals(eng.toScriptValue(QString::fromLatin1("123"))), true); - QCOMPARE(str.equals(eng.toScriptValue(QString::fromLatin1("321"))), false); - QCOMPARE(str.equals(eng.toScriptValue(123)), true); - QCOMPARE(str.equals(eng.toScriptValue(321)), false); - QCOMPARE(str.equals(eng.evaluate("new String('123')")), true); - QCOMPARE(str.equals(eng.evaluate("new String('321')")), false); - QCOMPARE(str.equals(eng.evaluate("new Number(123)")), true); - QCOMPARE(str.equals(eng.evaluate("new Number(321)")), false); - QVERIFY(eng.evaluate("new String('123')").equals(str)); - QCOMPARE(str.equals(QJSValue()), false); - - QJSValue num2 = QJSValue(123); - QCOMPARE(num2.equals(QJSValue(123)), true); - QCOMPARE(num2.equals(QJSValue(321)), false); - QCOMPARE(num2.equals(QJSValue("123")), true); - QCOMPARE(num2.equals(QJSValue("321")), false); - QCOMPARE(num2.equals(QJSValue()), false); - - QJSValue str2 = QJSValue("123"); - QCOMPARE(str2.equals(QJSValue("123")), true); - QCOMPARE(str2.equals(QJSValue("321")), false); - QCOMPARE(str2.equals(QJSValue(123)), true); - QCOMPARE(str2.equals(QJSValue(321)), false); - QCOMPARE(str2.equals(QJSValue()), false); - - QJSValue date1 = eng.toScriptValue(QDateTime(QDate(2000, 1, 1))); - QJSValue date2 = eng.toScriptValue(QDateTime(QDate(1999, 1, 1))); - QCOMPARE(date1.equals(date2), false); - QCOMPARE(date1.equals(date1), true); - QCOMPARE(date2.equals(date2), true); - - QJSValue undefined = eng.toScriptValue(QVariant()); - QJSValue null = eng.evaluate("null"); - QCOMPARE(undefined.equals(undefined), true); - QCOMPARE(null.equals(null), true); - QCOMPARE(undefined.equals(null), true); - QCOMPARE(null.equals(undefined), true); - QVERIFY(undefined.equals(QJSValue())); - QVERIFY(null.equals(QJSValue())); - QVERIFY(!null.equals(num)); - QVERIFY(!undefined.equals(num)); - - QJSValue sant = eng.toScriptValue(true); - QVERIFY(sant.equals(eng.toScriptValue(1))); - QVERIFY(sant.equals(eng.toScriptValue(QString::fromLatin1("1")))); - QVERIFY(sant.equals(sant)); - QVERIFY(sant.equals(eng.evaluate("new Number(1)"))); - QVERIFY(sant.equals(eng.evaluate("new String('1')"))); - QVERIFY(sant.equals(eng.evaluate("new Boolean(true)"))); - QVERIFY(eng.evaluate("new Boolean(true)").equals(sant)); - QVERIFY(!sant.equals(eng.toScriptValue(0))); - QVERIFY(!sant.equals(undefined)); - QVERIFY(!sant.equals(null)); - - QJSValue falskt = eng.toScriptValue(false); - QVERIFY(falskt.equals(eng.toScriptValue(0))); - QVERIFY(falskt.equals(eng.toScriptValue(QString::fromLatin1("0")))); - QVERIFY(falskt.equals(falskt)); - QVERIFY(falskt.equals(eng.evaluate("new Number(0)"))); - QVERIFY(falskt.equals(eng.evaluate("new String('0')"))); - QVERIFY(falskt.equals(eng.evaluate("new Boolean(false)"))); - QVERIFY(eng.evaluate("new Boolean(false)").equals(falskt)); - QVERIFY(!falskt.equals(sant)); - QVERIFY(!falskt.equals(undefined)); - QVERIFY(!falskt.equals(null)); - - QJSValue obj1 = eng.newObject(); - QJSValue obj2 = eng.newObject(); - QCOMPARE(obj1.equals(obj2), false); - QCOMPARE(obj2.equals(obj1), false); - QCOMPARE(obj1.equals(obj1), true); - QCOMPARE(obj2.equals(obj2), true); - - QJSValue qobj1 = eng.newQObject(this); - QJSValue qobj2 = eng.newQObject(this); - QJSValue qobj3 = eng.newQObject(0); - - // FIXME: No ScriptOwnership: QJSValue qobj4 = eng.newQObject(new QObject(), QScriptEngine::ScriptOwnership); - QJSValue qobj4 = eng.newQObject(new QObject()); - - QVERIFY(qobj1.equals(qobj2)); // compares the QObject pointers - QVERIFY(!qobj2.equals(qobj4)); // compares the QObject pointers - QVERIFY(!qobj2.equals(obj2)); // compares the QObject pointers - - QJSValue compareFun = eng.evaluate("(function(a, b) { return a == b; })"); - QVERIFY(compareFun.isCallable()); - { - QJSValue ret = compareFun.call(QJSValueList() << qobj1 << qobj2); - QVERIFY(ret.isBool()); - ret = compareFun.call(QJSValueList() << qobj1 << qobj3); - QVERIFY(ret.isBool()); - QVERIFY(!ret.toBool()); - ret = compareFun.call(QJSValueList() << qobj1 << qobj4); - QVERIFY(ret.isBool()); - QVERIFY(!ret.toBool()); - ret = compareFun.call(QJSValueList() << qobj1 << obj1); - QVERIFY(ret.isBool()); - QVERIFY(!ret.toBool()); - } - - { - QJSValue var1 = eng.toScriptValue(QVariant(QPoint(1, 2))); - QJSValue var2 = eng.toScriptValue(QVariant(QPoint(1, 2))); - QEXPECT_FAIL("", "FIXME: QVariant comparison does not work with v8", Continue); - QVERIFY(var1.equals(var2)); - } - { - QJSValue var1 = eng.toScriptValue(QVariant(QPoint(1, 2))); - QJSValue var2 = eng.toScriptValue(QVariant(QPoint(3, 4))); - QVERIFY(!var1.equals(var2)); - } - - QJSEngine otherEngine; - QTest::ignoreMessage(QtWarningMsg, "QJSValue::equals: " - "cannot compare to a value created in " - "a different engine"); - QCOMPARE(date1.equals(otherEngine.toScriptValue(123)), false); -} - -void tst_QJSValue::strictlyEquals() -{ - QJSEngine eng; - - QVERIFY(QJSValue().strictlyEquals(QJSValue())); - - QJSValue num = eng.toScriptValue(123); - QCOMPARE(num.strictlyEquals(eng.toScriptValue(123)), true); - QCOMPARE(num.strictlyEquals(eng.toScriptValue(321)), false); - QCOMPARE(num.strictlyEquals(eng.toScriptValue(QString::fromLatin1("123"))), false); - QCOMPARE(num.strictlyEquals(eng.toScriptValue(QString::fromLatin1("321"))), false); - QCOMPARE(num.strictlyEquals(eng.evaluate("new Number(123)")), false); - QCOMPARE(num.strictlyEquals(eng.evaluate("new Number(321)")), false); - QCOMPARE(num.strictlyEquals(eng.evaluate("new String('123')")), false); - QCOMPARE(num.strictlyEquals(eng.evaluate("new String('321')")), false); - QVERIFY(!eng.evaluate("new Number(123)").strictlyEquals(num)); - QVERIFY(!num.strictlyEquals(QJSValue())); - QVERIFY(!QJSValue().strictlyEquals(num)); - - QJSValue str = eng.toScriptValue(QString::fromLatin1("123")); - QCOMPARE(str.strictlyEquals(eng.toScriptValue(QString::fromLatin1("123"))), true); - QCOMPARE(str.strictlyEquals(eng.toScriptValue(QString::fromLatin1("321"))), false); - QCOMPARE(str.strictlyEquals(eng.toScriptValue(123)), false); - QCOMPARE(str.strictlyEquals(eng.toScriptValue(321)), false); - QCOMPARE(str.strictlyEquals(eng.evaluate("new String('123')")), false); - QCOMPARE(str.strictlyEquals(eng.evaluate("new String('321')")), false); - QCOMPARE(str.strictlyEquals(eng.evaluate("new Number(123)")), false); - QCOMPARE(str.strictlyEquals(eng.evaluate("new Number(321)")), false); - QVERIFY(!eng.evaluate("new String('123')").strictlyEquals(str)); - QVERIFY(!str.strictlyEquals(QJSValue())); - - QJSValue num2 = QJSValue(123); - QCOMPARE(num2.strictlyEquals(QJSValue(123)), true); - QCOMPARE(num2.strictlyEquals(QJSValue(321)), false); - QCOMPARE(num2.strictlyEquals(QJSValue("123")), false); - QCOMPARE(num2.strictlyEquals(QJSValue("321")), false); - QVERIFY(!num2.strictlyEquals(QJSValue())); - - QJSValue str2 = QJSValue("123"); - QCOMPARE(str2.strictlyEquals(QJSValue("123")), true); - QCOMPARE(str2.strictlyEquals(QJSValue("321")), false); - QCOMPARE(str2.strictlyEquals(QJSValue(123)), false); - QCOMPARE(str2.strictlyEquals(QJSValue(321)), false); - QVERIFY(!str2.strictlyEquals(QJSValue())); - - QJSValue date1 = eng.toScriptValue(QDateTime(QDate(2000, 1, 1))); - QJSValue date2 = eng.toScriptValue(QDateTime(QDate(1999, 1, 1))); - QCOMPARE(date1.strictlyEquals(date2), false); - QCOMPARE(date1.strictlyEquals(date1), true); - QCOMPARE(date2.strictlyEquals(date2), true); - QVERIFY(!date1.strictlyEquals(QJSValue())); - - QJSValue undefined = eng.toScriptValue(QVariant()); - QJSValue null = eng.evaluate("null"); - QCOMPARE(undefined.strictlyEquals(undefined), true); - QCOMPARE(null.strictlyEquals(null), true); - QCOMPARE(undefined.strictlyEquals(null), false); - QCOMPARE(null.strictlyEquals(undefined), false); - QVERIFY(!null.strictlyEquals(QJSValue())); - - QJSValue sant = eng.toScriptValue(true); - QVERIFY(!sant.strictlyEquals(eng.toScriptValue(1))); - QVERIFY(!sant.strictlyEquals(eng.toScriptValue(QString::fromLatin1("1")))); - QVERIFY(sant.strictlyEquals(sant)); - QVERIFY(!sant.strictlyEquals(eng.evaluate("new Number(1)"))); - QVERIFY(!sant.strictlyEquals(eng.evaluate("new String('1')"))); - QVERIFY(!sant.strictlyEquals(eng.evaluate("new Boolean(true)"))); - QVERIFY(!eng.evaluate("new Boolean(true)").strictlyEquals(sant)); - QVERIFY(!sant.strictlyEquals(eng.toScriptValue(0))); - QVERIFY(!sant.strictlyEquals(undefined)); - QVERIFY(!sant.strictlyEquals(null)); - QVERIFY(!sant.strictlyEquals(QJSValue())); - - QJSValue falskt = eng.toScriptValue(false); - QVERIFY(!falskt.strictlyEquals(eng.toScriptValue(0))); - QVERIFY(!falskt.strictlyEquals(eng.toScriptValue(QString::fromLatin1("0")))); - QVERIFY(falskt.strictlyEquals(falskt)); - QVERIFY(!falskt.strictlyEquals(eng.evaluate("new Number(0)"))); - QVERIFY(!falskt.strictlyEquals(eng.evaluate("new String('0')"))); - QVERIFY(!falskt.strictlyEquals(eng.evaluate("new Boolean(false)"))); - QVERIFY(!eng.evaluate("new Boolean(false)").strictlyEquals(falskt)); - QVERIFY(!falskt.strictlyEquals(sant)); - QVERIFY(!falskt.strictlyEquals(undefined)); - QVERIFY(!falskt.strictlyEquals(null)); - QVERIFY(!falskt.strictlyEquals(QJSValue())); - - QVERIFY(!QJSValue(false).strictlyEquals(123)); - QVERIFY(!QJSValue(QJSValue::UndefinedValue).strictlyEquals(123)); - QVERIFY(!QJSValue(QJSValue::NullValue).strictlyEquals(123)); - QVERIFY(!QJSValue(false).strictlyEquals("ciao")); - QVERIFY(!QJSValue(QJSValue::UndefinedValue).strictlyEquals("ciao")); - QVERIFY(!QJSValue(QJSValue::NullValue).strictlyEquals("ciao")); - QVERIFY(eng.toScriptValue(QString::fromLatin1("ciao")).strictlyEquals("ciao")); - QVERIFY(QJSValue("ciao").strictlyEquals(eng.toScriptValue(QString::fromLatin1("ciao")))); - QVERIFY(!QJSValue("ciao").strictlyEquals(123)); - QVERIFY(!QJSValue("ciao").strictlyEquals(eng.toScriptValue(123))); - QVERIFY(!QJSValue(123).strictlyEquals("ciao")); - QVERIFY(!QJSValue(123).strictlyEquals(eng.toScriptValue(QString::fromLatin1("ciao")))); - QVERIFY(!eng.toScriptValue(123).strictlyEquals("ciao")); - - QJSValue obj1 = eng.newObject(); - QJSValue obj2 = eng.newObject(); - QCOMPARE(obj1.strictlyEquals(obj2), false); - QCOMPARE(obj2.strictlyEquals(obj1), false); - QCOMPARE(obj1.strictlyEquals(obj1), true); - QCOMPARE(obj2.strictlyEquals(obj2), true); - QVERIFY(!obj1.strictlyEquals(QJSValue())); - - QJSValue qobj1 = eng.newQObject(this); - QJSValue qobj2 = eng.newQObject(this); - QVERIFY(qobj1.strictlyEquals(qobj2)); - - { - QJSValue var1 = eng.toScriptValue(QVariant(QStringList() << "a")); - QJSValue var2 = eng.toScriptValue(QVariant(QStringList() << "a")); - QVERIFY(var1.isArray()); - QVERIFY(var2.isArray()); - QVERIFY(!var1.strictlyEquals(var2)); - } - { - QJSValue var1 = eng.toScriptValue(QVariant(QStringList() << "a")); - QJSValue var2 = eng.toScriptValue(QVariant(QStringList() << "b")); - QVERIFY(!var1.strictlyEquals(var2)); - } - { - QJSValue var1 = eng.toScriptValue(QVariant(QPoint(1, 2))); - QJSValue var2 = eng.toScriptValue(QVariant(QPoint(1, 2))); - QVERIFY(!var1.strictlyEquals(var2)); - } - { - QJSValue var1 = eng.toScriptValue(QVariant(QPoint(1, 2))); - QJSValue var2 = eng.toScriptValue(QVariant(QPoint(3, 4))); - QVERIFY(!var1.strictlyEquals(var2)); - } - - QJSEngine otherEngine; - QTest::ignoreMessage(QtWarningMsg, "QJSValue::strictlyEquals: " - "cannot compare to a value created in " - "a different engine"); - QCOMPARE(date1.strictlyEquals(otherEngine.toScriptValue(123)), false); -} - -Q_DECLARE_METATYPE(int*) -Q_DECLARE_METATYPE(double*) -Q_DECLARE_METATYPE(QColor*) -Q_DECLARE_METATYPE(QBrush*) - -void tst_QJSValue::castToPointer() -{ - QJSEngine eng; - { - QColor c(123, 210, 231); - QJSValue v = eng.toScriptValue(c); - QColor *cp = qjsvalue_cast(v); - QVERIFY(cp != 0); - QCOMPARE(*cp, c); - - QBrush *bp = qjsvalue_cast(v); - QVERIFY(bp == 0); - - QJSValue v2 = eng.toScriptValue(qVariantFromValue(cp)); - QCOMPARE(qjsvalue_cast(v2), cp); - } -} - -void tst_QJSValue::prettyPrinter_data() -{ - QTest::addColumn("function"); - QTest::addColumn("expected"); - QTest::newRow("function() { }") << QString("function() { }") << QString("function () { }"); - QTest::newRow("function foo() { }") << QString("(function foo() { })") << QString("function foo() { }"); - QTest::newRow("function foo(bar) { }") << QString("(function foo(bar) { })") << QString("function foo(bar) { }"); - QTest::newRow("function foo(bar, baz) { }") << QString("(function foo(bar, baz) { })") << QString("function foo(bar, baz) { }"); - QTest::newRow("this") << QString("function() { this; }") << QString("function () { this; }"); - QTest::newRow("identifier") << QString("function(a) { a; }") << QString("function (a) { a; }"); - QTest::newRow("null") << QString("function() { null; }") << QString("function () { null; }"); - QTest::newRow("true") << QString("function() { true; }") << QString("function () { true; }"); - QTest::newRow("false") << QString("function() { false; }") << QString("function () { false; }"); - QTest::newRow("string") << QString("function() { 'test'; }") << QString("function () { \'test\'; }"); - QTest::newRow("string") << QString("function() { \"test\"; }") << QString("function () { \"test\"; }"); - QTest::newRow("number") << QString("function() { 123; }") << QString("function () { 123; }"); - QTest::newRow("number") << QString("function() { 123.456; }") << QString("function () { 123.456; }"); - QTest::newRow("regexp") << QString("function() { /hello/; }") << QString("function () { /hello/; }"); - QTest::newRow("regexp") << QString("function() { /hello/gim; }") << QString("function () { /hello/gim; }"); - QTest::newRow("array") << QString("function() { []; }") << QString("function () { []; }"); - QTest::newRow("array") << QString("function() { [10]; }") << QString("function () { [10]; }"); - QTest::newRow("array") << QString("function() { [10, 20, 30]; }") << QString("function () { [10, 20, 30]; }"); - QTest::newRow("array") << QString("function() { [10, 20, , 40]; }") << QString("function () { [10, 20, , 40]; }"); - QTest::newRow("array") << QString("function() { [,]; }") << QString("function () { [,]; }"); - QTest::newRow("array") << QString("function() { [, 10]; }") << QString("function () { [, 10]; }"); - QTest::newRow("array") << QString("function() { [, 10, ]; }") << QString("function () { [, 10, ]; }"); - QTest::newRow("array") << QString("function() { [, 10, ,]; }") << QString("function () { [, 10, ,]; }"); - QTest::newRow("array") << QString("function() { [[10], [20]]; }") << QString("function () { [[10], [20]]; }"); - QTest::newRow("member") << QString("function() { a.b; }") << QString("function () { a.b; }"); - QTest::newRow("member") << QString("function() { a.b.c; }") << QString("function () { a.b.c; }"); - QTest::newRow("call") << QString("function() { f(); }") << QString("function () { f(); }"); - QTest::newRow("call") << QString("function() { f(a); }") << QString("function () { f(a); }"); - QTest::newRow("call") << QString("function() { f(a, b); }") << QString("function () { f(a, b); }"); - QTest::newRow("new") << QString("function() { new C(); }") << QString("function () { new C(); }"); - QTest::newRow("new") << QString("function() { new C(a); }") << QString("function () { new C(a); }"); - QTest::newRow("new") << QString("function() { new C(a, b); }") << QString("function () { new C(a, b); }"); - QTest::newRow("++") << QString("function() { a++; }") << QString("function () { a++; }"); - QTest::newRow("++") << QString("function() { ++a; }") << QString("function () { ++a; }"); - QTest::newRow("--") << QString("function() { a--; }") << QString("function () { a--; }"); - QTest::newRow("--") << QString("function() { --a; }") << QString("function () { --a; }"); - QTest::newRow("delete") << QString("function() { delete a; }") << QString("function () { delete a; }"); - QTest::newRow("void") << QString("function() { void a; }") << QString("function () { void a; }"); - QTest::newRow("typeof") << QString("function() { typeof a; }") << QString("function () { typeof a; }"); - QTest::newRow("+") << QString("function() { +a; }") << QString("function () { +a; }"); - QTest::newRow("-") << QString("function() { -a; }") << QString("function () { -a; }"); - QTest::newRow("~") << QString("function() { ~a; }") << QString("function () { ~a; }"); - QTest::newRow("!") << QString("function() { !a; }") << QString("function () { !a; }"); - QTest::newRow("+") << QString("function() { a + b; }") << QString("function () { a + b; }"); - QTest::newRow("&&") << QString("function() { a && b; }") << QString("function () { a && b; }"); - QTest::newRow("&=") << QString("function() { a &= b; }") << QString("function () { a &= b; }"); - QTest::newRow("=") << QString("function() { a = b; }") << QString("function () { a = b; }"); - QTest::newRow("&") << QString("function() { a & b; }") << QString("function () { a & b; }"); - QTest::newRow("|") << QString("function() { a | b; }") << QString("function () { a | b; }"); - QTest::newRow("^") << QString("function() { a ^ b; }") << QString("function () { a ^ b; }"); - QTest::newRow("-=") << QString("function() { a -= b; }") << QString("function () { a -= b; }"); - QTest::newRow("/") << QString("function() { a / b; }") << QString("function () { a / b; }"); - QTest::newRow("/=") << QString("function() { a /= b; }") << QString("function () { a /= b; }"); - QTest::newRow("==") << QString("function() { a == b; }") << QString("function () { a == b; }"); - QTest::newRow(">=") << QString("function() { a >= b; }") << QString("function () { a >= b; }"); - QTest::newRow(">") << QString("function() { a > b; }") << QString("function () { a > b; }"); - QTest::newRow("in") << QString("function() { a in b; }") << QString("function () { a in b; }"); - QTest::newRow("+=") << QString("function() { a += b; }") << QString("function () { a += b; }"); - QTest::newRow("instanceof") << QString("function() { a instanceof b; }") << QString("function () { a instanceof b; }"); - QTest::newRow("<=") << QString("function() { a <= b; }") << QString("function () { a <= b; }"); - QTest::newRow("<<") << QString("function() { a << b; }") << QString("function () { a << b; }"); - QTest::newRow("<<=") << QString("function() { a <<= b; }") << QString("function () { a <<= b; }"); - QTest::newRow("<") << QString("function() { a < b; }") << QString("function () { a < b; }"); - QTest::newRow("%") << QString("function() { a % b; }") << QString("function () { a % b; }"); - QTest::newRow("%=") << QString("function() { a %= b; }") << QString("function () { a %= b; }"); - QTest::newRow("*") << QString("function() { a * b; }") << QString("function () { a * b; }"); - QTest::newRow("*=") << QString("function() { a *= b; }") << QString("function () { a *= b; }"); - QTest::newRow("!=") << QString("function() { a != b; }") << QString("function () { a != b; }"); - QTest::newRow("||") << QString("function() { a || b; }") << QString("function () { a || b; }"); - QTest::newRow("|=") << QString("function() { a |= b; }") << QString("function () { a |= b; }"); - QTest::newRow(">>") << QString("function() { a >> b; }") << QString("function () { a >> b; }"); - QTest::newRow(">>=") << QString("function() { a >>= b; }") << QString("function () { a >>= b; }"); - QTest::newRow("===") << QString("function() { a === b; }") << QString("function () { a === b; }"); - QTest::newRow("!==") << QString("function() { a !== b; }") << QString("function () { a !== b; }"); - QTest::newRow("-") << QString("function() { a - b; }") << QString("function () { a - b; }"); - QTest::newRow(">>>") << QString("function() { a >>> b; }") << QString("function () { a >>> b; }"); - QTest::newRow(">>>=") << QString("function() { a >>>= b; }") << QString("function () { a >>>= b; }"); - QTest::newRow("^=") << QString("function() { a ^= b; }") << QString("function () { a ^= b; }"); - QTest::newRow("? :") << QString("function() { a ? b : c; }") << QString("function () { a ? b : c; }"); - QTest::newRow("a; b; c") << QString("function() { a; b; c; }") << QString("function () { a; b; c; }"); - QTest::newRow("var a;") << QString("function() { var a; }") << QString("function () { var a; }"); - QTest::newRow("var a, b;") << QString("function() { var a, b; }") << QString("function () { var a, b; }"); - QTest::newRow("var a = 10;") << QString("function() { var a = 10; }") << QString("function () { var a = 10; }"); - QTest::newRow("var a, b = 20;") << QString("function() { var a, b = 20; }") << QString("function () { var a, b = 20; }"); - QTest::newRow("var a = 10, b = 20;") << QString("function() { var a = 10, b = 20; }") << QString("function () { var a = 10, b = 20; }"); - QTest::newRow("if") << QString("function() { if (a) b; }") << QString("function () { if (a) b; }"); - QTest::newRow("if") << QString("function() { if (a) { b; c; } }") << QString("function () { if (a) { b; c; } }"); - QTest::newRow("if-else") << QString("function() { if (a) b; else c; }") << QString("function () { if (a) b; else c; }"); - QTest::newRow("if-else") << QString("function() { if (a) { b; c; } else { d; e; } }") << QString("function () { if (a) { b; c; } else { d; e; } }"); - QTest::newRow("do-while") << QString("function() { do { a; } while (b); }") << QString("function () { do { a; } while (b); }"); - QTest::newRow("do-while") << QString("function() { do { a; b; c; } while (d); }") << QString("function () { do { a; b; c; } while (d); }"); - QTest::newRow("while") << QString("function() { while (a) { b; } }") << QString("function () { while (a) { b; } }"); - QTest::newRow("while") << QString("function() { while (a) { b; c; } }") << QString("function () { while (a) { b; c; } }"); - QTest::newRow("for") << QString("function() { for (a; b; c) { } }") << QString("function () { for (a; b; c) { } }"); - QTest::newRow("for") << QString("function() { for (; a; b) { } }") << QString("function () { for (; a; b) { } }"); - QTest::newRow("for") << QString("function() { for (; ; a) { } }") << QString("function () { for (; ; a) { } }"); - QTest::newRow("for") << QString("function() { for (; ; ) { } }") << QString("function () { for (; ; ) { } }"); - QTest::newRow("for") << QString("function() { for (var a; b; c) { } }") << QString("function () { for (var a; b; c) { } }"); - QTest::newRow("for") << QString("function() { for (var a, b, c; d; e) { } }") << QString("function () { for (var a, b, c; d; e) { } }"); - QTest::newRow("continue") << QString("function() { for (; ; ) { continue; } }") << QString("function () { for (; ; ) { continue; } }"); - QTest::newRow("break") << QString("function() { for (; ; ) { break; } }") << QString("function () { for (; ; ) { break; } }"); - QTest::newRow("return") << QString("function() { return; }") << QString("function () { return; }"); - QTest::newRow("return") << QString("function() { return 10; }") << QString("function () { return 10; }"); - QTest::newRow("with") << QString("function() { with (a) { b; } }") << QString("function () { with (a) { b; } }"); - QTest::newRow("with") << QString("function() { with (a) { b; c; } }") << QString("function () { with (a) { b; c; } }"); - QTest::newRow("switch") << QString("function() { switch (a) { } }") << QString("function () { switch (a) { } }"); - QTest::newRow("switch") << QString("function() { switch (a) { case 1: ; } }") << QString("function () { switch (a) { case 1: ; } }"); - QTest::newRow("switch") << QString("function() { switch (a) { case 1: b; break; } }") << QString("function () { switch (a) { case 1: b; break; } }"); - QTest::newRow("switch") << QString("function() { switch (a) { case 1: b; break; case 2: break; } }") << QString("function () { switch (a) { case 1: b; break; case 2: break; } }"); - QTest::newRow("switch") << QString("function() { switch (a) { case 1: case 2: ; } }") << QString("function () { switch (a) { case 1: case 2: ; } }"); - QTest::newRow("switch") << QString("function() { switch (a) { case 1: default: ; } }") << QString("function () { switch (a) { case 1: default: ; } }"); - QTest::newRow("switch") << QString("function() { switch (a) { case 1: default: ; case 3: ; } }") << QString("function () { switch (a) { case 1: default: ; case 3: ; } }"); - QTest::newRow("label") << QString("function() { a: b; }") << QString("function () { a: b; }"); - QTest::newRow("throw") << QString("function() { throw a; }") << QString("function () { throw a; }"); - QTest::newRow("try-catch") << QString("function() { try { a; } catch (e) { b; } }") << QString("function () { try { a; } catch (e) { b; } }"); - QTest::newRow("try-finally") << QString("function() { try { a; } finally { b; } }") << QString("function () { try { a; } finally { b; } }"); - QTest::newRow("try-catch-finally") << QString("function() { try { a; } catch (e) { b; } finally { c; } }") << QString("function () { try { a; } catch (e) { b; } finally { c; } }"); - QTest::newRow("a + b + c + d") << QString("function() { a + b + c + d; }") << QString("function () { a + b + c + d; }"); - QTest::newRow("a + b - c") << QString("function() { a + b - c; }") << QString("function () { a + b - c; }"); - QTest::newRow("a + -b") << QString("function() { a + -b; }") << QString("function () { a + -b; }"); - QTest::newRow("a + ~b") << QString("function() { a + ~b; }") << QString("function () { a + ~b; }"); - QTest::newRow("a + !b") << QString("function() { a + !b; }") << QString("function () { a + !b; }"); - QTest::newRow("a + +b") << QString("function() { a + +b; }") << QString("function () { a + +b; }"); - QTest::newRow("(a + b) - c") << QString("function() { (a + b) - c; }") << QString("function () { (a + b) - c; }"); - QTest::newRow("(a - b + c") << QString("function() { a - b + c; }") << QString("function () { a - b + c; }"); - QTest::newRow("(a - (b + c)") << QString("function() { a - (b + c); }") << QString("function () { a - (b + c); }"); - QTest::newRow("a + -(b + c)") << QString("function() { a + -(b + c); }") << QString("function () { a + -(b + c); }"); - QTest::newRow("a + ~(b + c)") << QString("function() { a + ~(b + c); }") << QString("function () { a + ~(b + c); }"); - QTest::newRow("a + !(b + c)") << QString("function() { a + !(b + c); }") << QString("function () { a + !(b + c); }"); - QTest::newRow("a + +(b + c)") << QString("function() { a + +(b + c); }") << QString("function () { a + +(b + c); }"); - QTest::newRow("a + b * c") << QString("function() { a + b * c; }") << QString("function () { a + b * c; }"); - QTest::newRow("(a + b) * c") << QString("function() { (a + b) * c; }") << QString("function () { (a + b) * c; }"); - QTest::newRow("(a + b) * (c + d)") << QString("function() { (a + b) * (c + d); }") << QString("function () { (a + b) * (c + d); }"); - QTest::newRow("a + (b * c)") << QString("function() { a + (b * c); }") << QString("function () { a + (b * c); }"); - QTest::newRow("a + (b / c)") << QString("function() { a + (b / c); }") << QString("function () { a + (b / c); }"); - QTest::newRow("(a / b) * c") << QString("function() { (a / b) * c; }") << QString("function () { (a / b) * c; }"); - QTest::newRow("a / (b * c)") << QString("function() { a / (b * c); }") << QString("function () { a / (b * c); }"); - QTest::newRow("a / (b % c)") << QString("function() { a / (b % c); }") << QString("function () { a / (b % c); }"); - QTest::newRow("a && b || c") << QString("function() { a && b || c; }") << QString("function () { a && b || c; }"); - QTest::newRow("a && (b || c)") << QString("function() { a && (b || c); }") << QString("function () { a && (b || c); }"); - QTest::newRow("a & b | c") << QString("function() { a & b | c; }") << QString("function () { a & b | c; }"); - QTest::newRow("a & (b | c)") << QString("function() { a & (b | c); }") << QString("function () { a & (b | c); }"); - QTest::newRow("a & b | c ^ d") << QString("function() { a & b | c ^ d; }") << QString("function () { a & b | c ^ d; }"); - QTest::newRow("a & (b | c ^ d)") << QString("function() { a & (b | c ^ d); }") << QString("function () { a & (b | c ^ d); }"); - QTest::newRow("(a & b | c) ^ d") << QString("function() { (a & b | c) ^ d; }") << QString("function () { (a & b | c) ^ d; }"); - QTest::newRow("a << b + c") << QString("function() { a << b + c; }") << QString("function () { a << b + c; }"); - QTest::newRow("(a << b) + c") << QString("function() { (a << b) + c; }") << QString("function () { (a << b) + c; }"); - QTest::newRow("a >> b + c") << QString("function() { a >> b + c; }") << QString("function () { a >> b + c; }"); - QTest::newRow("(a >> b) + c") << QString("function() { (a >> b) + c; }") << QString("function () { (a >> b) + c; }"); - QTest::newRow("a >>> b + c") << QString("function() { a >>> b + c; }") << QString("function () { a >>> b + c; }"); - QTest::newRow("(a >>> b) + c") << QString("function() { (a >>> b) + c; }") << QString("function () { (a >>> b) + c; }"); - QTest::newRow("a == b || c != d") << QString("function() { a == b || c != d; }") << QString("function () { a == b || c != d; }"); - QTest::newRow("a == (b || c != d)") << QString("function() { a == (b || c != d); }") << QString("function () { a == (b || c != d); }"); - QTest::newRow("a === b || c !== d") << QString("function() { a === b || c !== d; }") << QString("function () { a === b || c !== d; }"); - QTest::newRow("a === (b || c !== d)") << QString("function() { a === (b || c !== d); }") << QString("function () { a === (b || c !== d); }"); - QTest::newRow("a &= b + c") << QString("function() { a &= b + c; }") << QString("function () { a &= b + c; }"); - QTest::newRow("debugger") << QString("function() { debugger; }") << QString("function () { debugger; }"); -} - -void tst_QJSValue::prettyPrinter() -{ - QFETCH(QString, function); - QFETCH(QString, expected); - QJSEngine eng; - QJSValue val = eng.evaluate("(" + function + ")"); - QVERIFY(val.isCallable()); - QString actual = val.toString(); - int count = qMin(actual.size(), expected.size()); -// qDebug() << actual << expected; - for (int i = 0; i < count; ++i) { -// qDebug() << i << actual.at(i) << expected.at(i); - QCOMPARE(actual.at(i), expected.at(i)); - } - QCOMPARE(actual.size(), expected.size()); -} - -void tst_QJSValue::engineDeleted() -{ - QJSEngine *eng = new QJSEngine; - QJSValue v1 = eng->toScriptValue(123); - QVERIFY(v1.isNumber()); - QJSValue v2 = eng->toScriptValue(QString("ciao")); - QVERIFY(v2.isString()); - QJSValue v3 = eng->newObject(); - QVERIFY(v3.isObject()); - QJSValue v4 = eng->newQObject(this); - QVERIFY(v4.isQObject()); - QJSValue v5 = "Hello"; - QVERIFY(v2.isString()); - - delete eng; - - QVERIFY(v1.isUndefined()); - QVERIFY(v1.engine() == 0); - QVERIFY(v2.isUndefined()); - QVERIFY(v2.engine() == 0); - QVERIFY(v3.isUndefined()); - QVERIFY(v3.engine() == 0); - QVERIFY(v4.isUndefined()); - QVERIFY(v4.engine() == 0); - QVERIFY(v5.isString()); // was not bound to engine - QVERIFY(v5.engine() == 0); - - QVERIFY(v3.property("foo").isUndefined()); -} - -void tst_QJSValue::valueOfWithClosure() -{ - QJSEngine eng; - // valueOf() - { - QJSValue obj = eng.evaluate("o = {}; (function(foo) { o.valueOf = function() { return foo; } })(123); o"); - QVERIFY(obj.isObject()); - QCOMPARE(obj.toInt(), 123); - } - // toString() - { - QJSValue obj = eng.evaluate("o = {}; (function(foo) { o.toString = function() { return foo; } })('ciao'); o"); - QVERIFY(obj.isObject()); - QCOMPARE(obj.toString(), QString::fromLatin1("ciao")); - } -} - -#if 0 // FIXME: no objectId() -void tst_QJSValue::objectId() -{ - QCOMPARE(QJSValue().objectId(), (qint64)-1); - QCOMPARE(QJSValue(QJSValue::UndefinedValue).objectId(), (qint64)-1); - QCOMPARE(QJSValue(QJSValue::NullValue).objectId(), (qint64)-1); - QCOMPARE(QJSValue(false).objectId(), (qint64)-1); - QCOMPARE(QJSValue(123).objectId(), (qint64)-1); - QCOMPARE(QJSValue(uint(123)).objectId(), (qint64)-1); - QCOMPARE(QJSValue(123.5).objectId(), (qint64)-1); - QCOMPARE(QJSValue("ciao").objectId(), (qint64)-1); - - QScriptEngine eng; - QJSValue o1 = eng.newObject(); - QVERIFY(o1.objectId() != -1); - QJSValue o2 = eng.newObject(); - QVERIFY(o2.objectId() != -1); - QVERIFY(o1.objectId() != o2.objectId()); - - QVERIFY(eng.objectById(o1.objectId()).strictlyEquals(o1)); - QVERIFY(eng.objectById(o2.objectId()).strictlyEquals(o2)); - - qint64 globalObjectId = -1; - { - QJSValue global = eng.globalObject(); - globalObjectId = global.objectId(); - QVERIFY(globalObjectId != -1); - QVERIFY(eng.objectById(globalObjectId).strictlyEquals(global)); - } - QJSValue obj = eng.objectById(globalObjectId); - QVERIFY(obj.isObject()); - QVERIFY(obj.strictlyEquals(eng.globalObject())); -} -#endif - -void tst_QJSValue::nestedObjectToVariant_data() -{ - QTest::addColumn("program"); - QTest::addColumn("expected"); - - // Array literals - QTest::newRow("[[]]") - << QString::fromLatin1("[[]]") - << QVariant(QVariantList() << (QVariant(QVariantList()))); - QTest::newRow("[[123]]") - << QString::fromLatin1("[[123]]") - << QVariant(QVariantList() << (QVariant(QVariantList() << 123))); - QTest::newRow("[[], 123]") - << QString::fromLatin1("[[], 123]") - << QVariant(QVariantList() << QVariant(QVariantList()) << 123); - - // Cyclic arrays - QTest::newRow("var a=[]; a.push(a)") - << QString::fromLatin1("var a=[]; a.push(a); a") - << QVariant(QVariantList() << QVariant(QVariantList())); - QTest::newRow("var a=[]; a.push(123, a)") - << QString::fromLatin1("var a=[]; a.push(123, a); a") - << QVariant(QVariantList() << 123 << QVariant(QVariantList())); - QTest::newRow("var a=[]; var b=[]; a.push(b); b.push(a)") - << QString::fromLatin1("var a=[]; var b=[]; a.push(b); b.push(a); a") - << QVariant(QVariantList() << QVariant(QVariantList() << QVariant(QVariantList()))); - QTest::newRow("var a=[]; var b=[]; a.push(123, b); b.push(456, a)") - << QString::fromLatin1("var a=[]; var b=[]; a.push(123, b); b.push(456, a); a") - << QVariant(QVariantList() << 123 << QVariant(QVariantList() << 456 << QVariant(QVariantList()))); - - // Object literals - { - QVariantMap m; - QTest::newRow("{}") - << QString::fromLatin1("({})") - << QVariant(m); - } - { - QVariantMap m; - m["a"] = QVariantMap(); - QTest::newRow("{ a:{} }") - << QString::fromLatin1("({ a:{} })") - << QVariant(m); - } - { - QVariantMap m, m2; - m2["b"] = 10; - m2["c"] = 20; - m["a"] = m2; - QTest::newRow("{ a:{b:10, c:20} }") - << QString::fromLatin1("({ a:{b:10, c:20} })") - << QVariant(m); - } - { - QVariantMap m; - m["a"] = 10; - m["b"] = QVariantList() << 20 << 30; - QTest::newRow("{ a:10, b:[20, 30]}") - << QString::fromLatin1("({ a:10, b:[20,30]})") - << QVariant(m); - } - - // Cyclic objects - { - QVariantMap m; - m["p"] = QVariantMap(); - QTest::newRow("var o={}; o.p=o") - << QString::fromLatin1("var o={}; o.p=o; o") - << QVariant(m); - } - { - QVariantMap m; - m["p"] = 123; - m["q"] = QVariantMap(); - QTest::newRow("var o={}; o.p=123; o.q=o") - << QString::fromLatin1("var o={}; o.p=123; o.q=o; o") - << QVariant(m); - } -} - -void tst_QJSValue::nestedObjectToVariant() -{ - QJSEngine eng; - QFETCH(QString, program); - QFETCH(QVariant, expected); - QJSValue o = eng.evaluate(program); - QVERIFY(!o.isError()); - QVERIFY(o.isObject()); - QCOMPARE(o.toVariant(), expected); -} - -QTEST_MAIN(tst_QJSValue) diff --git a/tests/auto/declarative/qjsvalue/tst_qjsvalue.h b/tests/auto/declarative/qjsvalue/tst_qjsvalue.h deleted file mode 100644 index 0e7f7405a6..0000000000 --- a/tests/auto/declarative/qjsvalue/tst_qjsvalue.h +++ /dev/null @@ -1,204 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef TST_QJSVALUE_H -#define TST_QJSVALUE_H - -#include -#include -#include -#include -#include - -Q_DECLARE_METATYPE(QVariant) -Q_DECLARE_METATYPE(QJSValue) - -class tst_QJSValue : public QObject -{ - Q_OBJECT - -public: - tst_QJSValue(); - virtual ~tst_QJSValue(); - -private slots: - void ctor_invalid(); - void ctor_undefinedWithEngine(); - void ctor_undefined(); - void ctor_nullWithEngine(); - void ctor_null(); - void ctor_boolWithEngine(); - void ctor_bool(); - void ctor_intWithEngine(); - void ctor_int(); - void ctor_uintWithEngine(); - void ctor_uint(); - void ctor_floatWithEngine(); - void ctor_float(); - void ctor_stringWithEngine(); - void ctor_string(); - void ctor_copyAndAssignWithEngine(); - void ctor_copyAndAssign(); - - void toString(); - void toNumber(); - void toBoolean(); - void toBool(); - void toInt(); - void toUInt(); - void toVariant(); - void toQObject_nonQObject_data(); - void toQObject_nonQObject(); - void toQObject(); - void toDateTime(); - void toRegExp(); - void isArray_data(); - void isArray(); - void isDate(); - void isDate_data(); - void isError_propertiesOfGlobalObject(); - void isError_data(); - void isError(); - void isRegExp_data(); - void isRegExp(); - -#if 0 // FIXME: No QScriptValue::lessThan - void lessThan(); -#endif - void equals(); - void strictlyEquals(); - - void hasProperty_basic(); - void hasProperty_globalObject(); - void hasProperty_changePrototype(); - - void deleteProperty_basic(); - void deleteProperty_globalObject(); - void deleteProperty_inPrototype(); - - void getSetPrototype_cyclicPrototype(); - void getSetPrototype_evalCyclicPrototype(); - void getSetPrototype_eval(); - void getSetPrototype_invalidPrototype(); - void getSetPrototype_twoEngines(); - void getSetPrototype_null(); - void getSetPrototype_notObjectOrNull(); - void getSetPrototype(); - void getSetScope(); - void getSetProperty_HooliganTask162051(); - void getSetProperty_HooliganTask183072(); - void getSetProperty_propertyRemoval(); - void getSetProperty_resolveMode(); - void getSetProperty_twoEngines(); - void getSetProperty_gettersAndSetters(); - void getSetProperty_gettersAndSettersThrowErrorNative(); - void getSetProperty_gettersAndSettersThrowErrorJS(); - void getSetProperty_gettersAndSettersOnNative(); - void getSetProperty_gettersAndSettersOnGlobalObject(); - void getSetProperty_gettersAndSettersChange(); - void getSetProperty_gettersAndSettersStupid(); - void getSetProperty_array(); - void getSetProperty(); - void arrayElementGetterSetter(); - void getSetData_objects_data(); - void getSetData_objects(); - void getSetData_nonObjects_data(); - void getSetData_nonObjects(); - void setData_QTBUG15144(); -#if 0 // FIXME: no QScriptClass - void getSetScriptClass_emptyClass_data(); - void getSetScriptClass_emptyClass(); - void getSetScriptClass_JSObjectFromCpp(); - void getSetScriptClass_JSObjectFromJS(); - void getSetScriptClass_QVariant(); - void getSetScriptClass_QObject(); -#endif - void call_function(); - void call_object(); - void call_newObjects(); - void call_this(); - void call_arguments(); - void call(); - void call_invalidArguments(); - void call_invalidReturn(); - void call_twoEngines(); - void call_array(); - void call_nonFunction_data(); - void call_nonFunction(); - void construct_nonFunction_data(); - void construct_nonFunction(); - void construct_simple(); - void construct_newObjectJS(); -#if 0 // FIXME: no c-style callbacks - void construct_undefined(); - void construct_newObjectCpp(); -#endif - void construct_arg(); - void construct_proto(); - void construct_returnInt(); - void construct_throw(); -#if 0 // FIXME: The feature of interpreting an array as argument list has been removed from the API - void construct(); -#endif - void construct_twoEngines(); - void construct_constructorThrowsPrimitive(); - void castToPointer(); - void prettyPrinter_data(); - void prettyPrinter(); - void engineDeleted(); - void valueOfWithClosure(); -#if 0 // FIXME: no objectId() - void objectId(); -#endif - void nestedObjectToVariant_data(); - void nestedObjectToVariant(); - -private: - void newEngine() - { - if (engine) - delete engine; - engine = new QJSEngine(); - } - QJSEngine *engine; -}; - -#endif diff --git a/tests/auto/declarative/qjsvalueiterator/qjsvalueiterator.pro b/tests/auto/declarative/qjsvalueiterator/qjsvalueiterator.pro deleted file mode 100644 index 9f991c0ab6..0000000000 --- a/tests/auto/declarative/qjsvalueiterator/qjsvalueiterator.pro +++ /dev/null @@ -1,7 +0,0 @@ -CONFIG += testcase -TARGET = tst_qjsvalueiterator -macx:CONFIG -= app_bundle -QT = core declarative testlib -SOURCES += tst_qjsvalueiterator.cpp - - diff --git a/tests/auto/declarative/qjsvalueiterator/tst_qjsvalueiterator.cpp b/tests/auto/declarative/qjsvalueiterator/tst_qjsvalueiterator.cpp deleted file mode 100644 index eade3de1a7..0000000000 --- a/tests/auto/declarative/qjsvalueiterator/tst_qjsvalueiterator.cpp +++ /dev/null @@ -1,522 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -#include - -#include -#include -#include - -Q_DECLARE_METATYPE(QJSValue); - -class tst_QJSValueIterator : public QObject -{ - Q_OBJECT - -public: - tst_QJSValueIterator(); - virtual ~tst_QJSValueIterator(); - -private slots: - void iterateForward_data(); - void iterateForward(); - void iterateArray_data(); - void iterateArray(); - void iterateString(); -#if 0 - void iterateGetterSetter(); -#endif - void assignObjectToIterator(); - void iterateNonObject(); - void iterateOverObjectFromDeletedEngine(); -}; - -tst_QJSValueIterator::tst_QJSValueIterator() -{ -} - -tst_QJSValueIterator::~tst_QJSValueIterator() -{ -} - -void tst_QJSValueIterator::iterateForward_data() -{ - QTest::addColumn("propertyNames"); - QTest::addColumn("propertyValues"); - - QTest::newRow("no properties") - << QStringList() << QStringList(); - QTest::newRow("foo=bar") - << (QStringList() << "foo") - << (QStringList() << "bar"); - QTest::newRow("foo=bar, baz=123") - << (QStringList() << "foo" << "baz") - << (QStringList() << "bar" << "123"); - QTest::newRow("foo=bar, baz=123, rab=oof") - << (QStringList() << "foo" << "baz" << "rab") - << (QStringList() << "bar" << "123" << "oof"); -} - -void tst_QJSValueIterator::iterateForward() -{ - QFETCH(QStringList, propertyNames); - QFETCH(QStringList, propertyValues); - QMap pmap; - QVERIFY(propertyNames.size() == propertyValues.size()); - - QJSEngine engine; - QJSValue object = engine.newObject(); - for (int i = 0; i < propertyNames.size(); ++i) { - QString name = propertyNames.at(i); - QString value = propertyValues.at(i); - pmap.insert(name, value); - object.setProperty(name, engine.toScriptValue(value)); - } - QJSValue otherObject = engine.newObject(); - otherObject.setProperty("foo", engine.toScriptValue(123456)); - otherObject.setProperty("protoProperty", engine.toScriptValue(654321)); - object.setPrototype(otherObject); // should not affect iterator - - QStringList lst; - QJSValueIterator it(object); - while (!pmap.isEmpty()) { - QCOMPARE(it.hasNext(), true); - QCOMPARE(it.hasNext(), true); - it.next(); - QString name = it.name(); - QCOMPARE(pmap.contains(name), true); - QCOMPARE(it.name(), name); - QCOMPARE(it.value().strictlyEquals(engine.toScriptValue(pmap.value(name))), true); - pmap.remove(name); - lst.append(name); - } - - QCOMPARE(it.hasNext(), false); - QCOMPARE(it.hasNext(), false); - - it = object; - for (int i = 0; i < lst.count(); ++i) { - QCOMPARE(it.hasNext(), true); - it.next(); - QCOMPARE(it.name(), lst.at(i)); - } -} - -void tst_QJSValueIterator::iterateArray_data() -{ - QTest::addColumn("propertyNames"); - QTest::addColumn("propertyValues"); - - QTest::newRow("no elements") << QStringList() << QStringList(); - - QTest::newRow("0=foo, 1=barr") - << (QStringList() << "0" << "1") - << (QStringList() << "foo" << "bar"); - - - QTest::newRow("0=foo, 3=barr") - << (QStringList() << "0" << "1" << "2" << "3") - << (QStringList() << "foo" << "" << "" << "bar"); -} - -void tst_QJSValueIterator::iterateArray() -{ - QFETCH(QStringList, propertyNames); - QFETCH(QStringList, propertyValues); - - QJSEngine engine; - QJSValue array = engine.newArray(); - - // Fill the array - for (int i = 0; i < propertyNames.size(); ++i) { - array.setProperty(propertyNames.at(i), propertyValues.at(i)); - } - - // Iterate thru array properties. Note that the QJSValueIterator doesn't guarantee - // any order on the iteration! - int length = array.property("length").toInt(); - QCOMPARE(length, propertyNames.size()); - - bool iteratedThruLength = false; - QHash arrayProperties; - QJSValueIterator it(array); - - // Iterate forward - while (it.hasNext()) { - it.next(); - - const QString name = it.name(); - if (name == QString::fromLatin1("length")) { - QVERIFY(it.value().isNumber()); - QCOMPARE(it.value().toInt(), length); - QVERIFY2(!iteratedThruLength, "'length' appeared more than once during iteration."); - iteratedThruLength = true; - continue; - } - - // Storing the properties we iterate in a hash to compare with test data. - QVERIFY2(!arrayProperties.contains(name), "property appeared more than once during iteration."); - arrayProperties.insert(name, it.value()); - QVERIFY(it.value().strictlyEquals(array.property(name))); - } - - // Verify properties - QVERIFY(iteratedThruLength); - QCOMPARE(arrayProperties.size(), propertyNames.size()); - for (int i = 0; i < propertyNames.size(); ++i) { - QVERIFY(arrayProperties.contains(propertyNames.at(i))); - QCOMPARE(arrayProperties.value(propertyNames.at(i)).toString(), propertyValues.at(i)); - } - -#if 0 - - // Iterate backwards - arrayProperties.clear(); - iteratedThruLength = false; - it.toBack(); - - while (it.hasPrevious()) { - it.previous(); - - const QString name = it.name(); - if (name == QString::fromLatin1("length")) { - QVERIFY(it.value().isNumber()); - QCOMPARE(it.value().toInt(), length); - QCOMPARE(it.flags(), QScriptValue::SkipInEnumeration | QScriptValue::Undeletable); - QVERIFY2(!iteratedThruLength, "'length' appeared more than once during iteration."); - iteratedThruLength = true; - continue; - } - - // Storing the properties we iterate in a hash to compare with test data. - QVERIFY2(!arrayProperties.contains(name), "property appeared more than once during iteration."); - arrayProperties.insert(name, it.value()); - QCOMPARE(it.flags(), array.propertyFlags(name)); - QVERIFY(it.value().strictlyEquals(array.property(name))); - } - - // Verify properties - QVERIFY(iteratedThruLength); - QCOMPARE(arrayProperties.size(), propertyNames.size()); - for (int i = 0; i < propertyNames.size(); ++i) { - QVERIFY(arrayProperties.contains(propertyNames.at(i))); - QCOMPARE(arrayProperties.value(propertyNames.at(i)).toString(), propertyValues.at(i)); - } - - // ### Do we still need this test? - // Forward test again but as object - arrayProperties.clear(); - iteratedThruLength = false; - QJSValue arrayObject = engine.toObject(array); - QJSValueIterator it2(arrayObject); - - while (it2.hasNext()) { - it2.next(); - - const QString name = it2.name(); - if (name == QString::fromLatin1("length")) { - QVERIFY(it2.value().isNumber()); - QCOMPARE(it2.value().toInt(), length); - QCOMPARE(it2.flags(), QScriptValue::SkipInEnumeration | QScriptValue::Undeletable); - QVERIFY2(!iteratedThruLength, "'length' appeared more than once during iteration."); - iteratedThruLength = true; - continue; - } - - // Storing the properties we iterate in a hash to compare with test data. - QVERIFY2(!arrayProperties.contains(name), "property appeared more than once during iteration."); - arrayProperties.insert(name, it2.value()); - QCOMPARE(it2.flags(), arrayObject.propertyFlags(name)); - QVERIFY(it2.value().strictlyEquals(arrayObject.property(name))); - } - - // Verify properties - QVERIFY(iteratedThruLength); - QCOMPARE(arrayProperties.size(), propertyNames.size()); - for (int i = 0; i < propertyNames.size(); ++i) { - QVERIFY(arrayProperties.contains(propertyNames.at(i))); - QCOMPARE(arrayProperties.value(propertyNames.at(i)).toString(), propertyValues.at(i)); - } -#endif -} - -void tst_QJSValueIterator::iterateString() -{ - QJSEngine engine; - QJSValue obj = engine.evaluate("new String('ciao')"); - QVERIFY(obj.property("length").isNumber()); - int length = obj.property("length").toInt(); - QCOMPARE(length, 4); - - QJSValueIterator it(obj); - QHash stringProperties; - bool iteratedThruLength = false; - - while (it.hasNext()) { - it.next(); - const QString name = it.name(); - - if (name == QString::fromLatin1("length")) { - QVERIFY(it.value().isNumber()); - QCOMPARE(it.value().toInt(), length); - QVERIFY2(!iteratedThruLength, "'length' appeared more than once during iteration."); - iteratedThruLength = true; - continue; - } - - QVERIFY2(!stringProperties.contains(name), "property appeared more than once during iteration."); - stringProperties.insert(name, it.value()); - QVERIFY(it.value().strictlyEquals(obj.property(name))); - } - - QVERIFY(iteratedThruLength); - QCOMPARE(stringProperties.size(), length); -#if 0 - // And going backwards - iteratedThruLength = false; - stringProperties.clear(); - it.toBack(); - - while (it.hasPrevious()) { - it.previous(); - const QString name = it.name(); - - if (name == QString::fromLatin1("length")) { - QVERIFY(it.value().isNumber()); - QCOMPARE(it.value().toInt(), length); - QVERIFY2(!iteratedThruLength, "'length' appeared more than once during iteration."); - iteratedThruLength = true; - continue; - } - - QVERIFY2(!stringProperties.contains(name), "property appeared more than once during iteration."); - stringProperties.insert(name, it.value()); - QVERIFY(it.value().strictlyEquals(obj.property(name))); - } -#endif -} - -#if 0 // FIXME what we should to keep from here? -static QJSValue myGetterSetter(QScriptContext *ctx, QJSEngine *) -{ - if (ctx->argumentCount() == 1) - ctx->thisObject().setProperty("bar", ctx->argument(0)); - return ctx->thisObject().property("bar"); -} - -static QJSValue myGetter(QScriptContext *ctx, QJSEngine *) -{ - return ctx->thisObject().property("bar"); -} - -static QJSValue mySetter(QScriptContext *ctx, QJSEngine *) -{ - ctx->thisObject().setProperty("bar", ctx->argument(0)); - return ctx->argument(0); -} - -void tst_QJSValueIterator::iterateGetterSetter() -{ - // unified getter/setter function - { - QJSEngine eng; - QJSValue obj = eng.newObject(); - obj.setProperty("foo", eng.newFunction(myGetterSetter), - QScriptValue::PropertyGetter | QScriptValue::PropertySetter); - QJSValue val(&eng, 123); - obj.setProperty("foo", val); - QVERIFY(obj.property("bar").strictlyEquals(val)); - QVERIFY(obj.property("foo").strictlyEquals(val)); - - QJSValueIterator it(obj); - QVERIFY(it.hasNext()); - it.next(); - QCOMPARE(it.name(), QString::fromLatin1("foo")); - QCOMPARE(it.flags(), QScriptValue::PropertyFlags(QScriptValue::PropertyGetter | QScriptValue::PropertySetter)); - QVERIFY(it.value().strictlyEquals(val)); - QJSValue val2(&eng, 456); - it.setValue(val2); - QVERIFY(obj.property("bar").strictlyEquals(val2)); - QVERIFY(obj.property("foo").strictlyEquals(val2)); - - QVERIFY(it.hasNext()); - it.next(); - QCOMPARE(it.name(), QString::fromLatin1("bar")); - QVERIFY(!it.hasNext()); - - QVERIFY(it.hasPrevious()); - it.previous(); - QCOMPARE(it.name(), QString::fromLatin1("bar")); - QVERIFY(it.hasPrevious()); - it.previous(); - QCOMPARE(it.name(), QString::fromLatin1("foo")); - QCOMPARE(it.flags(), QScriptValue::PropertyFlags(QScriptValue::PropertyGetter | QScriptValue::PropertySetter)); - QVERIFY(it.value().strictlyEquals(val2)); - it.setValue(val); - QVERIFY(obj.property("bar").strictlyEquals(val)); - QVERIFY(obj.property("foo").strictlyEquals(val)); - } - // separate getter/setter function - for (int x = 0; x < 2; ++x) { - QJSEngine eng; - QJSValue obj = eng.newObject(); - if (x == 0) { - obj.setProperty("foo", eng.newFunction(myGetter), QScriptValue::PropertyGetter); - obj.setProperty("foo", eng.newFunction(mySetter), QScriptValue::PropertySetter); - } else { - obj.setProperty("foo", eng.newFunction(mySetter), QScriptValue::PropertySetter); - obj.setProperty("foo", eng.newFunction(myGetter), QScriptValue::PropertyGetter); - } - QJSValue val(&eng, 123); - obj.setProperty("foo", val); - QVERIFY(obj.property("bar").strictlyEquals(val)); - QVERIFY(obj.property("foo").strictlyEquals(val)); - - QJSValueIterator it(obj); - QVERIFY(it.hasNext()); - it.next(); - QCOMPARE(it.name(), QString::fromLatin1("foo")); - QVERIFY(it.value().strictlyEquals(val)); - QJSValue val2(&eng, 456); - it.setValue(val2); - QVERIFY(obj.property("bar").strictlyEquals(val2)); - QVERIFY(obj.property("foo").strictlyEquals(val2)); - - QVERIFY(it.hasNext()); - it.next(); - QCOMPARE(it.name(), QString::fromLatin1("bar")); - QVERIFY(!it.hasNext()); - - QVERIFY(it.hasPrevious()); - it.previous(); - QCOMPARE(it.name(), QString::fromLatin1("bar")); - QVERIFY(it.hasPrevious()); - it.previous(); - QCOMPARE(it.name(), QString::fromLatin1("foo")); - QVERIFY(it.value().strictlyEquals(val2)); - it.setValue(val); - QVERIFY(obj.property("bar").strictlyEquals(val)); - QVERIFY(obj.property("foo").strictlyEquals(val)); - } -} -#endif - -void tst_QJSValueIterator::assignObjectToIterator() -{ - QJSEngine eng; - QJSValue obj1 = eng.newObject(); - obj1.setProperty("foo", 123); - QJSValue obj2 = eng.newObject(); - obj2.setProperty("bar", 456); - - QJSValueIterator it(obj1); - QVERIFY(it.hasNext()); - it.next(); - it = obj2; - QVERIFY(it.hasNext()); - it.next(); - QCOMPARE(it.name(), QString::fromLatin1("bar")); - - it = obj1; - QVERIFY(it.hasNext()); - it.next(); - QCOMPARE(it.name(), QString::fromLatin1("foo")); - - it = obj2; - QVERIFY(it.hasNext()); - it.next(); - QCOMPARE(it.name(), QString::fromLatin1("bar")); - - it = obj2; - QVERIFY(it.hasNext()); - it.next(); - QCOMPARE(it.name(), QString::fromLatin1("bar")); -} - -void tst_QJSValueIterator::iterateNonObject() -{ - QJSValueIterator it(123); - QVERIFY(!it.hasNext()); - it.next(); - it.name(); - it.value(); - QJSValue num(5); - it = num; - QVERIFY(!it.hasNext()); -} - -void tst_QJSValueIterator::iterateOverObjectFromDeletedEngine() -{ - QJSEngine *engine = new QJSEngine; - QJSValue objet = engine->newObject(); - - // populate object with properties - QHash properties; - properties.insert("foo",1235); - properties.insert("oof",5321); - properties.insert("ofo",3521); - QHash::const_iterator i = properties.constBegin(); - for (; i != properties.constEnd(); ++i) { - objet.setProperty(i.key(), i.value()); - } - - // start iterating - QJSValueIterator it(objet); - it.next(); - QVERIFY(properties.contains(it.name())); - - delete engine; - - QVERIFY(objet.isUndefined()); - QVERIFY(it.name().isEmpty()); - QVERIFY(it.value().isUndefined()); - - QVERIFY(!it.hasNext()); - it.next(); - - QVERIFY(it.name().isEmpty()); - QVERIFY(it.value().isUndefined()); - -} - -QTEST_MAIN(tst_QJSValueIterator) -#include "tst_qjsvalueiterator.moc" diff --git a/tests/auto/declarative/qmlmin/qmlmin.pro b/tests/auto/declarative/qmlmin/qmlmin.pro deleted file mode 100644 index 61d2330b06..0000000000 --- a/tests/auto/declarative/qmlmin/qmlmin.pro +++ /dev/null @@ -1,9 +0,0 @@ -CONFIG += testcase -TARGET = tst_qmlmin -QT += declarative testlib -macx:CONFIG -= app_bundle - -SOURCES += tst_qmlmin.cpp -DEFINES += SRCDIR=\\\"$$PWD\\\" - -CONFIG += parallel_test diff --git a/tests/auto/declarative/qmlmin/tst_qmlmin.cpp b/tests/auto/declarative/qmlmin/tst_qmlmin.cpp deleted file mode 100644 index c6b019071e..0000000000 --- a/tests/auto/declarative/qmlmin/tst_qmlmin.cpp +++ /dev/null @@ -1,192 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include - -class tst_qmlmin : public QObject -{ - Q_OBJECT -public: - tst_qmlmin(); - -private slots: - void initTestCase(); - void qmlMinify_data(); - void qmlMinify(); - -private: - QString qmlminPath; - QStringList excludedDirs; - QStringList invalidFiles; - - QStringList findFiles(const QDir &); - bool isInvalidFile(const QFileInfo &fileName) const; -}; - -tst_qmlmin::tst_qmlmin() -{ -} - -void tst_qmlmin::initTestCase() -{ - qmlminPath = QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/qmlmin"); -#ifdef Q_OS_WIN - qmlminPath += QLatin1String(".exe"); -#endif - if (!QFileInfo(qmlminPath).exists()) { - QString message = QString::fromLatin1("qmlmin executable not found (looked for %0)") - .arg(qmlminPath); - QFAIL(qPrintable(message)); - } - - // Add directories you want excluded here - - // These snippets are not expected to run on their own. - excludedDirs << "doc/src/snippets/declarative/visualdatamodel_rootindex"; - excludedDirs << "doc/src/snippets/declarative/qtbinding"; - excludedDirs << "doc/src/snippets/declarative/imports"; - excludedDirs << "doc/src/snippets/qtquick1/visualdatamodel_rootindex"; - excludedDirs << "doc/src/snippets/qtquick1/qtbinding"; - excludedDirs << "doc/src/snippets/qtquick1/imports"; - - // Add invalid files (i.e. files with syntax errors) - invalidFiles << "tests/auto/qtquick2/qquickloader/data/InvalidSourceComponent.qml"; - invalidFiles << "tests/auto/declarative/qdeclarativelanguage/data/dynamicObjectProperties.2.qml"; - invalidFiles << "tests/auto/declarative/qdeclarativelanguage/data/signal.3.qml"; - invalidFiles << "tests/auto/declarative/qdeclarativelanguage/data/property.4.qml"; - invalidFiles << "tests/auto/declarative/qdeclarativelanguage/data/empty.qml"; - invalidFiles << "tests/auto/declarative/qdeclarativelanguage/data/signal.2.qml"; - invalidFiles << "tests/auto/declarative/qdeclarativelanguage/data/missingObject.qml"; - invalidFiles << "tests/auto/declarative/qdeclarativelanguage/data/insertedSemicolon.1.qml"; - invalidFiles << "tests/auto/declarative/qdeclarativelanguage/data/nonexistantProperty.5.qml"; - invalidFiles << "tests/auto/declarative/qdeclarativelanguage/data/invalidRoot.1.qml"; - invalidFiles << "tests/auto/declarative/qdeclarativefolderlistmodel/data/dummy.qml"; - invalidFiles << "tests/auto/declarative/qdeclarativeecmascript/data/qtbug_22843.js"; - invalidFiles << "tests/auto/declarative/qdeclarativeecmascript/data/qtbug_22843.library.js"; - invalidFiles << "tests/auto/declarative/qdeclarativeworkerscript/data/script_error_onLoad.js"; - invalidFiles << "tests/auto/declarative/parserstress/tests/ecma_3/Unicode/regress-352044-02-n.js"; -} - -QStringList tst_qmlmin::findFiles(const QDir &d) -{ - for (int ii = 0; ii < excludedDirs.count(); ++ii) { - QString s = excludedDirs.at(ii); - if (d.absolutePath().endsWith(s)) - return QStringList(); - } - - QStringList rv; - - QStringList files = d.entryList(QStringList() << QLatin1String("*.qml") << QLatin1String("*.js"), - QDir::Files); - foreach (const QString &file, files) { - rv << d.absoluteFilePath(file); - } - - QStringList dirs = d.entryList(QDir::Dirs | QDir::NoDotAndDotDot | - QDir::NoSymLinks); - foreach (const QString &dir, dirs) { - QDir sub = d; - sub.cd(dir); - rv << findFiles(sub); - } - - return rv; -} - -bool tst_qmlmin::isInvalidFile(const QFileInfo &fileName) const -{ - foreach (const QString &invalidFile, invalidFiles) { - if (fileName.absoluteFilePath().endsWith(invalidFile)) - return true; - } - return false; -} - -/* -This test runs all the examples in the declarative UI source tree and ensures -that they start and exit cleanly. - -Examples are any .qml files under the examples/ directory that start -with a lower case letter. -*/ - -void tst_qmlmin::qmlMinify_data() -{ - QTest::addColumn("file"); - - QString examples = QLatin1String(SRCDIR) + "/../../../../examples/"; - QString tests = QLatin1String(SRCDIR) + "/../../../../tests/"; - - QStringList files; - files << findFiles(QDir(examples)); - files << findFiles(QDir(tests)); - - foreach (const QString &file, files) - QTest::newRow(qPrintable(file)) << file; -} - -void tst_qmlmin::qmlMinify() -{ - QFETCH(QString, file); - - QProcess qmlminify; - qmlminify.start(qmlminPath, QStringList() << QLatin1String("--verify-only") << file); - qmlminify.waitForFinished(); - - QCOMPARE(qmlminify.error(), QProcess::UnknownError); - QCOMPARE(qmlminify.exitStatus(), QProcess::NormalExit); - - if (isInvalidFile(file)) - QCOMPARE(qmlminify.exitCode(), EXIT_FAILURE); // cannot minify files with syntax errors - else - QCOMPARE(qmlminify.exitCode(), 0); -} - -QTEST_MAIN(tst_qmlmin) - -#include "tst_qmlmin.moc" diff --git a/tests/auto/declarative/qmlplugindump/qmlplugindump.pro b/tests/auto/declarative/qmlplugindump/qmlplugindump.pro deleted file mode 100644 index 498a520873..0000000000 --- a/tests/auto/declarative/qmlplugindump/qmlplugindump.pro +++ /dev/null @@ -1,7 +0,0 @@ -CONFIG += testcase -TARGET = tst_qmlplugindump -QT += testlib -macx:CONFIG -= app_bundle -CONFIG += parallel_test - -SOURCES += tst_qmlplugindump.cpp diff --git a/tests/auto/declarative/qmlplugindump/tst_qmlplugindump.cpp b/tests/auto/declarative/qmlplugindump/tst_qmlplugindump.cpp deleted file mode 100644 index 5512cfdfe8..0000000000 --- a/tests/auto/declarative/qmlplugindump/tst_qmlplugindump.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include -#include -#include -#include -#include - -class tst_qmlplugindump : public QObject -{ - Q_OBJECT -public: - tst_qmlplugindump(); - -private slots: - void initTestCase(); - void builtins(); - -private: - QString qmlplugindumpPath; -}; - -tst_qmlplugindump::tst_qmlplugindump() -{ -} - -void tst_qmlplugindump::initTestCase() -{ - qmlplugindumpPath = QLibraryInfo::location(QLibraryInfo::BinariesPath); - -#if defined(Q_OS_MAC) - qmlplugindumpPath += QLatin1String("/qmlplugindump.app/Contents/MacOS/qmlplugindump"); -#elif defined(Q_OS_WIN) - qmlplugindumpPath += QLatin1String("/qmlplugindump.exe"); -#else - qmlplugindumpPath += QLatin1String("/qmlplugindump"); -#endif - - if (!QFileInfo(qmlplugindumpPath).exists()) { - QString message = QString::fromLatin1("qmlplugindump executable not found (looked for %0)") - .arg(qmlplugindumpPath); - QFAIL(qPrintable(message)); - } -} - -void tst_qmlplugindump::builtins() -{ - QProcess dumper; - QStringList args; - args += QLatin1String("-builtins"); - dumper.start(qmlplugindumpPath, args); - dumper.waitForFinished(); - - if (dumper.error() != QProcess::UnknownError - || dumper.exitStatus() != QProcess::NormalExit) { - qWarning() << QString("Error while running '%1 %2'").arg( - qmlplugindumpPath, args.join(QLatin1String(" "))); - } - - if (dumper.error() == QProcess::FailedToStart) { - QFAIL("failed to start"); - } - if (dumper.error() == QProcess::Crashed) { - qWarning() << "stderr:\n" << dumper.readAllStandardError(); - QFAIL("crashed"); - } - - QCOMPARE(dumper.error(), QProcess::UnknownError); - QCOMPARE(dumper.exitStatus(), QProcess::NormalExit); - - const QString &result = dumper.readAllStandardOutput(); - QVERIFY(result.contains(QLatin1String("Module {"))); -} - -QTEST_MAIN(tst_qmlplugindump) - -#include "tst_qmlplugindump.moc" diff --git a/tests/auto/declarative/runall.sh b/tests/auto/declarative/runall.sh deleted file mode 100755 index 621791b6ab..0000000000 --- a/tests/auto/declarative/runall.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/bash -# -############################################################################# -## -## Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -## Contact: http://www.qt-project.org/ -## -## This file is part of the test suite of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:LGPL$ -## GNU Lesser General Public License Usage -## This file may be used under the terms of the GNU Lesser General Public -## License version 2.1 as published by the Free Software Foundation and -## appearing in the file LICENSE.LGPL included in the packaging of this -## file. Please review the following information to ensure the GNU Lesser -## General Public License version 2.1 requirements will be met: -## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -## -## In addition, as a special exception, Nokia gives you certain additional -## rights. These rights are described in the Nokia Qt LGPL Exception -## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU General -## Public License version 3.0 as published by the Free Software Foundation -## and appearing in the file LICENSE.GPL included in the packaging of this -## file. Please review the following information to ensure the GNU General -## Public License version 3.0 requirements will be met: -## http://www.gnu.org/copyleft/gpl.html. -## -## Other Usage -## Alternatively, this file may be used in accordance with the terms and -## conditions contained in a signed written agreement between you and Nokia. -## -## -## -## -## -## -## $QT_END_LICENSE$ -## -############################################################################/ - -if [ "$(uname)" = Linux ] -then - Xnest :7 2>/dev/null & - sleep 1 - trap "kill $!" EXIT - export DISPLAY=:7 - export LANG=en_US - kwin 2>/dev/null & - sleep 1 -fi - -function filter -{ - exe=$1 - skip=0 - while read line - do - if [ $skip != 0 ] - then - let skip=skip-1 - else - case "$line" in - make*Error) echo "$line";; - make*Stop) echo "$line";; - /*/bin/make*) ;; - make*) ;; - install*) ;; - QDeclarativeDebugServer:*Waiting*) ;; - QDeclarativeDebugServer:*Connection*) ;; - */qmake*) ;; - */bin/moc*) ;; - *targ.debug*) ;; - g++*) ;; - cd*) ;; - XFAIL*) skip=1;; - SKIP*) skip=1;; - PASS*) ;; - QDEBUG*) ;; - Makefile*) ;; - Config*) ;; - Totals*) ;; - \**) ;; - ./*) ;; - *tst_*) echo "$line" ;; - *) echo "$exe: $line" - esac - fi - done -} - -make -k -j1 install 2>&1 | filter build -for exe in $(make install | sed -n 's/^install .* "\([^"]*qt4\/tst_[^"]*\)".*/\1/p') -do - echo $exe - $exe 2>&1 | filter $exe -done - diff --git a/tests/auto/declarative/v4/data/conditionalExpr.qml b/tests/auto/declarative/v4/data/conditionalExpr.qml deleted file mode 100644 index b74a95a94b..0000000000 --- a/tests/auto/declarative/v4/data/conditionalExpr.qml +++ /dev/null @@ -1,6 +0,0 @@ -import Qt.v4 1.0 - -Result { - property int n: 2 - result: !n ? 100 : 0 -} diff --git a/tests/auto/declarative/v4/data/doubleBoolJump.qml b/tests/auto/declarative/v4/data/doubleBoolJump.qml deleted file mode 100644 index 2eea73b573..0000000000 --- a/tests/auto/declarative/v4/data/doubleBoolJump.qml +++ /dev/null @@ -1,18 +0,0 @@ -import QtQuick 2.0 - -Rectangle { - QtObject { - property real output: i1.p1 || i2.p2 == "text" ? 0.7 : 0 - } - - QtObject { - id: i2 - property string p2 - } - - QtObject { - id: i1 - property bool p1: false - } -} - diff --git a/tests/auto/declarative/v4/data/fetchException.qml b/tests/auto/declarative/v4/data/fetchException.qml deleted file mode 100644 index 6431fcfae8..0000000000 --- a/tests/auto/declarative/v4/data/fetchException.qml +++ /dev/null @@ -1,6 +0,0 @@ -import QtQuick 2.0 - -Item { - property Item data - property int a: data.x, 1 -} diff --git a/tests/auto/declarative/v4/data/logicalOr.2.qml b/tests/auto/declarative/v4/data/logicalOr.2.qml deleted file mode 100644 index 54fb78b127..0000000000 --- a/tests/auto/declarative/v4/data/logicalOr.2.qml +++ /dev/null @@ -1,6 +0,0 @@ -import Qt.v4 1.0 - -Result { - property string s: "foo" || "bar" - result: s == "foo" -} diff --git a/tests/auto/declarative/v4/data/logicalOr.qml b/tests/auto/declarative/v4/data/logicalOr.qml deleted file mode 100644 index 406a7d83eb..0000000000 --- a/tests/auto/declarative/v4/data/logicalOr.qml +++ /dev/null @@ -1,6 +0,0 @@ -import Qt.v4 1.0 - -Result { - property int a: 10 - result: a == 1 || a == 2 -} diff --git a/tests/auto/declarative/v4/data/nestedLogicalOr.qml b/tests/auto/declarative/v4/data/nestedLogicalOr.qml deleted file mode 100644 index c4478a3e7b..0000000000 --- a/tests/auto/declarative/v4/data/nestedLogicalOr.qml +++ /dev/null @@ -1,14 +0,0 @@ -import Qt.v4 1.0 - -Result { - property bool val1: false - property bool val2: true - property bool val3: false - - property bool b1: (false || false || true) - property bool b2: (false || (false || true)) - property bool b3: ((false || false) || true) - property bool b4: (val1 || (val2 || val3)) ? true : false - - result: b1 && b2 && b3 && b4 -} diff --git a/tests/auto/declarative/v4/data/nestedObjectAccess.qml b/tests/auto/declarative/v4/data/nestedObjectAccess.qml deleted file mode 100644 index 56cd17e41e..0000000000 --- a/tests/auto/declarative/v4/data/nestedObjectAccess.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Qt.v4 1.0 - -Result { - result: nested.result -} diff --git a/tests/auto/declarative/v4/data/nullQObject.qml b/tests/auto/declarative/v4/data/nullQObject.qml deleted file mode 100644 index 00185b3988..0000000000 --- a/tests/auto/declarative/v4/data/nullQObject.qml +++ /dev/null @@ -1,7 +0,0 @@ -import QtQuick 2.0 - -Item { - property QtObject obj - property QtObject test - test: obj -} diff --git a/tests/auto/declarative/v4/data/qrealToIntRounding.qml b/tests/auto/declarative/v4/data/qrealToIntRounding.qml deleted file mode 100644 index ee3d405073..0000000000 --- a/tests/auto/declarative/v4/data/qrealToIntRounding.qml +++ /dev/null @@ -1,10 +0,0 @@ -import QtQuick 2.0 - -QtObject { - property int data: 1 - - property int test1: 6.6 + data - property int test2: 6.2 + data - property int test3: 6 + data -} - diff --git a/tests/auto/declarative/v4/data/qtbug_21883.qml b/tests/auto/declarative/v4/data/qtbug_21883.qml deleted file mode 100644 index a51f97c944..0000000000 --- a/tests/auto/declarative/v4/data/qtbug_21883.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Qt.v4 1.0 - -Result { - property Result dummy: Result -} diff --git a/tests/auto/declarative/v4/data/qtbug_22816.qml b/tests/auto/declarative/v4/data/qtbug_22816.qml deleted file mode 100644 index bfa8d4948c..0000000000 --- a/tests/auto/declarative/v4/data/qtbug_22816.qml +++ /dev/null @@ -1,18 +0,0 @@ -import QtQuick 2.0 - -Item { - QtObject { - id: object - property bool prop1: true - function myfunction() { return true; } - property bool prop2: object.prop1 && myfunction(); - } - - property bool test1: object.prop1 && object.prop2 - property bool test2: object.prop1 - - Component.onCompleted: { - object.prop1 = false; - } -} - diff --git a/tests/auto/declarative/v4/data/stringComparison.qml b/tests/auto/declarative/v4/data/stringComparison.qml deleted file mode 100644 index 64b6798c69..0000000000 --- a/tests/auto/declarative/v4/data/stringComparison.qml +++ /dev/null @@ -1,34 +0,0 @@ -import QtQuick 2.0 - -QtObject { - property string string1: "aaba" - property string string2: "aa" - property string string3: "aaab" - property string string4: "c" - - property bool test1: string1 > string2 - property bool test2: string2 < string1 - property bool test3: string1 > string3 - property bool test4: string3 < string1 - property bool test5: string1 < string4 - property bool test6: string4 > string1 - - property bool test7: string1 == "aaba" - property bool test8: string1 != "baa" - property bool test9: string1 === "aaba" - property bool test10: string1 !== "baa" - property bool test11: string4 == "c" - property bool test12: string4 != "d" - property bool test13: string4 === "c" - property bool test14: string4 !== "d" - - property bool test15: string1 >= string2 - property bool test16: string2 <= string1 - property bool test17: string1 >= string3 - property bool test18: string3 <= string1 - property bool test19: string1 <= string4 - property bool test20: string4 >= string1 - property bool test21: string4 <= "c" - property bool test22: string4 >= "c" -} - diff --git a/tests/auto/declarative/v4/data/subscriptionsInConditionalExpressions.qml b/tests/auto/declarative/v4/data/subscriptionsInConditionalExpressions.qml deleted file mode 100644 index a8e05eeda1..0000000000 --- a/tests/auto/declarative/v4/data/subscriptionsInConditionalExpressions.qml +++ /dev/null @@ -1,11 +0,0 @@ -import QtQuick 2.0 - -Item { - id: thisTest - - property bool cond: true - property real a: 1 - property real result: cond ? a : a - - PropertyAction { running: true; target: thisTest; property: "a"; value: 2; } -} diff --git a/tests/auto/declarative/v4/data/unaryMinus.qml b/tests/auto/declarative/v4/data/unaryMinus.qml deleted file mode 100644 index 410654fc3c..0000000000 --- a/tests/auto/declarative/v4/data/unaryMinus.qml +++ /dev/null @@ -1,24 +0,0 @@ -import QtQuick 2.0 - -Item { - property real test1: -i1.p2 - property int test2: -i1.p2 - property real test3: -i1.p1 - property int test4: -i1.p1 - property real test5: -i1.p3 - property int test6: -i1.p3 - property real test7: -i1.p4 - property int test8: -i1.p4 - property real test9: -i1.p5 - property int test10: -i1.p5 - - QtObject { - id: i1 - property real p1: -3.7 - property int p2: 18 - property real p3: -3.3 - property int p4: -7 - property real p5: 4.4 - } - } - diff --git a/tests/auto/declarative/v4/data/unaryPlus.qml b/tests/auto/declarative/v4/data/unaryPlus.qml deleted file mode 100644 index cd5315a7cc..0000000000 --- a/tests/auto/declarative/v4/data/unaryPlus.qml +++ /dev/null @@ -1,24 +0,0 @@ -import QtQuick 2.0 - -Item { - property real test1: +i1.p2 - property int test2: +i1.p2 - property real test3: +i1.p1 - property int test4: +i1.p1 - property real test5: +i1.p3 - property int test6: +i1.p3 - property real test7: +i1.p4 - property int test8: +i1.p4 - property real test9: +i1.p5 - property int test10: +i1.p5 - - QtObject { - id: i1 - property real p1: -3.7 - property int p2: 18 - property real p3: -3.3 - property int p4: -7 - property real p5: 4.4 - } -} - diff --git a/tests/auto/declarative/v4/data/unnecessaryReeval.qml b/tests/auto/declarative/v4/data/unnecessaryReeval.qml deleted file mode 100644 index 48662d7a2d..0000000000 --- a/tests/auto/declarative/v4/data/unnecessaryReeval.qml +++ /dev/null @@ -1,7 +0,0 @@ -import Qt.v4 1.0 - -Result { - property int a: 8 - property int b: 19 - result: (a == 8)?b:7 -} diff --git a/tests/auto/declarative/v4/testtypes.cpp b/tests/auto/declarative/v4/testtypes.cpp deleted file mode 100644 index 6bfd5dc43e..0000000000 --- a/tests/auto/declarative/v4/testtypes.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "testtypes.h" - -#include - -void registerTypes() -{ - qmlRegisterType("Qt.v4", 1,0, "Result"); - qmlRegisterType(); -} diff --git a/tests/auto/declarative/v4/testtypes.h b/tests/auto/declarative/v4/testtypes.h deleted file mode 100644 index 02ba721839..0000000000 --- a/tests/auto/declarative/v4/testtypes.h +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef TESTTYPES_H -#define TESTTYPES_H - -#include - -class NestedObject : public QObject -{ - Q_OBJECT - Q_PROPERTY(int dummy READ dummy); - Q_PROPERTY(int result READ result FINAL CONSTANT); - -public: - int dummy() const { return 7; } - int result() const { return 37; } -}; - -class ResultObject : public QObject -{ - Q_OBJECT - Q_PROPERTY(int result READ result WRITE setResult FINAL) - Q_PROPERTY(NestedObject *nested READ nested CONSTANT) -public: - ResultObject() : m_result(0), m_resultCounter(0) {} - - int resultCounter() const { return m_resultCounter; } - void resetResultCounter() { m_resultCounter = 0; } - - int result() const { return m_result; } - void setResult(int result) { m_result = result; m_resultCounter++; } - - NestedObject *nested() { return &m_nested; } - -private: - int m_result; - int m_resultCounter; - - NestedObject m_nested; -}; - -void registerTypes(); - -#endif // TESTTYPES_H - diff --git a/tests/auto/declarative/v4/tst_v4.cpp b/tests/auto/declarative/v4/tst_v4.cpp deleted file mode 100644 index 927dc0f082..0000000000 --- a/tests/auto/declarative/v4/tst_v4.cpp +++ /dev/null @@ -1,353 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "../../shared/util.h" -#include "testtypes.h" - -class tst_v4 : public QDeclarativeDataTest -{ - Q_OBJECT -public: - tst_v4() {} - -private slots: - void initTestCase(); - - void unnecessaryReeval(); - void logicalOr(); - void nestedLogicalOr(); - void conditionalExpr(); - void qtscript(); - void qtscript_data(); - void nestedObjectAccess(); - void subscriptionsInConditionalExpressions(); - void qtbug_21883(); - void qtbug_22816(); - void stringComparison(); - void unaryMinus(); - void unaryPlus(); - -private: - QDeclarativeEngine engine; -}; - -void tst_v4::initTestCase() -{ - QDeclarativeDataTest::initTestCase(); - registerTypes(); -} - -static int v4ErrorsMsgCount = 0; -static void v4ErrorsMsgHandler(QtMsgType, const char *message) -{ - QByteArray m(message); - if (m.contains("QV4")) - v4ErrorsMsgCount++; -} - -void tst_v4::qtscript() -{ - QFETCH(QString, file); - QV4Compiler::enableBindingsTest(true); - - QDeclarativeComponent component(&engine, testFileUrl(file)); - - v4ErrorsMsgCount = 0; - QtMsgHandler old = qInstallMsgHandler(v4ErrorsMsgHandler); - - QObject *o = component.create(); - delete o; - - qInstallMsgHandler(old); - - QCOMPARE(v4ErrorsMsgCount, 0); - - QV4Compiler::enableBindingsTest(false); -} - -void tst_v4::qtscript_data() -{ - QTest::addColumn("file"); - - QTest::newRow("qreal -> int rounding") << "qrealToIntRounding.qml"; - QTest::newRow("exception on fetch") << "fetchException.qml"; - QTest::newRow("logical or") << "logicalOr.qml"; - QTest::newRow("conditional expressions") << "conditionalExpr.qml"; - QTest::newRow("double bool jump") << "doubleBoolJump.qml"; - QTest::newRow("unary minus") << "unaryMinus.qml"; - QTest::newRow("null qobject") << "nullQObject.qml"; -} - -void tst_v4::unnecessaryReeval() -{ - QDeclarativeComponent component(&engine, testFileUrl("unnecessaryReeval.qml")); - - QObject *o = component.create(); - QVERIFY(o != 0); - - ResultObject *ro = qobject_cast(o); - QVERIFY(ro != 0); - - QCOMPARE(ro->resultCounter(), 1); - QCOMPARE(ro->result(), 19); - ro->resetResultCounter(); - - ro->setProperty("b", 6); - - QCOMPARE(ro->resultCounter(), 1); - QCOMPARE(ro->result(), 6); - ro->resetResultCounter(); - - ro->setProperty("a", 14); - - QCOMPARE(ro->resultCounter(), 1); - QCOMPARE(ro->result(), 7); - ro->resetResultCounter(); - - ro->setProperty("b", 14); - QCOMPARE(ro->resultCounter(), 0); - QCOMPARE(ro->result(), 7); - - delete o; -} - -void tst_v4::logicalOr() -{ - { - QDeclarativeComponent component(&engine, testFileUrl("logicalOr.qml")); - - QObject *o = component.create(); - QVERIFY(o != 0); - - ResultObject *ro = qobject_cast(o); - QVERIFY(ro != 0); - - QCOMPARE(ro->result(), 0); - delete o; - } - - { - QDeclarativeComponent component(&engine, testFileUrl("logicalOr.2.qml")); - - QObject *o = component.create(); - QVERIFY(o != 0); - - ResultObject *ro = qobject_cast(o); - QVERIFY(ro != 0); - - QCOMPARE(ro->result(), 1); - delete o; - } -} - -void tst_v4::nestedLogicalOr() -{ - //we are primarily testing that v4 does not get caught in a loop (QTBUG-24038) - QDeclarativeComponent component(&engine, testFileUrl("nestedLogicalOr.qml")); - - QObject *o = component.create(); - QVERIFY(o != 0); - - ResultObject *ro = qobject_cast(o); - QVERIFY(ro != 0); - - QCOMPARE(ro->result(), 1); - delete o; -} - -void tst_v4::conditionalExpr() -{ - { - QDeclarativeComponent component(&engine, testFileUrl("conditionalExpr.qml")); - - QObject *o = component.create(); - QVERIFY(o != 0); - - ResultObject *ro = qobject_cast(o); - QVERIFY(ro != 0); - - QCOMPARE(ro->result(), 0); - delete o; - } -} - -// This would previously use the metaObject of the root element to result the nested access. -// That is, the index for accessing "result" would have been RootObject::result, instead of -// NestedObject::result. -void tst_v4::nestedObjectAccess() -{ - QDeclarativeComponent component(&engine, testFileUrl("nestedObjectAccess.qml")); - - QObject *o = component.create(); - QVERIFY(o != 0); - - ResultObject *ro = qobject_cast(o); - QVERIFY(ro != 0); - - QCOMPARE(ro->result(), 37); - - delete o; -} - -void tst_v4::subscriptionsInConditionalExpressions() -{ - QDeclarativeComponent component(&engine, testFileUrl("subscriptionsInConditionalExpressions.qml")); - - QObject *o = component.create(); - QVERIFY(o != 0); - - QObject *ro = qobject_cast(o); - QVERIFY(ro != 0); - - QCOMPARE(ro->property("result").toReal(), qreal(2)); - - delete o; -} - -// Crash test -void tst_v4::qtbug_21883() -{ - QDeclarativeComponent component(&engine, testFileUrl("qtbug_21883.qml")); - - QString warning = component.url().toString() + ":4: Unable to assign null to ResultObject*"; - QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData()); - - QObject *o = component.create(); - QVERIFY(o != 0); - delete o; -} - -void tst_v4::qtbug_22816() -{ - QDeclarativeComponent component(&engine, testFileUrl("qtbug_22816.qml")); - - QObject *o = component.create(); - QVERIFY(o != 0); - QCOMPARE(o->property("test1").toBool(), false); - QCOMPARE(o->property("test2").toBool(), false); - delete o; -} - -void tst_v4::stringComparison() -{ - QDeclarativeComponent component(&engine, testFileUrl("stringComparison.qml")); - - QObject *o = component.create(); - QVERIFY(o != 0); - QCOMPARE(o->property("test1").toBool(), true); - QCOMPARE(o->property("test2").toBool(), true); - QCOMPARE(o->property("test3").toBool(), true); - QCOMPARE(o->property("test4").toBool(), true); - QCOMPARE(o->property("test5").toBool(), true); - QCOMPARE(o->property("test6").toBool(), true); - QCOMPARE(o->property("test7").toBool(), true); - QCOMPARE(o->property("test8").toBool(), true); - QCOMPARE(o->property("test9").toBool(), true); - QCOMPARE(o->property("test10").toBool(), true); - QCOMPARE(o->property("test11").toBool(), true); - QCOMPARE(o->property("test12").toBool(), true); - QCOMPARE(o->property("test13").toBool(), true); - QCOMPARE(o->property("test14").toBool(), true); - QCOMPARE(o->property("test15").toBool(), true); - QCOMPARE(o->property("test16").toBool(), true); - QCOMPARE(o->property("test17").toBool(), true); - QCOMPARE(o->property("test18").toBool(), true); - QCOMPARE(o->property("test19").toBool(), true); - QCOMPARE(o->property("test20").toBool(), true); - QCOMPARE(o->property("test21").toBool(), true); - QCOMPARE(o->property("test22").toBool(), true); - delete o; -} - -void tst_v4::unaryMinus() -{ - QDeclarativeComponent component(&engine, testFileUrl("unaryMinus.qml")); - - QObject *o = component.create(); - QVERIFY(o != 0); - - QCOMPARE(o->property("test1").toReal(), qreal(-18)); - QCOMPARE(o->property("test2").toInt(), -18); - QCOMPARE(o->property("test3").toReal(), qreal(3.7)); - QCOMPARE(o->property("test4").toInt(), 4); - QCOMPARE(o->property("test5").toReal(), qreal(3.3)); - QCOMPARE(o->property("test6").toInt(), 3); - QCOMPARE(o->property("test7").toReal(), qreal(7)); - QCOMPARE(o->property("test8").toInt(), 7); - QCOMPARE(o->property("test9").toReal(), qreal(-4.4)); - QCOMPARE(o->property("test10").toInt(), -4); - - delete o; -} - -void tst_v4::unaryPlus() -{ - QDeclarativeComponent component(&engine, testFileUrl("unaryPlus.qml")); - - QObject *o = component.create(); - QVERIFY(o != 0); - - QCOMPARE(o->property("test1").toReal(), qreal(18)); - QCOMPARE(o->property("test2").toInt(), 18); - QCOMPARE(o->property("test3").toReal(), qreal(-3.7)); - QCOMPARE(o->property("test4").toInt(), -4); - QCOMPARE(o->property("test5").toReal(), qreal(-3.3)); - QCOMPARE(o->property("test6").toInt(), -3); - QCOMPARE(o->property("test7").toReal(), qreal(-7)); - QCOMPARE(o->property("test8").toInt(), -7); - QCOMPARE(o->property("test9").toReal(), qreal(4.4)); - QCOMPARE(o->property("test10").toInt(), 4); - - delete o; -} - -QTEST_MAIN(tst_v4) - -#include "tst_v4.moc" diff --git a/tests/auto/declarative/v4/v4.pro b/tests/auto/declarative/v4/v4.pro deleted file mode 100644 index 81d12f89be..0000000000 --- a/tests/auto/declarative/v4/v4.pro +++ /dev/null @@ -1,17 +0,0 @@ -CONFIG += testcase -TARGET = tst_qdeclarativev4 -macx:CONFIG -= app_bundle - -SOURCES += tst_v4.cpp \ - testtypes.cpp -HEADERS += testtypes.h - -include (../../shared/util.pri) - -testDataFiles.files = data -testDataFiles.path = . -DEPLOYMENT += testDataFiles - -CONFIG += parallel_test - -QT += core-private gui-private v8-private declarative-private network testlib -- cgit v1.2.3